Commit 8dd8f713 authored by Pascal Bos's avatar Pascal Bos

Start counting from 2000 instead of 1970.

Gave credit where credit was due.
parent 63951dff
Pipeline #3915 failed with stage
in 2 minutes and 7 seconds
...@@ -82,7 +82,7 @@ entity spec7_wr_ref_top is ...@@ -82,7 +82,7 @@ entity spec7_wr_ref_top is
g_simulation : integer := 0; g_simulation : integer := 0;
g_use_pps_in : string := "single"; g_use_pps_in : string := "single";
g_refclk_tune_pos_slope : boolean := TRUE; g_refclk_tune_pos_slope : boolean := TRUE;
g_irig_b_enable : boolean := FALSE g_irig_b_enable : boolean := TRUE
); );
port ( port (
---------------------------------------------------------------------------` ---------------------------------------------------------------------------`
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
-- File : wr_irigb_conf.vhd -- File : wr_irigb_conf.vhd
-- Author(s) : Pascal Bos <bosp@nikhef.nl> -- Author(s) : Pascal Bos <bosp@nikhef.nl>
-- Author(s) : Bas Jansweijer
-- Company : Nikhef -- Company : Nikhef
-- Created : 2021-04-29 -- Created : 2021-04-29
-- Last update: 2021-05-04 -- Last update: 2021-05-04
...@@ -211,7 +212,7 @@ pps_trigger <= '1' when pps_i = '1' and pps_reg = '0' else '0'; ...@@ -211,7 +212,7 @@ pps_trigger <= '1' when pps_i = '1' and pps_reg = '0' else '0';
-- ______ ___________ _________________ -- ______ ___________ _________________
-- --------->| |---------------->| |-------------->| Multiply by 4 |------------------------------------------ -- --------->| |---------------->| |-------------->| Multiply by 4 |------------------------------------------
-- Days | +365 | | DIVIDE BY |(Answer) | (bit shift 2) | _|_ _|_ _|_ _|_ -- Days | +365 | | DIVIDE BY |(Answer) | (bit shift 2) | _|_ _|_ _|_ _|_
-- | | | 1461 | |_________________| |+ 0|-->year|+ 1|-->year|+ 2|-->year|+ 3|-->year -- | | | 1461 | |_________________| |+ 0|-->year|+ 1|-->year|+ 2|-->year|+ 3|-->year (+29 years) (to start in 2000 instead of 1969)
-- |______| | |------------ ________ |___| |___| |___| |___| -- |______| | |------------ ________ |___| |___| |___| |___|
-- | |(Remainder) | / <365 |-----------0 | | | -- | |(Remainder) | / <365 |-----------0 | | |
-- |___________| | / | | | | | -- |___________| | / | | | | |
...@@ -310,16 +311,16 @@ begin ...@@ -310,16 +311,16 @@ begin
remaining_days := unsigned(remainders(3)); remaining_days := unsigned(remainders(3));
block_4_years := unsigned(quotients(3)); block_4_years := unsigned(quotients(3));
if remaining_days < 365 then if remaining_days < 365 then
years <= std_logic_vector((block_4_years(37 downto 0) & "00") + 29); years <= std_logic_vector((block_4_years(37 downto 0) & "00") - 1);
days <= std_logic_vector(remaining_days(8 downto 0)+1); days <= std_logic_vector(remaining_days(8 downto 0)+1);
elsif remaining_days < 730 then elsif remaining_days < 730 then
years <= std_logic_vector((block_4_years(37 downto 0) & "00") + 30); years <= std_logic_vector((block_4_years(37 downto 0) & "00") + 0);
days <= std_logic_vector(remaining_days(8 downto 0)-365+1); days <= std_logic_vector(remaining_days(8 downto 0)-365+1);
elsif remaining_days < 1095 then elsif remaining_days < 1095 then
years <= std_logic_vector((block_4_years(37 downto 0) & "00") + 31); years <= std_logic_vector((block_4_years(37 downto 0) & "00") + 1);
days <= std_logic_vector(remaining_days(8 downto 0)-730+1); days <= std_logic_vector(remaining_days(8 downto 0)-730+1);
else else
years <= std_logic_vector((block_4_years(37 downto 0) & "00") + 32); years <= std_logic_vector((block_4_years(37 downto 0) & "00") + 2);
days <= std_logic_vector(remaining_days(8 downto 0)-1095+1); days <= std_logic_vector(remaining_days(8 downto 0)-1095+1);
end if; end if;
all_rdy(3) := '1'; all_rdy(3) := '1';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment