Tile Component Manager

This module implements component management for tiles.

class TileComponentManager(simulation_mode, test_mode, logger, poll_rate, tile_id, station_id, tpm_ip, tpm_cpld_port, preadu_levels, static_time_delays, subrack_fqdn, subrack_tpm_id, preadu_present, communication_state_changed_callback, component_state_changed_callback, update_attribute_callback, _tile=None, event_serialiser=None, default_lock_timeout=0.4, poll_timeout=6.0, power_callback_timeout=6.0)

A component manager for a Tile (simulator or driver) and its power supply.

__init__(simulation_mode, test_mode, logger, poll_rate, tile_id, station_id, tpm_ip, tpm_cpld_port, preadu_levels, static_time_delays, subrack_fqdn, subrack_tpm_id, preadu_present, communication_state_changed_callback, component_state_changed_callback, update_attribute_callback, _tile=None, event_serialiser=None, default_lock_timeout=0.4, poll_timeout=6.0, power_callback_timeout=6.0)

Initialise a new instance.

Parameters:
  • simulation_mode (SimulationMode) – the simulation mode of this component manager. If SimulationMode.TRUE, then this component manager will launch an internal TPM simulator and interact with it; if SimulationMode.FALSE, this component manager will attempt to connect with an external TPM at the configured IP address and port.

  • test_mode (TestMode) – the test mode of this component manager. This has no effect when the device is in SimulationMode.FALSE. But when the simulation mode is SimulationMode.TRUE, then this determines some properties of the simulator: if the test mode is TestMode.TEST, then the simulator will return static “canned” values that are easy to assert against during testing; if TestMode.NONE, the simulator will return dynamically changing values for attributes such as temperatures and voltages, making for a nice demo but not so easy to test against.

  • logger (Logger) – a logger for this object to use

  • poll_rate (float) – the poll rate

  • tile_id (int) – the unique ID for the tile

  • station_id (int) – the unique ID for the station to which this tile belongs.

  • tpm_ip (str) – the IP address of the tile

  • tpm_cpld_port (int) – the port at which the tile is accessed for control

  • preadu_levels (Optional[list[float]]) – preADU gain attenuation settings to apply for this TPM.

  • static_time_delays (list[float]) – Delays in nanoseconds to account for static delay missmatches.

  • subrack_fqdn (str) – FQDN of the subrack that controls power to this tile

  • subrack_tpm_id (int) – This tile’s position in its subrack

  • preadu_present (list[bool]) – A list representing if the PreAdu is attached.

  • communication_state_changed_callback (Callable[[CommunicationStatus], None]) – callback to be called when the status of the communications channel between the component manager and its component changes

  • update_attribute_callback (Callable[..., None]) – Callback to call when attribute is updated.

  • component_state_changed_callback (Callable[..., None]) – callback to be called when the component state changes

  • event_serialiser (Optional[EventSerialiser]) – serialiser for events

  • _tile (Optional[TileSimulator]) – Optional tile to inject.

  • default_lock_timeout (float) – default timeout for hardware serialisation lock.

  • poll_timeout (float) – max time for a poll to wait on hardware serialisation lock before giving up.

  • power_callback_timeout (float) – max time for power callback to wait for hardware serialisation lock to determine if initialisation is required.

property adcs: dict[str, Any]

Return the ADC status in the TPM.

Returns:

ADC status in the TPM

property alarms: dict[str, Any]

Return the alarms status in the TPM.

Returns:

alarms status in the TPM

apply_calibration(load_time='')

Load the calibration coefficients at the specified time delay.

Parameters:

load_time (str) – switch time as ISO formatted time

Return type:

tuple[list[ResultCode], list[str]]

Returns:

Result code and message.

apply_pointing_delays(load_time='')

Load the pointing delays at the specified time delay.

Parameters:

load_time (str) – switch time as ISO formatted time

Raises:

ValueError – invalid time

Return type:

tuple[list[ResultCode], list[str]]

Returns:

Result code and message

property arp_table: dict[int, list[int]] | None

Check that ARP table has been populated in for all used cores 40G interfaces.

Use cores 0 (fpga0) and 1(fpga1) and ARP ID 0 for beamformer, 1 for LMC 10G interfaces use cores 0,1 (fpga0) and 4,5 (fpga1) for beamforming, and 2, 6 for LMC with only one ARP.

