hbm_packet_controller module

HBM Packet Controller ICL (abstraction)

class hbm_packet_controller.HbmPacketController(*args: Any, **kwargs: Any)[source]

Bases: FpgaPeripheral

Class to represent an HbmPacketController FPGA Peripheral

__init__(*args, **kwargs) None[source]
configure_rx(packet_size: int, n_packets: int = 0) None[source]

Prepare for receiving packets

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

  • n_packets (int) – number of packets to receive

configure_tx(packet_size: int, n_packets: int, n_loops: int = 1, burst_size: int = 1, burst_gap: int | None = None, rate: float = 100.0) None[source]

Configure packet transmission parameters

Parameters:
  • packet_size (int) – packet size (Bytes), all packets assumed same size

  • n_packets (int) – number of packets to send

  • n_loops (int) – number of loops

  • burst_size (int) – packets per burst

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

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

dump_pcap(out_filename: str, packet_size: int)[source]

Dump a PCAP(NG) file to disk from HBM

Parameters:
  • out_filename (str) – file to save to

  • packet_size (int) – Number of Bytes used for each packet # TODO - remove

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

Is duplex mode active?

flush() None[source]

Flush internal FPGA Rx packet buffers into HBM. WARNING: After doing this, you won’t get any more packets until you run start_rx to configure a new receiving session.

property last_dumped_pcap: ska_low_cbf_fpga.IclField.<class 'str'>

Get our last dumped PCAP file name

load_pcap(in_filename: str) None[source]

Load a PCAP(NG) file from disk to FPGA.

Parameters:

in_filename (str) – path to input PCAP(NG) file

property loaded_pcap: ska_low_cbf_fpga.IclField.<class 'str'>

Get our last loaded PCAP file name

property loaded_pcap_packets: ska_low_cbf_fpga.IclField.<class 'int'>

Get our last loaded PCAP packet count.

property rx_packet_count: ska_low_cbf_fpga.IclField.<class 'int'>

Get 64-bit total Rx packet count

start_rx() None[source]

Begin receiving packets into FPGA memory. Call configure_rx first.

start_tx() None[source]

Start transmitting packets

property tx_packet_count: ska_low_cbf_fpga.IclField.<class 'int'>

Get 64-bit total Tx packet count

property tx_packets_to_mac: ska_low_cbf_fpga.IclField.<class 'int'>

Get 64-bit total Tx packets to MAC count

hbm_packet_controller.METADATA_SIZE

total bytes of metadata stored in HBM for each packet