Line 13... |
Line 13... |
-- doesnt generate the checksum(supposedly optional)
|
-- doesnt generate the checksum(supposedly optional)
|
-- Dependencies:
|
-- Dependencies:
|
--
|
--
|
-- Revision:
|
-- Revision:
|
-- Revision 0.01 - File Created
|
-- Revision 0.01 - File Created
|
|
-- Revision 0.02 - Added abort of tx when receive last from upstream
|
-- Additional Comments:
|
-- Additional Comments:
|
--
|
--
|
----------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------
|
library IEEE;
|
library IEEE;
|
use IEEE.STD_LOGIC_1164.ALL;
|
use IEEE.STD_LOGIC_1164.ALL;
|
Line 213... |
Line 214... |
udp_tx_data_out_ready <= '1'; -- in this state, we are always ready to accept user data for tx
|
udp_tx_data_out_ready <= '1'; -- in this state, we are always ready to accept user data for tx
|
if ip_tx_data_out_ready = '1' then
|
if ip_tx_data_out_ready = '1' then
|
if udp_txi.data.data_out_valid = '1' or tx_count = x"000" then
|
if udp_txi.data.data_out_valid = '1' or tx_count = x"000" then
|
-- only increment if ready and valid has been subsequently established, otherwise data count moves on too fast
|
-- only increment if ready and valid has been subsequently established, otherwise data count moves on too fast
|
if unsigned(tx_count) = unsigned(udp_txi.hdr.data_length) then
|
if unsigned(tx_count) = unsigned(udp_txi.hdr.data_length) then
|
|
-- TX terminated due to count - end normally
|
set_last <= '1';
|
set_last <= '1';
|
tx_data <= udp_txi.data.data_out;
|
tx_data <= udp_txi.data.data_out;
|
next_tx_result <= UDPTX_RESULT_SENT;
|
next_tx_result <= UDPTX_RESULT_SENT;
|
set_ip_tx_start <= CLR;
|
set_ip_tx_start <= CLR;
|
set_tx_result <= '1';
|
set_tx_result <= '1';
|
next_tx_state <= IDLE;
|
next_tx_state <= IDLE;
|
set_tx_state <= '1';
|
set_tx_state <= '1';
|
|
elsif udp_txi.data.data_out_last = '1' then
|
|
-- terminate tx with error as got last from upstream before exhausting count
|
|
set_last <= '1';
|
|
tx_data <= udp_txi.data.data_out;
|
|
next_tx_result <= UDPTX_RESULT_ERR;
|
|
set_ip_tx_start <= CLR;
|
|
set_tx_result <= '1';
|
|
next_tx_state <= IDLE;
|
|
set_tx_state <= '1';
|
else
|
else
|
|
-- TX continues
|
tx_count_mode <= INCR;
|
tx_count_mode <= INCR;
|
tx_data <= udp_txi.data.data_out;
|
tx_data <= udp_txi.data.data_out;
|
end if;
|
end if;
|
end if;
|
end if;
|
end if;
|
end if;
|