Returns:

list of core id and arp table populated

beamformer_running_for_channels(channel_groups)

Check if the beamformer is running in a list of channel blocks.

Parameters:

channel_groups (Optional[list[int]]) – List of channel blocks to check

Return type:

bool

Returns:

True if the beamformer is running

property board_temperature: float

Return the temperature of the TPM.

Returns:

the temperature of the TPM

property broadband_rfi_factor: float

Return the broadband RFI factor.

Returns:

the broadband RFI factor

property channeliser_truncation: list[int] | None

Read the value for the channeliser truncation.

Returns:

value for the channeliser truncation

cleanup()

Perform necessary cleanup before device teardown.

Return type:

None

clear_broadband_rfi()

Clear the broadband RFI levels.

Return type:

None

property clock_present: NoReturn

Check if 10 MHz clock signal is present.

Raises:

NotImplementedError – not implemented in ska-low-sps-tpm-api.

configure_40g_core(core_id=0, arp_table_entry=0, source_mac=None, source_ip=None, source_port=None, destination_ip=None, destination_port=None, rx_port_filter=None, netmask=None, gateway_ip=None)

Configure the 40G code.

Parameters:
  • core_id (int) – id of the core

  • arp_table_entry (int) – ARP table entry to use

  • source_mac (Optional[int]) – MAC address of the source

  • source_ip (Optional[str]) – IP address of the source

  • source_port (Optional[int]) – port of the source

  • destination_ip (Optional[str]) – IP address of the destination

  • destination_port (Optional[int]) – port of the destination

  • rx_port_filter (Optional[int]) – Filter for incoming packets

  • netmask (Optional[str]) – Netmask

  • gateway_ip (Optional[str]) – Gateway IP

Return type:

tuple[list[ResultCode], list[str]]

Returns:

result code and message

configure_integrated_beam_data(integration_time=0.5, first_channel=0, last_channel=191)

Configure and start the transmission of integrated channel data.

Configure with the provided integration time, first channel and last channel. Data are sent continuously until the StopIntegratedData command is run.

Parameters:
  • integration_time (float) – integration time in seconds, defaults to 0.5

  • first_channel (int) – first channel

  • last_channel (int) – last channel

Return type:

tuple[list[ResultCode], list[str]]

Returns:

Result code and message

configure_integrated_channel_data(integration_time=0.5, first_channel=0, last_channel=511)

Configure and start the transmission of integrated channel data.

Configure with the provided integration time, first channel and last channel. Data are sent continuously until the StopIntegratedData command is run.

Parameters:
  • integration_time (float) – integration time in seconds, defaults to 0.5

  • first_channel (int) – first channel

  • last_channel (int) – last channel

Return type:

tuple[list[ResultCode], list[str]]

Returns:

Result code and message

configure_pattern_generator(stage, pattern, adders, start=False, shift=0, zero=0, ramp1=None, ramp2=None)

Configure the TPM pattern generator.

Parameters:
  • stage (str) – The stage in the signal chain where the pattern is injected. Options are: ‘jesd’ (output of ADCs), ‘channel’ (output of channelizer), or ‘beamf’ (output of tile beamformer) or ‘all’ for all stages.

  • pattern (list[int]) – The data pattern in time order. This must be a list of integers with a length between 1 and 1024. The pattern represents values in time order (not antennas or polarizations).

  • adders (list[int]) – A list of 32 integers that expands the pattern to cover 16 antennas and 2 polarizations in hardware. This list maps the pattern to the corresponding signals for the antennas and polarizations.

  • start (bool) – Boolean flag indicating whether to start the pattern immediately. If False, the pattern will need to be started manually later.

  • shift (int) – Optional bit shift (divides the pattern by 2^shift). This must not be used in the ‘beamf’ stage, where it is always overridden to 4. The default value is 0.

  • zero (int) – An integer (0-65535) used as a mask to disable the pattern on specific antennas and polarizations. The same mask is applied to both FPGAs, supporting up to 8 antennas and 2 polarizations. The default value is 0.

  • ramp1 (Optional[dict[str, int]]) – if defined a ramp will be applied for ramp1 after the pattern is set. A mandatory kwarg polarisation is used a configuration. This must be 0, 1 or -1 to use all stages.

  • ramp2 (Optional[dict[str, int]]) – if defined a ramp will be applied for ramp2 after the pattern is set. A mandatory kwarg polarisation is used a configuration. This must be 0, 1 or -1 to use all stages.

