From 76ec5554dd6900fee89c5e37725c1e667a1730a1 Mon Sep 17 00:00:00 2001
From: Eric Kooistra <kooistra@astron.nl>
Date: Fri, 21 Jan 2022 14:20:45 +0100
Subject: [PATCH] Renamed sdp_beamlet_id into sdp_beamlet_index.

---
 .../lofar2/libraries/sdp/src/vhdl/sdp_beamformer_output.vhd | 4 ++--
 applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd      | 6 +++---
 applications/lofar2/libraries/sdp/tb/vhdl/tb_sdp_pkg.vhd    | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/applications/lofar2/libraries/sdp/src/vhdl/sdp_beamformer_output.vhd b/applications/lofar2/libraries/sdp/src/vhdl/sdp_beamformer_output.vhd
index de8c07ed0f..2a7d53aedc 100644
--- a/applications/lofar2/libraries/sdp/src/vhdl/sdp_beamformer_output.vhd
+++ b/applications/lofar2/libraries/sdp/src/vhdl/sdp_beamformer_output.vhd
@@ -76,7 +76,7 @@ END sdp_beamformer_output;
 ARCHITECTURE str OF sdp_beamformer_output IS
 
   CONSTANT c_data_w                 : NATURAL := c_nof_complex*c_sdp_W_beamlet; --16b
-  CONSTANT c_beamlet_id             : NATURAL := g_beamset_id * c_sdp_S_sub_bf;
+  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.
   -- For packets of variable length, dp_fifo_fill_eop must be used. In this case we can use the standard fill fifo.
@@ -217,7 +217,7 @@ BEGIN
   dp_offload_tx_hdr_fields(field_hi(c_sdp_cep_hdr_field_arr, "sdp_source_info_gn_id"              ) DOWNTO field_lo(c_sdp_cep_hdr_field_arr,  "sdp_source_info_gn_id"              )) <= gn_id;
   dp_offload_tx_hdr_fields(field_hi(c_sdp_cep_hdr_field_arr, "sdp_reserved"                       ) DOWNTO field_lo(c_sdp_cep_hdr_field_arr,  "sdp_reserved"                       )) <= (OTHERS => '0');
   dp_offload_tx_hdr_fields(field_hi(c_sdp_cep_hdr_field_arr, "sdp_beamlet_scale"                  ) DOWNTO field_lo(c_sdp_cep_hdr_field_arr,  "sdp_beamlet_scale"                  )) <= beamlet_scale;
-  dp_offload_tx_hdr_fields(field_hi(c_sdp_cep_hdr_field_arr, "sdp_beamlet_id"                     ) DOWNTO field_lo(c_sdp_cep_hdr_field_arr,  "sdp_beamlet_id"                     )) <= TO_UVEC(c_beamlet_id, c_halfword_w);
+  dp_offload_tx_hdr_fields(field_hi(c_sdp_cep_hdr_field_arr, "sdp_beamlet_index"                  ) DOWNTO field_lo(c_sdp_cep_hdr_field_arr,  "sdp_beamlet_index"                  )) <= TO_UVEC(c_beamlet_index, c_halfword_w);
   dp_offload_tx_hdr_fields(field_hi(c_sdp_cep_hdr_field_arr, "sdp_block_period"                   ) DOWNTO field_lo(c_sdp_cep_hdr_field_arr,  "sdp_block_period"                   )) <= sdp_info.block_period;
                                                                                                                
   dp_offload_tx_hdr_fields(field_hi(c_sdp_cep_hdr_field_arr, "dp_bsn" ) DOWNTO field_lo(c_sdp_cep_hdr_field_arr, "dp_bsn" )) <= dp_fifo_sc_src_out.bsn(63 DOWNTO 0); 
diff --git a/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd b/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd
index 71b4c59b9d..22487eba06 100644
--- a/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd
+++ b/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd
@@ -347,7 +347,7 @@ PACKAGE sdp_pkg is
 
       ( field_name_pad("sdp_reserved"                       ), "RW", 40, field_default(0) ),
       ( field_name_pad("sdp_beamlet_scale"                  ), "RW", 16, field_default(c_sdp_beamlet_scale_default) ),
-      ( field_name_pad("sdp_beamlet_id"                     ), "RW", 16, field_default(0) ),
+      ( field_name_pad("sdp_beamlet_index"                  ), "RW", 16, field_default(0) ),
       ( field_name_pad("sdp_nof_blocks_per_packet"          ), "RW",  8, field_default(c_sdp_cep_nof_blocks_per_packet) ),
       ( field_name_pad("sdp_nof_beamlets_per_block"         ), "RW", 16, field_default(c_sdp_cep_nof_beamlets_per_block) ),
       ( field_name_pad("sdp_block_period"                   ), "RW", 16, field_default(c_sdp_block_period) ),
