1
0
mirror of https://github.com/corundum/corundum.git synced 2025-01-16 08:12:53 +08:00

Prevent stale data frim being used to sync leaf clock

Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
Alex Forencich 2023-12-01 22:05:53 -08:00
parent f0c47db509
commit dd97924714

View File

@ -688,6 +688,10 @@ always @* begin
// extract data // extract data
if (dst_td_tvalid_reg) begin if (dst_td_tvalid_reg) begin
if (TS_TOD_EN) begin if (TS_TOD_EN) begin
if (dst_td_tid_reg[3:0] == 4'd1) begin
// prevent stale data from being used in time sync
dst_tod_shadow_valid_next = 1'b0;
end
if (dst_td_tid_reg == {4'd0, 4'd1}) begin if (dst_td_tid_reg == {4'd0, 4'd1}) begin
dst_tod_ns_shadow_next[15:0] = dst_td_tdata_reg; dst_tod_ns_shadow_next[15:0] = dst_td_tdata_reg;
dst_tod_shadow_valid_next = 1'b0; dst_tod_shadow_valid_next = 1'b0;