Boards

Although PyFABIL supported other FPGA boards such as the UniBoard, ROACH and TPM 1.2, currently the TPM (TPM >= v1.5) is the only board supported by this repository and used in the SKA-Low telescope.

FPGABoard

This describes a base class for a software representation of an FPGA board which manages plugin loading, memory map interface and protocol interface. All other board classes implement board-specific functionality by adding or overriding FPGA Board functions, using FPGA board as a parent class.

class ska_low_sps_tpm_api.boards.fpgaboard.FPGABoard(logger=None, **kwargs)[source]

Class which wraps LMC functionality for generic FPGA boards

__init__(logger=None, **kwargs)[source]

Class constructor for FPGABoard

add_plugin_directory(path)[source]

Load additional plugins from an external directory.

Parameters:

path – Directory where plugins are available

connect(ip, port, **kwargs)[source]

Connect to board.

Parameters:
  • ip – Board IP

  • port – Port to connect to

  • kwargs – Additional parameters if required

disconnect()[source]

Disconnect from board

download_firmware(device, bitfile)[source]

Download firmware onto the FPGA (or FLASH).

Parameters:

device – Device to download firmware to

find_device(string, display=False)[source]

Return SPI device information for provided search string.

Parameters:
  • string – Regular expression to search against

  • display – True to output result to console

Returns:

List of found devices

find_register(string, display=False, info=False)[source]

Return register information for provided search string.

Parameters:
  • string – Regular expression to search against

  • display – True to output result to console

Returns:

List of found registers

get_available_plugins()[source]

Get list of available plugins.

Returns:

List of plugins

get_firmware_list(device=Device.Board)[source]

Get list of firmware on board.

Parameters:

device – Device on board to get list of firmware

Returns:

List of firmware

get_loaded_plugins()[source]

Get the list of loaded plugins with associated methods.

Returns:

List of loaded plugins

get_register_list(reset=False, load_values=False)[source]

Get list of registers.

Parameters:
  • reset – Force reload register list

  • load_values – Load register values

get_status()[source]

Get board status.

Returns:

Status

has_register(register)[source]

Check if board has specified register.

Parameters:

register – Register name

Returns:

True if register exists in memory map

initialise(config)[source]

Method for explicit initialisation. This is called by instrument when a configuration file is provided.

Parameters:

config – Configuration dictionary

is_connected()[source]

Check if board is connected

is_programmed()[source]

Returns True if Board is programmed

list_device_names()[source]

Print list of SPI device names

list_register_names()[source]

Print list of register names

load_firmware(device, register_string=None, load_values=False, base_address=0)[source]

Blocking call to load firmware.

Parameters:
  • base_address – base address at which to load firmware

  • device – Device on board to load firmware to

  • register_string – String containing register information

  • load_values – Load register values

load_plugin(plugin, **kwargs)[source]

Loads a firmware block plugin and incorporates its functionality.

Parameters:

plugin – Plugin class name

load_spi_devices(xml_string)[source]

Load SPI devices.

Parameters:

xml_string – XML string containing SPI device information

log(string)[source]

Format string for logging output.

Parameters:

string – String to log

Returns:

Formatted string

read_address(address, n=1)[source]

” Get register value.

Parameters:
  • address – Memory address to read from

  • n – Number of words to read

Returns:

Values

read_device(device, address, unlock=True)[source]

Get device value.

Parameters:
  • device – SPI Device to read from

  • address – Address on device to read from

Returns:

Value

read_register(register, n=1, offset=0)[source]

” Get register value.

Parameters:
  • register – Register name

  • n – Number of words to read

  • offset – Memory address offset to read from

Returns:

Values

reset(device)[source]

Reset device on board.

Parameters:

device – Device on board to reset

status_check()[source]

Perform board and firmware status checks :return: Status

unload_all_plugins()[source]

Unload all plugins from instance

unload_plugin(plugin, instance=None)[source]

Unload plugin from instance.

Parameters:
  • plugin – Plugin name

  • instance – Unload a specific plugin instance

write_address(address, values, retry=True)[source]

Set register value.

Parameters:
  • address – Memory address to write to

  • values – Values to write

write_device(device, address, value, unlock=False)[source]

Set device value.

Parameters:
  • device – SPI device to write to

  • address – Address on device to write to

  • value – Value to write

write_register(register, values, offset=0, retry=True)[source]

Set register value.

Parameters:
  • register – Register name

  • values – Values to write

  • offset – Memory address offset to write to

TPMGeneric

This describes a generic TPM class which is solely used to determine the version of the TPM at connection. This allows an exception to be raised if the library is used with unsupported TPM hardware (TPM < v1.5). Probably this could be refactored and merged with the TPM board description.

class ska_low_sps_tpm_api.boards.tpm_generic.TPMGeneric(**kwargs)[source]

FPGABoard subclass for communicating with a TPM board

__init__(**kwargs)[source]

Class constructor

get_tpm_version(ip, port, **kwargs)[source]

Overload connect method.

Parameters:
  • fsample – Sampling rate

  • ip – IP address to connect to

  • port – Port to connect to

TPM

This provides a software representation of the Tile Processing Module. This provides board level methods which do not fall under the remit of Plugins.

class ska_low_sps_tpm_api.boards.tpm.TPM(**kwargs)[source]

FPGABoard subclass for communicating with a TPM board

__init__(**kwargs)[source]

Class constructor

calibrate_fpga_to_cpld()[source]

Calibrate communication between FPGAs and CPLD

check_ad9550_pll_status()[source]

Status of TPM AD9550 PLLs chip for 40GbE if.

This method returns lock status True if both AD9550 PLLs are locked. The lock loss counter increments for a loss of lock event on either PLL.

Returns:

current lock status and lock loss counter value

Return type:

tuple

clear_ad9550_pll_status()[source]

Resets the value in the AD9550 PLLs lock loss counter to 0.

clear_global_status_alarms()[source]

Clear global status alarm flags

connect(ip, port, fsample=800000000.0, ddc=False, fddc=0.0, adc_clock_divider=1, mono_channel_14_bit=False, mono_channel_sel=0, adc_low_bitrate=False, fullscale_voltage=1.59, **kwargs)[source]

Overload connect method.

Parameters:
  • fsample – Sampling rate

  • ip – IP address to connect to

  • port – Port to connect to

download_firmware(device, bitfile)[source]

Download bitfile to FPGA.

Parameters:
  • device – FPGA to download bitfile

  • bitfile – Bitfile to download

erase_fpga(force=True)[source]

Erase FPGAs configuration memory

get_adc_temperature(adc_id=None)[source]

Get ADC temperature diode via FPGA sysmon.

Parameters:

adc_id – range 0-15 or None

Returns:

List of ADC temperatures if adc_id=None, selected ADC temperature otherwise

get_bios()[source]
get_board_info()[source]
get_firmware_list(device=Device.Board)[source]

Get list of downloaded firmware on TPM FLASH.

Parameters:

device – This should always be the board for the TPM

Returns:

List of design name as well as version

get_global_status_alarms()[source]
get_hardware_revision()[source]
get_mac()[source]
get_part_number()[source]
get_serial_number()[source]
is_programmed(fpga_id=None)[source]

Returns True if Board is programmed

load_firmware(device, register_string=None, load_values=False, base_address=0)[source]

Override uperclass load_firmware to extract memory map from the bitfile.

Parameters:
  • base_address – base address at which to load firmware

  • device – Device on board to load firmware to

  • register_string – String containing register information

  • load_values – Load register values

load_plugins()[source]

load tpm plugins

set_c2c_calibration(enable=True)[source]
set_lmc_ip(ip='10.0.10.1', port=None, port2=None, port3=None, same_port=True)[source]

Set the IP address for LMC data transfer.

Parameters:
  • ip – IP address in string form

  • port – Port

  • port2 – Port for stream 1

  • port3 – Port for stream 2

  • same_port – Use the same port for all ports

set_qsfp_led(id, val)[source]
set_shutdown_temperature(temp)[source]
smap_deselect_fpga(fpga_list)[source]
smap_select_fpga(fpga_list)[source]
temperature()[source]

Get board temperature

voltage()[source]

Get board voltage