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

added xon backpressure to flush tx stream when pause frames are received

by MAC
parent fbb063c3
Branches
No related tags found
1 merge request!275added xon backpressure to flush tx stream when pause frames are received
Pipeline #34700 failed
...@@ -1042,13 +1042,14 @@ BEGIN ...@@ -1042,13 +1042,14 @@ BEGIN
--------------- ---------------
u_nw_10GbE_beamlet_output: ENTITY nw_10GbE_lib.nw_10GbE u_nw_10GbE_beamlet_output: ENTITY nw_10GbE_lib.nw_10GbE
GENERIC MAP ( GENERIC MAP (
g_sim => g_sim, g_sim => g_sim,
g_sim_level => 1, g_sim_level => 1,
g_nof_macs => c_nof_10GbE_beamlet_output, g_nof_macs => c_nof_10GbE_beamlet_output,
g_direction => "TX_RX", g_direction => "TX_RX",
g_tx_fifo_fill => c_fifo_tx_fill_beamlet_output, g_tx_fifo_fill => c_fifo_tx_fill_beamlet_output,
g_tx_fifo_size => c_fifo_tx_size_beamlet_output, g_tx_fifo_size => c_fifo_tx_size_beamlet_output,
g_ip_hdr_field_arr => c_sdp_cep_hdr_field_arr g_ip_hdr_field_arr => c_sdp_cep_hdr_field_arr,
g_xon_backpressure => TRUE
) )
PORT MAP ( PORT MAP (
......
...@@ -52,6 +52,7 @@ ENTITY nw_10GbE IS ...@@ -52,6 +52,7 @@ ENTITY nw_10GbE IS
g_tx_fifo_size : NATURAL := 256; -- 2 * 32b * 256 = 2 M9K (DP interface has 64b data, so at least 2 M9K needed) g_tx_fifo_size : NATURAL := 256; -- 2 * 32b * 256 = 2 M9K (DP interface has 64b data, so at least 2 M9K needed)
g_rx_fifo_size : NATURAL := 256; -- 2 * 32b * 256 = 2 M9K (DP interface has 64b data, so at least 2 M9K needed) g_rx_fifo_size : NATURAL := 256; -- 2 * 32b * 256 = 2 M9K (DP interface has 64b data, so at least 2 M9K needed)
g_word_alignment_padding : BOOLEAN := FALSE; g_word_alignment_padding : BOOLEAN := FALSE;
g_xon_backpressure : BOOLEAN := FALSE;
g_arp_period_s : NATURAL := 30; g_arp_period_s : NATURAL := 30;
g_ip_hdr_field_arr : t_common_field_arr g_ip_hdr_field_arr : t_common_field_arr
); );
...@@ -232,7 +233,8 @@ BEGIN ...@@ -232,7 +233,8 @@ BEGIN
g_tx_fifo_fill => g_tx_fifo_fill, g_tx_fifo_fill => g_tx_fifo_fill,
g_tx_fifo_size => g_tx_fifo_size, g_tx_fifo_size => g_tx_fifo_size,
g_rx_fifo_size => g_rx_fifo_size, g_rx_fifo_size => g_rx_fifo_size,
g_word_alignment_padding => g_word_alignment_padding g_word_alignment_padding => g_word_alignment_padding,
g_xon_backpressure => g_xon_backpressure
) )
PORT MAP ( PORT MAP (
-- Transceiver PLL reference clock -- Transceiver PLL reference clock
......
...@@ -45,6 +45,10 @@ ...@@ -45,6 +45,10 @@
-- --
-- to avoid that the packet transmission will get a gap that will abort it. -- to avoid that the packet transmission will get a gap that will abort it.
-- The average DP data rate depends on dp_clk and on the DP data valid. -- The average DP data rate depends on dp_clk and on the DP data valid.
--
-- g_xon_backpressure can be enabled to set xon = 0 when the TX fill fifo is
-- full. This also makes use of an extra fifo of size g_tx_fifo_size to
-- buffer the last incoming frame when xon = 0 to prevent corrupting the frame.
-- --
LIBRARY IEEE, common_lib, dp_lib, diag_lib, technology_lib, tech_mac_10g_lib, tech_eth_10g_lib, tr_xaui_lib; LIBRARY IEEE, common_lib, dp_lib, diag_lib, technology_lib, tech_mac_10g_lib, tech_eth_10g_lib, tr_xaui_lib;
...@@ -72,7 +76,8 @@ ENTITY tr_10GbE IS ...@@ -72,7 +76,8 @@ ENTITY tr_10GbE IS
g_tx_fifo_fill : NATURAL := 10; -- Release tx packet only when sufficiently data is available, g_tx_fifo_fill : NATURAL := 10; -- Release tx packet only when sufficiently data is available,
g_tx_fifo_size : NATURAL := 256; -- 2 * 32b * 256 = 2 M9K (DP interface has 64b data, so at least 2 M9K needed) g_tx_fifo_size : NATURAL := 256; -- 2 * 32b * 256 = 2 M9K (DP interface has 64b data, so at least 2 M9K needed)
g_rx_fifo_size : NATURAL := 256; -- 2 * 32b * 256 = 2 M9K (DP interface has 64b data, so at least 2 M9K needed) g_rx_fifo_size : NATURAL := 256; -- 2 * 32b * 256 = 2 M9K (DP interface has 64b data, so at least 2 M9K needed)
g_word_alignment_padding : BOOLEAN := FALSE g_word_alignment_padding : BOOLEAN := FALSE;
g_xon_backpressure : BOOLEAN := FALSE
); );
PORT ( PORT (
-- Transceiver PLL reference clock -- Transceiver PLL reference clock
...@@ -146,11 +151,12 @@ ARCHITECTURE str OF tr_10GbE IS ...@@ -146,11 +151,12 @@ ARCHITECTURE str OF tr_10GbE IS
SIGNAL eth_rx_clk_arr : STD_LOGIC_VECTOR(g_nof_macs-1 DOWNTO 0); SIGNAL eth_rx_clk_arr : STD_LOGIC_VECTOR(g_nof_macs-1 DOWNTO 0);
SIGNAL eth_rx_rst_arr : STD_LOGIC_VECTOR(g_nof_macs-1 DOWNTO 0); SIGNAL eth_rx_rst_arr : STD_LOGIC_VECTOR(g_nof_macs-1 DOWNTO 0);
SIGNAL dp_fifo_dc_tx_src_out_arr : t_dp_sosi_arr(g_nof_macs-1 DOWNTO 0); SIGNAL dp_fifo_sc_tx_src_out_arr : t_dp_sosi_arr(g_nof_macs-1 DOWNTO 0);
SIGNAL dp_fifo_dc_tx_src_in_arr : t_dp_siso_arr(g_nof_macs-1 DOWNTO 0); SIGNAL dp_fifo_sc_tx_src_in_arr : t_dp_siso_arr(g_nof_macs-1 DOWNTO 0);
SIGNAL dp_fifo_fill_tx_src_out_arr : t_dp_sosi_arr(g_nof_macs-1 DOWNTO 0); SIGNAL dp_fifo_fill_tx_src_out_arr : t_dp_sosi_arr(g_nof_macs-1 DOWNTO 0);
SIGNAL dp_fifo_fill_tx_src_in_arr : t_dp_siso_arr(g_nof_macs-1 DOWNTO 0); SIGNAL dp_fifo_fill_tx_src_in_arr : t_dp_siso_arr(g_nof_macs-1 DOWNTO 0);
SIGNAL dp_fifo_fill_tx_snk_out_arr : t_dp_siso_arr(g_nof_macs-1 DOWNTO 0);
SIGNAL mac_10g_src_out_arr : t_dp_sosi_arr(g_nof_macs-1 DOWNTO 0); SIGNAL mac_10g_src_out_arr : t_dp_sosi_arr(g_nof_macs-1 DOWNTO 0);
SIGNAL mac_10g_src_in_arr : t_dp_siso_arr(g_nof_macs-1 DOWNTO 0); SIGNAL mac_10g_src_in_arr : t_dp_siso_arr(g_nof_macs-1 DOWNTO 0);
...@@ -227,7 +233,48 @@ BEGIN ...@@ -227,7 +233,48 @@ BEGIN
eth_rx_clk_arr => eth_rx_clk_arr, eth_rx_clk_arr => eth_rx_clk_arr,
eth_rx_rst_arr => eth_rx_rst_arr eth_rx_rst_arr => eth_rx_rst_arr
); );
---------------------------------------------------------------------------------------
-- TX FIFO for buffering last packet when xon = 0 to prevent corrupt frames.
---------------------------------------------------------------------------------------
gen_xon_backpressure : IF g_xon_backpressure GENERATE
gen_dp_fifo_sc_tx : FOR i IN 0 TO g_nof_macs-1 GENERATE
u_dp_fifo_sc_tx : ENTITY dp_lib.dp_fifo_sc
GENERIC MAP (
g_technology => g_technology,
g_data_w => c_xgmii_data_w,
g_empty_w => c_tech_mac_10g_empty_w,
g_use_empty => TRUE,
g_fifo_size => g_tx_fifo_size
)
PORT MAP (
rst => dp_rst,
clk => dp_clk,
snk_out => snk_out_arr(i),
snk_in => snk_in_arr(i),
src_in => dp_fifo_sc_tx_src_in_arr(i),
src_out => dp_fifo_sc_tx_src_out_arr(i)
);
END GENERATE;
-- When MAC receives pause frames, it's ready signal is low for a long time
-- Set xon to (xon AND ready) to enable flushing frames using external dp_xonoff.
p_fifo_sc_tx : PROCESS(dp_fifo_fill_tx_snk_out_arr)
BEGIN
dp_fifo_sc_tx_src_in_arr <= dp_fifo_fill_tx_snk_out_arr;
FOR i IN 0 TO g_nof_macs-1 LOOP
dp_fifo_sc_tx_src_in_arr(i).xon <= dp_fifo_fill_tx_snk_out_arr(i).xon AND dp_fifo_fill_tx_snk_out_arr(i).ready;
END LOOP;
END PROCESS;
END GENERATE;
gen_no_xon_backpressure : IF NOT g_xon_backpressure GENERATE
dp_fifo_sc_tx_src_out_arr <= snk_in_arr;
snk_out_arr <= dp_fifo_fill_tx_snk_out_arr;
END GENERATE;
--------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------
-- TX: FIFO: dp_clk -> tx_clk and with fill level/eop trigger so we can deliver packets to the MAC fast enough -- TX: FIFO: dp_clk -> tx_clk and with fill level/eop trigger so we can deliver packets to the MAC fast enough
--------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------
...@@ -248,19 +295,17 @@ BEGIN ...@@ -248,19 +295,17 @@ BEGIN
rd_rst => eth_tx_rst_arr(i), rd_rst => eth_tx_rst_arr(i),
rd_clk => eth_tx_clk_arr(i), rd_clk => eth_tx_clk_arr(i),
snk_out => snk_out_arr(i), snk_out => dp_fifo_fill_tx_snk_out_arr(i),
snk_in => snk_in_arr(i), snk_in => dp_fifo_sc_tx_src_out_arr(i),
src_in => dp_fifo_fill_tx_src_in_arr(i), src_in => dp_fifo_fill_tx_src_in_arr(i),
src_out => dp_fifo_fill_tx_src_out_arr(i) src_out => dp_fifo_fill_tx_src_out_arr(i)
); );
END GENERATE; END GENERATE;
--------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------
-- ETH MAC + PHY -- ETH MAC + PHY
--------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------
u_tech_eth_10g : ENTITY tech_eth_10g_lib.tech_eth_10g u_tech_eth_10g : ENTITY tech_eth_10g_lib.tech_eth_10g
GENERIC MAP ( GENERIC MAP (
g_technology => g_technology, g_technology => g_technology,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment