From ef5d1a48ff514f871b51bf20041a1ea3955d7e08 Mon Sep 17 00:00:00 2001
From: Eric Kooistra <kooistra@astron.nl>
Date: Mon, 25 Sep 2023 13:57:02 +0200
Subject: [PATCH] Define c_sdp_nof_words_per_beamlet and
 c_sdp_nof_beamlets_per_block.

---
 applications/lofar2/libraries/sdp/src/vhdl/sdp_bdo_pkg.vhd | 3 ++-
 applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd     | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/applications/lofar2/libraries/sdp/src/vhdl/sdp_bdo_pkg.vhd b/applications/lofar2/libraries/sdp/src/vhdl/sdp_bdo_pkg.vhd
index 84c934a7ec..098d853c91 100644
--- a/applications/lofar2/libraries/sdp/src/vhdl/sdp_bdo_pkg.vhd
+++ b/applications/lofar2/libraries/sdp/src/vhdl/sdp_bdo_pkg.vhd
@@ -63,8 +63,9 @@ package sdp_bdo_pkg is
 
   -- Use functions that return look up tables to precalculate the values as
   -- constant arrays
+  -- . One ch (channel) = one 32b word = one dual polarization beamlet (Xre, Xim, Yre, Yim)
 
-  -- . Look up table arrays for t_natural_arr(1 to c_sdp_bdo_nof_destinations_max).
+  -- . Look up table arrays for: t_natural_arr(1 to c_sdp_bdo_nof_destinations_max)
   function func_sdp_bdo_nof_blocks_per_packet_look_up_table return t_natural_arr;
   function func_sdp_bdo_reorder_nof_blocks_look_up_table return t_natural_arr;
   function func_sdp_bdo_reorder_nof_ch_look_up_table return t_natural_arr;
diff --git a/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd b/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd
index 78cb5f8062..a3a41fdb21 100644
--- a/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd
+++ b/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd
@@ -137,7 +137,9 @@ package sdp_pkg is
   constant c_sdp_N_beamlets_sdp          : natural := c_sdp_N_beamsets * c_sdp_S_sub_bf;  -- = 976
   constant c_sdp_W_dual_pol_beamlet      : natural := c_sdp_N_pol_bf * c_nof_complex * c_sdp_W_beamlet;  -- 2 * 2 * 8 = 32b
 
+  constant c_sdp_nof_words_per_beamlet     : natural := 1;  -- 1 dual pol, complex, 8bit beamlet (Xre, Xim, Yre, Yim) per 32b word
   constant c_sdp_nof_beamlets_per_longword : natural := 2;  -- 2 dual pol, complex, 8bit beamlets fit in 1 64bit longword
+  constant c_sdp_nof_beamlets_per_block    : natural := c_sdp_S_sub_bf;  -- number of dual pol beamlets per block
 
   -- . unit weights
   constant c_sdp_unit_sub_weight      : natural := 2**c_sdp_W_sub_weight_fraction;  -- 2**13, so range +-4.0 for 16 bit signed weight
@@ -419,7 +421,7 @@ package sdp_pkg is
   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_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_block    : natural := c_sdp_nof_beamlets_per_block;  -- number of dual pol beamlets (c_sdp_N_pol_bf = 2)
   constant c_sdp_cep_nof_beamlets_per_packet   : natural := c_sdp_cep_nof_blocks_per_packet * c_sdp_cep_nof_beamlets_per_block;
   constant c_sdp_cep_payload_nof_longwords     : natural := c_sdp_cep_nof_beamlets_per_packet / c_sdp_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
-- 
GitLab