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

Get all blocks from packets. Add beamlet output index counters.

parent c51ad02d
No related branches found
No related tags found
1 merge request!311Correct beamlet output indexing in tr_10GbE_src_out.data. Verify exact beamlet...
Pipeline #44814 passed
...@@ -166,8 +166,12 @@ ARCHITECTURE tb OF tb_disturb2_unb2b_sdp_station_full_wg IS ...@@ -166,8 +166,12 @@ ARCHITECTURE tb OF tb_disturb2_unb2b_sdp_station_full_wg IS
SIGNAL rd_beamlet_scale : STD_LOGIC_VECTOR(15 DOWNTO 0); SIGNAL rd_beamlet_scale : STD_LOGIC_VECTOR(15 DOWNTO 0);
-- 10GbE -- 10GbE
SIGNAL dbg_beamlet_index_offset : NATURAL := 0; SIGNAL rx_beamlet_index_offset : NATURAL := 0;
SIGNAL rx_beamlet_blk : NATURAL := 0;
SIGNAL rx_beamlet_cnt : NATURAL := 0;
SIGNAL rx_beamlet_valid : STD_LOGIC := '0';
SIGNAL rx_beamlet_sop : STD_LOGIC := '0';
SIGNAL beamlet_arr2_re : t_slv_8_arr(c_sdp_R_os * c_sdp_N_pol_bf * c_sdp_cep_nof_beamlets_per_block-1 DOWNTO 0); SIGNAL beamlet_arr2_re : t_slv_8_arr(c_sdp_R_os * c_sdp_N_pol_bf * c_sdp_cep_nof_beamlets_per_block-1 DOWNTO 0);
SIGNAL beamlet_arr2_im : t_slv_8_arr(c_sdp_R_os * c_sdp_N_pol_bf * c_sdp_cep_nof_beamlets_per_block-1 DOWNTO 0); SIGNAL beamlet_arr2_im : t_slv_8_arr(c_sdp_R_os * c_sdp_N_pol_bf * c_sdp_cep_nof_beamlets_per_block-1 DOWNTO 0);
...@@ -396,50 +400,59 @@ BEGIN ...@@ -396,50 +400,59 @@ BEGIN
-- Read 3 packets to make sure we get 1 from each beamset. It can happen that two packets -- Read 3 packets to make sure we get 1 from each beamset. It can happen that two packets
-- (but not three) from the same beamset are received back to back. -- (but not three) from the same beamset are received back to back.
FOR blk IN 0 TO 6 LOOP FOR packet IN 0 TO 2 LOOP
-- Get beamlet_index from packet header -- Get beamlet_index from packet header
proc_common_wait_until_high(ext_clk, tr_10GbE_src_out.sop); proc_common_wait_until_high(ext_clk, tr_10GbE_src_out.sop);
FOR I IN 0 TO 8 LOOP -- Packet header is 9.25 words wide, which can be discarded FOR I IN 0 TO 8 LOOP -- Packet header is 9.25 words wide, which can be discarded
IF I = 7 THEN IF I = 7 THEN
v_beamlet_index_offset := c_sdp_N_pol_bf * TO_UINT(tr_10GbE_src_out.data(39 DOWNTO 24)); -- Read beamlet index v_beamlet_index_offset := c_sdp_N_pol_bf * TO_UINT(tr_10GbE_src_out.data(39 DOWNTO 24)); -- Read beamlet index
dbg_beamlet_index_offset <= v_beamlet_index_offset; rx_beamlet_index_offset <= v_beamlet_index_offset;
END IF; END IF;
proc_common_wait_until_high(ext_clk, tr_10GbE_src_out.valid); proc_common_wait_until_high(ext_clk, tr_10GbE_src_out.valid);
proc_common_wait_some_cycles(ext_clk, 1);
END LOOP; END LOOP;
-- Get first beamlets block from the packet -- Get all c_sdp_cep_nof_blocks_per_packet = 4 blocks from the packet
-- . First word contains 1 header part of two bytes and 3 beamlets FOR blk IN 0 TO c_sdp_cep_nof_blocks_per_packet-1 LOOP
-- [0:2]. The data is send big endian so index [0] first, therefore -- . First word contains 1 header part of two bytes and 3 beamlets [0:2].
-- beamlet.re[0] is at [47:40]. -- . expect c_sdp_cep_nof_beamlets_per_block = c_sdp_S_sub_bf = 488 dual pol
beamlet_arr2_re(v_beamlet_index_offset + 0) <= tr_10GbE_src_out.data(47 DOWNTO 40); -- and complex beamlets per packet, so 2 dual pol beamlets/64b data word.
beamlet_arr2_im(v_beamlet_index_offset + 0) <= tr_10GbE_src_out.data(39 DOWNTO 32); -- . Beamlets array is stored big endian in the data, so X index 0 first in
beamlet_arr2_re(v_beamlet_index_offset + 1) <= tr_10GbE_src_out.data(31 DOWNTO 24); -- MSByte of tr_10GbE_src_out.data.
beamlet_arr2_im(v_beamlet_index_offset + 1) <= tr_10GbE_src_out.data(23 DOWNTO 16); rx_beamlet_blk <= blk;
beamlet_arr2_re(v_beamlet_index_offset + 2) <= tr_10GbE_src_out.data(15 DOWNTO 8); rx_beamlet_cnt <= 0;
beamlet_arr2_im(v_beamlet_index_offset + 2) <= tr_10GbE_src_out.data(7 DOWNTO 0); rx_beamlet_valid <= '1';
proc_common_wait_until_high(ext_clk, tr_10GbE_src_out.valid); rx_beamlet_sop <= '1';
proc_common_wait_some_cycles(ext_clk, 1); beamlet_arr2_im(v_beamlet_index_offset + 0) <= tr_10GbE_src_out.data(47 DOWNTO 40);
-- . There are 4 complex beamlets per 64b word beamlet_arr2_re(v_beamlet_index_offset + 0) <= tr_10GbE_src_out.data(39 DOWNTO 32);
FOR I IN 1 TO (c_sdp_N_pol_bf * c_sdp_cep_nof_beamlets_per_block/4)-1 LOOP beamlet_arr2_im(v_beamlet_index_offset + 1) <= tr_10GbE_src_out.data(31 DOWNTO 24);
beamlet_arr2_re(v_beamlet_index_offset + I*4 -1) <= tr_10GbE_src_out.data(63 DOWNTO 56); beamlet_arr2_re(v_beamlet_index_offset + 1) <= tr_10GbE_src_out.data(23 DOWNTO 16);
beamlet_arr2_im(v_beamlet_index_offset + I*4 -1) <= tr_10GbE_src_out.data(55 DOWNTO 48); beamlet_arr2_im(v_beamlet_index_offset + 2) <= tr_10GbE_src_out.data(15 DOWNTO 8);
beamlet_arr2_re(v_beamlet_index_offset + I*4 +0) <= tr_10GbE_src_out.data(47 DOWNTO 40); beamlet_arr2_re(v_beamlet_index_offset + 2) <= tr_10GbE_src_out.data(7 DOWNTO 0);
beamlet_arr2_im(v_beamlet_index_offset + I*4 +0) <= tr_10GbE_src_out.data(39 DOWNTO 32);
beamlet_arr2_re(v_beamlet_index_offset + I*4 +1) <= tr_10GbE_src_out.data(31 DOWNTO 24);
beamlet_arr2_im(v_beamlet_index_offset + I*4 +1) <= tr_10GbE_src_out.data(23 DOWNTO 16);
beamlet_arr2_re(v_beamlet_index_offset + I*4 +2) <= tr_10GbE_src_out.data(15 DOWNTO 8);
beamlet_arr2_im(v_beamlet_index_offset + I*4 +2) <= tr_10GbE_src_out.data(7 DOWNTO 0);
proc_common_wait_until_high(ext_clk, tr_10GbE_src_out.valid); proc_common_wait_until_high(ext_clk, tr_10GbE_src_out.valid);
rx_beamlet_cnt <= rx_beamlet_cnt + 1;
rx_beamlet_sop <= '0';
-- . get beamlets during block, there are 4 complex beamlets per 64b word
FOR I IN 1 TO (c_sdp_N_pol_bf * c_sdp_cep_nof_beamlets_per_block/4)-1 LOOP
beamlet_arr2_im(v_beamlet_index_offset + I*4 -1) <= tr_10GbE_src_out.data(63 DOWNTO 56);
beamlet_arr2_re(v_beamlet_index_offset + I*4 -1) <= tr_10GbE_src_out.data(55 DOWNTO 48);
beamlet_arr2_im(v_beamlet_index_offset + I*4 +0) <= tr_10GbE_src_out.data(47 DOWNTO 40);
beamlet_arr2_re(v_beamlet_index_offset + I*4 +0) <= tr_10GbE_src_out.data(39 DOWNTO 32);
beamlet_arr2_im(v_beamlet_index_offset + I*4 +1) <= tr_10GbE_src_out.data(31 DOWNTO 24);
beamlet_arr2_re(v_beamlet_index_offset + I*4 +1) <= tr_10GbE_src_out.data(23 DOWNTO 16);
beamlet_arr2_im(v_beamlet_index_offset + I*4 +2) <= tr_10GbE_src_out.data(15 DOWNTO 8);
beamlet_arr2_re(v_beamlet_index_offset + I*4 +2) <= tr_10GbE_src_out.data(7 DOWNTO 0);
proc_common_wait_until_high(ext_clk, tr_10GbE_src_out.valid);
rx_beamlet_cnt <= rx_beamlet_cnt + 1;
END LOOP;
-- . get last beamlet of block
beamlet_arr2_im(v_beamlet_index_offset + c_sdp_N_pol_bf * c_sdp_cep_nof_beamlets_per_block-1) <= tr_10GbE_src_out.data(63 DOWNTO 56);
beamlet_arr2_re(v_beamlet_index_offset + c_sdp_N_pol_bf * c_sdp_cep_nof_beamlets_per_block-1) <= tr_10GbE_src_out.data(55 DOWNTO 48);
proc_common_wait_some_cycles(ext_clk, 1); proc_common_wait_some_cycles(ext_clk, 1);
rx_beamlet_valid <= '0';
-- Loop for next block.
END LOOP; END LOOP;
beamlet_arr2_re(v_beamlet_index_offset + c_sdp_N_pol_bf * c_sdp_cep_nof_beamlets_per_block-1) <= tr_10GbE_src_out.data(55 DOWNTO 48); -- Loop and wait for next packet.
beamlet_arr2_im(v_beamlet_index_offset + c_sdp_N_pol_bf * c_sdp_cep_nof_beamlets_per_block-1) <= tr_10GbE_src_out.data(63 DOWNTO 56);
-- There are c_sdp_cep_nof_blocks_per_packet = 4 blocks per packet. Only
-- read the first beamlets block in the packet, the other three beamlets
-- blocks in the packet contain the same. Loop and wait for next packet.
END LOOP; END LOOP;
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
......
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