spinnaker_tools 3.4.0
SpiNNaker API, sark, sc&mp, bmp firmware and build tools
Loading...
Searching...
No Matches
Data Structures | Enumerations
scamp.h File Reference

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.
 

Enumerations

enum  alloc_cmd_e {
  ALLOC_SDRAM , FREE_SDRAM , FREE_SDRAM_ID , ALLOC_RTR ,
  FREE_RTR , FREE_RTR_ID , SDRAM_SPACE , HEAP_TAG_PTR ,
  ALLOC_MAX =HEAP_TAG_PTR
}
 Allocation commands. More...
 
SDP Flags
enum  scamp_sdp_flags { SDPF_REPLY = 0x80 , SDPF_SUM = 0x40 , SDPF_NR = 0x20 }
 Bits in SDP Flags byte (3 used) More...
 
Failure Codes
enum  scamp_failure_codes {
  FAIL_RESET = 0xc0 , FAIL_ROMX = 0xc1 , FAIL_ITCM0 = 0xc2 , FAIL_ITCM1 = 0xc3 ,
  FAIL_DTCM = 0xc4 , FAIL_TIMER = 0xc5 , FAIL_VIC = 0xc6 , FAIL_CC = 0xc7 ,
  FAIL_DMA = 0xc8 , FAIL_MP = 0xc9 , FAIL_LATE = 0xca , FAIL_MANUF = 0xcb ,
  FAIL_SLEEP = 0xcc , FAIL_TLM = 0xcf , FAIL_VEC = 0xa0
}
 Failure codes. More...
 
Nearest-neighbour Discovery Protocol
enum  scamp_nn_opcodes {
  NN_CMD_SIG0 = 0 , NN_CMD_RTRC = 1 , NN_CMD_LTPC = 2 , NN_CMD_SP_3 = 3 ,
  NN_CMD_SIG1 = 4 , NN_CMD_P2PC = 5 , NN_CMD_FFS = 6 , NN_CMD_FFCS = 7 ,
  NN_CMD_P2PB = 8 , NN_CMD_LKSYN = 9 , NN_CMD_NISYN = 10 , NN_CMD_BIFF = 11 ,
  NN_CMD_FBS = 12 , NN_CMD_FBD = 13 , NN_CMD_FBE = 14 , NN_CMD_FFE = 15
}
 NN opcodes. More...
 
enum  scamp_nn_p2p_config_subcommands { P2PC_ADDR = 0 , P2PC_NEW = 1 , P2PC_DIMS = 2 , P2PC_RETH = 3 }
 NN_CMD_P2PC sub-command codes. More...
 
Network initialisation
enum  netinit_phase_e {
  NETINIT_PHASE_P2P_ADDR , NETINIT_PHASE_P2P_DIMS , NETINIT_PHASE_BIFF , NETINIT_PHASE_P2P_TABLE_ETH ,
  NETINIT_PHASE_P2P_TABLE_R_ETH , NETINIT_PHASE_P2P_TABLE , NETINIT_PHASE_SET_ETHERNET_ADDR , NETINIT_PHASE_DEL ,
  NETINIT_PHASE_DONE = 0xFF
}
 Phases of the network initialisation process, in order. More...
 
enum  ethinit_phase_e { ETHINIT_PHASE_WAIT_1 , ETHINIT_PHASE_WAIT_2 , ETHINIT_PHASE_DONE = 0xFF }
 Phases of the Ethernet initialisation process, in order. More...
 

Functions

SCAMP SROM interface
uint cmd_srom (sdp_msg_t *msg)
 General purpose SROM interface routine.
 
SCAMP interrupt handlers
void vic_setup (void)
 Initialise the VIC.
 
SCAMP delegation
void img_cp_exe (void)
 Copy executable image from SDRAM to ITCM and boot it.
 
SCAMP application interface
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
uint scamp_debug (sdp_msg_t *msg, uint srce_ip)
 General debugging and control command handler.
 
SCAMP bootROM support
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
 
uinthop_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
 
ucharp2p_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)
 

Detailed Description

Header file for SC&MP.

Author
Steve Temple, APT Group, School of Computer Science

