Compare commits

..

No commits in common. "474d444f5969807c244b956d8870e8bf0cc80d6c" and "ac553483dfea4191c1c5dda871d72c7e00fafa9f" have entirely different histories.

2 changed files with 9 additions and 17 deletions

View File

@ -59,7 +59,6 @@ begin
alias sr_destination_ip is sr(16 to 19);
signal header_ok : std_logic;
signal selected : std_logic;
signal bytecount : integer range 0 to 65535;
signal block_done : std_logic;
@ -78,18 +77,24 @@ begin
rx_fsm : process(clk, rst) is
begin
if rst then
state <= DONE;
state <= HEADER;
ipv4_out.rx_ok_stb <= '0';
ipv4_out.rx_error_stb <= '0';
ipv4_out.rx_header_rcv <= '0';
bytecount <= BYTECOUNT_HEADER;
selected <= '0';
elsif rising_edge(clk) then
ipv4_out.rx_ok_stb <= '0';
ipv4_out.rx_error_stb <= '0';
ipv4_out.rx_header_rcv <= '0';
if (ethernet_ii_out.rx_crc_ok or ethernet_ii_out.rx_crc_error) then
state <= HEADER;
bytecount <= BYTECOUNT_HEADER;
ipv4_out.rx_error_stb <= ethernet_ii_out.rx_crc_error or to_std_logic(state = PAYLOAD);
ipv4_out.rx_ok_stb <= ethernet_ii_out.rx_crc_ok and to_std_logic(state = DONE);
end if;
if (ethernet_ii_out.rx_data_valid = '1') and (bytecount > 0) then
if state = HEADER then
sr <= sr(sr'low + 1 to sr'high) & ethernet_ii_out.rx_data;
@ -103,10 +108,7 @@ begin
bytecount <= to_integer(unsigned(sr_ihl) - 5) * 4; -- five 32-bit words is the header itself
if header_ok then
state <= OPT;
selected <= '1';
ipv4_out.rx_header_rcv <= '1';
else
state <= DONE;
end if;
end if;
@ -124,15 +126,6 @@ begin
when DONE => -- @suppress "Dead state 'DONE'": Outgoing state transition is outside of case statement
null; -- We just wait here until the MAC gives us a CRC OK/error
end case;
if selected and (ethernet_ii_out.rx_crc_ok or ethernet_ii_out.rx_crc_error) then
ipv4_out.rx_error_stb <= ethernet_ii_out.rx_crc_error or to_std_logic(state = PAYLOAD);
ipv4_out.rx_ok_stb <= ethernet_ii_out.rx_crc_ok and to_std_logic(state = DONE);
end if;
if (ethernet_ii_out.rx_header_rcv) then
state <= HEADER;
bytecount <= BYTECOUNT_HEADER;
selected <= '0';
end if;
end if;
end process rx_fsm;

View File

@ -60,7 +60,6 @@ begin
for i in udpprot_rx_out'range loop
if (udp_out.rx_header.destination_port = udpprot_rx_in(i).port_bind) then
rx_sel <= i;
exit;
end if;
end loop;
end if;
@ -110,7 +109,7 @@ begin
state <= WAITDONE when (not udp_in.tx_en);
when WAITDONE =>
if udp_out.tx_err_stb or udp_out.tx_ok_stb then
if udp_out.tx_err_stb or udp_out.tx_ok_stb or udp_out.tx_data_ack then
state <= IDLE;
tx_sel <= udpprot_tx_in'left; -- To avoid arbitration errors, always select the highest priority one by default
end if;