Return type:

None

configure_test_generator(frequency0, amplitude0, frequency1, amplitude1, amplitude_noise, pulse_code, amplitude_pulse, delays=None, load_time=None)

Test generator setting.

Parameters:
  • frequency0 (float) – Tone frequency in Hz of DDC 0

  • amplitude0 (float) – Tone peak amplitude, normalized to 31.875 ADC units, resolution 0.125 ADU

  • frequency1 (float) – Tone frequency in Hz of DDC 1

  • amplitude1 (float) – Tone peak amplitude, normalized to 31.875 ADC units, resolution 0.125 ADU

  • amplitude_noise (float) – Amplitude of pseudorandom noise normalized to 26.03 ADC units, resolution 0.102 ADU

  • pulse_code (int) – Code for pulse frequency. Range 0 to 7: 16,12,8,6,4,3,2 times frame frequency

  • amplitude_pulse (float) – pulse peak amplitude, normalized to 127.5 ADC units, resolution 0.5 ADU

  • delays (Optional[list[float]]) – delays to load into the test generator, list of 32 floats.

  • load_time (Optional[str]) – Time to start the generator. in UTC ISO formatted string.

Raises:
Return type:

None

connect()

Check we can connect to the TPM.

Raises:

ConnectionError – when unable to connect to TPM

Return type:

None

property csp_rounding: list[int]

Read the cached value for the final rounding in the CSP samples.

Need to be specfied only for the last tile :return: Final rounding for the CSP samples. Up to 384 values

property csp_spead_format: str

Get CSP SPEAD format.

CSP format is: AAVS for the format used in AAVS2-AAVS3 system, using a reference Unix time specified in the header. SKA for the format defined in SPS-CBF ICD, based on TAI2000 epoch.

Returns:

CSP Spead format. AAVS or SKA

property current_tile_beamformer_frame: int

Return current tile beamformer frame, in units of 256 ADC frames.

Returns:

current tile beamformer frame

property data_router_discarded_packets: dict

Return the data router values.

Returns:

The number of discarded packets

property data_router_status: dict

Return the data router values.

Returns:

The status of both FPGAs

disable_broadband_rfi_blanking(antennas)

Disable broadband RFI blanking for a list of antennas.

Parameters:

antennas (list[int]) – list of antennas to disable broadband RFI blanking

Return type:

None

disable_station_beam_flagging()

Disable station beam flagging.

Return type:

None

download_firmware(argin, task_callback)

Submit the download_firmware slow task.

This method returns immediately after it is submitted for execution.

Parameters:
  • argin (str) – can either be the design name returned from GetFirmwareAvailable command, or a path to a file

  • task_callback (Optional[Callable]) – Update task state, defaults to None

Return type:

tuple[list[ResultCode], list[str]]

Returns:

A tuple containing a result code and a unique id string to identify the command

enable_broadband_rfi_blanking(antennas)

Enable broadband RFI blanking for a list of antennas.

Parameters:

antennas (list[int]) – list of antennas to enable broadband RFI blanking

Return type:

None

enable_station_beam_flagging()

Enable station beam flagging.

Return type:

None

property firmware_available: List[dict[str, Any]]

Return the list of the firmware loaded in the system.

Returns:

the firmware list

property firmware_name: str

Return the name of the firmware that this TPM simulator is running.

Returns:

firmware name

property firmware_version: str

Return the name of the firmware that this TPM simulator is running.

Returns:

firmware version (major.minor)

property flagged_packets: dict

Return the total number of flagged packets by the TPM.

Returns:

the total number of flagged packets by the TPM

property formatted_fpga_reference_time: str

Return FPGA reference time in UTC format.

Reference time is set as part of start_observation. It represents the timestamp for the first frame

Returns:

FPGA reference time

property fpga1_temperature: float

Return the temperature of FPGA 1.

Returns:

the temperature of FPGA 1

property fpga2_temperature: float

Return the temperature of FPGA 2.

Returns:

the temperature of FPGA 2

property fpga_current_frame: int

Return the FPGA current frame counter.

Returns:

the FPGA_1 current frame counter

