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

Add types and function for beamlet output packet verification.

parent 8455a6fb
No related branches found
No related tags found
1 merge request!348Use use_bdo_transpose = true in c_bf revision. Test use_bdo_transpose = false...
......@@ -105,6 +105,22 @@ package tb_sdp_pkg is
nof_rem : natural)
return t_real_arr; -- 0:3 = ampl, phase, re, im
-----------------------------------------------------------------------------
-- Beamlet output packet
-----------------------------------------------------------------------------
-- beamlet part index in longword [0 : 3] = X, Y, X, Y
subtype t_sdp_beamlet_longword_list is t_slv_8_arr(0 to c_sdp_cep_nof_beamlets_per_longword * c_sdp_N_pol_bf - 1);
-- beamlet part index in packet [0 : 4 * 488 * 2 - 1] = [0 : 3903]
subtype t_sdp_beamlet_packet_list is t_slv_8_arr(0 to c_sdp_cep_nof_beamlets_per_packet * c_sdp_N_pol_bf - 1);
-- beamlet part index in block [0 : 488 * 2 - 1] = [0 : 975]
subtype t_sdp_beamlet_block_list is t_slv_8_arr(0 to c_sdp_cep_nof_beamlets_per_block * c_sdp_N_pol_bf - 1);
function func_sdp_transpose_packet(nof_blocks_per_packet : natural;
nof_beamlets_per_block : natural;
packet_list : t_sdp_beamlet_packet_list) return t_sdp_beamlet_packet_list;
end package tb_sdp_pkg;
package body tb_sdp_pkg is
......@@ -475,4 +491,29 @@ package body tb_sdp_pkg is
return v_tuple;
end;
-- input packet_list:
-- . blk 0, 1, 2, 3, for nof_blocks_per_packet = 4
-- . blet 0:487, 0:487, 0:487, 0:487, for nof_beamlets_per_block = 488
-- . v_in 0,1,2, ... 1951
-- return v_list = transposed packet_list:
-- 0, 1, ..., 487
-- 0:3, 0:3, ..., 0:3
-- 0,488,976,1464, 1,489,977,1465, ..., 487,975,1463,1951
-- . v_out 0,4,8,...,1948, 1,5,9,...,1949, 2,6,10,...,1950, 3,7,11,...,1951
function func_sdp_transpose_packet(nof_blocks_per_packet : natural;
nof_beamlets_per_block : natural;
packet_list : t_sdp_beamlet_packet_list) return t_sdp_beamlet_packet_list is
variable v_list : t_sdp_beamlet_packet_list;
variable v_in : natural;
variable v_out : natural;
begin
for blk in 0 to nof_blocks_per_packet - 1 loop
for blet in 0 to nof_beamlets_per_block - 1 loop
v_in := blk * nof_beamlets_per_block + blet;
v_out := blet * nof_blocks_per_packet + blk;
v_list(v_out) := packet_list(v_in);
end loop;
end loop;
end func_sdp_transpose_packet;
end tb_sdp_pkg;
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