From 61d222bd3cb3cf374957d8734957c65d8a92732b Mon Sep 17 00:00:00 2001
From: Eric Kooistra <kooistra@astron.nl>
Date: Tue, 15 Feb 2022 16:08:06 +0100
Subject: [PATCH] Removed O_si, N_si from sdp_info because not used. Moved
 O_rn, N_rn to ring_info.

---
 .../lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd | 24 ++++++++++---------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd b/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd
index 1cedc89fbc..554dc4248a 100644
--- a/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd
+++ b/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd
@@ -52,31 +52,28 @@ PACKAGE sdp_pkg is
     f_adc                   : STD_LOGIC;     
     fsub_type               : STD_LOGIC;  
     beam_repositioning_flag : STD_LOGIC; 
-    O_si                    : STD_LOGIC_VECTOR(7 DOWNTO 0);    
-    N_si                    : STD_LOGIC_VECTOR(7 DOWNTO 0);    
-    O_rn                    : STD_LOGIC_VECTOR(7 DOWNTO 0);    
-    N_rn                    : STD_LOGIC_VECTOR(7 DOWNTO 0);   
     block_period            : STD_LOGIC_VECTOR(15 DOWNTO 0);      
   END RECORD;   
 
   CONSTANT c_sdp_info_rst : t_sdp_info := 
       ( (OTHERS => '0'), '0', (OTHERS => '0'), (OTHERS => '0'),
         '0', '0', '0',
-        (OTHERS => '0'), (OTHERS => '0'), (OTHERS => '0'), (OTHERS => '0'),
         (OTHERS => '0') );  
 
   -------------------------------------------------
   -- SDP specific parameters as defined in:
   --  L3 SDP Decision: SDP Parameter definitions 
   CONSTANT c_sdp_f_adc_MHz                 : NATURAL := 200;
-  CONSTANT c_sdp_N_beamsets                : NATURAL := 2;
+  CONSTANT c_sdp_N_beamsets                : NATURAL := 2;  -- = N_beamsets_sdp in doc
+  CONSTANT c_sdp_N_cross_sets_sdp          : NATURAL := 1;
   CONSTANT c_sdp_N_crosslets_max           : NATURAL := 7;
   CONSTANT c_sdp_N_fft                     : NATURAL := 1024;
   CONSTANT c_sdp_N_pn_lb                   : NATURAL := 16;
   CONSTANT c_sdp_N_pn_max                  : NATURAL := 16;  -- gn 0:31 --> pn 0:15, pn 0:15 per antenna band
   CONSTANT c_sdp_N_pol                     : NATURAL := 2;
   CONSTANT c_sdp_N_pol_bf                  : NATURAL := 2;
-  CONSTANT c_sdp_N_ring_lanes_max          : NATURAL := 8;
+  CONSTANT c_sdp_N_rings_sdp               : NATURAL := 1;
+  CONSTANT c_sdp_N_ring_lanes_max          : NATURAL := 8;   -- = N_lane in doc
   CONSTANT c_sdp_N_sub                     : NATURAL := 512;
   CONSTANT c_sdp_N_sync_rcu                : NATURAL := 1;
   CONSTANT c_sdp_N_taps                    : NATURAL := 16;
@@ -551,13 +548,18 @@ END PACKAGE sdp_pkg;
 PACKAGE BODY sdp_pkg IS
 
   FUNCTION func_sdp_gn_index_to_pn_index(gn_index : NATURAL) RETURN NATURAL IS
-    -- Determine PN index that starts at 0 per antenna band.
-    -- For LOFAR2 SDP there are two antenna bands: LB and HB. The LB starts at
-    -- GN index = 0 and has c_sdp_N_pn_lb = c_sdp_N_pn_max = 16 nodes. The HB
-    -- starts at c_sdp_N_pn_max. Assume every antenna_band starts at a GN:
+    -- Determine PN index that starts at 0 per antenna band. For LOFAR2 SDP
+    -- each antenna_band has c_sdp_N_pn_max = 16 PN. The pn_index defines the
+    -- PN index within an antenna_band:
     --
     --   pn_index = gn_index MOD c_sdp_N_pn_max
     --
+    -- The c_sdp_N_pn_max = 16 fits the LB and HB of LOFAR2:
+    -- . The LB starts at GN index = 0 and has c_sdp_N_pn_lb = c_sdp_N_pn_max
+    --   = 16 nodes.
+    -- . The HB starts at GN index = c_sdp_N_pn_max, and has 8 or 16 nodes
+    --   dependent on the type of station.
+    --
     -- The fact that c_sdp_N_pn_max = 16 implies that instead of implementing
     -- MOD it is possible to do:
     --
-- 
GitLab