44#define SCAMP_MC_ROUTING_KEY 0xffff5554
47#define SCAMP_MC_ROUTING_MASK 0xfffffffe
53#define SCAMP_MC_TIME_SYNC_KEY 0xffff5554
56#define SCAMP_MC_SIGNAL_KEY 0xffff5555
59#define MC_SLOT SLOT_FIQ
75#define BYTE_COUNT (WORD_COUNT * sizeof(uint))
77#define BOOT_IMAGE_SIZE (BLOCK_COUNT * BYTE_COUNT)
86#define TAG_FIXED_SIZE 8
88#define TAG_POOL_SIZE 8
91#define FIRST_POOL_TAG TAG_FIXED_SIZE
93#define LAST_POOL_TAG (TAG_FIXED_SIZE + TAG_POOL_SIZE - 1)
96#define TAG_TABLE_SIZE (TAG_FIXED_SIZE + TAG_POOL_SIZE)
281#define NO_IDEA (-1024)
284#define P2P_ADDR_TABLE_BYTES (512 * 512 / 8)
288#define P2PB_OFFSET_USEC 100
297#define NODE_DLY_NS 500
298#define BRD_DLY_NS 900
299#define TOP_DLY_US 155
308#define NN_HOP_MASK 0x3ff
310#define HOP_TABLE_SIZE 65536
390#define PKT_QUEUE_SIZE 32
396 volatile uchar count;
516extern void p2p_req_count(
uint addr,
uint app_id,
uint state);
Struct holding a packet.
Definition sark.h:811
SDP message definition.
Definition sark.h:574
Contents of SV SROM area (32 bytes)
Definition sark.h:517
static uint x
The x coordinate of this chip.
Definition scamp-3.c:226
static uint y
The y coordinate of this chip.
Definition scamp-3.c:229
uchar core_app[MAX_CPUS]
What application (or at least AppID) is running on each core.
Definition scamp-nn.c:109
void delegate(void)
Delegate acting as a monitor to another core.
Definition scamp-3.c:1939
void p2pc_dims_nn_send(uint arg1, uint arg2)
Transmit our current best guess of coordinates to all neighbouring chips.
Definition scamp-nn.c:542
void boot_ap(void)
Boot APs.
Definition scamp-app.c:75
pkt_t pkt
What to send.
Definition scamp.h:408
volatile int p2p_min_x
Estimated minimum X size.
Definition scamp-3.c:164
uchar v2p_map[MAX_CPUS]
Virtual-core-ID to physical-core-ID map.
Definition scamp-3.c:100
uint link_en
Bitmap of enabled links.
Definition scamp-3.c:114
ushort tx_port
Transmit port.
Definition scamp.h:379
volatile int p2p_max_x
Estimated maximum X size.
Definition scamp-3.c:165
volatile uint ticks_since_last_p2pc_new
Number of 10ms ticks ellapsed since the last P2PC_NEW arrived.
Definition scamp-3.c:141
uchar fwd
Is this a forwarded packet.
Definition scamp.h:405
iptag_t tag_table[]
Table of all IPTags.
Definition scamp-3.c:125
void p2pb_nn_send(uint arg1, uint arg2)
Transmit "P2PB" table generating packets.
Definition scamp-nn.c:579
uint p2p_send_msg(uint addr, sdp_msg_t *msg)
Send an SDP message to another SCAMP instance.
Definition scamp-p2p.c:365
scamp_sdp_flags
Bits in SDP Flags byte (3 used)
Definition scamp.h:128
@ SDPF_REPLY
Reply expected.
Definition scamp.h:129
@ SDPF_SUM
Checksum before routing.
Definition scamp.h:130
@ SDPF_NR
Don't route via P2P.
Definition scamp.h:131
uchar delay
How long to wait before sending.
Definition scamp.h:406
uint p2p_up
Whether the P2P system is operational or still needs to be initialised.
Definition scamp-3.c:109
uint p2p_addr
Our P2P address.
Definition scamp-3.c:103
void img_cp_exe(void)
Copy executable image from SDRAM to ITCM and boot it.
Definition scamp-del.c:36
struct pkt_buf_t * next
Next packet to transmit.
Definition scamp.h:403
ushort timeout
Timeout when waiting to transmit.
Definition scamp.h:380
volatile int p2p_min_y
Estimated minimum Y size.
Definition scamp-3.c:166
uint pkt_tx(uint tcr, uint data, uint key)
Add a SpiNNaker message to the queue of messages to send.
Definition scamp-3.c:375
uint cmd_srom(sdp_msg_t *msg)
General purpose SROM interface routine.
Definition spinn_srom.c:138
uint p2p_root
The address of the P2P root.
Definition scamp-3.c:107
volatile uint ticks_since_last_p2pc_dims
Number of 10ms ticks ellapsed since the last P2PC_DIMS arrived.
Definition scamp-3.c:143
void reset_ap(uint virt_mask)
Soft reset a set of cores specified by a bit mask.
Definition scamp-app.c:58
uint scamp_debug(sdp_msg_t *msg, uint srce_ip)
General debugging and control command handler.
Definition scamp-cmd.c:784
uint tag_tto
IPTag timeout (logarithmic)
Definition scamp-3.c:128
scamp_p2p_control_message_codes
Distinguish data/control packets in SDP/P2P (4 bits)
Definition scamp.h:266
@ P2P_CLOSE_ACK
Close channel acknowledge.
Definition scamp.h:271
@ P2P_OPEN_REQ
Open channel request.
Definition scamp.h:267
@ P2P_PING
Ping from a neighbor.
Definition scamp.h:272
@ P2P_CLOSE_REQ
Close channel request.
Definition scamp.h:270
@ P2P_OPEN_ACK
Open channel acknowledge.
Definition scamp.h:268
@ P2P_COUNT_RESP
Count state response.
Definition scamp.h:274
@ P2P_COUNT_REQ
Count state request.
Definition scamp.h:273
@ P2P_DATA_ACK
Data acknowledge.
Definition scamp.h:269
void signal_app(uint data)
Signal cores running a range of applications identified by an AppID and a mask.
Definition scamp-app.c:257
srom_data_t srom
Copy of SROM struct.
Definition scamp-3.c:116
netinit_phase_e
Phases of the network initialisation process, in order.
Definition scamp.h:319
@ NETINIT_PHASE_DEL
Blacklisted monitor delegates its functions to another core.
Definition scamp.h:339
@ NETINIT_PHASE_P2P_TABLE
Construct the P2P routing tables.
Definition scamp.h:335
@ NETINIT_PHASE_SET_ETHERNET_ADDR
Setting the Ethernet address.
Definition scamp.h:337
@ NETINIT_PHASE_P2P_TABLE_R_ETH
Construct the P2P routing tables for return to Ethernet (next critical)
Definition scamp.h:333
@ NETINIT_PHASE_P2P_TABLE_ETH
Construct the P2P routing tables for Ethernet chips (more critical)
Definition scamp.h:331
@ NETINIT_PHASE_BIFF
Definition scamp.h:329
@ NETINIT_PHASE_DONE
The boot process is complete and the system is ready for use.
Definition scamp.h:341
@ NETINIT_PHASE_P2P_DIMS
Definition scamp.h:326
@ NETINIT_PHASE_P2P_ADDR
Definition scamp.h:322
scamp_p2p_type_codes
Values in P2P type (seq) field.
Definition scamp.h:259
@ P2P_CTRL
Control message.
Definition scamp.h:261
@ P2P_LEVEL
Currently unimplemented.
Definition scamp.h:262
@ P2P_DATA
Data message.
Definition scamp.h:260
uint link_read_word(uint addr, uint link, uint *buf, uint timeout)
Read a word from the chip (or device) over a link.
Definition scamp-nn.c:288
void proc_word_set(uint a1, uint a2)
Write a word at a location.
Definition scamp-3.c:341
uchar dest_port
Destination SDP port.
Definition scamp.h:385
uint mon_del
delegate blacklisted monitor
Definition scamp-nn.c:122
void biff_nn_send(uint data)
Board information flood fill packet sender.
Definition scamp-nn.c:479
void proc_ffe(uint aplx_addr, uint cpu_mask)
alloc_cmd_e
Allocation commands.
Definition scamp.h:358
@ ALLOC_SDRAM
Allocate SDRAM.
Definition scamp.h:359
@ ALLOC_MAX
Maximum command.
Definition scamp.h:367
@ FREE_SDRAM
Free SDRAM.
Definition scamp.h:360
@ SDRAM_SPACE
Total free space & largest free block.
Definition scamp.h:365
@ HEAP_TAG_PTR
Heap block from tag & ID.
Definition scamp.h:366
@ FREE_SDRAM_ID
Free DRAM by ID.
Definition scamp.h:361
@ FREE_RTR_ID
Free Router by ID.
Definition scamp.h:364
@ FREE_RTR
Free Router.
Definition scamp.h:363
@ ALLOC_RTR
Allocate Router.
Definition scamp.h:362
ushort sent
4: Number of requests sent out in this region
Definition scamp.h:414
uint link_write_word(uint addr, uint link, uint *buf, uint timeout)
Write a word to the chip (or device) over a link.
Definition scamp-nn.c:333
ushort rx_port
Receive port.
Definition scamp.h:383
scamp_iptag_commands
Commands applicable to IPTags.
Definition scamp.h:100
@ IPTAG_TTO
Configure IPTag Timeout.
Definition scamp.h:105
@ IPTAG_SET
Configure IPTag.
Definition scamp.h:102
@ IPTAG_NEW
Create IPTag.
Definition scamp.h:101
@ IPTAG_MAX
Maximum command value.
Definition scamp.h:107
@ IPTAG_GET
Retrieve IPTag.
Definition scamp.h:103
@ IPTAG_CLR
Clear IPTag.
Definition scamp.h:104
#define MAX_CPUS
Legacy const!
Definition scamp.h:34
void nn_init(void)
Initialise the nearest-neighbour data structures.
Definition scamp-nn.c:139
void compute_eth(void)
Computes where our board's ethernet chip is.
Definition scamp-nn.c:185
ethinit_phase_e
Phases of the Ethernet initialisation process, in order.
Definition scamp.h:345
@ ETHINIT_PHASE_WAIT_2
SECOND_PHASE - wait for Ethernet to come up.
Definition scamp.h:349
@ ETHINIT_PHASE_WAIT_1
FIRST PHASE - wait for Ethernet to come up.
Definition scamp.h:347
@ ETHINIT_PHASE_DONE
Ethernet either up or timed out.
Definition scamp.h:351
uchar remove
Removal index.
Definition scamp.h:395
enum ethinit_phase_e ethinit_phase
The Ethernet initialisation process phase currently in progress.
Definition scamp-3.c:138
ushort parent
8: P2P address of the chip which sent the last request
Definition scamp.h:416
uint next_id(void)
Get the next flood-fill identifier we should use.
Definition scamp-nn.c:397
void nn_mark(uint key)
Mark an ID as discovered.
Definition scamp-nn.c:427
scamp_iptag_flags
IPTag flag bits.
Definition scamp.h:111
@ IPFLAG_VALID
Entry is valid.
Definition scamp.h:112
@ IPFLAG_REV
Reverse IPTag.
Definition scamp.h:117
@ IPFLAG_USE_SENDER
Use sender address and port.
Definition scamp.h:116
@ IPFLAG_TRANS
Entry is transient.
Definition scamp.h:113
@ IPFLAG_STRIP
Strip SDP headers.
Definition scamp.h:118
@ IPFLAG_ARP
Awaiting ARP resolution.
Definition scamp.h:114
void p2pc_addr_nn_send(uint arg1, uint arg2)
Transmit our current best guess of coordinates to all neighbouring chips.
Definition scamp-nn.c:504
uint level_addr
0: This chip's region at this level
Definition scamp.h:413
ushort rcvd
6: Number of responses received
Definition scamp.h:415
void clock_ap(uint virt_mask, uint enable)
Enable/disable clocks to a set of cores specified by a bit mask.
Definition scamp-app.c:40
uchar * p2p_addr_table
Definition scamp-3.c:173
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().
Definition scamp-3.c:355
uint app_mask[256]
Unused?
Definition scamp-nn.c:111
uchar link
Which ways to send along.
Definition scamp.h:407
uint p2p_dims
Dimensions of the P2P-addressable area.
Definition scamp-3.c:105
volatile uchar flags
General flags.
Definition scamp.h:404
#define PKT_QUEUE_SIZE
Max number of entries in packet queue.
Definition scamp.h:390
volatile int p2p_addr_guess_y
Y coordinate of the current best guess of P2P address.
Definition scamp-3.c:156
void nn_cmd_biff(uint x, uint y, uint data)
Board information flood fill command handler.
Definition scamp-nn.c:1260
uint * hop_table
Table "hop_table" has entries of type (id << 24, hops) for each possible P2P address.
Definition scamp-nn.c:106
uint result
12: Result accumulated within this region
Definition scamp.h:418
void desc_init(void)
initialise TX and RX descriptors
Definition scamp-p2p.c:167
void assign_virt_cpu(uint phys_cpu)
Build virtual/physical CPU maps.
Definition scamp-3.c:902
uint num_cpus
Number of operational CPUs.
Definition scamp-3.c:95
void remap_phys_cores(uint phys_cores)
Disables a specified core and recomputes the virtual core map accordingly.
Definition scamp-3.c:955
ushort flags
See scamp_iptag_flags.
Definition scamp.h:381
uint iptag_new(void)
Find a free IPTag.
Definition scamp-3.c:283
scamp_nn_p2p_config_subcommands
NN_CMD_P2PC sub-command codes.
Definition scamp.h:245
@ P2PC_DIMS
(Broadcast) The current best guess of P2P coordinates is...
Definition scamp.h:248
@ P2PC_RETH
Sending route back to 0, 0 or nearest Ethernet.
Definition scamp.h:249
@ P2PC_ADDR
Your P2P address is...
Definition scamp.h:246
@ P2PC_NEW
(Broadcast) I/somebody just discovered/updated my/their P2P address
Definition scamp.h:247
ushort dest_addr
Destination SDP address.
Definition scamp.h:384
void ff_nn_send(uint key, uint data, uint fwd_rty, uint log)
Flood fill NN packet sender.
Definition scamp-nn.c:448
volatile int p2p_max_y
Definition scamp-3.c:167
uchar insert
Insertion index.
Definition scamp.h:394
enum netinit_phase_e netinit_phase
The network initialisation process phase currently in progress.
Definition scamp-3.c:135
void proc_start_app(uint aplx_addr, uint id_op_mask)
Start an application on a set of cores.
Definition scamp-app.c:145
void boot_nn(uint hw_ver)
Boot SCAMP on chips using the bootROM protocols.
Definition scamp-boot.c:132
volatile int p2p_addr_guess_x
X coordinate of the current best guess of P2P address.
Definition scamp-3.c:154
scamp_nn_opcodes
NN opcodes.
Definition scamp.h:223
@ NN_CMD_SP_3
Spare.
Definition scamp.h:227
@ NN_CMD_LTPC
Local Time Phase Control (ID=0, Fwd=0)
Definition scamp.h:226
@ NN_CMD_FBS
Filtered in FF code.
Definition scamp.h:239
@ NN_CMD_SIG1
Misc (MEM, etc)
Definition scamp.h:229
@ NN_CMD_P2PB
Hop count limited.
Definition scamp.h:234
@ NN_CMD_RTRC
Router Control Reg.
Definition scamp.h:225
@ NN_CMD_FFS
Flood fill start.
Definition scamp.h:231
@ NN_CMD_SIG0
Misc (GTPC, Set FwdRty, LED, etc)
Definition scamp.h:224
@ NN_CMD_FFCS
Flood fill core and region select.
Definition scamp.h:232
@ NN_CMD_P2PC
P2P Address setup (Handled specially)
Definition scamp.h:230
@ NN_CMD_BIFF
Board-info flood-fill (handled specially)
Definition scamp.h:237
@ NN_CMD_NISYN
Synchronize Netinit level.
Definition scamp.h:236
@ NN_CMD_LKSYN
Synchronize opposite links.
Definition scamp.h:235
void proc_byte_set(uint a1, uint a2)
Write a byte at a location.
Definition scamp-3.c:333
scamp_failure_codes
Failure codes.
Definition scamp.h:148
@ FAIL_VEC
Unhandled exception.
Definition scamp.h:167
@ FAIL_ROMX
Exception in ROM code.
Definition scamp.h:150
@ FAIL_TIMER
Timer reg test failed.
Definition scamp.h:155
@ FAIL_ITCM0
ITCM top 512 failure.
Definition scamp.h:151
@ FAIL_VIC
VIC reg test failed.
Definition scamp.h:156
@ FAIL_MP
Previous monitor proc failure.
Definition scamp.h:160
@ FAIL_ITCM1
ITCM main test failure.
Definition scamp.h:152
@ FAIL_RESET
Catch-all - set at reset.
Definition scamp.h:149
@ FAIL_DMA
DMAC reg test failed.
Definition scamp.h:158
@ FAIL_TLM
Special for TLM.
Definition scamp.h:165
@ FAIL_MANUF
App CPU in manuf test.
Definition scamp.h:162
@ FAIL_LATE
App CPU failed to set CPU_OK.
Definition scamp.h:161
@ FAIL_SLEEP
Ordered to sleep in startup.
Definition scamp.h:163
@ FAIL_CC
Comms ctlr reg test failed.
Definition scamp.h:157
@ FAIL_DTCM
DTCM test failure.
Definition scamp.h:153
uint count
Count of packets routed via this IPTag.
Definition scamp.h:382
void vic_setup(void)
Initialise the VIC.
Definition scamp-isr.c:432
IPTAG entry (32 bytes)
Definition scamp.h:376
Used for tracking signal dispatch.
Definition scamp.h:412
Holds a NN packet awaiting transmission.
Definition scamp.h:402
Queue of packets (really a circular buffer)
Definition scamp.h:393
unsigned char uchar
Unsigned integer - 8 bits.
Definition spinnaker.h:37
unsigned int uint
Unsigned integer - 32 bits.
Definition spinnaker.h:39
unsigned short ushort
Unsigned integer - 16 bits.
Definition spinnaker.h:38