Data Structure Documentation

◆ iptag_t

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]

◆ pkt_queue_t

struct pkt_queue_t

Queue of packets (really a circular buffer)

Data Fields
uchar insert Insertion index.
uchar remove Removal index.
volatile uchar count
uchar max
pkt_t queue[PKT_QUEUE_SIZE]

◆ pkt_buf_t

struct pkt_buf_t

Holds a NN packet awaiting transmission.

Data Fields
struct pkt_buf_t * next Next packet to transmit.
volatile uchar flags General flags.
uchar fwd Is this a forwarded packet.
uchar delay How long to wait before sending.
uchar link Which ways to send along.
pkt_t pkt What to send.

◆ level_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?

Macro Definition Documentation

◆ MONITOR_CPU

#define MONITOR_CPU   0

Virtual CPU number

◆ HOP_TABLE_SIZE

#define HOP_TABLE_SIZE   65536

Size of the hop table

Enumeration Type Documentation

◆ scamp_iptag_commands

Commands applicable to IPTags.

Enumerator
IPTAG_NEW 

Create IPTag.

IPTAG_SET 

Configure IPTag.

IPTAG_GET 

Retrieve IPTag.

IPTAG_CLR 

Clear IPTag.

IPTAG_TTO 

Configure IPTag Timeout.

IPTAG_MAX 

Maximum command value.

◆ scamp_iptag_flags

IPTag flag bits.

Enumerator
IPFLAG_VALID 

Entry is valid.

IPFLAG_TRANS 

Entry is transient.

IPFLAG_ARP 

Awaiting ARP resolution.

IPFLAG_USE_SENDER 

Use sender address and port.

IPFLAG_REV 

Reverse IPTag.

IPFLAG_STRIP 

Strip SDP headers.

◆ scamp_sdp_flags

Bits in SDP Flags byte (3 used)

Enumerator
SDPF_REPLY 

Reply expected.

SDPF_SUM 

Checksum before routing.

SDPF_NR 

Don't route via P2P.

◆ 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.

Enumerator
FAIL_RESET 

Catch-all - set at reset.

FAIL_ROMX 

Exception in ROM code.

FAIL_ITCM0 

ITCM top 512 failure.

FAIL_ITCM1 

ITCM main test failure.

FAIL_DTCM 

DTCM test failure.

FAIL_TIMER 

Timer reg test failed.

FAIL_VIC 

VIC reg test failed.

FAIL_CC 

Comms ctlr reg test failed.

FAIL_DMA 

DMAC reg test failed.

FAIL_MP 

Previous monitor proc failure.

FAIL_LATE 

App CPU failed to set CPU_OK.

FAIL_MANUF 

App CPU in manuf test.

FAIL_SLEEP 

Ordered to sleep in startup.

FAIL_TLM 

Special for TLM.

FAIL_VEC 

Unhandled exception.

◆ scamp_nn_opcodes

NN opcodes.

  • Codes < 7 have propagation limited by the ID field in the packet.
  • Codes >= 7 have various other ways of handling propagation.
  • Codes 0-3, 8-11 have explicit FwdRty in the packet.
  • Codes 4-7, 12-15 use stored FwdRty parameters

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:

key[31:28] 4-bit one's complement checksum of key and data (see chksum_64())
key[27:24] NN command (== NN_CMD_P2PC)
key[23:4] Unused
key[3:2] Type: P2PC_ADDR, P2PC_NEW or P2PC_DIMS
key[1] Must be 0, differentiator between peek/poke responses and other
NN packets

Format for NN_CMD_BIFF commands

key[31:28] 4-bit one's complement checksum of key and data (see chksum_64())
key[27:24] NN command (== NN_CMD_BIFF)
key[23:16] Unused
key[13:11] X coordinate of packet within board (updated when forwarded)
key[10:8] Y coordinate of packet within board (updated when forwarded)
key[7:1] 7-bit packet ID, used for ignoring echos (in a different address
space to other NN packets).
key[1] Must be 0, differentiator between peek/poke responses and other
NN packets

Nearest neighbour packet format all other commands

