PTP clock period is always positive

This commit is contained in:
Alex Forencich 2021-03-17 21:13:36 -07:00
parent a3f6e36777
commit 1dd349399b

View File

@ -161,7 +161,7 @@ always @(posedge clk) begin
end
// timestamp increment calculation
{ts_inc_ns_reg, ts_inc_fns_reg} <= $signed({period_ns_reg, period_fns_reg}) +
{ts_inc_ns_reg, ts_inc_fns_reg} <= $signed({1'b0, period_ns_reg, period_fns_reg}) +
(adj_active_reg ? $signed({adj_ns_reg, adj_fns_reg}) : 0) +
((DRIFT_ENABLE && drift_cnt == 0) ? $signed({drift_ns_reg, drift_fns_reg}) : 0);