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
- 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
- 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_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
- 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
- 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
- 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
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.
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
- 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
- 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
- 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_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
- 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