diff --git a/libraries/io/eth/src/vhdl/eth_tester_tx.vhd b/libraries/io/eth/src/vhdl/eth_tester_tx.vhd index 4554fde1d419b9f37a094f04dab9b81abc8082b9..2468c46966073788b274257bdbe67d2d802cead0 100644 --- a/libraries/io/eth/src/vhdl/eth_tester_tx.vhd +++ b/libraries/io/eth/src/vhdl/eth_tester_tx.vhd @@ -70,10 +70,9 @@ END eth_tester_tx; ARCHITECTURE str OF eth_tester_tx IS - CONSTANT c_bg_block_len_max : NATURAL := c_network_eth_payload_jumbo_max; -- 9000 octets - CONSTANT c_bg_block_len_w : NATURAL := ceil_log2(c_bg_block_len_max); + CONSTANT c_empty_w : NATURAL := 2; -- for 0, 1, 2, 3 empty octets per word - CONSTANT c_fifo_fill : NATURAL := c_network_eth_payload_jumbo_max / c_word_sz; -- = 9000 / 4 = 2250 + CONSTANT c_fifo_fill : NATURAL := c_eth_tester_bg_block_len_max / c_word_sz; -- = 9000 / 4 = 2250 CONSTANT c_fifo_size : NATURAL := true_log_pow2(c_fifo_fill); -- = 4096 CONSTANT c_nof_total_counts : NATURAL := 1; -- one to count Tx packets @@ -83,13 +82,18 @@ ARCHITECTURE str OF eth_tester_tx IS SIGNAL app_total_length : NATURAL; SIGNAL bg_sosi : t_dp_sosi; - SIGNAL bg_ctrl_hold : t_diag_block_gen; + SIGNAL bg_data : STD_LOGIC_VECTOR(c_octet_w-1 DOWNTO 0); + SIGNAL bg_ctrl_hold : t_diag_block_gen; SIGNAL bg_block_len : NATURAL; SIGNAL tx_packed_sosi : t_dp_sosi; + SIGNAL tx_packed_data : STD_LOGIC_VECTOR(c_word_w-1 DOWNTO 0); SIGNAL tx_fifo_sosi : t_dp_sosi; + SIGNAL tx_fifo_data : STD_LOGIC_VECTOR(c_word_w-1 DOWNTO 0); SIGNAL tx_fifo_siso : t_dp_siso; SIGNAL i_ref_sync : STD_LOGIC := '0'; SIGNAL in_strobe_arr : STD_LOGIC_VECTOR(c_nof_total_counts-1 DOWNTO 0); + SIGNAL i_tx_udp_sosi : t_dp_sosi; + SIGNAL tx_udp_data : STD_LOGIC_VECTOR(c_word_w-1 DOWNTO 0); -- Use hdr_fields_slv_in default 0, to have DP driven fields ip_header_checksum = 0 and udp_checksum = 0 SIGNAL hdr_fields_slv_in : STD_LOGIC_VECTOR(1023 DOWNTO 0) := (OTHERS => '0'); @@ -100,6 +104,13 @@ ARCHITECTURE str OF eth_tester_tx IS BEGIN ref_sync <= i_ref_sync; + tx_udp_sosi <= i_tx_udp_sosi; + + -- View sosi.data in Wave Window + bg_data <= bg_sosi.data(c_octet_w-1 DOWNTO 0); + tx_packed_data <= tx_packed_sosi.data(c_word_w-1 DOWNTO 0); + tx_fifo_data <= tx_fifo_sosi.data(c_word_w-1 DOWNTO 0); + tx_udp_data <= i_tx_udp_sosi.data(c_word_w-1 DOWNTO 0); ------------------------------------------------------------------------------- -- Generate packed data blocks @@ -107,7 +118,8 @@ BEGIN u_bg : ENTITY diag_lib.mms_diag_block_gen GENERIC MAP ( g_nof_streams => 1, - g_use_bg_buffer_ram => FALSE + g_use_bg_buffer_ram => FALSE, + g_buf_addr_w => c_diag_bg_mem_adrs_w -- = 24, use full range 2**24 for BG addr --> data values ) PORT MAP ( -- System @@ -124,12 +136,14 @@ BEGIN out_sosi_arr(0) => bg_sosi ); - u_repack : ENTITY dp_lib.dp_repack_data -- pack 8b octets into 32b words + u_pack : ENTITY dp_lib.dp_repack_data -- pack 8b octets into 32b words GENERIC MAP ( g_in_dat_w => c_octet_w, -- = 8 g_in_nof_words => c_word_sz, -- = 4 + g_in_symbol_w => c_octet_w, g_out_dat_w => c_word_w, -- = 32 - g_out_nof_words => 1 + g_out_nof_words => 1, + g_out_symbol_w => c_octet_w ) PORT MAP ( rst => st_rst, @@ -138,10 +152,11 @@ BEGIN src_out => tx_packed_sosi ); - u_fifo : ENTITY dp_lib.dp_fifo_fill_eop + u_tx_fifo : ENTITY dp_lib.dp_fifo_fill_eop GENERIC MAP ( g_data_w => c_word_w, g_bsn_w => c_diag_bg_bsn_init_w, -- = 64 bit + g_empty_w => c_empty_w, g_use_bsn => TRUE, g_use_empty => TRUE, g_use_sync => TRUE, @@ -237,7 +252,7 @@ BEGIN snk_in_arr(0) => tx_fifo_sosi, snk_out_arr(0) => tx_fifo_siso, - src_out_arr(0) => tx_udp_sosi, + src_out_arr(0) => i_tx_udp_sosi, src_in_arr(0) => tx_udp_siso, hdr_fields_in_arr(0) => hdr_fields_slv_in, -- hdr_fields_slv_in_arr(i) is considered valid @ snk_in_arr(i).sop