From dd979247142885400eb79ede3333ebdfcb0d5f5b Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Fri, 1 Dec 2023 22:05:53 -0800 Subject: [PATCH] Prevent stale data frim being used to sync leaf clock Signed-off-by: Alex Forencich --- rtl/ptp_td_leaf.v | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rtl/ptp_td_leaf.v b/rtl/ptp_td_leaf.v index cd4c5838..7e864e72 100644 --- a/rtl/ptp_td_leaf.v +++ b/rtl/ptp_td_leaf.v @@ -688,6 +688,10 @@ always @* begin // extract data if (dst_td_tvalid_reg) 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 dst_tod_ns_shadow_next[15:0] = dst_td_tdata_reg; dst_tod_shadow_valid_next = 1'b0;