From d3e30d0a73604e3b873661ceee1877b59021d38c Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Sat, 28 Feb 2015 23:09:41 -0800 Subject: [PATCH] Fix padding bug --- rtl/axis_eth_fcs_insert.v | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rtl/axis_eth_fcs_insert.v b/rtl/axis_eth_fcs_insert.v index a9538017..dd0a4309 100644 --- a/rtl/axis_eth_fcs_insert.v +++ b/rtl/axis_eth_fcs_insert.v @@ -158,7 +158,7 @@ always @* begin state_next = STATE_IDLE; end else begin input_axis_tready_next = 0; - if (ENABLE_PADDING && frame_ptr_next < MIN_FRAME_LENGTH-5) begin + if (ENABLE_PADDING && frame_ptr_reg < MIN_FRAME_LENGTH-5) begin state_next = STATE_PAD; end else begin frame_ptr_next = 0; @@ -184,12 +184,14 @@ always @* begin if (output_axis_tready_int) begin frame_ptr_next = frame_ptr_reg + 1; update_crc = 1; - if (frame_ptr_next < MIN_FRAME_LENGTH-5) begin + if (frame_ptr_reg < MIN_FRAME_LENGTH-5) begin state_next = STATE_PAD; end else begin frame_ptr_next = 0; state_next = STATE_FCS; end + end else begin + state_next = STATE_PAD; end end STATE_FCS: begin