spinnaker_tools 3.4.0
SpiNNaker API, sark, sc&mp, bmp firmware and build tools
Loading...
Searching...
No Matches
Functions
sark_pkt.c File Reference

Packet handling routines for SARK. More...

#include <sark.h>

Functions

void txpkt_int_han (void)
 SpiNNaker packet may be transmitted interrupt handler.
 
void event_register_pkt (uint queue_size, vic_slot slot)
 Register the use of "pkt" routines.
 
uint pkt_tx_kdc (uint key, uint data, uint ctrl)
 Transmit a packet which contains key, data and control byte (cb) fields.
 
uint pkt_tx_kd (uint key, uint data)
 Transmit a packet which contains key and data fields.
 
uint pkt_tx_k (uint key)
 Transmit a packet which contains only a key.
 
uint pkt_tx_kc (uint key, uint ctrl)
 Transmit a packet which contains key and control byte (cb) fields.
 

Detailed Description

Packet handling routines for SARK.

Author
Steve Temple, APT Group, School of Computer Science

Function Documentation

◆ txpkt_int_han()

void txpkt_int_han ( void  )
extern

SpiNNaker packet may be transmitted interrupt handler.

Sends the next packet on the event_data_t::pkt_queue. Disables itself if no packet is waiting.

◆ event_register_pkt()

void event_register_pkt ( uint  queue_size,
vic_slot  slot 
)

Register the use of "pkt" routines.

An interrupt handler needs to be installed and assigned to a VIC slot. In addition, the size of the transmit packet queue must be specified. It should be a power of two no larger than 256 and refers to the number of packets in the queue. A run time error will occur if the queue size is invalid, the VIC slot is in use or memory for the packet queue could not be allocated. This routine also initialises the Transmit Control Register to send multicast packets.

Parameters
queue_sizenumber of packets in the transmit queue
slotthe VIC slot to use for the packet transmit interrupt

◆ pkt_tx_kdc()

uint pkt_tx_kdc ( uint  key,
uint  data,
uint  ctrl 
)

Transmit a packet which contains key, data and control byte (cb) fields.

The packet is placed on a transmit queue and sent when it reaches the head of the queue. The "ctrl" field is in the bottom 8 bits of the argument and is shifted left by 16 bits when it is placed in the hardware TCR in the chip.

Parameters
keythe key field to be placed in the packet
datathe key field to be placed in the packet
ctrlthe control byte to be placed in the packet
Returns
zero if the transmit queue is full, 1 otherwise

◆ pkt_tx_kd()

uint pkt_tx_kd ( uint  key,
uint  data 
)

Transmit a packet which contains key and data fields.

The packet is placed on a transmit queue and sent when it reaches the head of the queue. The transmit control register (TCR) which controls the type of packet which is sent is not modified by this routine so the previous value will be used.

Parameters
key;the key field to be placed in the packet
datathe data field to be placed in the packet
Returns
zero if the transmit queue is full, 1 otherwise

◆ pkt_tx_k()

uint pkt_tx_k ( uint  key)

Transmit a packet which contains only a key.

The packet is placed on a transmit queue and sent when it reaches the head of the queue. The transmit control register (TCR) which controls the type of packet which is sent is not modified by this routine so the previous value will be used. The routine pkt_register must be called (once) before any of the pkt_tx_XXX routines are used.

Parameters
keythe key field to be placed in the packet
Returns
zero if the transmit queue is full, 1 otherwise

◆ pkt_tx_kc()

uint pkt_tx_kc ( uint  key,
uint  ctrl 
)

Transmit a packet which contains key and control byte (cb) fields.

The packet is placed on a transmit queue and sent when it reaches the head of the queue. The "ctrl" field is in the bottom 8 bits of the argument and is shifted left by 16 bits when it is placed in the hardware TCR in the chip.

Parameters
keythe key field to be placed in the packet
ctrlthe control byte to be placed in the packet
Returns
zero if the transmit queue is full, 1 otherwise