Raises:

ConnectionError – if communication with tile failed

property fpga_frame_time: str

Return FPGA frame time in UTC format.

frame time is the timestamp for the current frame being processed. Value reported here refers to the ADC frames, but the total processing delay is < 1ms and thus irrelevant on the timescales of MCCS response time

Returns:

FPGA reference time

property fpga_reference_time: int

Return the FPGA reference time.

Required to map the FPGA timestamps, expressed in frames to UTC time

Returns:

the FPGA_1 reference time, in Unix seconds

property fpga_time: str

Return FPGA internal time in UTC format.

Returns:

FPGA internal time

property fpgas_time: list[int]

Return the FPGAs clock time.

Useful for detecting clock skew, propagation delays, contamination delays, etc.

Returns:

the FPGAs clock time

Raises:

ConnectionError – if communication with tile failed

frame_from_utc_time(utc_time)

Return the frame from utc time.

Parameters:

utc_time (str) – the time in utc format.

Return type:

int

Returns:

the frame from utc time.

get_40g_configuration(core_id=-1, arp_table_entry=0)

Return a 40G configuration.

Parameters:
  • core_id (int) – id of the core for which a configuration is to be return. Defaults to -1, in which case all cores configurations are returned

  • arp_table_entry (int) – ARP table entry to use

Return type:

list[dict]

Returns:

core configuration or list of core configurations

get_40g_packet_counts()

Get 40G packet counts.

The return value depends on how many 40G cores are active. Typically, only one core is active.

Example:

# 0 cores active
{}

# 1 core active
{
    'FPGA0': {
        'rx_received': 2921,
        'rx_forwarded': 0,
        'tx_transmitted': 6973024
    }
}

# 2 cores active
{
    'FPGA0': {
        'rx_received': 3881,
        'rx_forwarded': 0,
        'tx_transmitted': 7321460
    },
    'FPGA1': {
        'rx_received': 1,
        'rx_forwarded': 0,
        'tx_transmitted': 3122
    }
}
Returns:

Packet counts per active 40G core. Returns an empty dictionary if no 40G cores are active.

Return type:

dict

get_all_pointing_delays()

Read pointing delays from the TPM for all beams.

Return type:

ndarray

Returns:

pointing delays for all beams as (8, 32) ndarray.

get_current_warning_thresholds(current='')

Get the current warning thresholds.

Parameters:

current (str) – The current type to get the thresholds for.

Return type:

str

Returns:

a jsonified dictionary with the current warning thresholds or a message if the specified current is not recognized.

get_request()

Return the action/s to be taken in the next poll.

Raises:

AssertionError – if the request provider is not initialised i.e has a None value.

Return type:

Union[TileRequest, TileLRCRequest, None]

Returns:

request to be to be executed in the next poll.

get_static_delays()

Read the cached value for the static delays, in sample.

Return type:

list[float]

Returns:

static delay, in nanoseconds one per TPM input

get_tpm_temperature_thresholds()

Return the temperature thresholds in firmware.

Return type:

Optional[dict[str, float]]

Returns:

A dictionary containing the thresholds or None if lock could not be acquired in 0.4 seconds.

get_voltage_warning_thresholds(voltage='')

Get the voltage warning thresholds.

Parameters:

voltage (str) – The voltage type to get the thresholds for.

Return type:

str

Returns:

a jsonified dictionary with the voltage warning thresholds or a message if the specified voltage is not recognized.

property global_reference_time: str | None

Return the Unix time used as global synchronization time.

Returns:

Unix time used as global synchronization time

initialise(task_callback=None, force_reprogramming=True)

Submit the initialise slow task.

This method returns immediately after it is submitted for polling.

Parameters:
  • task_callback (Optional[Callable]) – Update task state, defaults to None

  • force_reprogramming (bool) – Force FPGA reprogramming, for complete initialisation

Return type:

tuple[list[ResultCode], list[str]]

Returns:

A tuple containing a task status and a unique id string to identify the command

initialise_beamformer(start_channel, nof_channels, is_first, is_last)

Initialise the beamformer.

Parameters:
  • start_channel (int) – the start channel

  • nof_channels (int) – number of channels

  • is_first (bool) – whether this is the first (?)

  • is_last (bool) – whether this is the last (?)

Return type:

None

