diff --git a/applications/lofar2/designs/lofar2_unb2c_sdp_station/revisions/lofar2_unb2c_sdp_station_bf/tb_lofar2_unb2c_sdp_station_bf.vhd b/applications/lofar2/designs/lofar2_unb2c_sdp_station/revisions/lofar2_unb2c_sdp_station_bf/tb_lofar2_unb2c_sdp_station_bf.vhd index c249bdfbf36cd3bfb72c435d906390f3187bf112..da901213a23fee1782471b330fee9210c8d33a0d 100644 --- a/applications/lofar2/designs/lofar2_unb2c_sdp_station/revisions/lofar2_unb2c_sdp_station_bf/tb_lofar2_unb2c_sdp_station_bf.vhd +++ b/applications/lofar2/designs/lofar2_unb2c_sdp_station/revisions/lofar2_unb2c_sdp_station_bf/tb_lofar2_unb2c_sdp_station_bf.vhd @@ -195,7 +195,7 @@ ARCHITECTURE tb OF tb_lofar2_unb2c_sdp_station_bf IS CONSTANT c_stat_lo_factor : REAL := 1.0 - c_stat_percentage; -- lower boundary CONSTANT c_stat_hi_factor : REAL := 1.0 + c_stat_percentage; -- higher boundary - CONSTANT c_nof_beamlets_per_data : NATURAL := 2; -- 2 dual pol beamlets (= XY, XY) per 64b data word + CONSTANT c_nof_beamlets_per_data : NATURAL := c_sdp_cep_nof_beamlets_per_longword; -- = 2 dual pol beamlets per 64b data word CONSTANT c_beamlet_output_delta : INTEGER := 2; -- +-delta margin diff --git a/applications/lofar2/libraries/sdp/src/vhdl/sdp_beamformer_output.vhd b/applications/lofar2/libraries/sdp/src/vhdl/sdp_beamformer_output.vhd index 2a7d53aedc234b28cc2e2a929add7cd0bfbf6a5c..b7638e6df68a210231533e47e986a953a95eba7d 100644 --- a/applications/lofar2/libraries/sdp/src/vhdl/sdp_beamformer_output.vhd +++ b/applications/lofar2/libraries/sdp/src/vhdl/sdp_beamformer_output.vhd @@ -78,9 +78,9 @@ ARCHITECTURE str OF sdp_beamformer_output IS CONSTANT c_data_w : NATURAL := c_nof_complex*c_sdp_W_beamlet; --16b CONSTANT c_beamlet_index : NATURAL := g_beamset_id * c_sdp_S_sub_bf; -- call beamset 'id' and beamlet 'index' - -- c_fifo_fill must be the exact size of a packet such that no packet gets stuck in the FIFO or the FIFO gets read out too soon. + -- c_fifo_fill must be the exact size of a payload such that no payload gets stuck in the FIFO or the FIFO gets read out too soon. -- For packets of variable length, dp_fifo_fill_eop must be used. In this case we can use the standard fill fifo. - CONSTANT c_fifo_fill : NATURAL := c_sdp_cep_nof_blocks_per_packet * c_sdp_cep_nof_beamlets_per_block / 2; -- Size of packet: 2 beamlets (dual pol) fit in 1 64bit longword + CONSTANT c_fifo_fill : NATURAL := c_sdp_cep_payload_nof_longwords; CONSTANT c_fifo_size : NATURAL := c_fifo_fill*2; -- Make fifo size large enough for adding header and muxing beamsets. SIGNAL snk_in_concat : t_dp_sosi; diff --git a/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd b/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd index 18ced76934adca24873bbf0f90cd1368a1398ee2..1f392030b12ec07086cbf4db03e3f304d44545a5 100644 --- a/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd +++ b/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd @@ -116,9 +116,11 @@ PACKAGE sdp_pkg is CONSTANT c_sdp_N_clk_sync_timeout : NATURAL := c_sdp_f_adc_MHz*10**6 + c_sdp_f_adc_MHz*10**5; -- 10% margin. CONSTANT c_sdp_N_clk_sync_timeout_xsub : NATURAL := 2147483647; -- = 2**31 - 1 = largest value for NATURAL for 10.7 seconds. Do not use 2*31 to avoid Modelsim NATURAL overflow warning. CONSTANT c_sdp_N_sync_jesd : NATURAL := c_sdp_S_pn * c_sdp_N_sync_rcu / c_sdp_S_rcu; -- = 4, nof JESD IP sync outputs per PN - CONSTANT c_sdp_f_sub_Hz : REAL := REAL(c_sdp_f_adc_MHz * 10**6) / REAL(c_sdp_N_fft); + CONSTANT c_sdp_f_sub_Hz : REAL := REAL(c_sdp_f_adc_MHz * 10**6) / REAL(c_sdp_N_fft); -- = 195312.5 CONSTANT c_sdp_N_int : NATURAL := c_sdp_f_adc_MHz * 10**6; -- nof ADC sample periods per 1 s integration interval CONSTANT c_sdp_N_int_sub : REAL := c_sdp_f_sub_Hz; -- nof subband sample periods per 1 s integration interval + CONSTANT c_sdp_N_int_sub_lo : NATURAL := NATURAL(FLOOR(c_sdp_N_int_sub)); -- = 195312 + CONSTANT c_sdp_N_int_sub_hi : NATURAL := NATURAL(CEIL(c_sdp_N_int_sub)); -- = 195313 CONSTANT c_sdp_A_pn : NATURAL := c_sdp_S_pn / c_sdp_N_pol; -- = 6 dual pol antenna per PN, is 6 signal input pairs CONSTANT c_sdp_P_pfb : NATURAL := c_sdp_S_pn / c_sdp_Q_fft; -- = 6 PFB units, for 6 signal input pairs CONSTANT c_sdp_T_adc : TIME := (10**6 / c_sdp_f_adc_MHz) * 1 ps; -- = 5 ns @ 200MHz @@ -309,9 +311,10 @@ PACKAGE sdp_pkg is END RECORD; ----------------------------------------------------------------------------- - -- Beamlet output via 10GbE to CEP (= central processor) + -- Beamlet output via 10GbE to CEP (= central processor, see ICD STAT-CEP) ----------------------------------------------------------------------------- - CONSTANT c_sdp_marker_beamlets : NATURAL := 98; -- = x"62" = 'b' + CONSTANT c_sdp_cep_version_id : NATURAL := 5; + CONSTANT c_sdp_marker_beamlets : NATURAL := 98; -- = x"62" = 'b' CONSTANT c_sdp_cep_eth_dst_mac : STD_LOGIC_VECTOR(47 DOWNTO 0) := x"00074306C700"; -- 00074306C700 = DOP36-eth0 CONSTANT c_sdp_cep_eth_src_mac_47_16 : STD_LOGIC_VECTOR(31 DOWNTO 0) := x"00228608"; -- 47:16, 15:8 = backplane, 7:0 = node @@ -322,13 +325,16 @@ PACKAGE sdp_pkg is CONSTANT c_sdp_cep_udp_dst_port : STD_LOGIC_VECTOR(15 DOWNTO 0) := TO_UVEC(5000, 16); -- 0x1380 = 5000 CONSTANT c_sdp_cep_udp_src_port_15_8 : STD_LOGIC_VECTOR( 7 DOWNTO 0) := x"D0"; -- 15:8, 7:0 = gn_id (= ID[7:0] = backplane[5:0] & node[1:0]) - CONSTANT c_sdp_cep_app_header_len : NATURAL := 32; + CONSTANT c_sdp_cep_app_header_len : NATURAL := 32; -- octets, see ICD STAT-CEP + CONSTANT c_sdp_cep_header_len : NATURAL := 14 + 20 + 8 + c_sdp_cep_app_header_len; -- = eth + ip + udp + app = 74 octets, see ICD STAT-CEP - CONSTANT c_sdp_cep_version_id : NATURAL := 5; - CONSTANT c_sdp_cep_nof_blocks_per_packet : NATURAL := 4; - CONSTANT c_sdp_cep_nof_beamlets_per_block : NATURAL := c_sdp_S_sub_bf; -- number of dual pol beamlets (c_sdp_N_pol_bf = 2) + CONSTANT c_sdp_cep_nof_blocks_per_packet : NATURAL := 4; -- number of time blocks of beamlets per output packet + CONSTANT c_sdp_cep_nof_beamlets_per_block : NATURAL := c_sdp_S_sub_bf; -- number of dual pol beamlets (c_sdp_N_pol_bf = 2) + CONSTANT c_sdp_cep_nof_beamlets_per_longword : NATURAL := 2; -- 2 dual pol, complex, 8bit beamlets fit in 1 64bit longword + CONSTANT c_sdp_cep_payload_nof_longwords : NATURAL := c_sdp_cep_nof_blocks_per_packet * c_sdp_cep_nof_beamlets_per_block / c_sdp_cep_nof_beamlets_per_longword; -- = 976 + CONSTANT c_sdp_cep_packet_nof_longwords : NATURAL := ceil_div(c_sdp_cep_header_len, c_longword_sz) + c_sdp_cep_payload_nof_longwords; -- without tail CRC, the CRC is applied by 10GbE MAC - CONSTANT c_sdp_cep_nof_hdr_fields : NATURAL := 3+12+4+18+1; -- 592b; 9.25 64b words + CONSTANT c_sdp_cep_nof_hdr_fields : NATURAL := 3+12+4+18+1; -- c_sdp_cep_header_len / c_longword_sz = 74 / 8 = 9.25 64b words = 592b CONSTANT c_sdp_cep_hdr_field_sel : STD_LOGIC_VECTOR(c_sdp_cep_nof_hdr_fields-1 DOWNTO 0) := "101"&"111111111001"&"0111"&"1100"&"00000010"&"000110"&"0"; -- 0=data path, 1=MM controlled TODO --CONSTANT c_sdp_cep_hdr_field_sel : STD_LOGIC_VECTOR(c_sdp_cep_nof_hdr_fields-1 DOWNTO 0) := "100"&"000000010001"&"0100"&"0100"&"00000000"&"101000"&"0"; -- 0=data path, 1=MM controlled TODO diff --git a/applications/lofar2/libraries/sdp/src/vhdl/sdp_station.vhd b/applications/lofar2/libraries/sdp/src/vhdl/sdp_station.vhd index 7396bd3d3a6133dab982e8af25078f0f2114b1a7..7455fcaf62c5127110fd4ff974b0c1d6a6187b3d 100644 --- a/applications/lofar2/libraries/sdp/src/vhdl/sdp_station.vhd +++ b/applications/lofar2/libraries/sdp/src/vhdl/sdp_station.vhd @@ -26,7 +26,7 @@ -- Combines sdp nodes. Contains the UniBoard2 HW version independent LOFAR2 SDP application code. ------------------------------------------------------------------------------- -LIBRARY IEEE, common_lib, diag_lib, dp_lib, tech_jesd204b_lib, wpfb_lib, tech_pll_lib, tr_10gbe_lib, nw_10gbe_lib, eth_lib, ring_lib; +LIBRARY IEEE, common_lib, diag_lib, dp_lib, tech_jesd204b_lib, wpfb_lib, tech_pll_lib, tr_10GbE_lib, nw_10GbE_lib, eth_lib, ring_lib; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.NUMERIC_STD.ALL; USE common_lib.common_pkg.ALL; @@ -88,15 +88,6 @@ ENTITY sdp_station IS udp_tx_sosi_arr : OUT t_dp_sosi_arr(c_eth_nof_udp_ports-1 DOWNTO 0) := (OTHERS => c_dp_sosi_rst); udp_tx_siso_arr : IN t_dp_siso_arr(c_eth_nof_udp_ports-1 DOWNTO 0) := (OTHERS => c_dp_siso_rdy); - ---------------------------------------------- - -- 10 GbE - ---------------------------------------------- - reg_nw_10GbE_mac_copi : IN t_mem_copi := c_mem_copi_rst; - reg_nw_10GbE_mac_cipo : OUT t_mem_cipo := c_mem_cipo_rst; - - reg_nw_10GbE_eth10g_copi : IN t_mem_copi := c_mem_copi_rst; - reg_nw_10GbE_eth10g_cipo : OUT t_mem_cipo := c_mem_cipo_rst; - ---------------------------------------------- -- AIT ---------------------------------------------- @@ -170,6 +161,7 @@ ENTITY sdp_station IS -- SST UDP offload bsn monitor reg_bsn_monitor_v2_sst_offload_copi : IN t_mem_copi := c_mem_copi_rst; reg_bsn_monitor_v2_sst_offload_cipo : OUT t_mem_cipo := c_mem_cipo_rst; + ---------------------------------------------- -- SDP Info ---------------------------------------------- @@ -265,6 +257,18 @@ ENTITY sdp_station IS -- BF ring bsn at sync reg_dp_block_validate_bsn_at_sync_bf_copi : IN t_mem_copi := c_mem_copi_rst; reg_dp_block_validate_bsn_at_sync_bf_cipo : OUT t_mem_cipo := c_mem_cipo_rst; + + ---------------------------------------------- + -- BST + ---------------------------------------------- + -- Statistics Enable + reg_stat_enable_bst_copi : IN t_mem_copi := c_mem_copi_rst; + reg_stat_enable_bst_cipo : OUT t_mem_cipo := c_mem_cipo_rst; + + -- Statistics header info + reg_stat_hdr_dat_bst_copi : IN t_mem_copi := c_mem_copi_rst; + reg_stat_hdr_dat_bst_cipo : OUT t_mem_cipo := c_mem_cipo_rst; + ---------------------------------------------- -- SST ---------------------------------------------- @@ -321,35 +325,38 @@ ENTITY sdp_station IS reg_dp_block_validate_bsn_at_sync_xst_copi : IN t_mem_copi := c_mem_copi_rst; reg_dp_block_validate_bsn_at_sync_xst_cipo : OUT t_mem_cipo := c_mem_cipo_rst; - -- XST ring MAC + ---------------------------------------------- + -- tr 10 GbE for ring + ---------------------------------------------- + reg_tr_10GbE_mac_copi : IN t_mem_copi := c_mem_copi_rst; reg_tr_10GbE_mac_cipo : OUT t_mem_cipo := c_mem_cipo_rst; - -- XST ring ETH reg_tr_10GbE_eth10g_copi : IN t_mem_copi := c_mem_copi_rst; reg_tr_10GbE_eth10g_cipo : OUT t_mem_cipo := c_mem_cipo_rst; + -- RING_0 serial + RING_0_TX: OUT STD_LOGIC_VECTOR(c_quad - 1 DOWNTO 0) := (OTHERS => '0'); + RING_0_RX: IN STD_LOGIC_VECTOR(c_quad - 1 DOWNTO 0) := (OTHERS => '0'); + + -- RING_1 serial + RING_1_TX : OUT STD_LOGIC_VECTOR(c_quad - 1 DOWNTO 0) := (OTHERS => '0'); + RING_1_RX : IN STD_LOGIC_VECTOR(c_quad - 1 DOWNTO 0) := (OTHERS => '0'); ---------------------------------------------- - -- BST + -- nw 10 GbE for beamlet output ---------------------------------------------- - -- Statistics Enable - reg_stat_enable_bst_copi : IN t_mem_copi := c_mem_copi_rst; - reg_stat_enable_bst_cipo : OUT t_mem_cipo := c_mem_cipo_rst; - - -- Statistics header info - reg_stat_hdr_dat_bst_copi : IN t_mem_copi := c_mem_copi_rst; - reg_stat_hdr_dat_bst_cipo : OUT t_mem_cipo := c_mem_cipo_rst; + reg_nw_10GbE_mac_copi : IN t_mem_copi := c_mem_copi_rst; + reg_nw_10GbE_mac_cipo : OUT t_mem_cipo := c_mem_cipo_rst; - -- RING_0 serial - RING_0_TX: OUT STD_LOGIC_VECTOR( c_quad - 1 DOWNTO 0) := (OTHERS => '0'); - RING_0_RX: IN STD_LOGIC_VECTOR( c_quad - 1 DOWNTO 0) := (OTHERS => '0'); + reg_nw_10GbE_eth10g_copi : IN t_mem_copi := c_mem_copi_rst; + reg_nw_10GbE_eth10g_cipo : OUT t_mem_cipo := c_mem_cipo_rst; - -- RING_1 serial - RING_1_TX : OUT STD_LOGIC_VECTOR( c_quad - 1 DOWNTO 0) := (OTHERS => '0'); - RING_1_RX : IN STD_LOGIC_VECTOR( c_quad - 1 DOWNTO 0) := (OTHERS => '0'); + ---------------------------------------------- + -- QSFP for beamlet output and for ring cable + ---------------------------------------------- - -- QSFP serial + -- QSFP serial (6 QSFP ports per FPGA) unb2_board_front_io_serial_tx_arr : OUT STD_LOGIC_VECTOR(6 * c_quad-1 DOWNTO 0) := (OTHERS => '0'); unb2_board_front_io_serial_rx_arr : IN STD_LOGIC_VECTOR(6 * c_quad-1 DOWNTO 0) := (OTHERS => '0'); @@ -363,14 +370,17 @@ END sdp_station; ARCHITECTURE str OF sdp_station IS - -- 10 GbE Interface - CONSTANT c_nof_10GbE_offload_streams : NATURAL := 1; - CONSTANT c_nof_blocks_per_packet : NATURAL := 4; - CONSTANT c_nof_beamlets_per_block : NATURAL := c_sdp_N_pol * c_sdp_S_sub_bf; - CONSTANT c_10GbE_block_size : NATURAL := c_nof_blocks_per_packet * c_nof_beamlets_per_block / 4; -- 4 beamlets fit in 1 64bit longword - CONSTANT c_fifo_tx_fill : NATURAL := c_10GbE_block_size; - CONSTANT c_fifo_tx_size : NATURAL := c_fifo_tx_fill + 11; -- Make fifo size large enough for adding header. - + -- Make Tx FIFOs at least c_fifo_tx_fill_margin larger than needed to fit the largest Tx packet + CONSTANT c_fifo_tx_fill_margin : NATURAL := 10; -- >= c_fifo_fill_margin = 6 that is used in dp_fifo_fill_eop + + -- 10 GbE Interface for beamlet output + CONSTANT c_nof_10GbE_beamlet_output : NATURAL := 1; + + -- The nw_10GbE/tr_10GbE uses dp_fifo_fill_eop, so rely on releasing packets (beamlets, arp and ping) at eop instead + -- of at fill level. Make fifo size large enough to fit one packet and the c_fifo_tx_fill_margin. + CONSTANT c_fifo_tx_size_beamlet_output : NATURAL := true_log_pow2(c_sdp_cep_packet_nof_longwords + c_fifo_tx_fill_margin); -- = 976 + 6 --> 1024 + CONSTANT c_fifo_tx_fill_beamlet_output : NATURAL := c_fifo_tx_size_beamlet_output - c_fifo_tx_fill_margin; -- = maximum fill level, so rely on eop + -- Address widths of a single MM instance CONSTANT c_addr_w_ram_ss_ss_wide : NATURAL := ceil_log2(c_sdp_P_pfb * c_sdp_S_sub_bf * c_sdp_Q_fft); CONSTANT c_addr_w_ram_bf_weights : NATURAL := ceil_log2(c_sdp_N_pol * c_sdp_P_pfb * c_sdp_S_sub_bf * c_sdp_Q_fft); @@ -386,27 +396,37 @@ ARCHITECTURE str OF sdp_station IS CONSTANT c_f_adc : STD_LOGIC := '1'; -- '0' => 160M, '1' => 200M CONSTANT c_fsub_type : STD_LOGIC := '0'; -- '0' => critical sampled PFB, '1' => oversampled PFB - CONSTANT c_use_dp_layer : BOOLEAN := TRUE; - CONSTANT c_lane_packet_length_xst : NATURAL := c_sdp_N_crosslets_max * c_sdp_S_pn / 2; -- = crosslet subband select block size devided by 2 as it is repacked from 32b to 64b. = 42 words - CONSTANT c_lane_packet_length_bf : NATURAL := (c_sdp_S_sub_bf * c_sdp_N_pol_bf * 9) / 16; -- = beamlet block size repacked from 36b to 64b (9/16 = 36/64). = 549 words - CONSTANT c_err_bi : NATURAL := 0; + CONSTANT c_lane_payload_nof_longwords_xst : NATURAL := c_sdp_N_crosslets_max * c_sdp_S_pn / 2; -- = crosslet subband select block size divided by 2 as it is repacked from 32b to 64b. = 42 longwords + CONSTANT c_lane_payload_nof_longwords_bf : NATURAL := (c_sdp_S_sub_bf * c_sdp_N_pol_bf * 9) / 16; -- = beamlet block size repacked from 36b to 64b (9/16 = 36/64). = 549 longwords + CONSTANT c_lane_payload_nof_longwords_max : NATURAL := largest(c_lane_payload_nof_longwords_xst, c_lane_payload_nof_longwords_bf); + CONSTANT c_lane_packet_nof_longwords_max : NATURAL := c_lane_payload_nof_longwords_max + c_ring_dp_hdr_field_size; -- = 549 + 3 = 552 + + CONSTANT c_err_bi : NATURAL := 0; CONSTANT c_nof_err_counts : NATURAL := 8; CONSTANT c_bsn_at_sync_check_channel : NATURAL := 1; CONSTANT c_validate_channel : BOOLEAN := TRUE; CONSTANT c_validate_channel_mode : STRING := "="; - CONSTANT c_sync_timeout : NATURAL := sel_a_b(g_sim, g_sim_sync_timeout, c_sdp_N_clk_sync_timeout ); - CONSTANT c_xsub_fifo_tx_fill : NATURAL := c_lane_packet_length_bf + sel_a_b(c_use_dp_layer, c_ring_dp_hdr_field_size, c_ring_eth_hdr_field_size); --total max packet length (bf has largest packets) - CONSTANT c_xsub_fifo_tx_size : NATURAL := 2 * c_lane_packet_length_bf; + CONSTANT c_sync_timeout : NATURAL := sel_a_b(g_sim, g_sim_sync_timeout, c_sdp_N_clk_sync_timeout); + + -- Use same Tx FIFO size for all lanes in the ring to ease the code, no need to optimize Tx FIFO RAM usage per lane. + -- The tr_10GbE uses dp_fifo_fill_eop, so rely on releasing packets (beamlets, crosslets) at eop instead + -- of at fill level. Make fifo size large enough to fit one packet and the c_fifo_tx_fill_margin. + CONSTANT c_fifo_tx_size_ring : NATURAL := true_log_pow2(c_lane_packet_nof_longwords_max + c_fifo_tx_fill_margin); -- = 552 + 6 --> 1024 + CONSTANT c_fifo_tx_fill_ring : NATURAL := c_fifo_tx_size_ring - c_fifo_tx_fill_margin; -- = maximum fill level, so rely on eop CONSTANT c_nof_lane : NATURAL := 3; -- 0 = XST, 1 = BF_0, 2 = BF_1. CONSTANT c_nof_if : NATURAL := 3; -- 3 different interfaces, QSFP, RING_0 and RING_1 CONSTANT c_qsfp_if_offset : NATURAL := 0; -- QSFP signals are indexed at c_nof_if * I. CONSTANT c_ring_0_if_offset : NATURAL := 1; -- RING_0 signals are indexed at c_nof_if * I + 1. CONSTANT c_ring_1_if_offset : NATURAL := 2; -- RING_1 signals are indexed at c_nof_if * I + 2. - CONSTANT c_nof_mac : NATURAL := 12; -- Using 9 out of 12 (this is NOT optimized away during synthesis), must match one of the MAC IP variations, e.g. 1, 3, 4, 12, 24, 48 + CONSTANT c_ring_nof_mac : NATURAL := 12; -- Using 9 out of 12 (this is NOT optimized away during synthesis), must match one of the MAC IP variations, e.g. 1, 3, 4, 12, 24, 48 + + SIGNAL gn_index : NATURAL := 0; + SIGNAL this_rn : STD_LOGIC_VECTOR(c_byte_w-1 DOWNTO 0); + + SIGNAL sdp_info : t_sdp_info := c_sdp_info_rst; + SIGNAL ring_info : t_ring_info; - SIGNAL gn_index : NATURAL := 0; - SIGNAL this_rn : STD_LOGIC_VECTOR(c_byte_w-1 DOWNTO 0); ---------------------------------------------- -- BF ---------------------------------------------- @@ -505,26 +525,29 @@ ARCHITECTURE str OF sdp_station IS SIGNAL bf_udp_siso_arr : t_dp_siso_arr(c_sdp_N_beamsets-1 DOWNTO 0); SIGNAL bf_10GbE_hdr_fields_out_arr : t_slv_1024_arr(c_sdp_N_beamsets-1 DOWNTO 0); - -- 10GbE + -- 10GbE clock SIGNAL tr_ref_clk_312 : STD_LOGIC; SIGNAL tr_ref_clk_156 : STD_LOGIC; SIGNAL tr_ref_rst_156 : STD_LOGIC; - SIGNAL tr_10gbe_serial_tx_arr : STD_LOGIC_VECTOR(c_nof_mac-1 DOWNTO 0) := (OTHERS => '0'); - SIGNAL tr_10gbe_serial_rx_arr : STD_LOGIC_VECTOR(c_nof_mac-1 DOWNTO 0) := (OTHERS => '0'); + -- 10GbE ring + SIGNAL tr_10gbe_ring_serial_tx_arr : STD_LOGIC_VECTOR(c_ring_nof_mac-1 DOWNTO 0) := (OTHERS => '0'); + SIGNAL tr_10gbe_ring_serial_rx_arr : STD_LOGIC_VECTOR(c_ring_nof_mac-1 DOWNTO 0) := (OTHERS => '0'); - SIGNAL nw_10gbe_snk_in_arr : t_dp_sosi_arr(c_nof_10GbE_offload_streams-1 DOWNTO 0) := (OTHERS => c_dp_sosi_rst); - SIGNAL nw_10gbe_snk_out_arr : t_dp_siso_arr(c_nof_10GbE_offload_streams-1 DOWNTO 0) := (OTHERS => c_dp_siso_rdy); - SIGNAL nw_10gbe_src_out_arr : t_dp_sosi_arr(c_nof_10GbE_offload_streams-1 DOWNTO 0) := (OTHERS => c_dp_sosi_rst); - SIGNAL nw_10gbe_src_in_arr : t_dp_siso_arr(c_nof_10GbE_offload_streams-1 DOWNTO 0) := (OTHERS => c_dp_siso_rdy); + SIGNAL tr_10gbe_ring_snk_in_arr : t_dp_sosi_arr(c_ring_nof_mac-1 DOWNTO 0) := (OTHERS => c_dp_sosi_rst); + SIGNAL tr_10gbe_ring_snk_out_arr : t_dp_siso_arr(c_ring_nof_mac-1 DOWNTO 0) := (OTHERS => c_dp_siso_rdy); + SIGNAL tr_10gbe_ring_src_out_arr : t_dp_sosi_arr(c_ring_nof_mac-1 DOWNTO 0) := (OTHERS => c_dp_sosi_rst); + SIGNAL tr_10gbe_ring_src_in_arr : t_dp_siso_arr(c_ring_nof_mac-1 DOWNTO 0) := (OTHERS => c_dp_siso_rdy); - SIGNAL nw_10GbE_hdr_fields_in_arr : t_slv_1024_arr(c_nof_10GbE_offload_streams-1 DOWNTO 0); - - SIGNAL tr_10gbe_src_out_arr : t_dp_sosi_arr(c_nof_mac-1 DOWNTO 0) := (OTHERS => c_dp_sosi_rst); - SIGNAL tr_10gbe_snk_in_arr : t_dp_sosi_arr(c_nof_mac-1 DOWNTO 0) := (OTHERS => c_dp_sosi_rst); - SIGNAL tr_10gbe_src_in_arr : t_dp_siso_arr(c_nof_mac-1 DOWNTO 0) := (OTHERS => c_dp_siso_rdy); - SIGNAL tr_10gbe_snk_out_arr : t_dp_siso_arr(c_nof_mac-1 DOWNTO 0) := (OTHERS => c_dp_siso_rdy); + -- 10GbE beamlet output + SIGNAL nw_10gbe_beamlet_output_snk_in_arr : t_dp_sosi_arr(c_nof_10GbE_beamlet_output-1 DOWNTO 0) := (OTHERS => c_dp_sosi_rst); + SIGNAL nw_10gbe_beamlet_output_snk_out_arr : t_dp_siso_arr(c_nof_10GbE_beamlet_output-1 DOWNTO 0) := (OTHERS => c_dp_siso_rdy); + SIGNAL nw_10gbe_beamlet_output_src_out_arr : t_dp_sosi_arr(c_nof_10GbE_beamlet_output-1 DOWNTO 0) := (OTHERS => c_dp_sosi_rst); + SIGNAL nw_10gbe_beamlet_output_src_in_arr : t_dp_siso_arr(c_nof_10GbE_beamlet_output-1 DOWNTO 0) := (OTHERS => c_dp_siso_rdy); + + SIGNAL nw_10GbE_hdr_fields_in_arr : t_slv_1024_arr(c_nof_10GbE_beamlet_output-1 DOWNTO 0); + -- Network mac, ip, udp SIGNAL cep_eth_src_mac : STD_LOGIC_VECTOR(c_network_eth_mac_addr_w-1 DOWNTO 0); SIGNAL cep_ip_src_addr : STD_LOGIC_VECTOR(c_network_ip_addr_w-1 DOWNTO 0); SIGNAL cep_udp_src_port : STD_LOGIC_VECTOR(c_network_udp_port_w-1 DOWNTO 0); @@ -534,10 +557,6 @@ ARCHITECTURE str OF sdp_station IS SIGNAL bst_udp_src_port : STD_LOGIC_VECTOR(c_network_udp_port_w-1 DOWNTO 0); SIGNAL xst_udp_src_port : STD_LOGIC_VECTOR(c_network_udp_port_w-1 DOWNTO 0); - SIGNAL sdp_info : t_sdp_info := c_sdp_info_rst; - SIGNAL ring_info : t_ring_info; - - BEGIN ----------------------------------------------------------------------------- @@ -993,7 +1012,7 @@ BEGIN ); ----------------------------------------------------------------------------- - -- DP MUX + -- DP MUX to multiplex the c_sdp_N_beamsets via one beamlet output 10GbE link ----------------------------------------------------------------------------- -- Assign hdr_fields to nw_10GbE for ARP/PING functionality. Only the fields: -- eth_src_mac, ip_src_addr and ip_dst_addr are used. Which are identical for @@ -1014,21 +1033,21 @@ BEGIN snk_in_arr => bf_udp_sosi_arr, snk_out_arr => bf_udp_siso_arr, - src_out => nw_10gbe_snk_in_arr(0), - src_in => nw_10gbe_snk_out_arr(0) + src_out => nw_10gbe_beamlet_output_snk_in_arr(0), + src_in => nw_10gbe_beamlet_output_snk_out_arr(0) ); --------------- - -- nw_10GbE + -- nw_10GbE beamlet output --------------- - u_nw_10GbE: ENTITY nw_10GbE_lib.nw_10GbE + u_nw_10GbE_beamlet_output: ENTITY nw_10GbE_lib.nw_10GbE GENERIC MAP ( g_sim => g_sim, g_sim_level => 1, - g_nof_macs => c_nof_10GbE_offload_streams, + g_nof_macs => c_nof_10GbE_beamlet_output, g_direction => "TX_RX", - g_tx_fifo_fill => c_fifo_tx_fill, - g_tx_fifo_size => c_fifo_tx_size, + g_tx_fifo_fill => c_fifo_tx_fill_beamlet_output, + g_tx_fifo_size => c_fifo_tx_size_beamlet_output, g_ip_hdr_field_arr => c_sdp_cep_hdr_field_arr ) @@ -1054,15 +1073,15 @@ BEGIN dp_clk => dp_clk, dp_pps => dp_pps, - src_out_arr => nw_10gbe_src_out_arr, - src_in_arr => nw_10gbe_src_in_arr, - - snk_out_arr => nw_10gbe_snk_out_arr, - snk_in_arr => nw_10gbe_snk_in_arr, + snk_out_arr => nw_10gbe_beamlet_output_snk_out_arr, + snk_in_arr => nw_10gbe_beamlet_output_snk_in_arr, + src_out_arr => nw_10gbe_beamlet_output_src_out_arr, + src_in_arr => nw_10gbe_beamlet_output_src_in_arr, + -- Serial IO - serial_tx_arr => unb2_board_front_io_serial_tx_arr(c_nof_10GbE_offload_streams+c_quad-1 DOWNTO c_quad), - serial_rx_arr => unb2_board_front_io_serial_rx_arr(c_nof_10GbE_offload_streams+c_quad-1 DOWNTO c_quad), + serial_tx_arr => unb2_board_front_io_serial_tx_arr(c_nof_10GbE_beamlet_output+c_quad-1 DOWNTO c_quad), + serial_rx_arr => unb2_board_front_io_serial_rx_arr(c_nof_10GbE_beamlet_output+c_quad-1 DOWNTO c_quad), hdr_fields_in_arr => nw_10GbE_hdr_fields_in_arr ); @@ -1074,8 +1093,8 @@ BEGIN GENERIC MAP ( g_lane_direction => 1, -- transport in positive direction. g_lane_data_w => c_longword_w, - g_lane_packet_length => c_lane_packet_length_xst, - g_use_dp_layer => c_use_dp_layer, + g_lane_packet_length => c_lane_payload_nof_longwords_xst, + g_use_dp_layer => TRUE, g_nof_rx_monitors => c_sdp_N_pn_max, g_nof_tx_monitors => c_sdp_N_pn_max, g_err_bi => c_err_bi, @@ -1123,8 +1142,8 @@ BEGIN GENERIC MAP ( g_lane_direction => 1, -- transport in positive direction. g_lane_data_w => c_longword_w, - g_lane_packet_length => c_lane_packet_length_bf, - g_use_dp_layer => c_use_dp_layer, + g_lane_packet_length => c_lane_payload_nof_longwords_bf, + g_use_dp_layer => TRUE, g_nof_rx_monitors => 1, g_nof_tx_monitors => 1, g_err_bi => c_err_bi, @@ -1231,30 +1250,30 @@ BEGIN -- Combine seperate signals into array for tr_10GbE ----------------------------------------------------------------------------- gen_lane_wires : FOR I IN 0 TO c_nof_lane-1 GENERATE - -- QSFP_RX - lane_rx_cable_sosi_arr(I) <= tr_10gbe_src_out_arr(c_nof_if * I + c_qsfp_if_offset) WHEN ring_info.use_cable_to_previous_rn = '1' ELSE c_dp_sosi_rst; -- use_cable_to_previous_rn=1 -> even lanes receive from cable + -- QSFP_RX, use_cable_to_previous_rn=1 -> even lanes receive from cable + lane_rx_cable_sosi_arr(I) <= tr_10gbe_ring_src_out_arr(c_nof_if * I + c_qsfp_if_offset) WHEN ring_info.use_cable_to_previous_rn = '1' ELSE c_dp_sosi_rst; - -- QSFP_TX - tr_10gbe_snk_in_arr(c_nof_if * I + c_qsfp_if_offset) <= lane_tx_cable_sosi_arr(I) WHEN ring_info.use_cable_to_next_rn = '1' ELSE c_dp_sosi_rst; -- use_cable_to_next_rn=1 -> even lanes transmit to cable + -- QSFP_TX, use_cable_to_next_rn=1 -> even lanes transmit to cable + tr_10gbe_ring_snk_in_arr(c_nof_if * I + c_qsfp_if_offset) <= lane_tx_cable_sosi_arr(I) WHEN ring_info.use_cable_to_next_rn = '1' ELSE c_dp_sosi_rst; - -- RING_0_RX even lanes receive from RING_0 (from the left) - lane_rx_board_sosi_arr(I) <= tr_10gbe_src_out_arr(c_nof_if * I + c_ring_0_if_offset); + -- RING_0_RX even lanes receive from RING_0 (from the left) + lane_rx_board_sosi_arr(I) <= tr_10gbe_ring_src_out_arr(c_nof_if * I + c_ring_0_if_offset); - -- RING_1_TX even lanes transmit to RING_1 (to the right) - tr_10gbe_snk_in_arr(c_nof_if * I + c_ring_1_if_offset) <= lane_tx_board_sosi_arr(I); + -- RING_1_TX even lanes transmit to RING_1 (to the right) + tr_10gbe_ring_snk_in_arr(c_nof_if * I + c_ring_1_if_offset) <= lane_tx_board_sosi_arr(I); END GENERATE; ----------------------------------------------------------------------------- - -- tr_10GbE + -- tr_10GbE ring ----------------------------------------------------------------------------- - u_tr_10GbE: ENTITY tr_10GbE_lib.tr_10GbE + u_tr_10GbE_ring: ENTITY tr_10GbE_lib.tr_10GbE GENERIC MAP ( g_sim => g_sim, g_sim_level => 1, - g_nof_macs => c_nof_mac, + g_nof_macs => c_ring_nof_mac, g_direction => "TX_RX", - g_tx_fifo_fill => c_xsub_fifo_tx_fill, - g_tx_fifo_size => c_xsub_fifo_tx_size + g_tx_fifo_fill => c_fifo_tx_fill_ring, + g_tx_fifo_size => c_fifo_tx_size_ring ) PORT MAP ( -- Transceiver PLL reference clock @@ -1277,15 +1296,15 @@ BEGIN dp_rst => dp_rst, dp_clk => dp_clk, - src_out_arr => tr_10gbe_src_out_arr, - src_in_arr => tr_10gbe_src_in_arr, + src_out_arr => tr_10gbe_ring_src_out_arr, + src_in_arr => tr_10gbe_ring_src_in_arr, - snk_out_arr => tr_10gbe_snk_out_arr, - snk_in_arr => tr_10gbe_snk_in_arr, + snk_out_arr => tr_10gbe_ring_snk_out_arr, + snk_in_arr => tr_10gbe_ring_snk_in_arr, -- Serial IO - serial_tx_arr => tr_10gbe_serial_tx_arr, - serial_rx_arr => tr_10gbe_serial_rx_arr + serial_tx_arr => tr_10gbe_ring_serial_tx_arr, + serial_rx_arr => tr_10gbe_ring_serial_rx_arr ); ----------------------------------------------------------------------------- @@ -1295,19 +1314,19 @@ BEGIN -- QSFP port, RING_0 port and RING_1 port. gen_serial_wires : FOR I IN 0 TO c_nof_lane-1 GENERATE -- QSFP_TX - unb2_board_front_io_serial_tx_arr(I) <= tr_10gbe_serial_tx_arr(c_nof_if * I + c_qsfp_if_offset); + unb2_board_front_io_serial_tx_arr(I) <= tr_10gbe_ring_serial_tx_arr(c_nof_if * I + c_qsfp_if_offset); -- QSFP_RX - tr_10gbe_serial_rx_arr(c_nof_if * I + c_qsfp_if_offset) <= unb2_board_front_io_serial_rx_arr(I); + tr_10gbe_ring_serial_rx_arr(c_nof_if * I + c_qsfp_if_offset) <= unb2_board_front_io_serial_rx_arr(I); -- RING_0_TX - RING_0_TX(I) <= tr_10gbe_serial_tx_arr(c_nof_if * I + c_ring_0_if_offset); + RING_0_TX(I) <= tr_10gbe_ring_serial_tx_arr(c_nof_if * I + c_ring_0_if_offset); -- RING_0_RX - tr_10gbe_serial_rx_arr(c_nof_if * I + c_ring_0_if_offset) <= RING_0_RX(I); + tr_10gbe_ring_serial_rx_arr(c_nof_if * I + c_ring_0_if_offset) <= RING_0_RX(I); -- RING_1_TX - RING_1_TX(I) <= tr_10gbe_serial_tx_arr(c_nof_if * I + c_ring_1_if_offset); + RING_1_TX(I) <= tr_10gbe_ring_serial_tx_arr(c_nof_if * I + c_ring_1_if_offset); -- RING_1_RX - tr_10gbe_serial_rx_arr(c_nof_if * I + c_ring_1_if_offset) <= RING_1_RX(I); + tr_10gbe_ring_serial_rx_arr(c_nof_if * I + c_ring_1_if_offset) <= RING_1_RX(I); END GENERATE; END GENERATE; @@ -1328,12 +1347,12 @@ BEGIN -- LEDs ------------ -- QSFP 1 - Beamlets - unb2_board_qsfp_leds_tx_siso_arr(c_nof_10GbE_offload_streams+c_quad-1 DOWNTO c_quad) <= nw_10gbe_snk_out_arr; - unb2_board_qsfp_leds_tx_sosi_arr(c_nof_10GbE_offload_streams+c_quad-1 DOWNTO c_quad) <= nw_10gbe_snk_in_arr; - unb2_board_qsfp_leds_rx_sosi_arr(c_nof_10GbE_offload_streams+c_quad-1 DOWNTO c_quad) <= nw_10gbe_src_out_arr; + unb2_board_qsfp_leds_tx_siso_arr(c_nof_10GbE_beamlet_output+c_quad-1 DOWNTO c_quad) <= nw_10gbe_beamlet_output_snk_out_arr; + unb2_board_qsfp_leds_tx_sosi_arr(c_nof_10GbE_beamlet_output+c_quad-1 DOWNTO c_quad) <= nw_10gbe_beamlet_output_snk_in_arr; + unb2_board_qsfp_leds_rx_sosi_arr(c_nof_10GbE_beamlet_output+c_quad-1 DOWNTO c_quad) <= nw_10gbe_beamlet_output_src_out_arr; -- QSFP 0 - Ring - unb2_board_qsfp_leds_tx_siso_arr(0 DOWNTO 0) <= tr_10gbe_snk_out_arr(0 DOWNTO 0); - unb2_board_qsfp_leds_tx_sosi_arr(0 DOWNTO 0) <= tr_10gbe_snk_in_arr(0 DOWNTO 0); - unb2_board_qsfp_leds_rx_sosi_arr(0 DOWNTO 0) <= tr_10gbe_src_out_arr(0 DOWNTO 0); + unb2_board_qsfp_leds_tx_siso_arr(0 DOWNTO 0) <= tr_10gbe_ring_snk_out_arr(0 DOWNTO 0); + unb2_board_qsfp_leds_tx_sosi_arr(0 DOWNTO 0) <= tr_10gbe_ring_snk_in_arr(0 DOWNTO 0); + unb2_board_qsfp_leds_rx_sosi_arr(0 DOWNTO 0) <= tr_10gbe_ring_src_out_arr(0 DOWNTO 0); END str; diff --git a/libraries/base/dp/src/vhdl/dp_fifo_fill_eop.vhd b/libraries/base/dp/src/vhdl/dp_fifo_fill_eop.vhd index 21063d1e94390343e93984f694530cb543810f59..381cd124bba1ff193c3423fc76e24d20af32a686 100644 --- a/libraries/base/dp/src/vhdl/dp_fifo_fill_eop.vhd +++ b/libraries/base/dp/src/vhdl/dp_fifo_fill_eop.vhd @@ -19,7 +19,7 @@ ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- --- Author: R. van der Walle +-- Author: R. van der Walle, E. Kooistra -- Purpose: -- The FIFO starts outputting data when the output is ready and it has been @@ -32,6 +32,22 @@ -- after the fifo has been filled sufficiently, a frame is also available when -- the in_eop has been received earlier than the specified g_fifo_fill. For -- more details, please consult the description of dp_fill_fifo_core. +-- Usage: +-- * Typically rely only on eop to release any block from the FIFO. This can +-- be achieved by choosing: +-- . g_fifo_size >= largest block size + c_fifo_fill_margin. +-- . g_fifo_fill = largest block size, or equivalently choose: +-- g_fifo_fill = g_fifo_size - c_fifo_fill_margin +-- It is not adviced to choose g_fifo_fill = g_fifo_size, because then +-- internally the FIFO becomes c_fifo_fill_margin bigger and may then use +-- more RAM. Default c_fifo_fill_margin = 4 + 2 = 6 words. +-- * Often it is possible to make full use of a block RAM by using a FIFO size +-- that is a power of 2, so g_fifo_size = true_log_pow2(largest block size + +-- c_fifo_tx_fill_margin). +-- Remark: +-- * The dp_fifo_fill_eop cannot handle continues stream of blocks without a +-- gap between blocks it needs 1 cycle to process a block. +-- ------------------------------------------------------------------------------- LIBRARY IEEE, common_lib, technology_lib; diff --git a/libraries/base/ring/src/vhdl/ring_pkg.vhd b/libraries/base/ring/src/vhdl/ring_pkg.vhd index 41ecf785cedd835bc29d1b7270f45c6499d52560..da55bc2268dc5badf90243a91ae79e45123ceb61 100644 --- a/libraries/base/ring/src/vhdl/ring_pkg.vhd +++ b/libraries/base/ring/src/vhdl/ring_pkg.vhd @@ -78,8 +78,7 @@ PACKAGE ring_pkg is ( field_name_pad("eth_src_mac" ), "RW", 48, field_default(c_ring_eth_src_mac) ), ( field_name_pad("eth_type" ), "RW", 16, field_default(0) ) ); - CONSTANT c_ring_eth_hdr_field_size : NATURAL := ceil_div(field_slv_len(c_ring_eth_hdr_field_arr), c_longword_w); - + CONSTANT c_ring_eth_hdr_field_size : NATURAL := ceil_div(field_slv_len(c_ring_eth_hdr_field_arr), c_longword_w); -- = 14/8 = 2 longwords CONSTANT c_ring_dp_nof_hdr_fields : NATURAL := 6; CONSTANT c_ring_dp_hdr_field_sel : STD_LOGIC_VECTOR(c_ring_dp_nof_hdr_fields-1 DOWNTO 0) := "000"&"000"; @@ -91,7 +90,7 @@ PACKAGE ring_pkg is ( field_name_pad("dp_sync" ), "RW", 1, field_default(0) ), ( field_name_pad("dp_bsn" ), "RW", 63, field_default(0) ) ); - CONSTANT c_ring_dp_hdr_field_size : NATURAL := ceil_div(field_slv_len(c_ring_dp_hdr_field_arr), c_longword_w); + CONSTANT c_ring_dp_hdr_field_size : NATURAL := ceil_div(field_slv_len(c_ring_dp_hdr_field_arr), c_longword_w); -- = 24/8 = 3 longwords FUNCTION func_ring_nof_hops_to_source_rn(hops, this_rn, N_rn, lane_dir : NATURAL) RETURN NATURAL; FUNCTION func_ring_nof_hops_to_source_rn(hops, this_rn, N_rn : STD_LOGIC_VECTOR; lane_dir : NATURAL) RETURN STD_LOGIC_VECTOR; -- return vector length is same as hops vector length