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

Add func_sdp_compose_cep_header() variants.

parent 0490d7b1
Branches
No related tags found
1 merge request!359Clarify g_nof_destinations_max design revision parameter and package constants...
...@@ -62,22 +62,43 @@ package tb_sdp_pkg is ...@@ -62,22 +62,43 @@ package tb_sdp_pkg is
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- Beamlet output via 10GbE to CEP (= central processor) -- Beamlet output via 10GbE to CEP (= central processor)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
function func_sdp_compose_cep_header(ip_src_addr : std_logic_vector; function func_sdp_compose_cep_header(ip_src_addr : std_logic_vector;
ip_header_checksum : natural; ip_header_checksum : natural;
sdp_info : t_sdp_info; -- app header sdp_info : t_sdp_info; -- app header
gn_index : natural; gn_index : natural;
payload_error : std_logic; payload_error : std_logic;
beamlet_scale : natural; beamlet_scale : natural;
beamlet_index : natural; beamlet_index : natural;
dp_bsn : natural) return t_sdp_cep_header; nof_blocks_per_packet : natural;
nof_beamlets_per_block : natural;
function func_sdp_compose_cep_header(ip_header_checksum : natural; dp_bsn : natural) return t_sdp_cep_header;
sdp_info : t_sdp_info; -- app header
gn_index : natural; function func_sdp_compose_cep_header(ip_header_checksum : natural;
payload_error : std_logic; sdp_info : t_sdp_info; -- app header
beamlet_scale : natural; gn_index : natural;
beamlet_index : natural; payload_error : std_logic;
dp_bsn : natural) return t_sdp_cep_header; beamlet_scale : natural;
beamlet_index : natural;
nof_blocks_per_packet : natural;
nof_beamlets_per_block : natural;
dp_bsn : natural) return t_sdp_cep_header;
function func_sdp_compose_cep_header(ip_src_addr : std_logic_vector;
ip_header_checksum : natural;
sdp_info : t_sdp_info; -- app header
gn_index : natural;
payload_error : std_logic;
beamlet_scale : natural;
beamlet_index : natural;
dp_bsn : natural) return t_sdp_cep_header;
function func_sdp_compose_cep_header(ip_header_checksum : natural;
sdp_info : t_sdp_info; -- app header
gn_index : natural;
payload_error : std_logic;
beamlet_scale : natural;
beamlet_index : natural;
dp_bsn : natural) return t_sdp_cep_header;
function func_sdp_verify_cep_header(in_hdr, exp_hdr : t_sdp_cep_header) return boolean; function func_sdp_verify_cep_header(in_hdr, exp_hdr : t_sdp_cep_header) return boolean;
...@@ -109,8 +130,8 @@ package tb_sdp_pkg is ...@@ -109,8 +130,8 @@ package tb_sdp_pkg is
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- Beamlet output packet -- Beamlet output packet
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- beamlet part index [0 : 3] of X, Y, X, Y in network longword: -- beamlet complex part index [0 : 3] of X, Y, X, Y in network longword:
-- - use separate array for re and for im: -- - use separate array for re part and for im part:
-- . re[0 : 3] at 0, 2, 4, 6 in longword -- . re[0 : 3] at 0, 2, 4, 6 in longword
-- . im[0 : 3] at 1, 3, 5, 7 in longword -- . im[0 : 3] at 1, 3, 5, 7 in longword
subtype t_sdp_beamlet_part_arr is t_slv_8_arr(0 to c_sdp_nof_beamlets_per_longword * c_sdp_N_pol_bf - 1); subtype t_sdp_beamlet_part_arr is t_slv_8_arr(0 to c_sdp_nof_beamlets_per_longword * c_sdp_N_pol_bf - 1);
...@@ -311,14 +332,16 @@ package body tb_sdp_pkg is ...@@ -311,14 +332,16 @@ package body tb_sdp_pkg is
return true; return true;
end func_sdp_verify_stat_header; end func_sdp_verify_stat_header;
function func_sdp_compose_cep_header(ip_src_addr : std_logic_vector; function func_sdp_compose_cep_header(ip_src_addr : std_logic_vector;
ip_header_checksum : natural; ip_header_checksum : natural;
sdp_info : t_sdp_info; -- app header sdp_info : t_sdp_info; -- app header
gn_index : natural; gn_index : natural;
payload_error : std_logic; payload_error : std_logic;
beamlet_scale : natural; beamlet_scale : natural;
beamlet_index : natural; beamlet_index : natural;
dp_bsn : natural) return t_sdp_cep_header is nof_blocks_per_packet : natural;
nof_beamlets_per_block : natural;
dp_bsn : natural) return t_sdp_cep_header is
-- Use sim default dst and src MAC, IP, UDP port from sdp_pkg.vhd and based on gn_index -- Use sim default dst and src MAC, IP, UDP port from sdp_pkg.vhd and based on gn_index
constant c_mac_15_0 : std_logic_vector(15 downto 0) := func_sdp_gn_index_to_mac_15_0(gn_index); constant c_mac_15_0 : std_logic_vector(15 downto 0) := func_sdp_gn_index_to_mac_15_0(gn_index);
variable v_hdr : t_sdp_cep_header; variable v_hdr : t_sdp_cep_header;
...@@ -367,14 +390,60 @@ package body tb_sdp_pkg is ...@@ -367,14 +390,60 @@ package body tb_sdp_pkg is
v_hdr.app.sdp_reserved := TO_UVEC(0, 32); v_hdr.app.sdp_reserved := TO_UVEC(0, 32);
v_hdr.app.sdp_beamlet_scale := TO_UVEC(beamlet_scale, 16); v_hdr.app.sdp_beamlet_scale := TO_UVEC(beamlet_scale, 16);
v_hdr.app.sdp_beamlet_index := TO_UVEC(beamlet_index, 16); v_hdr.app.sdp_beamlet_index := TO_UVEC(beamlet_index, 16);
v_hdr.app.sdp_nof_blocks_per_packet := TO_UVEC(c_sdp_cep_nof_blocks_per_packet, 8); v_hdr.app.sdp_nof_blocks_per_packet := TO_UVEC(nof_blocks_per_packet, 8);
v_hdr.app.sdp_nof_beamlets_per_block := TO_UVEC(c_sdp_cep_nof_beamlets_per_block, 16); v_hdr.app.sdp_nof_beamlets_per_block := TO_UVEC(nof_beamlets_per_block, 16);
v_hdr.app.sdp_block_period := sdp_info.block_period; v_hdr.app.sdp_block_period := sdp_info.block_period;
v_hdr.app.dp_bsn := TO_UVEC(dp_bsn, 64); v_hdr.app.dp_bsn := TO_UVEC(dp_bsn, 64);
return v_hdr; return v_hdr;
end func_sdp_compose_cep_header; end func_sdp_compose_cep_header;
function func_sdp_compose_cep_header(ip_header_checksum : natural;
sdp_info : t_sdp_info; -- app header
gn_index : natural;
payload_error : std_logic;
beamlet_scale : natural;
beamlet_index : natural;
nof_blocks_per_packet : natural;
nof_beamlets_per_block : natural;
dp_bsn : natural) return t_sdp_cep_header is
-- Use sim default dst and src MAC, IP, UDP port from sdp_pkg.vhd and based on gn_index
constant c_ip_15_0 : std_logic_vector(15 downto 0) := func_sdp_gn_index_to_ip_15_0(gn_index);
constant c_ip_src_addr : std_logic_vector(31 downto 0) := c_sdp_cep_ip_src_addr_31_16 & c_ip_15_0;
begin
return func_sdp_compose_cep_header(c_ip_src_addr,
ip_header_checksum,
sdp_info,
gn_index,
payload_error,
beamlet_scale,
beamlet_index,
nof_blocks_per_packet,
nof_beamlets_per_block,
dp_bsn);
end func_sdp_compose_cep_header;
function func_sdp_compose_cep_header(ip_src_addr : std_logic_vector;
ip_header_checksum : natural;
sdp_info : t_sdp_info; -- app header
gn_index : natural;
payload_error : std_logic;
beamlet_scale : natural;
beamlet_index : natural;
dp_bsn : natural) return t_sdp_cep_header is
begin
return func_sdp_compose_cep_header(ip_src_addr,
ip_header_checksum,
sdp_info,
gn_index,
payload_error,
beamlet_scale,
beamlet_index,
c_sdp_cep_nof_blocks_per_packet,
c_sdp_cep_nof_beamlets_per_block,
dp_bsn);
end func_sdp_compose_cep_header;
function func_sdp_compose_cep_header(ip_header_checksum : natural; function func_sdp_compose_cep_header(ip_header_checksum : natural;
sdp_info : t_sdp_info; -- app header sdp_info : t_sdp_info; -- app header
gn_index : natural; gn_index : natural;
...@@ -393,6 +462,8 @@ package body tb_sdp_pkg is ...@@ -393,6 +462,8 @@ package body tb_sdp_pkg is
payload_error, payload_error,
beamlet_scale, beamlet_scale,
beamlet_index, beamlet_index,
c_sdp_cep_nof_blocks_per_packet,
c_sdp_cep_nof_beamlets_per_block,
dp_bsn); dp_bsn);
end func_sdp_compose_cep_header; end func_sdp_compose_cep_header;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment