Commit aca7795a authored by Maciej Lipinski's avatar Maciej Lipinski

Ensure better coherency of leapSecond info and timestamp.

Register the two (leapSecond info and timestamp) at exactly the
same time. Still not perfect but better than before.
parent 51c1dc8e
......@@ -877,13 +877,6 @@ begin
--gpio_in(29) <= dio_clk_i;
dio_sdn_ck_n_o <= gpio_out(30);
dio_sdn_n_o <= gpio_out(31);
leap_second_asig : for i in 0 to 5 generate
dio_tsf_leap_second(i) <= leap_second_value_i;
dio_tsf_leap_second_flag_59(i) <= leap_second_flag_59_i;
dio_tsf_leap_second_flag_61(i) <= leap_second_flag_61_i;
dio_tsf_leap_second_valid(i) <= leap_second_flag_valid_i;
end generate leap_second_asig;
-- Adapter of wbgen2 salve to top wb mode and granularity
U_Adapter : wb_slave_adapter
......@@ -1099,11 +1092,24 @@ begin
dio_tsf_wr_req(i) <= '0';
dio_tsf_tag_seconds(i) <= (others => '0');
dio_tsf_tag_cycles(i) <= (others => '0');
dio_tsf_leap_second(i) <= (others => '0');
dio_tsf_leap_second_flag_59(i) <= '0';
dio_tsf_leap_second_flag_61(i) <= '0';
dio_tsf_leap_second_valid(i) <= '0';
else
if ((tag_valid_p1(i) = '1') and (dio_tsf_wr_full(i) = '0')) then
dio_tsf_wr_req(i) <= '1';
dio_tsf_tag_seconds(i) <= tag_seconds(i);
dio_tsf_tag_cycles(i) <= tag_cycles(i);
-- Capture the leap second information together with timestamps
-- This does not cover a corner case in which the timestamp is
-- registered just before the leap second event and this code is
-- executed just after... TODO: fixme.
dio_tsf_leap_second(i) <= leap_second_value_i;
dio_tsf_leap_second_flag_59(i) <= leap_second_flag_59_i;
dio_tsf_leap_second_flag_61(i) <= leap_second_flag_61_i;
dio_tsf_leap_second_valid(i) <= leap_second_flag_valid_i;
else
dio_tsf_wr_req(i) <= '0';
end if;
......
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