diff --git a/CDB/stations/DTS.json b/CDB/stations/DTS.json index 1acc0c3decd193bbfe761fb4daa18e5540e13adc..a86d02a81f403142c39fa533556dbcd9f365db30 100644 --- a/CDB/stations/DTS.json +++ b/CDB/stations/DTS.json @@ -142,9 +142,6 @@ "53262", "53263" ], - "FPGA_beamlet_output_nof_destinations_R_default_shorthand": [ - "4" - ], "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ "ec:0d:9a:bf:f2:dc", "ec:0d:9a:bf:f2:dc", @@ -221,9 +218,6 @@ "53262", "53263" ], - "FPGA_beamlet_output_nof_destinations_R_default_shorthand": [ - "4" - ], "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ "ec:0d:9a:bf:f2:dc", "ec:0d:9a:bf:f2:dc", @@ -300,9 +294,6 @@ "53262", "53263" ], - "FPGA_beamlet_output_nof_destinations_R_default_shorthand": [ - "4" - ], "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ "ec:0d:9a:bf:f2:dc", "ec:0d:9a:bf:f2:dc", diff --git a/CDB/stations/cs001.json b/CDB/stations/cs001.json index fa365e675510c20dad4871d70bb0f742d68605d4..c599747b4843a397e391aa05786325fba159144d 100644 --- a/CDB/stations/cs001.json +++ b/CDB/stations/cs001.json @@ -142,9 +142,6 @@ "53262", "53263" ], - "FPGA_beamlet_output_nof_destinations_R_default_shorthand": [ - "4" - ], "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ "e4:43:4b:3d:89:81", "e4:43:4b:3d:89:81", @@ -221,9 +218,6 @@ "53262", "53263" ], - "FPGA_beamlet_output_nof_destinations_R_default_shorthand": [ - "4" - ], "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ "e4:43:4b:3d:89:81", "e4:43:4b:3d:89:81", @@ -300,9 +294,6 @@ "53262", "53263" ], - "FPGA_beamlet_output_nof_destinations_R_default_shorthand": [ - "4" - ], "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ "e4:43:4b:3d:89:81", "e4:43:4b:3d:89:81", diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py b/tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py index 9a55718f3e234e911c78183bcaeab28a586bcab2..cbc81108bf2601cd1b62eda761b001573d1885c4 100644 --- a/tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py +++ b/tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py @@ -34,7 +34,6 @@ from tangostationcontrol.common.constants import ( ) # Additional import -from tangostationcontrol.common.device_decorators import debugit from tangostationcontrol.common.lofar_logging import log_exceptions from tangostationcontrol.common.proxy import create_device_proxy from tangostationcontrol.common.sdp import phases_to_weights @@ -74,13 +73,6 @@ class Beamlet(OPCUADevice): dtype="DevVarUShortArray", mandatory=True ) - FPGA_beamlet_output_nof_destinations_RW_default_shorthand = device_property( - doc="Number of output streams. Will be set to this value for all FPGAs", - dtype=numpy.uint8, - mandatory=False, - default_value=4, - ) - FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand = device_property( doc="MAC addresses for each output stream. Will be set to this value for all FPGAs, augmented with blank values.", dtype="DevVarStringArray", @@ -220,25 +212,6 @@ class Beamlet(OPCUADevice): access=AttrWriteType.READ_WRITE, ) - FPGA_beamlet_output_nof_destinations_R = AttributeWrapper( - comms_annotation=["FPGA_beamlet_output_nof_destinations_R"], - datatype=numpy.uint8, - dims=(N_pn,), - ) - _FPGA_beamlet_output_nof_destinations_RW = AttributeWrapper( - doc="Number of UDP streams to create. NB: sdp.FPGA_processing_enable_R must be all False when setting this value! Use beamlet_output_nof_destinations_RW instead!", - comms_annotation=["FPGA_beamlet_output_nof_destinations_RW"], - datatype=numpy.uint8, - dims=(N_pn,), - access=AttrWriteType.READ_WRITE, - ) - FPGA_beamlet_output_nof_destinations_RW = attribute( - doc="Number of UDP streams to create.", - dtype=(numpy.uint8,), - max_dim_x=N_pn, - access=AttrWriteType.READ_WRITE, - ) - FPGA_beamlet_output_nof_destinations_act_R = AttributeWrapper( comms_annotation=["FPGA_beamlet_output_nof_destinations_act_R"], datatype=numpy.uint8, @@ -634,15 +607,7 @@ class Beamlet(OPCUADevice): based on shorthand defaults.""" # --- Configure FPGA destination streams equally for all 16 FPGAs - # NB: For this to properly take, sdp_proxy.FPGA_processing_enable_RW needs to transition False -> True - # afterwards - nof_destinations = properties[ - "FPGA_beamlet_output_nof_destinations_RW_default_shorthand" - ] - - default_settings = [ - ("FPGA_beamlet_output_nof_destinations_RW", [nof_destinations] * N_pn), - ] + default_settings = [] # Set MAC, IP, port for setting, value_if_undefined in [ @@ -655,10 +620,6 @@ class Beamlet(OPCUADevice): ]: # obtain shorthand description (first values per fpga) shorthand_value = properties[f"{setting}_default_shorthand"] - if len(shorthand_value) != nof_destinations: - raise ValueError( - f"Invalid configuration: {len(shorthand_value)} values defined for {setting} but need {nof_destinations} values" - ) # construct value for all FPGAs, extending the given values with blanks # to obtain the required array shape. @@ -671,24 +632,6 @@ class Beamlet(OPCUADevice): return default_settings - def read_FPGA_beamlet_output_nof_destinations_RW(self): - # report effective number of output destinations - return self.read_attribute("FPGA_beamlet_output_nof_destinations_act_R") - - @debugit() - def write_FPGA_beamlet_output_nof_destinations_RW(self, value): - old_FPGA_processing_enable = self.sdp_proxy.FPGA_processing_enable_RW - try: - # need to turn off FPGA processing when setting this value - self.sdp_proxy.FPGA_processing_enable_RW = [False] * N_pn - - self.proxy.write_attribute( - "_FPGA_beamlet_output_nof_destinations_RW", value - ) - finally: - # restore previous setting - self.sdp_proxy.FPGA_processing_enable_RW = old_FPGA_processing_enable - def read_subband_select_RW(self): # We can only return a single value, so we assume the FPGA is configured coherently. # Which is something that is to be checked by an independent monitoring system anyway. diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/sdp.py b/tangostationcontrol/tangostationcontrol/devices/sdp/sdp.py index 9efa55076757c6043e0446b74e6d12c0609ef075..c9b0a46a8896fac5c5db38c38e82f62e75df7bc2 100644 --- a/tangostationcontrol/tangostationcontrol/devices/sdp/sdp.py +++ b/tangostationcontrol/tangostationcontrol/devices/sdp/sdp.py @@ -54,9 +54,10 @@ class SDP(OPCUADevice): # Device Properties # ----------------- - # By default, do not enable processing when: + # Do not enable processing before: # * the ring is configured by this device # * the (number of) beamlet output destinations is configured by the beamlet device + # Changing these values after processing has been enabled leads to unstable results! FPGA_processing_enable_RW_default = device_property( dtype="DevVarBooleanArray", mandatory=False, default_value=[True] * N_pn ) @@ -77,6 +78,13 @@ class SDP(OPCUADevice): dtype="DevVarBooleanArray", mandatory=False, default_value=[False] * N_pn ) + FPGA_beamlet_output_nof_destinations_RW_default = device_property( + doc="Number of output streams. Will be set to this value for all FPGAs", + dtype="DevVarUShortArray", + mandatory=False, + default_value=[4] * N_pn, + ) + FPGA_wg_enable_RW_default = device_property( dtype="DevVarBooleanArray", mandatory=False, @@ -129,10 +137,12 @@ class SDP(OPCUADevice): ) FIRST_DEFAULT_SETTINGS = [ + # These settings must be configured before FPGA_processing_enable_RW is set to True "FPGA_ring_node_offset_RW", "FPGA_ring_nof_nodes_RW", "FPGA_ring_use_cable_to_next_rn_RW", "FPGA_ring_use_cable_to_previous_rn_RW", + "FPGA_beamlet_output_nof_destinations_RW", ] def get_defaults(self, properties: Dict[str, object]) -> List[Tuple[str, object]]: @@ -199,6 +209,20 @@ class SDP(OPCUADevice): dims=(N_pn,), access=AttrWriteType.READ_WRITE, ) + + FPGA_beamlet_output_nof_destinations_R = AttributeWrapper( + comms_annotation=["FPGA_beamlet_output_nof_destinations_R"], + datatype=numpy.uint8, + dims=(N_pn,), + ) + FPGA_beamlet_output_nof_destinations_RW = AttributeWrapper( + doc="Number of UDP streams to create for beamlets. NB: Cannot be configured once FPGA_processing_enable_R has been True.", + comms_annotation=["FPGA_beamlet_output_nof_destinations_RW"], + datatype=numpy.uint8, + dims=(N_pn,), + access=AttrWriteType.READ_WRITE, + ) + FPGA_sdp_info_antenna_band_index_R = AttributeWrapper( doc="Antenna band number to put in packet headers. 0=LB, 1=HB", comms_annotation=["FPGA_sdp_info_antenna_band_index_R"],