key[31:28] 4-bit one's complement checksum of key and data (see chksum_64())
key[27:24] NN command
key[23:16] Forward (for packets with command bit 2 set)
key[15:8] Retry (for packets with command bit 2 set)
key[7:1] 7-bit packet ID, used for ignoring echos (for packets with
commands < 7)
key[1] Must be 0, differentiator between peek/poke responses and other
NN packets
Enumerator
NN_CMD_SIG0 

Misc (GTPC, Set FwdRty, LED, etc)

NN_CMD_RTRC 

Router Control Reg.

NN_CMD_LTPC 

Local Time Phase Control (ID=0, Fwd=0)

NN_CMD_SP_3 

Spare.

NN_CMD_SIG1 

Misc (MEM, etc)

NN_CMD_P2PC 

P2P Address setup (Handled specially)

NN_CMD_FFS 

Flood fill start.

NN_CMD_FFCS 

Flood fill core and region select.

NN_CMD_P2PB 

Hop count limited.

NN_CMD_LKSYN 

Synchronize opposite links.

NN_CMD_NISYN 

Synchronize Netinit level.

NN_CMD_BIFF 

Board-info flood-fill (handled specially)

NN_CMD_FBS 

Filtered in FF code.

◆ scamp_nn_p2p_config_subcommands

NN_CMD_P2PC sub-command codes.

Enumerator
P2PC_ADDR 

Your P2P address is...

P2PC_NEW 

(Broadcast) I/somebody just discovered/updated my/their P2P address

P2PC_DIMS 

(Broadcast) The current best guess of P2P coordinates is...

P2PC_RETH 

Sending route back to 0, 0 or nearest Ethernet.

◆ scamp_p2p_type_codes

Values in P2P type (seq) field.

Enumerator
P2P_DATA 

Data message.

P2P_CTRL 

Control message.

P2P_LEVEL 

Currently unimplemented.

◆ scamp_p2p_control_message_codes

Distinguish data/control packets in SDP/P2P (4 bits)

Enumerator
P2P_OPEN_REQ 

Open channel request.

P2P_OPEN_ACK 

Open channel acknowledge.

P2P_DATA_ACK 

Data acknowledge.

P2P_CLOSE_REQ 

Close channel request.

P2P_CLOSE_ACK 

Close channel acknowledge.

P2P_PING 

Ping from a neighbor.

P2P_COUNT_REQ 

Count state request.

P2P_COUNT_RESP 

Count state response.

◆ netinit_phase_e

Phases of the network initialisation process, in order.

Enumerator
NETINIT_PHASE_P2P_ADDR 

Configure P2P addresses for all chips while waiting for all chips to come online.

NETINIT_PHASE_P2P_DIMS 

Determine the dimensions of the system and kill off all chips outside this range (ensuring incorrectly guessed dimensions do not result in address aliasing).

NETINIT_PHASE_BIFF 

Send Board-info flood-fill messages to disable all known iffy links, cores and chips.

NETINIT_PHASE_P2P_TABLE_ETH 

Construct the P2P routing tables for Ethernet chips (more critical)

NETINIT_PHASE_P2P_TABLE_R_ETH 

Construct the P2P routing tables for return to Ethernet (next critical)

NETINIT_PHASE_P2P_TABLE 

Construct the P2P routing tables.

NETINIT_PHASE_SET_ETHERNET_ADDR 

Setting the Ethernet address.

NETINIT_PHASE_DEL 

Blacklisted monitor delegates its functions to another core.

NETINIT_PHASE_DONE 

The boot process is complete and the system is ready for use.

◆ ethinit_phase_e

Phases of the Ethernet initialisation process, in order.

Enumerator
ETHINIT_PHASE_WAIT_1 

FIRST PHASE - wait for Ethernet to come up.

ETHINIT_PHASE_WAIT_2 

SECOND_PHASE - wait for Ethernet to come up.

ETHINIT_PHASE_DONE 

Ethernet either up or timed out.

◆ alloc_cmd_e

Allocation commands.

Enumerator
ALLOC_SDRAM 

Allocate SDRAM.

FREE_SDRAM 

Free SDRAM.

FREE_SDRAM_ID 