property is_beamformer_running: bool | None

Check if the beamformer is running.

Returns:

True if the beamformer is running

property is_programmed: bool

Return whether this TPM is programmed (i.e. firmware has been downloaded to it).

Returns:

whether this TPM is programmed

property is_station_beam_flagging_enabled: list

Return station beam data flagging state for each fpga.

Returns:

a list of bool values corresponding to the fpgas

load_calibration_coefficients(antenna, calibration_coefficients)

Load calibration coefficients.

These may include any rotation matrix (e.g. the parallactic angle), but do not include the geometric delay.

Parameters:
  • antenna (int) – the antenna to which the coefficients apply

  • calibration_coefficients (list[list[complex]]) – a bidirectional complex array of coefficients, flattened into a list

Return type:

tuple[list[ResultCode], list[str]]

Returns:

Result code and message.

load_calibration_coefficients_for_channels(start_channel, calibration_coefficients)

Load calibration coefficients for all antennas and a subset of channels.

These may include any rotation matrix (e.g. the parallactic angle), but do not include the geometric delay.

Parameters:
  • start_channel (int) – the first channel to which the coefficients apply

  • calibration_coefficients (list[list[list[complex]]]) – a tridimensional complex array of coefficients

Return type:

tuple[list[ResultCode], list[str]]

Returns:

Result code and message.

load_pointing_delays(delay_array, beam_index)

Specify the delay in seconds and the delay rate in seconds/second.

The delay_array specifies the delay and delay rate for each antenna. beam_index specifies which beam is desired (range 0-7)

Parameters:
  • delay_array (list[list[float]]) – list of [delay in seconds, and delay rate in seconds/second] per antenna.

  • beam_index (int) – the beam to which the pointing delay should be applied

Return type:

tuple[list[ResultCode], list[str]]

Returns:

Result code and message

max_broadband_rfi(antennas)

Read the maximum broadband RFI levels for a list of antennas.

Parameters:

antennas (list[int]) – list of antennas to read maximum broadband RFI levels

Return type:

int

Returns:

maximum broadband RFI levels for the specified antennas

off(task_callback=None)

Tell the upstream power supply proxy to turn the tpm off.

Parameters:

task_callback (Optional[Callable]) – Update task state, defaults to None

Return type:

tuple[TaskStatus, str]

Returns:

a result code and a unique_id or message.

on(task_callback=None)

Tell the upstream power supply proxy to turn the tpm on.

Parameters:

task_callback (Optional[Callable]) – Update task state, defaults to None

Return type:

tuple[TaskStatus, str]

Returns:

a result code and a unique_id or message.

Raises:

AssertionError – request_provider is not yet initialised.

property pending_data_requests: bool | None

Check for pending data requests.

Returns:

whether there are pending send data requests

ping()

Check we can communicate with TPM.

Return type:

None

poll(poll_request)

Poll request for TileComponentManager.

Execute a command or read some values.

Parameters:

poll_request (TileRequest | TileLRCRequest) – specification of the actions to be taken in this poll.

Return type:

TileResponse

Returns:

responses to queries in this poll

poll_failed(exception)

Handle a failed poll.

This is a hook called by the poller when an exception was raised.

NOTE: This implementation may be a bit simplistic as of MCCS-1507. The exception code can be used to give more information to user. And potentially inform the poll prioritisation.

Parameters:

exception (Exception) – exception code raised from poll.

Return type:

None

poll_succeeded(poll_response)

Handle the receipt of new polling values.

This is a hook called by the poller when values have been read during a poll.

Parameters:

poll_response (TileResponse) – response to the pool, including any values read.

Return type:

None

polling_started()

Initialise the request provider and start connecting.

Return type:

None

polling_stopped()

Uninitialise the request provider and set state UNKNOWN.

Return type:

None

property pps_delay: int | None

Return the pps delay from the TPM.

Returns:

the pps_delay from the TPM.

property pps_present: bool

Check if PPS signal is present.

Returns:

True if PPS is present. Checked in poll loop, cached

read_address(address, nvalues)

Return a list of values from a given address.

Parameters:
  • address (int) – address of start of read

  • nvalues (int) – number of values to read

Return type:

list[int]

Returns:

values at the address

read_all_live_calibration_coefficients()

Read all live calibration coefficients from the TPM.

Return type:

list[list[list[complex]]]

Returns:

Calibration coefficient array

read_all_staged_calibration_coefficients()

Read all staged calibration coefficients from the TPM.

Return type:

list[list[list[complex]]]

Returns:

Calibration coefficient array

read_broadband_rfi(antennas)

Read the broadband RFI levels for a list of antennas.

Parameters:

antennas (range | list[int]) – list of antennas to read broadband RFI levels

Return type:

ndarray

Returns:

broadband RFI levels for the specified antennas

read_firmware_thresholds()

Read all thresholds from firmware and save in cache.

Return type:

FirmwareThresholds

Returns:

the firmwareThesholds.

read_register(register_name)

Read the values in a named register.

Parameters:

register_name (str) – name of the register

Return type:

list[int]

Returns:

values read from the register

Raises:

ValueError – if the tpm is value None.

reevaluate_tpm_status()

Reevaluate the TpmStatus.

NOTE: This method should not be needed. But can be used as a sanity check on the TileProgrammingState

Return type:

bool

Returns:

True is the re-evaluated TpmStatus differs from the automated evaluation.

property register_list: list[str]

Return a list of registers available on each device.

Returns:

list of registers

Raises:

ValueError – if the tpm is value None.

property rfi_blanking_enabled_antennas: list[int]

Return the list of antennas with RFI blanking enabled.

Returns:

list of antennas with RFI blanking enabled

property running_beams: list[bool]

List hardware beams currently running.

Returns:

list of hardware beam running states

send_data_samples(data_type='', start_time=None, seconds=0.2, n_samples=1024, sync=False, first_channel=0, last_channel=511, channel_id=128, frequency=100.0, round_bits=3, **params)

Front end for send_xxx_data methods.

Parameters:
  • data_type (str) – sample type. “raw”, “channel”, “channel_continuous”, “narrowband”, “beam”

  • start_time (Optional[str]) – UTC Time for start sending data. Default start now

  • seconds (float) – Delay if timestamp is not specified. Default 0.2 seconds

  • n_samples (int) – number of samples to send per packet

  • sync (bool) – (raw) send synchronised antenna samples, vs. round robin

  • first_channel (int) – (channel) first channel to send, default 0

  • last_channel (int) – (channel) last channel to send, default 511

  • channel_id (int) – (channel_continuous) channel to send

  • frequency (float) – (narrowband) Sky frequency for band centre, in Hz

  • round_bits (int) – (narrowband) how many bits to round

  • params (Any) – any additional keyword arguments

Raises:

ValueError – error in time specification

Return type:

None

set_beamformer_regions(regions)

Set the frequency regions to be beamformed into a single beam.

The input list contains up to 48 blocks which represent at most 16 contiguous channel regions. Each block has 8 entries which represent: - starting physical channel - number of channels - hardware beam number - subarray ID - subarray logical channel - subarray beam ID - substation ID

Parameters:

regions (list[list[int]]) – a list encoding up to 48 regions

Raises:

ValueError – if the tpm is value None.

Return type:

tuple[list[ResultCode], list[str]]

Returns:

Result code and message

set_broadband_rfi_factor(factor)

Set the broadband RFI factor.

Parameters:

factor (float) – the broadband RFI factor

Return type:

None

set_csp_download(src_port, dst_ip_1, dst_ip_2, dst_port, is_last, netmask, gateway)

Set CSP Destination per tile.

Parameters:
  • src_port (int) – Source port

  • dst_ip_1 (str) – Destination IP FPGA1

  • dst_ip_2 (str) – Destination IP FPGA2

  • dst_port (int) – Destination port

  • is_last (bool) – True for last tile in beamforming chain

  • netmask (str) – Netmask

  • gateway (str) – Gateway IP

Return type:

tuple[list[ResultCode], list[str]]

Returns:

Result code and message for information.

set_current_warning_thresholds(current, min_thr, max_thr)

Set the current warning thresholds.

Parameters:
  • current (str) – The current type to set the thresholds for. Must be one of the keys in the current warning thresholds dictionary.

  • min_thr (float) – The minimum threshold value.

  • max_thr (float) – The maximum threshold value.

Return type:

Optional[dict[str, Any]]

Returns:

The set current thresholds if successful else None

