spinnaker_tools 3.4.0
SpiNNaker API, sark, sc&mp, bmp firmware and build tools
|
Header file for SC&MP. More...
Go to the source code of this file.
Data Structures | |
struct | iptag_t |
IPTAG entry (32 bytes) More... | |
struct | pkt_queue_t |
Queue of packets (really a circular buffer) More... | |
struct | pkt_buf_t |
Holds a NN packet awaiting transmission. More... | |
struct | level_t |
Used for tracking signal dispatch. More... | |
Macros | |
Misc Constants | |
#define | MAX_CPUS 20 |
Legacy const! | |
#define | MONITOR_CPU 0 |
SCAMP Multicast constants | |
#define | SCAMP_MC_ROUTING_KEY 0xffff5554 |
Key used in the routing table. | |
#define | SCAMP_MC_ROUTING_MASK 0xfffffffe |
Mask used in the routing table. | |
#define | SCAMP_MC_TIME_SYNC_KEY 0xffff5554 |
The key used for time synchronisation packets. | |
#define | SCAMP_MC_SIGNAL_KEY 0xffff5555 |
The key used for signal packets. | |
#define | MC_SLOT SLOT_FIQ |
Multicast packet handler uses the FIQ VIC slot. | |
SCAMP boot image constants | |
#define | BLOCK_COUNT 32 |
The number of blocks in the image to boot. | |
#define | WORD_COUNT 256 |
The number of words in a block (1kB) | |
#define | BYTE_COUNT (WORD_COUNT * sizeof(uint)) |
The number of bytes in a block. | |
#define | BOOT_IMAGE_SIZE (BLOCK_COUNT * BYTE_COUNT) |
The maximum boot image size. | |
sync0/sync1 arrival alignment | |
#define | NODE_DLY_NS 500 |
per-node delay (ns) | |
#define | BRD_DLY_NS 900 |
board-to-board delay (ns) | |
#define | TOP_DLY_US 155 |
largest delay in 256x256 nodes (us) | |
Hop table | |
#define | NN_HOP_MASK 0x3ff |
!! Allows hops <= 1023 | |
#define | HOP_TABLE_SIZE 65536 |
Structures | |
#define | PKT_QUEUE_SIZE 32 |
Max number of entries in packet queue. | |
Functions | |
SCAMP SROM interface | |
See spinn_srom.c | |
uint | cmd_srom (sdp_msg_t *msg) |
General purpose SROM interface routine. | |
SCAMP interrupt handlers | |
See scamp-isr.c | |
void | vic_setup (void) |
Initialise the VIC. | |
SCAMP delegation | |
See scamp-del.c | |
void | img_cp_exe (void) |
Copy executable image from SDRAM to ITCM and boot it. | |
SCAMP application interface | |
See scamp-app.c | |
void | proc_start_app (uint aplx_addr, uint id_op_mask) |
Start an application on a set of cores. | |
void | signal_app (uint data) |
Signal cores running a range of applications identified by an AppID and a mask. | |
void | boot_ap (void) |
Boot APs. | |
void | clock_ap (uint virt_mask, uint enable) |
Enable/disable clocks to a set of cores specified by a bit mask. | |
void | reset_ap (uint virt_mask) |
Soft reset a set of cores specified by a bit mask. | |
SCAMP command interface | |
See scamp-cmd.c | |
uint | scamp_debug (sdp_msg_t *msg, uint srce_ip) |
General debugging and control command handler. | |
SCAMP bootROM support | |
See scamp-boot.c | |
void | boot_nn (uint hw_ver) |
Boot SCAMP on chips using the bootROM protocols. | |
IPTags | |
#define | TAG_FIXED_SIZE 8 |
Number of IPTags available for application use. | |
#define | TAG_POOL_SIZE 8 |
Number of (temporary) IPTags available for managing SDP replies. | |
#define | FIRST_POOL_TAG TAG_FIXED_SIZE |
Index of first temporary IPTag. | |
#define | LAST_POOL_TAG (TAG_FIXED_SIZE + TAG_POOL_SIZE - 1) |
Index of last temporary IPTag. | |
#define | TAG_TABLE_SIZE (TAG_FIXED_SIZE + TAG_POOL_SIZE) |
Total number of IPTags available. | |
enum | scamp_iptag_commands { IPTAG_NEW = 0 , IPTAG_SET = 1 , IPTAG_GET = 2 , IPTAG_CLR = 3 , IPTAG_TTO = 4 , IPTAG_MAX = 4 } |
Commands applicable to IPTags. More... | |
enum | scamp_iptag_flags { IPFLAG_VALID = 0x8000 , IPFLAG_TRANS = 0x4000 , IPFLAG_ARP = 0x2000 , IPFLAG_USE_SENDER = 0x0400 , IPFLAG_REV = 0x0200 , IPFLAG_STRIP = 0x0100 } |
IPTag flag bits. More... | |
Peer-to-peer messaging | |
#define | P2P_DEF_SQL 4 |
Seq len = 24 | |
#define | NO_IDEA (-1024) |
Initial value of p2p_addr_guess_{x,y} when not the root chip. | |
#define | P2P_ADDR_TABLE_BYTES (512 * 512 / 8) |
Size of p2p_addr_table in bytes. | |
#define | P2PB_OFFSET_USEC 100 |
Number of microseconds to wait between sending P2PB packets on neighbouring chips. | |
enum | scamp_p2p_type_codes { P2P_DATA = 0 , P2P_CTRL = 1 , P2P_LEVEL = 2 } |
Values in P2P type (seq) field. More... | |
enum | scamp_p2p_control_message_codes { P2P_OPEN_REQ = (1 << 24) , P2P_OPEN_ACK = (2 << 24) , P2P_DATA_ACK = (3 << 24) , P2P_CLOSE_REQ = (4 << 24) , P2P_CLOSE_ACK = (5 << 24) , P2P_PING = (6 << 24) , P2P_COUNT_REQ = (7 << 24) , P2P_COUNT_RESP = (8 << 24) } |
Distinguish data/control packets in SDP/P2P (4 bits) More... | |
SCAMP core | |
srom_data_t | srom |
Copy of SROM struct. | |
uint | link_en |
Bitmap of enabled links. | |
uint | num_cpus |
Number of operational CPUs. | |
iptag_t | tag_table [] |
Table of all IPTags. | |
uint | tag_tto |
IPTag timeout (logarithmic) | |
uchar | v2p_map [MAX_CPUS] |
Virtual-core-ID to physical-core-ID map. | |
enum netinit_phase_e | netinit_phase |
The network initialisation process phase currently in progress. | |
enum ethinit_phase_e | ethinit_phase |
The Ethernet initialisation process phase currently in progress. | |
uint | pkt_tx (uint tcr, uint data, uint key) |
Add a SpiNNaker message to the queue of messages to send. | |
uint | pkt_tx_wait (uint tcr, uint data, uint key) |
void | proc_byte_set (uint a1, uint a2) |
Write a byte at a location. | |
void | proc_word_set (uint a1, uint a2) |
Write a word at a location. | |
void | msg_queue_insert (sdp_msg_t *msg, uint srce_ip) |
Adds a message to SCAMP's master message queue, to be processed by proc_route_msg(). | |
uint | iptag_new (void) |
Find a free IPTag. | |
void | assign_virt_cpu (uint phys_cpu) |
Build virtual/physical CPU maps. | |
void | remap_phys_cores (uint phys_cores) |
Disables a specified core and recomputes the virtual core map accordingly. | |
void | delegate (void) |
Delegate acting as a monitor to another core. | |
SCAMP nearest-neighbour discovery protocol | |
uint | mon_del |
delegate blacklisted monitor | |
uint * | hop_table |
Table "hop_table" has entries of type (id << 24, hops) for each possible P2P address. | |
uchar | core_app [MAX_CPUS] |
What application (or at least AppID) is running on each core. | |
uint | app_mask [256] |
Unused? | |
void | compute_eth (void) |
Computes where our board's ethernet chip is. | |
void | compute_level (uint p2p_addr) |
void | ff_nn_send (uint key, uint data, uint fwd_rty, uint log) |
Flood fill NN packet sender. | |
void | biff_nn_send (uint data) |
Board information flood fill packet sender. | |
void | nn_cmd_biff (uint x, uint y, uint data) |
Board information flood fill command handler. | |
void | nn_mark (uint key) |
Mark an ID as discovered. | |
uint | link_read_word (uint addr, uint link, uint *buf, uint timeout) |
Read a word from the chip (or device) over a link. | |
uint | link_write_word (uint addr, uint link, uint *buf, uint timeout) |
Write a word to the chip (or device) over a link. | |
uint | next_id (void) |
Get the next flood-fill identifier we should use. | |
void | nn_init (void) |
Initialise the nearest-neighbour data structures. | |
void | proc_ffe (uint aplx_addr, uint cpu_mask) |
void | p2pc_addr_nn_send (uint arg1, uint arg2) |
Transmit our current best guess of coordinates to all neighbouring chips. | |
void | p2pc_dims_nn_send (uint arg1, uint arg2) |
Transmit our current best guess of coordinates to all neighbouring chips. | |
void | p2pb_nn_send (uint arg1, uint arg2) |
Transmit "P2PB" table generating packets. | |
SCAMP peer-to-peer networking | |
uint | p2p_addr |
Our P2P address. | |
uint | p2p_dims |
Dimensions of the P2P-addressable area. | |
uint | p2p_root |
The address of the P2P root. | |
uint | p2p_up |
Whether the P2P system is operational or still needs to be initialised. | |
volatile uint | ticks_since_last_p2pc_new |
Number of 10ms ticks ellapsed since the last P2PC_NEW arrived. | |
volatile uint | ticks_since_last_p2pc_dims |
Number of 10ms ticks ellapsed since the last P2PC_DIMS arrived. | |
volatile int | p2p_addr_guess_x |
X coordinate of the current best guess of P2P address. | |
volatile int | p2p_addr_guess_y |
Y coordinate of the current best guess of P2P address. | |
volatile int | p2p_min_x |
Estimated minimum X size. | |
volatile int | p2p_max_x |
Estimated maximum X size. | |
volatile int | p2p_min_y |
Estimated minimum Y size. | |
volatile int | p2p_max_y |
uchar * | p2p_addr_table |
uint | p2p_send_msg (uint addr, sdp_msg_t *msg) |
Send an SDP message to another SCAMP instance. | |
void | desc_init (void) |
initialise TX and RX descriptors | |
uint | p2p_send_ping (uint addr, uint link) |
void | p2p_req_count (uint addr, uint app_id, uint state) |
Header file for SC&MP.
struct iptag_t |
IPTAG entry (32 bytes)
Data Fields | ||
---|---|---|
uchar | ip[4] | IP address. |
uchar | mac[6] | MAC address. |
ushort | tx_port | Transmit port. |
ushort | timeout | Timeout when waiting to transmit. |
ushort | flags | See scamp_iptag_flags. |
uint | count | Count of packets routed via this IPTag. |
ushort | rx_port | Receive port. |
ushort | dest_addr | Destination SDP address. |
uchar | dest_port | Destination SDP port. |
uchar | __PAD1[7] |
struct pkt_queue_t |
struct pkt_buf_t |
struct level_t |
Used for tracking signal dispatch.
Data Fields | ||
---|---|---|
uint | level_addr | 0: This chip's region at this level |
ushort | sent | 4: Number of requests sent out in this region |
ushort | rcvd | 6: Number of responses received |
ushort | parent | 8: P2P address of the chip which sent the last request |
ushort | __PAD1 | |
uint | result | 12: Result accumulated within this region |
ushort | addr[16] | 16: A working chip p2p for each subregion, if valid |
uchar | valid[16] | 48: Is at least one chip in each sub-region known to be alive? |
#define MONITOR_CPU 0 |
Virtual CPU number
#define HOP_TABLE_SIZE 65536 |
Size of the hop table
enum scamp_iptag_commands |
enum scamp_iptag_flags |
enum scamp_sdp_flags |
enum scamp_failure_codes |
Failure codes.
Non-zero causes CPU to sleep. Bit 6 set causes CPU_OK bit to be cleared. Bit 5 set causes LED3 to be turned on.
HW errors have bit 7 set & bit 6 set. SW errors have bit 7 set & bit 6 clr.
enum scamp_nn_opcodes |
NN opcodes.
Contrary to the above:
NN_CMD_P2PC are limited to only forward packets containing new information, NN_CMD_BIFF are limited by ID in a separate ID-space to other commands and their propagation is limited to just the current board.
Format for NN_CMD_P2PC commands:
Format for NN_CMD_BIFF commands
Nearest neighbour packet format all other commands
enum scamp_p2p_type_codes |
Distinguish data/control packets in SDP/P2P (4 bits)
enum netinit_phase_e |
Phases of the network initialisation process, in order.
enum ethinit_phase_e |
enum alloc_cmd_e |
Allocation commands.
Add a SpiNNaker message to the queue of messages to send.
[in] | tcr | Control word |
[in] | data | Payload word |
[in] | key | Key word |
Write a byte at a location.
[in] | a1 | The location to write |
[in] | a2 | The byte to write there |
Write a word at a location.
[in] | a1 | The location to write |
[in] | a2 | The byte to write there |
Adds a message to SCAMP's master message queue, to be processed by proc_route_msg().
[in] | msg | The message to dispatch. Transfers ownership of the message. |
[in] | srce_ip | Source IP address (if meaningful). |
|
extern |
Find a free IPTag.
|
extern |
Build virtual/physical CPU maps.
Caller is monitor processor and passes its physical CPU.
[in] | phys_cpu | What our physical CPU number is. |
|
extern |
Disables a specified core and recomputes the virtual core map accordingly.
This command has a number of dangerous effects:
[in] | phys_cores | Bitmap of which cores to remap. |
Flood fill NN packet sender.
[in] | key | The key to use |
[in] | data | The data to use |
[in] | fwd_rty | Forward/delay/retry configuration |
[in] | add_id | Whether to merge the next_id() result into the key |
|
extern |
Board information flood fill packet sender.
[in] | data | The payload of the packet to send. |
Board information flood fill command handler.
Can be invoked directly during setup, or in response to a BIFF message.
[in] | x | The believed X coordinate |
[in] | y | The believed Y coordinate |
[in] | data | The payload word from the message |
|
extern |
Mark an ID as discovered.
[in] | key | The key from the NN packet |
Read a word from the chip (or device) over a link.
[in] | addr | The address to read from |
[in] | link | The link to use |
[out] | buf | The data that has been read (4 byte buffer) |
[in] | timeout | How long to wait for the other side to respond |
Write a word to the chip (or device) over a link.
[in] | addr | The address to write to |
[in] | link | The link to use |
[in] | buf | The data that is to be written (buffer containing 4 bytes) |
[in] | timeout | How long to wait for the other side to respond |
|
extern |
Get the next flood-fill identifier we should use.
aplx_addr | Address of APLX? |
cpu_mask | Core select mask? |
General purpose SROM interface routine.
[in,out] | msg | SCP message describing what to do. Updated with response payload if relevant. |
Start an application on a set of cores.
[in] | aplx_addr | Where the APLX has been loaded in SDRAM |
[in] | id_op_mask | AppID, and flags to pass to APLX loader |
|
extern |
Signal cores running a range of applications identified by an AppID and a mask.
[in] | data | What signal, cores and app ID |
Delegates to:
|
extern |
Boot APs.
Assumes the "boot_aplx" image has been placed at 0x7f00 and the default "sark" image at 0x7000. Copies "boot_aplx" to start of SysRAM and the default image to SDRAM. Then starts the default app on all cores.
Enable/disable clocks to a set of cores specified by a bit mask.
[in] | phys_mask | Which physical cores to enable or disable the clock for. |
[in] | enable | True to switch on the clock for the cores, false to switch the clock off for them. |
|
extern |
Soft reset a set of cores specified by a bit mask.
Clocks for those cores are enabled.
[in] | virt_mask | Which (virtual) cores to soft reset |
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 |
Transmit our current best guess of coordinates to all neighbouring chips.
arg1 | unused |
arg2 | unused |
Transmit our current best guess of coordinates to all neighbouring chips.
arg1 | unused |
arg2 | unused |
Transmit "P2PB" table generating packets.
arg1 | unused |
arg2 | unused |
General debugging and control command handler.
Delegates to:
based on the sdp_msg_t::cmd_rc contents.
[in,out] | msg | The SCP message. Will be updated with response. |
[in] | srce_ip | Source IP address. Only used for cmd_iptag() |
|
extern |
Boot SCAMP on chips using the bootROM protocols.
[in] | hw_ver | Hardware version |
|
extern |
IPTag timeout (logarithmic)
2.56s = 10ms * (1 << (9-1))
|
extern |
Table "hop_table" has entries of type (id << 24, hops)
for each possible P2P address.
Field "hops" contains the number of hops to the address (initialised to 65535) and "id" contains the ID of the last packet used to update the table (initialised to 128). These are packed into a word.
Stored in SYSRAM so visible to all cores. Should only be updated by SCAMP
|
extern |
Estimated maximum Y size
|
extern |
A bitmap giving the coordinates of all P2P coordinates which have been seen mentioned in a P2PC_NEW message. A 2D array of bits whose bit indexes are ((bx<<9) | by)
where bx
and by
are x + 256
and y + 256
respectively.