Skip to content
Snippets Groups Projects
Commit b8222b41 authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Add phy_tx_ready and phy_tx_ready.

parent af1333ef
No related branches found
No related tags found
1 merge request!451Transport app packet along ring and add network header at TDO. Get source...
Pipeline #122319 passed with warnings
...@@ -124,10 +124,10 @@ entity tb_lofar2_unb2c_sdp_station_tbuf_ring is ...@@ -124,10 +124,10 @@ entity tb_lofar2_unb2c_sdp_station_tbuf_ring is
g_nof_rn : natural := 2; -- nof ring nodes (RN) in ring g_nof_rn : natural := 2; -- nof ring nodes (RN) in ring
g_ddr_buffer_size : natural := 256; -- <= 4096, because c_tech_ddr4_sim_4k_64 has 4k = 4096 words of g_ddr_buffer_size : natural := 256; -- <= 4096, because c_tech_ddr4_sim_4k_64 has 4k = 4096 words of
-- c_sdp_tbuf_W_word = 512b -- c_sdp_tbuf_W_word = 512b
g_rs_block_size : natural := 34; -- c_sdp_tbuf_rs_block_size = 2000, must be even see sdp_tbuf_output g_rs_block_size : natural := 100; -- c_sdp_tbuf_rs_block_size = 2000, must be even see sdp_tbuf_output
g_rs_record_nof_block : natural := 3; -- choose > c_rs_nof_block_per_sync to have at least on sync interval g_rs_record_nof_block : natural := 3; -- choose > c_rs_nof_block_per_sync to have at least on sync interval
-- for the RSN monitor -- for the RSN monitor
g_dump_direction : natural := 1; -- dump direction on the lane, 0 is negative, > 0 is positive direction g_dump_direction : natural := 0; -- dump direction on the lane, 0 is negative, > 0 is positive direction
g_dump_inter_packet_gap : natural := 0; -- use 1708 for 3 Gbps and g_rs_block_size = 2000 g_dump_inter_packet_gap : natural := 0; -- use 1708 for 3 Gbps and g_rs_block_size = 2000
g_dump_page_offset : natural := 1; -- offset relative to recorded_first_page g_dump_page_offset : natural := 1; -- offset relative to recorded_first_page
g_dump_nof_pages : natural := 2; -- g_dump_page_offset + g_dump_nof_pages <= g_rs_record_nof_block, else g_dump_nof_pages : natural := 2; -- g_dump_page_offset + g_dump_nof_pages <= g_rs_record_nof_block, else
...@@ -149,7 +149,10 @@ architecture tb of tb_lofar2_unb2c_sdp_station_tbuf_ring is ...@@ -149,7 +149,10 @@ architecture tb of tb_lofar2_unb2c_sdp_station_tbuf_ring is
constant c_tb_str : string := "TB-" & int_to_str(g_tb_index) & ": "; constant c_tb_str : string := "TB-" & int_to_str(g_tb_index) & ": ";
constant c_Gbps : real := 10.0**9; constant c_Gbps : real := 10.0**9;
constant c_design_name : string := "lofar2_unb2c_sdp_station_tbuf_ring"; constant c_use_bf : boolean := false; -- use true to verify tbuf_state_rec.phy_tx_ready pulse extend
constant c_design_name : string := sel_a_b(c_use_bf, "lofar2_unb2c_sdp_station_lift",
"lofar2_unb2c_sdp_station_tbuf_ring");
constant c_version : std_logic_vector(1 downto 0) := "00"; constant c_version : std_logic_vector(1 downto 0) := "00";
constant c_fw_version : t_unb2c_board_fw_version := (1, 0); constant c_fw_version : t_unb2c_board_fw_version := (1, 0);
...@@ -273,6 +276,7 @@ architecture tb of tb_lofar2_unb2c_sdp_station_tbuf_ring is ...@@ -273,6 +276,7 @@ architecture tb of tb_lofar2_unb2c_sdp_station_tbuf_ring is
signal tb_almost_end : std_logic := '0'; signal tb_almost_end : std_logic := '0';
signal i_tb_end : std_logic := '0'; signal i_tb_end : std_logic := '0';
signal tb_clk : std_logic := '0'; signal tb_clk : std_logic := '0';
signal rd_data_state : std_logic_vector(c_32 - 1 downto 0);
signal rd_data_setup : std_logic_vector(c_32 - 1 downto 0); signal rd_data_setup : std_logic_vector(c_32 - 1 downto 0);
signal rd_data_control : std_logic_vector(c_32 - 1 downto 0); signal rd_data_control : std_logic_vector(c_32 - 1 downto 0);
signal rd_data_bsn : std_logic_vector(c_32 - 1 downto 0); signal rd_data_bsn : std_logic_vector(c_32 - 1 downto 0);
...@@ -852,6 +856,11 @@ begin ...@@ -852,6 +856,11 @@ begin
-- Wait for DUT power up after reset -- Wait for DUT power up after reset
wait for 200 ns; wait for 200 ns;
-- Read TBuf state
mmf_mm_bus_rd(c_mm_file_reg_tbuf, 19, rd_data_state, tb_clk);
proc_common_wait_some_cycles(tb_clk, 1);
v_bool := func_sdp_tbuf_print_state(c_tb_str, rd_data_state);
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
-- Enable packet dump output only on last node -- Enable packet dump output only on last node
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
...@@ -1024,6 +1033,11 @@ begin ...@@ -1024,6 +1033,11 @@ begin
wait for 100 ns; wait for 100 ns;
end loop; end loop;
-- Read TBuf state
mmf_mm_bus_rd(c_mm_file_reg_tbuf, 19, rd_data_state, tb_clk);
proc_common_wait_some_cycles(tb_clk, 1);
v_bool := func_sdp_tbuf_print_state(c_tb_str, rd_data_state);
-- Enable dump of antenna inputs per RN -- Enable dump of antenna inputs per RN
if g_dump_nof_pages > 0 then if g_dump_nof_pages > 0 then
for RN in 0 to c_last_rn loop for RN in 0 to c_last_rn loop
......
...@@ -367,6 +367,31 @@ begin ...@@ -367,6 +367,31 @@ begin
dump_ai => tbuf_state_rec.dump_ai dump_ai => tbuf_state_rec.dump_ai
); );
-- From ip_arria10_e2sg_eth_10g.vhd in tr_10GbE.vhd it follows that tbuf_udp_siso.xon = '1' when xgmii_tx_ready =
-- '1' and xgmii_link_status is 0 = OK. The xgmii_tx_ready goes high some time after power up and then remains
-- high. When xgmii_link_status OK then both sides of the link are OK. Therefore buf_udp_siso.xon = '1' indicates
-- that the cable is connected on both sides and that the 10GbE link is ready to use for data transport.
tbuf_state_rec.phy_tx_xon <= tbuf_udp_siso.xon when rising_edge(dp_clk);
-- The tbuf_udp_siso.ready is wired to the avalon_st_tx_ready of ip_arria10_e2sg_mac_10g.vhd in the
-- tech_mac_10g_arria10_e2sg.vhd. In simulation the avalon_st_tx_ready is typically '1'. The tbuf_udp_siso.ready
-- is only high once every three dp_clk cycles due to the dp_mux in nw_10GbE.vhd that round robin selects between
-- tx for data, arp or ping. When the tbuf_udp_sosi has tx data, then the tbuf_udp_siso.ready remains '1' during
-- the transmit. For MM status of tbuf_udp_siso.ready it is useful to extend it to three cycles, because then
-- it remains '1' when then there is no transmit and becomes '0' when a ping or arp packet is being transmitted.
-- In combination with BF beamlet data output the duty cycle of tbuf_udp_siso.ready twice longer due to the
-- u_bf_tbuf_mux in sdp_station.vhd that selects round robin between BF beamlets and TBuf dump.
u_common_pulse_extend : entity common_lib.common_pulse_extend
generic map (
g_nof_cycles => 6 -- = 3 for u_dp_mux in nw_10GbE.vhd, and * 2 for u_bf_tbuf_mux in sdp_station.vhd
)
port map (
rst => dp_rst,
clk => dp_clk,
p_in => tbuf_udp_siso.ready,
ep_out => tbuf_state_rec.phy_tx_ready
);
u_sdp_tbuf_output : entity work.sdp_tbuf_output u_sdp_tbuf_output : entity work.sdp_tbuf_output
generic map ( generic map (
g_rs_block_size => c_rs_block_size g_rs_block_size => c_rs_block_size
......
...@@ -90,6 +90,8 @@ package sdp_tbuf_pkg is ...@@ -90,6 +90,8 @@ package sdp_tbuf_pkg is
dump_busy : std_logic; -- 24 dump_busy : std_logic; -- 24
dump_done : std_logic; -- 25 dump_done : std_logic; -- 25
dump_ai : natural; -- 28:26 dump_ai : natural; -- 28:26
phy_tx_xon : std_logic; -- 29
phy_tx_ready : std_logic; -- 30
end record; end record;
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
...@@ -645,6 +647,8 @@ package body sdp_tbuf_pkg is ...@@ -645,6 +647,8 @@ package body sdp_tbuf_pkg is
v_slv(24) := state_rec.dump_busy; v_slv(24) := state_rec.dump_busy;
v_slv(25) := state_rec.dump_done; v_slv(25) := state_rec.dump_done;
v_slv(28 downto 26) := to_uvec(state_rec.dump_ai, 3); v_slv(28 downto 26) := to_uvec(state_rec.dump_ai, 3);
v_slv(29) := state_rec.phy_tx_xon;
v_slv(30) := state_rec.phy_tx_ready;
return v_slv; return v_slv;
end func_sdp_tbuf_map_state; end func_sdp_tbuf_map_state;
...@@ -666,6 +670,8 @@ package body sdp_tbuf_pkg is ...@@ -666,6 +670,8 @@ package body sdp_tbuf_pkg is
v_rec.dump_busy := state_slv(24); v_rec.dump_busy := state_slv(24);
v_rec.dump_done := state_slv(25); v_rec.dump_done := state_slv(25);
v_rec.dump_ai := to_uint(state_slv(28 downto 26)); v_rec.dump_ai := to_uint(state_slv(28 downto 26));
v_rec.phy_tx_xon := state_slv(29);
v_rec.phy_tx_ready := state_slv(30);
return v_rec; return v_rec;
end func_sdp_tbuf_map_state; end func_sdp_tbuf_map_state;
......
...@@ -219,6 +219,8 @@ package body tb_sdp_tbuf_pkg is ...@@ -219,6 +219,8 @@ package body tb_sdp_tbuf_pkg is
print_str(prefix & " dump_busy = " & sl_to_str(state_rec.dump_busy)); print_str(prefix & " dump_busy = " & sl_to_str(state_rec.dump_busy));
print_str(prefix & " dump_done = " & sl_to_str(state_rec.dump_done)); print_str(prefix & " dump_done = " & sl_to_str(state_rec.dump_done));
print_str(prefix & " dump_ai = " & int_to_str(state_rec.dump_ai)); print_str(prefix & " dump_ai = " & int_to_str(state_rec.dump_ai));
print_str(prefix & ". phy_tx_xon = " & sl_to_str(state_rec.phy_tx_xon));
print_str(prefix & ". phy_tx_ready = " & sl_to_str(state_rec.phy_tx_ready));
print_str(""); print_str("");
return true; return true;
end func_sdp_tbuf_print_state; end func_sdp_tbuf_print_state;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment