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

Merge branch 'L2SDP-776' into 'master'

Some clean up of sdp_station.vhd and fifo fill eop usage

Closes L2SDP-776

See merge request desp/hdl!269
parents 1c16ff21 169f8fab
No related branches found
No related tags found
1 merge request!269Some clean up of sdp_station.vhd and fifo fill eop usage
Pipeline #34212 passed
...@@ -195,7 +195,7 @@ ARCHITECTURE tb OF tb_lofar2_unb2c_sdp_station_bf IS ...@@ -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_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_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 CONSTANT c_beamlet_output_delta : INTEGER := 2; -- +-delta margin
......
...@@ -78,9 +78,9 @@ ARCHITECTURE str OF sdp_beamformer_output IS ...@@ -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_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' 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. -- 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. 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; SIGNAL snk_in_concat : t_dp_sosi;
......
...@@ -116,9 +116,11 @@ PACKAGE sdp_pkg is ...@@ -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 : 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_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_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 : 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 : 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_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_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 CONSTANT c_sdp_T_adc : TIME := (10**6 / c_sdp_f_adc_MHz) * 1 ps; -- = 5 ns @ 200MHz
...@@ -309,8 +311,9 @@ PACKAGE sdp_pkg is ...@@ -309,8 +311,9 @@ PACKAGE sdp_pkg is
END RECORD; 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_cep_version_id : NATURAL := 5;
CONSTANT c_sdp_marker_beamlets : NATURAL := 98; -- = x"62" = 'b' 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_dst_mac : STD_LOGIC_VECTOR(47 DOWNTO 0) := x"00074306C700"; -- 00074306C700 = DOP36-eth0
...@@ -322,13 +325,16 @@ PACKAGE sdp_pkg is ...@@ -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_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_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; -- number of time blocks of beamlets per output packet
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_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) := "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 --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
......
This diff is collapsed.
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
-- Author: R. van der Walle -- Author: R. van der Walle, E. Kooistra
-- Purpose: -- Purpose:
-- The FIFO starts outputting data when the output is ready and it has been -- The FIFO starts outputting data when the output is ready and it has been
...@@ -32,6 +32,22 @@ ...@@ -32,6 +32,22 @@
-- after the fifo has been filled sufficiently, a frame is also available when -- 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 -- 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. -- 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; LIBRARY IEEE, common_lib, technology_lib;
......
...@@ -78,8 +78,7 @@ PACKAGE ring_pkg is ...@@ -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_src_mac" ), "RW", 48, field_default(c_ring_eth_src_mac) ),
( field_name_pad("eth_type" ), "RW", 16, field_default(0) ) ( 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_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"; 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 ...@@ -91,7 +90,7 @@ PACKAGE ring_pkg is
( field_name_pad("dp_sync" ), "RW", 1, field_default(0) ), ( field_name_pad("dp_sync" ), "RW", 1, field_default(0) ),
( field_name_pad("dp_bsn" ), "RW", 63, 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, 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 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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment