From d3b548de65694816cace18e2fe4b2d5aec723727 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Fri, 13 Jul 2018 15:43:34 +0200 Subject: [PATCH] jesd204_rx: Reset lane error statistics when link is disabled When the link is explicitly disabled through the control interface reset the error statistics counter. There is usually little benefit to preserving until after the link has been disabled. If software is interested in the values it can read them before disabling the link. Having them reset makes the behavior consistent with all other internal state of the jesd204 RX peripheral, which is reset when the link is disabled. Signed-off-by: Lars-Peter Clausen --- library/jesd204/jesd204_rx/jesd204_rx_lane.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/jesd204/jesd204_rx/jesd204_rx_lane.v b/library/jesd204/jesd204_rx/jesd204_rx_lane.v index 2911029a3..b0c8488c0 100644 --- a/library/jesd204/jesd204_rx/jesd204_rx_lane.v +++ b/library/jesd204/jesd204_rx/jesd204_rx_lane.v @@ -181,7 +181,7 @@ endgenerate end always @(posedge clk) begin - if (ctrl_err_statistics_reset == 1'b1) begin + if (reset == 1'b1 || ctrl_err_statistics_reset == 1'b1) begin status_err_statistics_cnt <= 32'h0; end else if (status_err_statistics_cnt[31:5] != 27'h7ffffff) begin status_err_statistics_cnt <= status_err_statistics_cnt + phy_notintable_cnt + phy_disperr_cnt + phy_unexpectedk_cnt;