@@ -373,7 +373,7 @@ PACKAGE sdp_pkg is
 
     sdp_reserved                            : STD_LOGIC_VECTOR(39 DOWNTO 0);
     sdp_beamlet_scale                       : STD_LOGIC_VECTOR(15 DOWNTO 0);
-    sdp_beamlet_id                          : STD_LOGIC_VECTOR(15 DOWNTO 0);
+    sdp_beamlet_index                       : STD_LOGIC_VECTOR(15 DOWNTO 0);
     sdp_nof_blocks_per_packet               : STD_LOGIC_VECTOR( 7 DOWNTO 0);
     sdp_nof_beamlets_per_block              : STD_LOGIC_VECTOR(15 DOWNTO 0);
     sdp_block_period                        : STD_LOGIC_VECTOR(15 DOWNTO 0);
@@ -778,7 +778,7 @@ PACKAGE BODY sdp_pkg IS
 
     v.app.sdp_reserved                       := hdr_fields_raw(field_hi(c_sdp_cep_hdr_field_arr, "sdp_reserved")               DOWNTO field_lo(c_sdp_cep_hdr_field_arr, "sdp_reserved"));
     v.app.sdp_beamlet_scale                  := hdr_fields_raw(field_hi(c_sdp_cep_hdr_field_arr, "sdp_beamlet_scale")          DOWNTO field_lo(c_sdp_cep_hdr_field_arr, "sdp_beamlet_scale"));
-    v.app.sdp_beamlet_id                     := hdr_fields_raw(field_hi(c_sdp_cep_hdr_field_arr, "sdp_beamlet_id")             DOWNTO field_lo(c_sdp_cep_hdr_field_arr, "sdp_beamlet_id"));
+    v.app.sdp_beamlet_index                  := hdr_fields_raw(field_hi(c_sdp_cep_hdr_field_arr, "sdp_beamlet_index")          DOWNTO field_lo(c_sdp_cep_hdr_field_arr, "sdp_beamlet_index"));
     v.app.sdp_nof_blocks_per_packet          := hdr_fields_raw(field_hi(c_sdp_cep_hdr_field_arr, "sdp_nof_blocks_per_packet")  DOWNTO field_lo(c_sdp_cep_hdr_field_arr, "sdp_nof_blocks_per_packet"));
     v.app.sdp_nof_beamlets_per_block         := hdr_fields_raw(field_hi(c_sdp_cep_hdr_field_arr, "sdp_nof_beamlets_per_block") DOWNTO field_lo(c_sdp_cep_hdr_field_arr, "sdp_nof_beamlets_per_block"));
     v.app.sdp_block_period                   := hdr_fields_raw(field_hi(c_sdp_cep_hdr_field_arr, "sdp_block_period")           DOWNTO field_lo(c_sdp_cep_hdr_field_arr, "sdp_block_period"));
diff --git a/applications/lofar2/libraries/sdp/tb/vhdl/tb_sdp_pkg.vhd b/applications/lofar2/libraries/sdp/tb/vhdl/tb_sdp_pkg.vhd
index cfdb39d357..2456f4bed0 100644
--- a/applications/lofar2/libraries/sdp/tb/vhdl/tb_sdp_pkg.vhd
+++ b/applications/lofar2/libraries/sdp/tb/vhdl/tb_sdp_pkg.vhd
@@ -160,7 +160,7 @@ PACKAGE BODY tb_sdp_pkg IS
 
     ASSERT in_hdr.app.sdp_reserved               = exp_hdr.app.sdp_reserved               REPORT "Wrong beamlet app.sdp_reserved"               SEVERITY ERROR;
     ASSERT in_hdr.app.sdp_beamlet_scale          = exp_hdr.app.sdp_beamlet_scale          REPORT "Wrong beamlet app.sdp_beamlet_scale"          SEVERITY ERROR;
-    ASSERT in_hdr.app.sdp_beamlet_id             = exp_hdr.app.sdp_beamlet_id             REPORT "Wrong beamlet app.sdp_beamlet_id"             SEVERITY ERROR;
+    ASSERT in_hdr.app.sdp_beamlet_index          = exp_hdr.app.sdp_beamlet_index          REPORT "Wrong beamlet app.sdp_beamlet_index"          SEVERITY ERROR;
     ASSERT in_hdr.app.sdp_nof_blocks_per_packet  = exp_hdr.app.sdp_nof_blocks_per_packet  REPORT "Wrong beamlet app.sdp_nof_blocks_per_packet"  SEVERITY ERROR;
     ASSERT in_hdr.app.sdp_nof_beamlets_per_block = exp_hdr.app.sdp_nof_beamlets_per_block REPORT "Wrong beamlet app.sdp_nof_beamlets_per_block" SEVERITY ERROR;
     ASSERT in_hdr.app.sdp_block_period           = sdp_info.block_period                  REPORT "Wrong beamlet app.sdp_block_period"           SEVERITY ERROR;
-- 
GitLab