set_lmc_download(mode, payload_length=1024, dst_ip='10.0.10.1', src_port=61648, dst_port=4660, netmask_40g=None, gateway_40g=None)

Specify whether control data will be transmitted over 1G or 40G networks.

Parameters:
  • mode (str) – “1G” or “10G”

  • payload_length (int) – SPEAD payload length for integrated channel data, defaults to 1024

  • dst_ip (str) – destination IP, defaults to “10.0.10.1”

  • src_port (Optional[int]) – sourced port, defaults to 0xF0D0

  • dst_port (Optional[int]) – destination port, defaults to 4660

  • netmask_40g (Optional[str]) – netmask of the 40g subnet

  • gateway_40g (Optional[str]) – IP address of the 40g subnet gateway, if it exists.

Return type:

tuple[list[ResultCode], list[str]]

Returns:

Result code and message

set_lmc_integrated_download(mode, channel_payload_length, beam_payload_length, dst_ip='10.0.10.1', src_port=61648, dst_port=4660, netmask_40g=None, gateway_40g=None)

Configure link and size of control data.

Parameters:
  • mode (str) – ‘1G’ or ‘10G’

  • channel_payload_length (int) – SPEAD payload length for integrated channel data

  • beam_payload_length (int) – SPEAD payload length for integrated beam data

  • dst_ip (str) – Destination IP, defaults to “10.0.10.1”

  • src_port (int) – source port, defaults to 0xF0D0

  • dst_port (int) – destination port, defaults to 4660

  • netmask_40g (Optional[str]) – netmask of the 40g subnet

  • gateway_40g (Optional[str]) – IP address of the 40g subnet gateway, if it exists.

Return type:

None

set_phase_terminal_count(value)

Set the phase terminal count.

Parameters:

value (int) – the phase terminal count

Return type:

None

set_pps_delay_correction(correction)

Set the ppsDelay correction.

Parameters:

correction (int) – the correction to set

Return type:

None

set_preadu_levels(levels)

Set preadu levels in dB.

Parameters:

levels (ndarray) – Preadu attenuation levels in dB

Raises:
  • ValueError – When attempting to set preaduLevels with a list of length not equal to 32 (i.e 32 ADC channels).

  • HardwareVerificationError – When the readback from hardware is unexpected.

Return type:

None

set_static_delays(delays)

Set the static delays.

Parameters:

delays (list[float]) – Static zenith delays, one per input channel, in nanoseconds, nominal = 0, positive delay adds delay to the signal stream

Return type:

None

set_station_id(value)

Set Station ID.

Parameters:

value (int) – assigned station Id value

Return type:

None

set_tile_id(value)

Set Tile ID.

Parameters:

value (int) – assigned tile Id value

Return type:

None

set_tpm_temperature_thresholds(max_board_alarm_threshold=None, max_fpga1_alarm_threshold=None, max_fpga2_alarm_threshold=None)

Set the temperature thresholds.

NOTE: Warning this method can configure the shutdown temperature of components and must be used with care. This method is capped to a maximum of 50 (unit: Degree Celsius). And is ONLY supported in tpm1_6.

Parameters:
  • max_board_alarm_threshold (Optional[float]) – The maximum alarm thresholds for the board (unit: Degree Celsius)

  • max_fpga1_alarm_threshold (Optional[float]) – The maximum alarm thresholds for the fpga1 (unit: Degree Celsius)

  • max_fpga2_alarm_threshold (Optional[float]) – The maximum alarm thresholds for the fpga2 (unit: Degree Celsius)

Return type:

dict[str, Any]

Returns:

The set temperature thresholds if successful else None

set_voltage_warning_thresholds(voltage, min_thr, max_thr)

Set the voltage warning thresholds.

Parameters:
  • voltage (str) – The voltage type to set the thresholds for. Must be one of the keys in the voltage warning thresholds dictionary.

  • min_thr (float) – The minimum threshold value.

  • max_thr (float) – The maximum threshold value.

Return type:

Optional[dict[str, Any]]

Returns:

The set voltage thresholds if successful else None

start_acquisition(task_callback=None, start_time=None, delay=2, global_reference_time=None)

Submit the start_acquisition slow task.

Parameters:
  • task_callback (Optional[Callable]) – Update task state, defaults to None

  • start_time (Optional[str]) – the acquisition start time

  • delay (int) – a delay to the acquisition start

  • global_reference_time (Optional[str]) – the start time assumed for starting the timestamp

