From 119e5318e316d7335bc7e000f4e1f1068fa07306 Mon Sep 17 00:00:00 2001 From: Mathias Kreider <m.kreider@gsi.de> Date: Tue, 14 Feb 2012 16:42:24 +0000 Subject: [PATCH] --- hdl/EB_SPEC_Test/EB_2_wb_converter.vhd | 14 +++++++------- hdl/EB_SPEC_Test/EB_HDR_pkg.vhd | 2 ++ hdl/EB_SPEC_Test/EB_RX_CTRL.vhd | 13 +++++++------ 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/hdl/EB_SPEC_Test/EB_2_wb_converter.vhd b/hdl/EB_SPEC_Test/EB_2_wb_converter.vhd index 6221385..048513a 100644 --- a/hdl/EB_SPEC_Test/EB_2_wb_converter.vhd +++ b/hdl/EB_SPEC_Test/EB_2_wb_converter.vhd @@ -381,15 +381,15 @@ begin -- RX cycle line lowered before all words were transferred if (s_EB_RX_byte_cnt < s_EB_packet_length AND EB_RX_i.CYC = '0') then - report "EB: PACKET WAS ABORTED" severity note; + -- report "EB: PACKET WAS ABORTED" severity note; -- ERROR: -- RX cycle line lowered before all words were transferred - s_state_RX <= IDLE; - s_state_TX <= IDLE; + -- s_state_RX <= IDLE; + -- s_state_TX <= IDLE; -- elsif(s_EB_RX_byte_cnt > s_EB_packet_length AND NOT (s_EB_RX_byte_cnt < 16)) then - report "EB: PACKET TOO LONG" severity note; - s_state_RX <= IDLE; - s_state_TX <= IDLE; + -- report "EB: PACKET TOO LONG" severity note; + -- s_state_RX <= IDLE; + -- s_state_TX <= IDLE; else case s_state_RX is @@ -416,7 +416,7 @@ begin s_state_RX <= CYC_HDR_REC; s_state_TX <= EB_HDR_INIT; else - report "EB: Waiting for buffer ..." severity note; + --report "EB: Waiting for buffer ..." severity note; end if; if(s_EB_RX_HDR.PROBE = '1') then -- no probe, prepare cycle reception s_state_RX <= EB_HDR_PROBE_ID ; diff --git a/hdl/EB_SPEC_Test/EB_HDR_pkg.vhd b/hdl/EB_SPEC_Test/EB_HDR_pkg.vhd index 76eb4b3..254f363 100644 --- a/hdl/EB_SPEC_Test/EB_HDR_pkg.vhd +++ b/hdl/EB_SPEC_Test/EB_HDR_pkg.vhd @@ -60,6 +60,8 @@ constant c_EB_PORT_SIZE_n : natural := 32; constant c_EB_ADDR_SIZE_n : natural := 32; +constant c_ETH_FRAME_MIN_END : natural := 64 - 4 - 2; + constant c_ETH_HLEN : natural := 14; constant c_ETH_Q_HLEN : natural := 18; diff --git a/hdl/EB_SPEC_Test/EB_RX_CTRL.vhd b/hdl/EB_SPEC_Test/EB_RX_CTRL.vhd index d136044..0ef4789 100644 --- a/hdl/EB_SPEC_Test/EB_RX_CTRL.vhd +++ b/hdl/EB_SPEC_Test/EB_RX_CTRL.vhd @@ -240,7 +240,7 @@ snk_hdr_fsm.stall <= parser_wait or snk_hdr_fsm_stall; -- enable drivers in two reply_MAC_o <= ETH_RX.SRC; reply_IP_o <= IPV4_RX.SRC; reply_PORT_o <= UDP_RX.SRC_PORT; -payload_len <= UDP_RX.MLEN; +payload_len <= UDP_RX.MLEN; payload_len_o <= payload_len; @@ -392,7 +392,8 @@ begin - when UDP => if((byte_count = counter_comp + to_integer(unsigned(IPV4_RX.IHL)*4) + c_UDP_HLEN -2) AND snk_WR = '1') then report("RX: matched UDP len") severity note; + when UDP => if((byte_count = counter_comp + to_integer(unsigned(IPV4_RX.IHL)*4) + c_UDP_HLEN -2) AND snk_WR = '1') then + --report("RX: matched UDP len") severity note; parser_wait <= '1'; parse <= UDP_FETCH_BUF; end if; @@ -460,7 +461,7 @@ begin end if; when HEADER => if(parse = DONE) then - eop <= (counter_comp + to_integer(unsigned(IPV4_RX.IHL)*4) + to_integer(unsigned(UDP_RX.MLEN))); + eop <= (counter_comp + to_integer(unsigned(IPV4_RX.IHL)*4) + to_integer(unsigned(UDP_RX.MLEN)) -2); state <= PAYLOAD; --snk_hdr_fsm_STALL <= '1'; else @@ -470,7 +471,7 @@ begin end if; - when PAYLOAD => if(byte_count < (64 - 4)) then + when PAYLOAD => if(byte_count < c_ETH_FRAME_MIN_END) then if(snk_i.cyc = '0') then @@ -493,8 +494,8 @@ begin end if; when PADDING => if(snk_i.cyc = '0') then - if(byte_count = 64 - 4 ) then state <= DONE; - elsif(byte_count > eop) then + if(byte_count = c_ETH_FRAME_MIN_END) then state <= DONE; + elsif(byte_count > c_ETH_FRAME_MIN_END) then report("RX: frame too long") severity warning; state <= ERRORS; else report("RX: frame cut short") severity warning; state <= ERRORS; -- GitLab