From 6907db2b7d450d52cb96bfea10ee637254f4642a Mon Sep 17 00:00:00 2001
From: stedif <stefano.difrischia@inaf.it>
Date: Wed, 3 Aug 2022 15:59:25 +0200
Subject: [PATCH] L2SS-879: add fpga_bf_rx points to beamlet

---
 .../tangostationcontrol/devices/sdp/beamlet.py     | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py b/tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py
index 309016fa7..3a302239c 100644
--- a/tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py
+++ b/tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py
@@ -37,6 +37,7 @@ class Beamlet(opcua_device):
     N_BEAMLETS_CTRL = 488
     N_BEAMSETS_CTRL = 2
     N_POL_BF = 2
+    P_SUM = 2   # number of hops that the data of the stream has traveled to reach the BSN aligner on this node
 
     # -----------------
     # Device Properties
@@ -154,6 +155,19 @@ class Beamlet(opcua_device):
     FPGA_bf_weights_yy_R = attribute_wrapper(comms_annotation=["FPGA_bf_weights_yy_R"], datatype=numpy.uint32, dims=(N_PN, A_PN, N_BEAMLETS_CTRL))
     FPGA_bf_weights_yy_RW = attribute_wrapper(comms_annotation=["FPGA_bf_weights_yy_RW"], datatype=numpy.uint32, dims=(N_PN, A_PN, N_BEAMLETS_CTRL), access=AttrWriteType.READ_WRITE)
 
+    # boolean[N_pn][N_beamsets_ctrl][P_sum]
+    FPGA_bf_rx_align_stream_enable_R = attribute_wrapper(comms_annotation=["FPGA_bf_rx_align_stream_enable_R"], datatype=bool, dims=(N_PN, N_BEAMSETS_CTRL, P_SUM))
+    FPGA_bf_rx_align_stream_enable_RW = attribute_wrapper(comms_annotation=["FPGA_bf_rx_align_stream_enable_RW"], datatype=bool, dims=(N_PN, N_BEAMSETS_CTRL, P_SUM), access=AttrWriteType.READ_WRITE)
+
+    # int64[N_pn][N_beamsets_ctrl][P_sum]
+    FPGA_bf_rx_align_bsn_R = attribute_wrapper(comms_annotation=["FPGA_bf_rx_align_bsn_R"], datatype=numpy.int64, dims=(N_PN, N_BEAMSETS_CTRL, P_SUM))
+
+    #int32[N_pn][N_beamsets_ctrl][P_sum]
+    FPGA_bf_rx_align_nof_packets_R = attribute_wrapper(comms_annotation=["FPGA_bf_rx_align_nof_packets_R"], datatype=numpy.int32, dims=(N_PN, N_BEAMSETS_CTRL, P_SUM))
+    FPGA_bf_rx_align_nof_valid_R = attribute_wrapper(comms_annotation=["FPGA_bf_rx_align_nof_valid_R"], datatype=numpy.int32, dims=(N_PN, N_BEAMSETS_CTRL, P_SUM))
+    FPGA_bf_rx_align_latency_R = attribute_wrapper(comms_annotation=["FPGA_bf_rx_align_latency_R"], datatype=numpy.int32, dims=(N_PN, N_BEAMSETS_CTRL, P_SUM))
+    FPGA_bf_rx_align_nof_replaced_packets_R = attribute_wrapper(comms_annotation=["FPGA_bf_rx_align_nof_replaced_packets_R"], datatype=numpy.int32, dims=(N_PN, N_BEAMSETS_CTRL, P_SUM))
+    
     subband_select_RW = attribute(dtype=(numpy.uint32,), max_dim_x=N_BEAMLETS_CTRL, access=AttrWriteType.READ_WRITE, fisallowed="is_attribute_access_allowed")
 
     def read_subband_select_RW(self):
-- 
GitLab