Return type:

tuple[list[ResultCode], list[str]]

Returns:

A tuple containing a result code and a unique id string to identify the command

start_adcs()

Start the ADCs.

Return type:

None

start_beamformer(task_callback=None, start_time=None, duration=-1, channel_groups=None, scan_id=0)

Start beamforming on a specific subset of the beamformed channels.

Current firmware version does not support channel mask and scan ID, these are ignored

Parameters:
  • task_callback (Optional[Callable]) – Update task state, defaults to None

  • start_time (Optional[str]) – Start time as ISO formatted time

  • duration (int) – Scan duration, in frames, default “forever”

  • channel_groups (Optional[list[int]]) – Channel groups to be started Command affects only beamformed channels for given groups Default: all channels

  • scan_id (int) – ID of the scan to be started. Default 0

Raises:

ValueError – invalid time specified

Return type:

tuple[list[ResultCode], list[str]]

Returns:

A tuple containing a task status and a unique id string to identify the command

start_pattern_generator(stage)

Start the pattern generator.

Parameters:

stage (str) – The stage in the signal chain where the pattern was injected. Options are: ‘jesd’ (output of ADCs), ‘channel’ (output of channelizer), or ‘beamf’ (output of tile beamformer) or ‘all’ for all stages.

Return type:

None

stop_adcs()

Stop the ADCs.

Return type:

None

stop_beamformer(task_callback=None, channel_groups=None)

Stop the beamformer.

Parameters:
  • task_callback (Optional[Callable]) – Update task state, defaults to None

  • channel_groups (Optional[list[int]]) – Channel groups to be started Command affects only beamformed channels for given groups Default: all channels

Return type:

tuple[list[ResultCode], list[str]]

Returns:

A tuple containing a result code and a unique id string to

stop_data_transmission()

Stop data transmission for send_channelised_data_continuous.

Return type:

tuple[list[ResultCode], list[str]]

Returns:

Result code and message

stop_integrated_data()

Stop the integrated data.

Return type:

tuple[list[ResultCode], list[str]]

Returns:

Result code and message

stop_pattern_generator(stage)

Stop the pattern generator.

Parameters:

stage (str) – The stage in the signal chain where the pattern was injected. Options are: ‘jesd’ (output of ADCs), ‘channel’ (output of channelizer), or ‘beamf’ (output of tile beamformer) or ‘all’ for all stages.

Return type:

None

property sysref_present: NoReturn

Check if SYSREF signal is present.

Raises:

NotImplementedError – not implemented in ska-low-sps-tpm-api.

property test_generator_active: bool

Check if the test generator is active.

Returns:

whether the test generator is active

test_generator_input_select(inputs=0)

Specify ADC inputs which are substitute to test signal.

Specified using a 32 bit mask, with LSB for ADC input 0.

Parameters:

inputs (int) – Bit mask of inputs using test signal

Return type:

None

tile_info()

Return information about the tile.

Return type:

dict[str, Any]

Returns:

information relevant to tile.

property tpm_status: TpmStatus

Return the TPM status.

Returns:

the TPM status

update_fault_state(poll_success, exception_code=None)

Update fault state.

This method will evaluate if the current state if faulty. Depending on the previous fault state we will update the fault_state to allow navigation of the Opstate machine

NOTE: As evaluation becomes more complex we may want to refactor this method into a class. Currently this is a very simple evaluation, only checking for an inconsistent state.

Parameters:
  • poll_success (bool) – a bool representing if the poll was a success

  • exception_code (Optional[Any]) – the exception code raised in last poll.

Return type:

None

property voltage_mon: float

Return the internal 5V supply of the TPM.

Returns:

the internal 5V supply of the TPM

write_address(address, values)

Write a list of values to a given address.

Parameters:
  • address (int) – address of start of read

  • values (list[int]) – values to write

Return type:

tuple[list[ResultCode], list[str]]

Returns:

Result code and message

write_register(register_name, values)

Read the values in a register.

Parameters:
  • register_name (str) – name of the register

  • values (list[Any] | int) – values to write

Raises:

ValueError – if the tpm is value None.

Return type:

tuple[list[ResultCode], list[str]]

Returns:

Result code and message