Free DRAM by ID.

ALLOC_RTR 

Allocate Router.

FREE_RTR 

Free Router.

FREE_RTR_ID 

Free Router by ID.

SDRAM_SPACE 

Total free space & largest free block.

HEAP_TAG_PTR 

Heap block from tag & ID.

ALLOC_MAX 

Maximum command.

Function Documentation

◆ pkt_tx()

uint pkt_tx ( uint  tcr,
uint  data,
uint  key 
)
extern

Add a SpiNNaker message to the queue of messages to send.

Parameters
[in]tcrControl word
[in]dataPayload word
[in]keyKey word
Returns
True if the packet was correctly enqueued

◆ proc_byte_set()

void proc_byte_set ( uint  a1,
uint  a2 
)
extern

Write a byte at a location.

Parameters
[in]a1The location to write
[in]a2The byte to write there

◆ proc_word_set()

void proc_word_set ( uint  a1,
uint  a2 
)
extern

Write a word at a location.

Parameters
[in]a1The location to write
[in]a2The byte to write there

◆ msg_queue_insert()

void msg_queue_insert ( sdp_msg_t msg,
uint  srce_ip 
)
extern

Adds a message to SCAMP's master message queue, to be processed by proc_route_msg().

Note
This silently drops messages if the queue is full.
Parameters
[in]msgThe message to dispatch. Transfers ownership of the message.
[in]srce_ipSource IP address (if meaningful).

◆ iptag_new()

uint iptag_new ( void  )
extern

Find a free IPTag.

Returns
The ID of the IPTag, or TAG_NONE if all tags are in use

◆ assign_virt_cpu()

void assign_virt_cpu ( uint  phys_cpu)
extern

Build virtual/physical CPU maps.

Caller is monitor processor and passes its physical CPU.

Parameters
[in]phys_cpuWhat our physical CPU number is.

◆ remap_phys_cores()

void remap_phys_cores ( uint  phys_cores)
extern

Disables a specified core and recomputes the virtual core map accordingly.

This command has a number of dangerous effects:

  • All application cores are rebooted (so that the new virtual core map takes effect)
  • If the core to be disabled includes the monitor then the monitor is disabled without being remapped rendering the chip non-communicative.
    Parameters
    [in]phys_coresBitmap of which cores to remap.

◆ ff_nn_send()

void ff_nn_send ( uint  key,
uint  data,
uint  fwd_rty,
uint  add_id 
)
extern

Flood fill NN packet sender.

Parameters
[in]keyThe key to use
[in]dataThe data to use
[in]fwd_rtyForward/delay/retry configuration
[in]add_idWhether to merge the next_id() result into the key

◆ biff_nn_send()

void biff_nn_send ( uint  data)
extern

Board information flood fill packet sender.

Note
Should only be called on chips which are at position (0, 0) on their board.
Parameters
[in]dataThe payload of the packet to send.

◆ nn_cmd_biff()

void nn_cmd_biff ( uint  x,
uint  y,
uint  data 
)
extern

Board information flood fill command handler.

Can be invoked directly during setup, or in response to a BIFF message.

Parameters
[in]xThe believed X coordinate
[in]yThe believed Y coordinate
[in]dataThe payload word from the message

◆ nn_mark()

void nn_mark ( uint  key)
extern

Mark an ID as discovered.

Parameters
[in]keyThe key from the NN packet

◆ link_read_word()

uint link_read_word ( uint  addr,
uint  link,
uint buf,
uint  timeout 
)
extern

Read a word from the chip (or device) over a link.

Parameters
[in]addrThe address to read from
[in]linkThe link to use
[out]bufThe data that has been read (4 byte buffer)
[in]timeoutHow long to wait for the other side to respond
Returns
result code

◆ link_write_word()

uint link_write_word ( uint  addr,
uint  link,
uint buf,
uint  timeout 
)
extern

Write a word to the chip (or device) over a link.

Parameters
[in]addrThe address to write to
[in]linkThe link to use
[in]bufThe data that is to be written (buffer containing 4 bytes)
[in]timeoutHow long to wait for the other side to respond
Returns
result code

