cnic_fpga module

CNIC FPGA Firmware ICL (Instrument Control Layer)

class cnic_fpga.CnicFpga(*args: Any, **kwargs: Any)[source]

Bases: FpgaPersonality

__init__(driver, map_: ska_low_cbf_fpga.ArgsMap, hardware_info: ska_low_cbf_fpga.FpgaHardwareInfo | None = None, logger: Logger | None = None, ptp_domain: int = 24, ptp_source_b: bool = False, firmware_version_check: bool = True, **kwargs) None[source]

CNIC FPGA Personality ICL Class

Parameters:
  • driver – see FpgaPersonality

  • map – see FpgaPersonality

  • logger – see FpgaPersonality

  • ptp_domain – PTP domain number

  • ptp_source_b – Use PTP source B? (Note: only present for some firmware versions / FPGA cards)

  • firmware_version_check – Enforce firmware version restriction?

begin_transmit(start_time: str | None = None, stop_time: str | None = None) None[source]

Begin Transmission (either now or later)

Parameters:
  • start_time – optional time to begin transmission at (start now if not otherwise specified)

  • stop_time – optional time to end transmission at

configure_from_yaml(yamlstr: str) None[source]

Configure data generator using a YAML string. In case of too many sources (>8192) send the spill over to the 2nd peripheral vd_datagen_2

configure_vd(stream_configs: List[StreamConfig], sps_packet_version: int = 2, spead_epoch: int = 0, spead_timestamp_10ns: int = 0, ska_time: float = 0, max_bursts: int | None = None) None[source]

Configure the VD - SPEAD packetiser & Data Generator.

Parameters:
  • stream_configs – All the VD Stream configs to apply

  • sps_packet_version – SPS packet version; currently: 2, 3

  • spead_epoch – UNIX timestamp used as SPEAD epoch (SPS SPEAD v1, v2)

  • spead_timestamp_10ns – Tens of nanoseconds after epoch (SPS SPEAD v1, v2)

  • ska_time – Time since SKA epoch - seconds since 2000 (SPS SPEAD v3)

  • max_bursts – Maximum output bursts (defaults to infinite)

property enable_vd: ska_low_cbf_fpga.IclField.<class 'bool'>

Is Virtual Digitiser enabled?

property finished_receive: ska_low_cbf_fpga.IclField.<class 'bool'>

Have we finished receiving, including writing to disk?

property finished_transmit: ska_low_cbf_fpga.IclField.<class 'bool'>

Have we finished transmitting?

prepare_transmit(in_filename: str, n_loops: int = 1, burst_size: int = 1, burst_gap: int | None = None, rate: float = 100.0, n_packets: int = 0) None[source]

Prepare for transmission

Parameters:
  • in_filename (str) – input PCAP(NG) file path

  • n_loops (int) – number of loops

  • burst_size (int) – packets per burst

  • burst_gap – packet burst period (ns), overrides rate

  • rate (float) – transmission rate (Gigabits per sec), ignored if burst_gap given

  • n_packets – Number of packets to transmit, if 0 then send all in the file

property ready_to_transmit: ska_low_cbf_fpga.IclField.<class 'bool'>

Can we transmit? i.e. Is our PCAP file loaded?

receive_pcap(out_filename: str, packet_size: int, n_packets: int = 0, start_time: str | None = None, stop_time: str | None = None) None[source]

Receive packets into a PCAP file

Parameters:
  • out_filename – File path to write to

  • packet_size – only packets of this exact size are captured (bytes)

  • n_packets – number of packets to receive

  • start_time – optional time to begin reception at

  • stop_time – optional time to end reception at

reset()[source]

Reset Receive, Transmit, Virtual Digitiser, PTP, and turn Duplex off.

stop_receive() None[source]

Abort a ‘receive_pcap’ that’s still waiting. (e.g. if we set the wrong number of packets to wait for it may never finish automatically)

transmit_pcap(in_filename: str, n_loops: int = 1, burst_size: int = 1, burst_gap: int | None = None, rate: float = 100.0, start_time: str | None = None, stop_time: str | None = None, n_packets: int = 0) None[source]

Transmit packets from a PCAP file

Parameters:
  • in_filename (str) – input PCAP(NG) file path

  • n_loops (int) – number of loops (default 1)

  • burst_size (int) – packets per burst (default 1)

  • burst_gap (int) – packet burst period (ns), overrides rate

  • rate (float) – transmission rate (Gigabits per sec), ignored if burst_gap given (default 100.0)

  • start_time – optional time to begin transmission at (start now if not otherwise specified)

  • stop_time – optional time to end transmission at

  • n_packets – Number of packets to transmit, defaults to all

cnic_fpga.LOAD_SLEEP_TIME = 5

wait this many seconds between checking if Load is finished

cnic_fpga.RX_SLEEP_TIME = 5

wait this many seconds between checking if Rx is finished