From 60685297947ad5304e8309df677503330681fc79 Mon Sep 17 00:00:00 2001
From: Eric Kooistra <kooistra@astron.nl>
Date: Fri, 12 Mar 2021 11:47:09 +0100
Subject: [PATCH] Corrected use of reorder_col_wide.

---
 .../lofar2_unb2b_beamformer.fpga.yaml                  |  5 ++++-
 libraries/base/reorder/reorder.peripheral.yaml         | 10 +++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/applications/lofar2/designs/lofar2_unb2b_beamformer/lofar2_unb2b_beamformer.fpga.yaml b/applications/lofar2/designs/lofar2_unb2b_beamformer/lofar2_unb2b_beamformer.fpga.yaml
index 565856c1ae..123017ea4a 100644
--- a/applications/lofar2/designs/lofar2_unb2b_beamformer/lofar2_unb2b_beamformer.fpga.yaml
+++ b/applications/lofar2/designs/lofar2_unb2b_beamformer/lofar2_unb2b_beamformer.fpga.yaml
@@ -198,8 +198,11 @@ peripherals:
       
   - peripheral_name: reorder/reorder_col_wide
     parameter_overrides:
-      - { name: g_wb_factor, value: c_N_beamsets * c_P_pfb }
+      - { name: g_nof_instances, value: c_N_beamsets }
+      - { name: g_wb_factor, value: c_P_pfb }
       - { name: g_nof_ch_in, value: c_N_sub * c_Q_fft }
       - { name: g_nof_ch_sel, value: c_S_sub_bf * c_Q_fft }
     slave_port_names:
       - RAM_SS_SS_WIDE
+
+
diff --git a/libraries/base/reorder/reorder.peripheral.yaml b/libraries/base/reorder/reorder.peripheral.yaml
index 5281f2590d..efd54e4b2b 100644
--- a/libraries/base/reorder/reorder.peripheral.yaml
+++ b/libraries/base/reorder/reorder.peripheral.yaml
@@ -13,8 +13,11 @@ peripherals:
        selected data is passed on. The index fields specify the order and the index of
        the input data that is passed on.
        There are g_wb_factor parallel data streams. All data streams can be reordered
-       independently."
+       independently. The selections for are stored as [g_wb_factor][g_nof_ch_sel].
+       Use g_nof_instances > 1 to have an array of multiple instances of the reorder_col_wide."
     parameters:
+      # Parameters of pi_ss_ss_wide.py
+      - { name: g_nof_instances, value: 1 }
       # Parameters of reorder_col_wide.vhd / reorder_col.vhd
       - { name: g_wb_factor, value: 1 }
       - { name: g_nof_ch_in, value: 256 }
@@ -24,10 +27,11 @@ peripherals:
       - slave_name: RAM_SS_SS_WIDE
         slave_description: ""
         slave_type: RAM
-        number_of_slaves: g_wb_factor
+        number_of_slaves: g_nof_instances
         fields:
           - - field_name: index
               field_description: ""
               width: ceil_log2(g_nof_ch_in)
               address_offset: 0x0
-              number_of_fields: g_nof_ch_sel
+              number_of_fields: g_nof_ch_sel * g_wb_factor
+
-- 
GitLab