From 2fd2663eeecf077ea80912261ff0e589e64f4512 Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Fri, 19 Sep 2014 17:31:34 -0700 Subject: [PATCH] Update comments --- rtl/arp_eth_rx.v | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rtl/arp_eth_rx.v b/rtl/arp_eth_rx.v index a42f61aa4..33ab19cec 100644 --- a/rtl/arp_eth_rx.v +++ b/rtl/arp_eth_rx.v @@ -273,12 +273,16 @@ always @* begin end endcase if (input_eth_payload_tlast) begin + // end of frame state_next = STATE_IDLE; if (frame_ptr_reg != 8'h1B) begin + // don't have the whole header error_header_early_termination_next = 1; end else if (output_arp_hlen != 6 || output_arp_plen != 4) begin + // lengths not valid error_invalid_header_next = 1; end else begin + // otherwise, transfer tuser output_frame_valid_next = ~input_eth_payload_tuser; end end @@ -287,13 +291,14 @@ always @* begin end end STATE_WAIT_LAST: begin - // read last payload word; data in output register; do not accept new data + // wait for end of frame; read and discard if (input_eth_payload_tvalid) begin - // word transfer out - done if (input_eth_payload_tlast) begin if (output_arp_hlen != 6 || output_arp_plen != 4) begin + // lengths not valid error_invalid_header_next = 1; end else begin + // otherwise, transfer tuser output_frame_valid_next = ~input_eth_payload_tuser; end state_next = STATE_IDLE; @@ -301,7 +306,6 @@ always @* begin state_next = STATE_WAIT_LAST; end end else begin - // wait for end of frame; read and discard state_next = STATE_WAIT_LAST; end end