From e4bbc086204db22c307b34324479efa1fdcb4351 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sat, 6 Aug 2022 14:54:04 -0400 Subject: [PATCH] pcs: tx: Calculate idle correctly when there is no new data When the PMA has no new data for us, idle should be determined based on raw_bits[11:2]. However, we just calculated that last cycle, so we can reuse it. Fixes: d351291 ("Initial commit") Signed-off-by: Sean Anderson --- rtl/pcs.v | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rtl/pcs.v b/rtl/pcs.v index 1284228..16c0668 100644 --- a/rtl/pcs.v +++ b/rtl/pcs.v @@ -334,7 +334,9 @@ module pcs_rx_bits ( endfunction always @(*) begin - idle_next = &raw_bits[10:1]; + idle_next = idle; + if (bits_valid != 0) + idle_next = &raw_bits[10:1]; if (bits_valid & 2) idle_next = idle_next || &raw_bits[9:0];