◆ next_id()

uint next_id ( void  )
extern

Get the next flood-fill identifier we should use.

Returns
A new flood fill ID (range: 2–254)

◆ proc_ffe()

void proc_ffe ( uint  aplx_addr,
uint  cpu_mask 
)
extern
Deprecated:
No definition available; not used
Parameters
aplx_addrAddress of APLX?
cpu_maskCore select mask?

◆ cmd_srom()

uint cmd_srom ( sdp_msg_t msg)
extern

General purpose SROM interface routine.

msg->arg1[31:16] = Data length (or zero)
msg->arg1[8] = Write (1) or Read (0)
msg->arg1[7] = Send WREN command first
msg->arg1[6] = Wait for completion
msg->arg1[5:0] = Number of command bits (8,16,32)
msg->arg2[31:24] = SROM command
msg->arg2[23:0] = extra command bits
Parameters
[in,out]msgSCP message describing what to do. Updated with response payload if relevant.
Returns
the length of the result message

◆ proc_start_app()

void proc_start_app ( uint  aplx_addr,
uint  id_op_mask 
)
extern

Start an application on a set of cores.

Parameters
[in]aplx_addrWhere the APLX has been loaded in SDRAM
[in]id_op_maskAppID, and flags to pass to APLX loader

◆ signal_app()

void signal_app ( uint  data)
extern

Signal cores running a range of applications identified by an AppID and a mask.

Parameters
[in]dataWhat signal, cores and app ID

Delegates to:

◆ boot_ap()

void boot_ap ( void  )
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.

◆ clock_ap()

void clock_ap ( uint  phys_mask,
uint  enable 
)
extern

Enable/disable clocks to a set of cores specified by a bit mask.

Parameters
[in]phys_maskWhich physical cores to enable or disable the clock for.
[in]enableTrue to switch on the clock for the cores, false to switch the clock off for them.

◆ reset_ap()

void reset_ap ( uint  virt_mask)
extern

Soft reset a set of cores specified by a bit mask.

Clocks for those cores are enabled.

Parameters
[in]virt_maskWhich (virtual) cores to soft reset

◆ p2p_send_msg()

uint p2p_send_msg ( uint  addr,
sdp_msg_t msg 
)
extern

Send an SDP message to another SCAMP instance.

Parameters
[in]addrthe P2P address of the SCAMP to send to
[in]msgthe message to send, presumably for either the target SCAMP or a core that that SCAMP can deliver to
Returns
result code saying whether message sending was successful

◆ p2pc_addr_nn_send()

void p2pc_addr_nn_send ( uint  arg1,
uint  arg2 
)
extern

Transmit our current best guess of coordinates to all neighbouring chips.

Parameters
arg1unused
arg2unused

◆ p2pc_dims_nn_send()

void p2pc_dims_nn_send ( uint  arg1,
uint  arg2 
)
extern

Transmit our current best guess of coordinates to all neighbouring chips.

Parameters
arg1unused
arg2unused

◆ p2pb_nn_send()

void p2pb_nn_send ( uint  arg1,
uint  arg2 
)
extern

Transmit "P2PB" table generating packets.

Parameters
arg1unused
arg2unused

◆ scamp_debug()

uint scamp_debug ( sdp_msg_t msg,
uint  srce_ip 
)
extern

General debugging and control command handler.

Delegates to:

based on the sdp_msg_t::cmd_rc contents.

Parameters
[in,out]msgThe SCP message. Will be updated with response.
[in]srce_ipSource IP address. Only used for cmd_iptag()
Returns
the length of the content in the response message. 0 means there's just a header

◆ boot_nn()

void boot_nn ( uint  hw_ver)
extern

Boot SCAMP on chips using the bootROM protocols.

Parameters
[in]hw_verHardware version

Variable Documentation

◆ tag_tto

uint tag_tto
extern

IPTag timeout (logarithmic)

2.56s = 10ms * (1 << (9-1))

◆ hop_table

uint* hop_table
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

◆ p2p_max_y

volatile int p2p_max_y
extern

Estimated maximum Y size

◆ p2p_addr_table

uchar* p2p_addr_table
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.