TpmFortyGCoreXg
Overview
This plugin is responsible for managing the TPM FPGA firmware 40 gigabit ethernet.
Python Class & Methods Index
- class ska_low_sps_tpm_api.plugins.forty_g_xg_core.TpmFortyGCoreXg(board, logger=None, **kwargs)[source]
TpmFortyGCoreXg plugin
- __init__(board, logger=None, **kwargs)[source]
TpmFortyGCoreXg initialiser.
- Parameters:
board – Pointer to board instance
- check_errors()[source]
Check FortyGCore for errors.
- Returns:
True if errors detected, else False
- Return type:
bool
- check_linkup_loss_cnt(show_result=True)[source]
Get linkup loss count. Increments by 1 each time the linkup is lost.
- Returns:
number of linkup lost events
- Return type:
int
- get_arp_table_status(idx, silent_mode=True)[source]
Returns contents of ARP table status register and resolved MAC address.
Optionally prints the ARP table status register in a human-readable form the log when
silent_mode=False.Example console output when
silent_mode=False:valid: 1 renewing: 0 mac_resolved: 1 mac: 0xbc8d1fab0fdf
- Parameters:
idx (int) – ARP table index
silent_mode (bool) – enable or disable logging of result
- Returns:
ARP table status
- Return type:
tuple(int, int) of status register value and MAC address
- get_bip_error_count()[source]
Get RX Bit Interleaved Partity error count.
- Returns:
number of BIP errors
- Return type:
int
- get_crc_error_count()[source]
Get RX Cyclic Redundancy Check error count.
- Returns:
number of CRC errors
- Return type:
int
- get_decode_error_count()[source]
Get RX Decode error count.
- Returns:
number of decode errors
- Return type:
int
- get_dst_ip(slot=0)[source]
Get destination IP address.
- Parameters:
slot (int) – entry in the tx config table
- Returns:
IP address
- Return type:
str
- get_dst_port(slot=0)[source]
Get destination UDP port.
- Parameters:
slot (int) – entry in the tx config table
- Returns:
UDP port
- Return type:
int
- get_number_of_arp_table_entries()[source]
Get maximum number of ARP table entries supported by firmware.
- Returns:
number of ARP table entries
- Return type:
int
- get_packet_counter()[source]
Get status of packet counters.
- Returns:
dictionary of packets received, forwarded and transmitted
- Return type:
dict of int
- get_src_port(slot=0)[source]
Get source UDP port.
- Parameters:
slot (int) – entry in the tx config table
- Returns:
UDP port
- Return type:
int
- is_link_up()[source]
Return link status. True if link is up, else False.
- Returns:
Link is up
- Return type:
bool
- is_tx_disabled()[source]
Check if FortyGCore TX is globally disabled.
- Returns:
True if TX disabled, else False
- Return type:
bool
- renew_arp_table()[source]
Renew ARP table. This will be called after netmask or gateway are written to the registers, if there are entries that forward packets to the gateway.
TODO: Not sure this actually does anything?
- reset_core(timeout=10)[source]
Resets the FortyGCore and attempts to establish link up.
- Parameters:
timeout (int) – Timeout for link up (seconds)
- Returns:
Link is up (True if link is up, else False)
- Return type:
bool
- reset_errors()[source]
Reset the following error counters:
RX Cyclic Redundancy Check (CRC) error count
RX Bit Interleaved Partity (BIP) error count
RX Decode error count
Linkup loss count
- set_dst_ip(ip, slot=0)[source]
Set source IP address.
- Parameters:
ip (int | str) – IP address
slot (int) – entry in the tx config table
- Raises:
PluginError – if configuration fails
- set_dst_port(port, slot=0)[source]
Set destination UDP port.
- Parameters:
port (int) – UDP port
slot (int) – entry in the tx config table
- set_gateway_ip(gateway=0)[source]
Set gateway.
- Parameters:
gateway (int | str) – Gateway IP address
- Raises:
PluginError – if configuration fails
- set_netmask(netmask='255.0.0.0')[source]
Set netmask.
- Parameters:
netmask (int | str) – Netmask
- Raises:
PluginError – if configuration fails
- set_rx_port_filter(port, slot)[source]
Configure RX Port filter. This configures which UDP ports are filtered to which TID in the firmware.
For example: port 4662, slot 1. This would filter packets received on UDP port 4662 to
axi4s.tid1.- Parameters:
port (int) – UDP port
slot (int) – entry in the rx config table
- set_src_ip(ip)[source]
Set source IP address.
- Parameters:
ip (int | str) – IP address
- Raises:
PluginError – if configuration fails
- set_src_port(port, slot=0)[source]
Set source UDP port.
- Parameters:
port (int) – UDP port
slot (int) – entry in the tx config table
- test_start_rx(single_packet_mode=False)[source]
Starts RX for the 40G embedded test.
- Parameters:
single_packet_mode (bool) – Only transmit a single packet
- test_start_tx(dst_ip=None, ipg=4, packet_len=8192)[source]
Starts TX for the 40G embedded test.
- Parameters:
dst_ip (int | str) – Destination IP address
ipg (int) – Inter packet gap
packet_len (int) – UDP packet length
- Returns:
Test start pass (0) or fail (1)
- Return type:
int
- turn_off_qsfp_led()[source]
Turn OFF QSFP LED. Used for software driven QSFP module insertion detection LED.