spinnaker_tools 3.4.0
SpiNNaker API, sark, sc&mp, bmp firmware and build tools
|
P2P packet handling for SC&MP. More...
Data Structures | |
struct | rx_desc_t |
P2P channel state structure: receiver. More... | |
struct | tx_desc_t |
P2P channel state structure: transmitter. More... | |
Macros | |
#define | P2P_NUM_STR 8 |
Number of streams. | |
Enumerations | |
enum | p2p_tx_state { TX_IDLE = 0 , TX_OPEN_REQ = 1 , TX_OPEN = 2 , TX_RETRY = 3 , TX_CLOSE = 4 } |
Possible states in P2P protocol: transmitter side. | |
enum | p2p_rx_state { RX_IDLE = 0 , RX_OPEN = 1 , RX_CLOSE_REQ = 2 } |
Possible states in P2P protocol: receiver side. | |
enum | p2p_stats_indices { DATA_TO = 0 , ACK_TO = 1 , OPEN_TO = 2 , CLOSE_TO = 3 , P2P_SENDS = 4 , P2P_OPENS = 5 , P2P_BUSY1 = 6 , P2P_BUSY2 = 7 , P2P_REJECTS = 8 , TCOUNT = 9 , OPEN_DUP = 10 , TX_FAIL = 11 , OPEN_EVENT = 12 , P2P_OPEN_N = 16 } |
Indices into p2p_stats. More... | |
Functions | |
void | desc_init (void) |
initialise TX and RX descriptors | |
static void | p2p_send_data (uint data, uint addr) |
Send a P2P data packet. Delegates to pkt_tx() | |
static uint | p2p_send_ctl (uint ctrl, uint addr, uint data) |
Send a P2P control packet. Delegates to pkt_tx() | |
void | p2p_data_ack (uint data, uint srce) |
Received ACK from receiver. Cancel ack timeout and update tx_desc. | |
void | p2p_close_req (uint data, uint srce) |
Received CLOSE_REQ from receiver. | |
void | p2p_ack_timeout (uint txd, uint a2) |
Timed out waiting for data ACK from receiver. | |
void | p2p_open_timeout (uint a, uint b) |
Timeout handler during channel opening phase. | |
uint | p2p_send_msg (uint addr, sdp_msg_t *msg) |
Send an SDP message to another SCAMP instance. | |
void | p2p_data_timeout (uint rxd, uint a2) |
Timed out waiting for "seq_len" data packets. Send P2P_DATA_ACK with current mask and restart timeout. | |
void | p2p_open_ack (uint data, uint srce) |
Received OPEN_ACK packet. | |
void | p2p_open_req (uint data, uint addr) |
Another SCAMP has asked for an open channel. | |
void | p2p_close_timeout (uint rxd, uint rid) |
Timed out waiting for CLOSE_ACK. Repeat P2P_CLOSE_REQ a few times then give up. | |
void | p2p_close_ack (uint data, uint srce) |
Received an acknowledge that a channel has been closed. | |
void | p2p_rcv_data (uint data, uint addr) |
Receive data on channel. | |
uint | p2p_send_ping (uint addr, uint link) |
void | p2p_ping (uint data, uint addr) |
void | p2p_req_count (uint addr, uint app_id, uint state) |
uint | n_cores_in_state (uint app_id, uint state) |
void | p2p_count (uint data, uint addr) |
void | p2p_count_resp (uint data, uint addr) |
void | p2p_rcv_ctrl (uint data, uint addr) |
Received P2P control packet. | |
Variables | |
tx_desc_t | tx_desc |
Transmitter state descriptor. Transmission is a foreground task. | |
rx_desc_t | rx_desc_table [P2P_NUM_STR] |
Receiver state descriptors. Reception is a background task. | |
uint | p2p_stats [32] |
Peer-to-peer statistics table. | |
const uint | open_req_retry = 16 |
Number of retries for an open request. | |
const uint | open_ack_retry = 4 |
Number of retries for an open acknowledge. | |
const uint | data_ack_retry = 4 |
Number of retries for a data acknowledge. | |
const uint | close_req_retry = 4 |
Number of retries for a close request. | |
const uint | open_ack_time = 250 |
Timeout on open acknowledge, in μs. | |
const uint | data_ack_time = 3000 |
Timeout on data acknowledge, in μs. | |
const uint | data_time = 500 |
Timeout on data, in μs. | |
const uint | close_ack_time = 250 |
Timeout on close acknowledge, in μs. | |
volatile uint | pp_ping_count [NUM_LINKS] |
Reserved for performing P2P pings. | |
volatile uint | p2p_count_result |
Reserved for performing a P2P count operation. | |
volatile uint | p2p_count_n_results |
uint | p2p_count_id |
P2P packet handling for SC&MP.
struct rx_desc_t |
struct tx_desc_t |
enum p2p_stats_indices |
Indices into p2p_stats.
Send a P2P data packet. Delegates to pkt_tx()
[in] | data | Payload of the message |
[in] | addr | Where to send to |
Send a P2P control packet. Delegates to pkt_tx()
[in] | ctrl | What message to send |
[in] | addr | Where to send to |
[in] | data | Payload of the message |
Received ACK from receiver. Cancel ack timeout and update tx_desc.
[in] | data | The payload from the packet |
[in] | srce | The sender address (lower 16 bits) from the packet |
Received CLOSE_REQ from receiver.
If TX_OPEN then tidy up tx_desc. In any case, send a CLOSE_ACK back to receiver.
[in] | data | The payload from the packet |
[in] | srce | The sender address (lower 16 bits) from the packet |
Timed out waiting for data ACK from receiver.
This suggests that the receiver has died so close the connection.
[out] | txd | Transmit descriptor |
[in] | a2 | ignored |
Timeout handler during channel opening phase.
[out] | a | pointer to transmit descriptor |
[in] | b | code to write to tx_desc_t::ack on timeout |
Send an SDP message to another SCAMP instance.
[in] | addr | the P2P address of the SCAMP to send to |
[in] | msg | the message to send, presumably for either the target SCAMP or a core that that SCAMP can deliver to |
Timed out waiting for "seq_len" data packets. Send P2P_DATA_ACK with current mask and restart timeout.
[in,out] | rxd | channel receiver descriptor |
[in] | a2 | ignored |
Received OPEN_ACK packet.
If RX_BUSY do nothing so that timeout will expire (and we keep trying). Otherwise update tx_desc and cancel timeout.
[in] | data | The payload from the packet |
[in] | srce | The sender address (lower 16 bits) from the packet |
Another SCAMP has asked for an open channel.
[in] | data | The payload from the packet |
[in] | addr | The sender address (lower 16 bits) from the packet |
Timed out waiting for CLOSE_ACK. Repeat P2P_CLOSE_REQ a few times then give up.
State should be RX_CLOSE_REQ
[in,out] | rxd | Receive descriptor |
[in] | rid | Receiver ID |
Received an acknowledge that a channel has been closed.
[in] | data | The payload from the packet |
[in] | srce | The sender address (lower 16 bits) from the packet |
Receive data on channel.
May write 1 or 2 bytes beyond end of buffer (buffer has pad word)
[in] | data | The payload from the packet |
[in] | addr | The sender address (lower 16 bits) from the packet |
Received P2P control packet.
Delegates to:
[in] | data | The payload from the packet |
[in] | addr | The sender address (lower 16 bits) from the packet |