virtual_digitiser module
Virtual Digitiser ICL (abstraction)
- virtual_digitiser.CONFIG_ROW_WORDS = 8
Word
v1
v2
v3 (proposed)
0
Frequency Hz low 32b
Scan ID
Scan ID low 32b
1
Beam ID
Beam ID
Beam ID
2
Frequency ID
Frequency ID
Frequency ID
3
Substation ID
Substation ID
Substation ID
4
Subarray ID
Subarray ID
Subarray ID
5
Station ID
Station ID
Station ID
6
Frequency Hz high 16b
[unused]
Scan ID high 16b
7
[unused]
[unused]
[unused]
- virtual_digitiser.MAX_BURST_ENABLE_BIT = 2147483648
Top bit of Max. Bursts register used as enable bit.
- virtual_digitiser.SPS_PACKET_PERIOD = 0.00221184
SPS packet period in seconds.
- class virtual_digitiser.SpeadVersion(value)[source]
Bases:
IntEnum
Supported SPEAD packet versions.
For details on packet contents, see CNIC firmware docs or SPS v3 ECP.
- v2 = 2
- v3 = 3
- class virtual_digitiser.VDChannelConfig(scan: int, beam: int, frequency: int, substation: int, subarray: int, station: int)[source]
Bases:
object
Virtual Digitiser Channel Configuration
- as_registers(spead_version: int = SpeadVersion.v2) numpy.ndarray [source]
Render as np array, ready to write to FPGA data RAM.
Note: for v2 SPS SPEAD format only.
- classmethod from_registers(registers: numpy.ndarray, spead_version: int = SpeadVersion.v2)[source]
Create a VDChannelConfig object from a row of config table registers.
Note: for v2 SPS SPEAD format only.
- Parameters:
registers – a slice of CONFIG_ROW_WORDS registers
- Returns:
VDChannelConfig object to match supplied registers
- class virtual_digitiser.VirtualDigitiser(*args: Any, **kwargs: Any)[source]
Bases:
FpgaPeripheral
- property configuration: ska_low_cbf_fpga.IclField.<class 'str'>
Get the current configuration (JSON).
- configure_channels(configs: Sequence[VDChannelConfig]) None [source]
Configure all the Virtual Digitiser channels you want to use
- Parameters:
configs – all the channel configurations
- configure_pulsar_mode(enable: bool, sample_count: tuple = ()) None [source]
Configure Virtual Digitiser pulsar mode. Write ‘count’ registers before enabling the mode.
- Parameters:
enable – enable/disable pulsar mode
sample_count – sample counts for start/on/off conditions, defaults to ()
- configure_time(ska_time: float = 0) None [source]
Configure time for SPS SPEAD protocol v3 headers.
- Parameters:
ska_time – SKA epoch based time - seconds since 2000
- configure_time_v2(epoch: int = 0, timestamp: int = 0) None [source]
Set time & packet count parameters for SPS SPEAD protocol v1/v2 headers.
- Parameters:
epoch – UNIX timestamp used as SPEAD epoch
timestamp – 10s of nanoseconds from epoch
- property configured_channels: ska_low_cbf_fpga.IclField.<class 'int'>
Number of configured SPEAD channels (1 means 1).
- property epoch: ska_low_cbf_fpga.IclField.<class 'str'>
- get_channel_config(n: int) VDChannelConfig [source]
Get one SPEAD channel’s configuration.
- Parameters:
n – zero-indexed channel number (row in data table)
- Raises:
RuntimeError – if not configured
- property last_used_datagen_buffer: ska_low_cbf_fpga.IclField.<class 'int'>
The last used (i.e. idle) Data Generator config buffer. The buffer is an internal interface between the DataGenerator and packetiser
- vd_buffer_gen_status is a 4-bit wide FPGA register
b0: last buffer written 0 b1: last buffer written 1 b2: buffer 0 generation in progress b3: buffer 1 generation in progress
- Returns:
-1 if neither has been used
- property max_bursts: ska_low_cbf_fpga.IclField.<class 'int'>
Output burst limit value.
- property max_bursts_enabled: ska_low_cbf_fpga.IclField.<class 'bool'>
Output burst limit active?
- property session_packets: ska_low_cbf_fpga.IclField.<class 'int'>
Get number of packets sent since VD last enabled.
- set_max_bursts(max_bursts: int | None) None [source]
Set the output burst limit.
- Parameters:
max_bursts – Maximum VD output bursts. Use
None
to run forever.
- property sps_packet_version: ska_low_cbf_fpga.IclField.<class 'int'>
SPS packet version in use (1 means v1).
- property sps_packets: ska_low_cbf_fpga.IclField.<class 'int'>
- property timestamp: ska_low_cbf_fpga.IclField.<class 'int'>