Skip to content
Snippets Groups Projects
Commit 02a9a4bf authored by Reinier van der Walle's avatar Reinier van der Walle
Browse files

added ip checksum calculation to ethernet tester

parent 92f71ecf
No related branches found
No related tags found
1 merge request!338added ip checksum inserter + added generics to eth_tester for setting
Pipeline #52800 passed
...@@ -189,10 +189,11 @@ begin ...@@ -189,10 +189,11 @@ begin
generic map ( generic map (
g_nof_octet_generate => c_rdma_demo_nof_octet_generate_100gbe, g_nof_octet_generate => c_rdma_demo_nof_octet_generate_100gbe,
g_nof_octet_output => c_rdma_demo_nof_octet_output_100gbe, g_nof_octet_output => c_rdma_demo_nof_octet_output_100gbe,
g_use_network_header => false, g_use_eth_header => false,
g_use_ip_udp_header => false,
g_use_dp_header => true, g_use_dp_header => true,
g_hdr_field_arr => c_rdma_demo_hdr_field_arr, g_hdr_field_arr => c_rdma_demo_dp_hdr_field_arr,
g_hdr_field_sel => c_rdma_demo_hdr_field_sel, g_hdr_field_sel => c_rdma_demo_dp_hdr_field_sel,
g_remove_crc => false g_remove_crc => false
) )
port map ( port map (
......
...@@ -192,8 +192,9 @@ begin ...@@ -192,8 +192,9 @@ begin
g_use_eth_header => false, g_use_eth_header => false,
g_use_ip_udp_header => true, g_use_ip_udp_header => true,
g_use_dp_header => false, g_use_dp_header => false,
g_hdr_field_arr => c_rdma_demo_dp_hdr_field_arr, g_hdr_calc_ip_crc => true,
g_hdr_field_sel => c_rdma_demo_dp_hdr_field_sel, g_hdr_field_arr => c_rdma_demo_roce_hdr_field_arr,
g_hdr_field_sel => c_rdma_demo_roce_hdr_field_sel,
g_hdr_app_len => c_rdma_demo_roce_hdr_len + c_rdma_demo_roce_icrc_len, -- Add icrc length here as this generic is used to calculate the total packet length. g_hdr_app_len => c_rdma_demo_roce_hdr_len + c_rdma_demo_roce_icrc_len, -- Add icrc length here as this generic is used to calculate the total packet length.
g_remove_crc => false g_remove_crc => false
) )
......
...@@ -45,6 +45,7 @@ entity eth_tester is ...@@ -45,6 +45,7 @@ entity eth_tester is
g_use_eth_header : boolean := true; g_use_eth_header : boolean := true;
g_use_ip_udp_header : boolean := true; g_use_ip_udp_header : boolean := true;
g_use_dp_header : boolean := true; g_use_dp_header : boolean := true;
g_hdr_calc_ip_crc : boolean := false;
g_hdr_field_arr : t_common_field_arr := c_eth_tester_hdr_field_arr; g_hdr_field_arr : t_common_field_arr := c_eth_tester_hdr_field_arr;
g_hdr_field_sel : std_logic_vector := c_eth_tester_hdr_field_sel; g_hdr_field_sel : std_logic_vector := c_eth_tester_hdr_field_sel;
g_hdr_app_len : natural := c_eth_tester_app_hdr_len; g_hdr_app_len : natural := c_eth_tester_app_hdr_len;
...@@ -130,6 +131,7 @@ begin ...@@ -130,6 +131,7 @@ begin
g_use_eth_header => g_use_eth_header, g_use_eth_header => g_use_eth_header,
g_use_ip_udp_header => g_use_ip_udp_header, g_use_ip_udp_header => g_use_ip_udp_header,
g_use_dp_header => g_use_dp_header, g_use_dp_header => g_use_dp_header,
g_hdr_calc_ip_crc => g_hdr_calc_ip_crc,
g_hdr_field_arr => g_hdr_field_arr, g_hdr_field_arr => g_hdr_field_arr,
g_hdr_field_sel => g_hdr_field_sel, g_hdr_field_sel => g_hdr_field_sel,
g_hdr_app_len => g_hdr_app_len g_hdr_app_len => g_hdr_app_len
......
...@@ -51,6 +51,7 @@ entity eth_tester_tx is ...@@ -51,6 +51,7 @@ entity eth_tester_tx is
g_use_eth_header : boolean := true; g_use_eth_header : boolean := true;
g_use_ip_udp_header : boolean := true; g_use_ip_udp_header : boolean := true;
g_use_dp_header : boolean := true; g_use_dp_header : boolean := true;
g_hdr_calc_ip_crc : boolean := false;
g_hdr_field_arr : t_common_field_arr := c_eth_tester_hdr_field_arr; g_hdr_field_arr : t_common_field_arr := c_eth_tester_hdr_field_arr;
g_hdr_field_sel : std_logic_vector := c_eth_tester_hdr_field_sel; g_hdr_field_sel : std_logic_vector := c_eth_tester_hdr_field_sel;
g_hdr_app_len : natural := c_eth_tester_app_hdr_len g_hdr_app_len : natural := c_eth_tester_app_hdr_len
...@@ -110,6 +111,7 @@ architecture str of eth_tester_tx is ...@@ -110,6 +111,7 @@ architecture str of eth_tester_tx is
constant c_out_data_w : natural := g_nof_octet_output * c_octet_w; constant c_out_data_w : natural := g_nof_octet_output * c_octet_w;
constant c_nof_symbols_max : natural := c_network_eth_payload_jumbo_max; constant c_nof_symbols_max : natural := c_network_eth_payload_jumbo_max;
constant c_use_split : boolean := sel_a_b(g_nof_octet_generate > 1, true, false); constant c_use_split : boolean := sel_a_b(g_nof_octet_generate > 1, true, false);
constant c_hdr_calc_ip_crc : boolean := g_use_ip_udp_header and g_hdr_calc_ip_crc;
signal ip_total_length : natural; signal ip_total_length : natural;
signal udp_total_length : natural; signal udp_total_length : natural;
...@@ -135,6 +137,8 @@ architecture str of eth_tester_tx is ...@@ -135,6 +137,8 @@ architecture str of eth_tester_tx is
signal i_tx_fifo_rd_emp : std_logic; signal i_tx_fifo_rd_emp : std_logic;
signal tx_offload_siso : t_dp_siso; signal tx_offload_siso : t_dp_siso;
signal tx_offload_sosi : t_dp_sosi; signal tx_offload_sosi : t_dp_sosi;
signal tx_offload_frame_siso : t_dp_siso;
signal tx_offload_frame_sosi : t_dp_sosi;
signal i_ref_sync : std_logic := '0'; signal i_ref_sync : std_logic := '0';
signal in_strobe_arr : std_logic_vector(c_nof_total_counts - 1 downto 0); signal in_strobe_arr : std_logic_vector(c_nof_total_counts - 1 downto 0);
...@@ -391,6 +395,33 @@ begin ...@@ -391,6 +395,33 @@ begin
hdr_fields_rec_in <= func_eth_tester_map_header(hdr_fields_slv_in); hdr_fields_rec_in <= func_eth_tester_map_header(hdr_fields_slv_in);
hdr_fields_rec_tx <= func_eth_tester_map_header(hdr_fields_slv_tx); hdr_fields_rec_tx <= func_eth_tester_map_header(hdr_fields_slv_tx);
-------------------------------------------------------------------------------
-- IP header checksum
-------------------------------------------------------------------------------
gen_ip_crc : if c_hdr_calc_ip_crc generate
u_eth_ip_header_checksum : entity work.eth_ip_header_checksum
generic map (
g_data_w => c_out_data_w,
g_hdr_field_arr => g_hdr_field_arr
)
port map (
rst => st_rst,
clk => st_clk,
snk_in => tx_offload_sosi,
snk_out => tx_offload_siso,
src_out => tx_offload_frame_sosi,
src_in => tx_offload_frame_siso,
hdr_fields_slv_in => hdr_fields_slv_tx
);
end generate;
gen_no_ip_crc : if not c_hdr_calc_ip_crc generate
tx_offload_frame_sosi <= tx_offload_sosi;
tx_offload_siso <= tx_offload_frame_siso;
end generate;
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
-- dp_pipeline_ready to ease timing closure -- dp_pipeline_ready to ease timing closure
...@@ -400,8 +431,8 @@ begin ...@@ -400,8 +431,8 @@ begin
rst => st_rst, rst => st_rst,
clk => st_clk, clk => st_clk,
snk_out => tx_offload_siso, snk_out => tx_offload_frame_siso,
snk_in => tx_offload_sosi, snk_in => tx_offload_frame_sosi,
src_in => tx_udp_siso, src_in => tx_udp_siso,
src_out => i_tx_udp_sosi src_out => i_tx_udp_sosi
); );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment