Public Interfaces
Module init code.
- class ska_low_cbf_fpga.ArgsAmi(logger=None, mem_config='', **kwargs)[source]
FPGA driver that wraps
ami_tool
.
- class ska_low_cbf_fpga.ArgsFieldInfo(description=None, address=None, length=1, bit_offset=None, width=None)[source]
- class ska_low_cbf_fpga.ArgsFpgaDriver(logger=None, mem_config='', **kwargs)[source]
Base class for ARGS FPGA Drivers.
Extends interface class with startup steps common to all ARGS FPGAs.
- class ska_low_cbf_fpga.ArgsSimulator(logger=None, mem_config='', **kwargs)[source]
FPGA Simulation driver.
- read(source, length=1)[source]
Read values from simulated FPGA register space
- Parameters:
source – Byte address to start reading from
length (
int
) – Number of words to read
- Returns:
value(s) from simulated registers
- read_memory(index, size_bytes=None, offset_bytes=0)[source]
Read a shared memory buffer.
- Parameters:
- Return type:
ndarray
- Returns:
shared memory buffer
- write(destination, values)[source]
Write values to simulated FPGA registers
- Parameters:
destination – FPGA byte address where writes should start
values – value(s) to write, if more than one value they must be words, to be written to consecutive words (i.e. byte addresses increment by WORD_SIZE)
- class ska_low_cbf_fpga.ArgsXrt(logger=None, mem_config='', **kwargs)[source]
pyxrt-based FPGA Driver. Requires a .xclbin file.
- MINUS_ONE_16BIT = 65535
-1 as a 16 bit signed integer (0xFFFF)
- read_memory(index, size_bytes=None, offset_bytes=0)[source]
Read a shared memory buffer.
- Parameters:
- Return type:
ndarray
- Returns:
shared memory buffer
- class ska_low_cbf_fpga.FpgaHardwareInfo(device=None)[source]
Hardware monitoring interface definition.
- class ska_low_cbf_fpga.FpgaPersonality(driver, map_, hardware_info=None, logger=None)[source]
- property default_interface: ArgsFpgaDriver
Temporary backwards-compatibility layer
- property driver: ArgsFpgaDriver
Access to underlying ArgsFpgaDriver
- class ska_low_cbf_fpga.FpgaUserInterface[source]
A common interface used by
FpgaPeripheral
andFpgaPersonality
for exposing attributes and methods to the control system.
- class ska_low_cbf_fpga.IclField(description=None, address=None, length=1, bit_offset=None, width=None, type_=~T, format='%i', user_write=True, user_error=False, value=None)[source]
ICL field, probably derived from one or more
IclFpgaField
s
- class ska_low_cbf_fpga.IclFpgaField(description=None, address=None, length=1, bit_offset=None, width=None, type_=<class 'ska_low_cbf_fpga.args_fpga.ArgsWordType'>, format='%i', user_write=True, user_error=False, value=<property object>, driver=None)[source]
An ICL field that is linked to an
ArgsFpgaDriver
.- type_
alias of
ArgsWordType
- class ska_low_cbf_fpga.XrtInfo(device)[source]
Hardware info monitoring via pyxrt xrt_info_device.
Access via item index, e.g.
my_xrt_info["thermal"]
. Some flattening of data structures is performed.
- ska_low_cbf_fpga.create_driver_map_info(logger=None, mem_config='', fpgamap_path=None, xcl_file=None, firmware_path=None, device='0', simulate=None)[source]
Create
ArgsFpgaDriver
,ArgsMap
,FpgaHardwareInfo
Will use real FPGA hardware if present, unless simulate is explicitly set to True. If simulate is
True
or no FPGA is present,fpgamap_path
must be provided forArgsSimulator
to use.- Parameters:
logger (
Optional
[Logger
]) – Logger object to pass along for log outputsmem_config (
Union
[list
,str
]) – FPGA memory access configurationfpgamap_path (
Optional
[str
]) – Path tofpgamap_<numbers>.py
file to be usedxcl_file (
Optional
[str
]) – Deprecated, usefirmware_path
instead (equivalent)firmware_path (
Optional
[str
]) – path to a .pdi FPGA image (for AMI FPGA cards), or .xclbin FPGA kernel (for XRT FPGA cards)device (
str
) – PCIe Board:Device.Function addresssimulate (
Optional
[bool
]) – if True, simulate FPGA register/memory access
- Return type:
(
ArgsFpgaDriver
,Optional
[ArgsMap
],Optional
[FpgaHardwareInfo
])- Returns:
(driver, map, info)
driver
is only created when either:fpgamap_path is supplied or
an FPGA is present, either xcl_file or pdi_file is supplied, and simulate is False.
To guarantee creation of driver, supply both fpgamap_path and a firmware file!
map
is only created when an fpgamap is present (either explicitly specified or implicitly in the xclbin’s directory). If no fpgamap, the return value of map will beNone
.info
is only created if XRT FPGA hardware is present. If no XRT FPGA, the return value of info will beNone
.simulate
has no effect here, if info is not None then it is real hardware info.- Raises:
ValueError – if both types of firmware are given
RuntimeError – if supplied firmware not suitable for detected FPGA (AMI and XRT are mutually exclusive)
- ska_low_cbf_fpga.log_to_file(logger, filename, level=10, hex_vals=False)[source]
Add a file handler to a logger, with our predefined log format, and configure numpy to ensure full arrays are printed on a single line. Warning: numpy print options are a global setting!
- ska_low_cbf_fpga.mem_parse(memory_config='')[source]
Convert a string-formatted list of memory configurations to a list of MemConfigs.
The register interchange buffer is automatically included as the first element. Do not list the register buffer in the input string!