55#define DMA_BURST_SIZE 4
58#define N_DMA_BUFFERS 2
65#define END_FLAG_SIZE 4
67#define END_FLAG 0xFFFFFFFF
99#define SDP_TIMEOUT 1000
102#define LENGTH_OF_SDP_HEADER 8
109#define N_ROUTER_ENTRIES 1024
112#define INVALID_ROUTER_ENTRY_KEY 0xFFFFFFFF
115#define INVALID_ROUTER_ENTRY_MASK 0x00000000
118#define INVALID_ROUTER_ENTRY_ROUTE 0xFF000000
121#define APP_ID_MASK_FROM_FREE 0x000000FF
124#define APP_ID_OFFSET_FROM_FREE 24
127#define N_BASIC_SYSTEM_ROUTER_ENTRIES 1
130#define N_USABLE_ROUTER_ENTRIES (N_ROUTER_ENTRIES - N_BASIC_SYSTEM_ROUTER_ENTRIES)
137#define TDMA_WAIT_PERIOD 0
140#define ROUTER_INITIAL_TIMEOUT 0x4f
143#define TICK_PERIOD 10
146#define PKT_QUEUE_SIZE 4096
149#define ROUTER_TIMEOUT_MAX 0xFF
242 POSITION_OF_NO_MISSING_SEQ_PACKETS = 2,
243 START_OF_MISSING_MORE = 2,
244 START_OF_MISSING_SEQ_NUMS = 3,
293 uint reinjection_base_mc_key;
299 DATA_SPEED_UP_OUT_PORT = 5,
548static vcpu_t *
const _sark_virtual_processor_info = (
vcpu_t *) SV_VCPU;
637 .cc_tx_not_full =
true
645 .cc_tx_not_full =
true
691 .route = pkt->
hdr.route
697 if (control.payload) {
825 if (
config->multicast_flag == 1) {
832 if (
config->point_to_point_flag == 1) {
839 if (
config->fixed_route_flag == 1) {
846 if (
config->nearest_neighbour_flag == 1) {
853 "[INFO] Setting reinject mc to %d\n[INFO] Setting reinject pp to %d\n"
854 "[INFO] Setting reinject fr to %d\n[INFO] Setting reinject nn to %d\n",
884#ifdef DEBUG_REINJECTOR
908#ifdef DEBUG_REINJECTOR
909 io_printf(
IO_BUF,
"[DEBUG] setting router emergency timeouts via sdp\n");
936 "[INFO] Setting reinject mc to %d\n[INFO] Setting reinject pp to %d\n"
937 "[INFO] Setting reinject fr to %d\n[INFO] Setting reinject nn to %d\n",
968 data->packet_types_reinjected = 0;
971 for (
int i = 0;
i < 4;
i++) {
1011 .router_dump =
false
1051#ifdef DEBUG_REINJECTOR
1055#ifdef DEBUG_REINJECTOR
1060#ifdef DEBUG_REINJECTOR
1065#ifdef DEBUG_REINJECTOR
1070#ifdef DEBUG_REINJECTOR
1075#ifdef DEBUG_REINJECTOR
1080#ifdef DEBUG_REINJECTOR
1085#ifdef DEBUG_REINJECTOR
1102 .interrupt_enable =
false
1194 io_printf(
IO_BUF,
"[ERROR] Write address not set when write data received!\n");
1231 "[WARNING] failed to recognise multicast packet key 0x%08x\n",
1253 "[ERROR] Received error with requesting %u router entries.\n",
1267 "[DEBUG] Setting key %08x, mask %08x, route %08x for entry %u\n",
1268 sdram_address[
idx].key, sdram_address[
idx].
mask,
1273 sdram_address[
idx].
mask, sdram_address[
idx].route) != 1) {
1275 "with key %08x, mask %08x, route %08x\n",
1277 sdram_address[
idx].
mask, sdram_address[
idx].route);
1325 items->system_router_entries,
items->n_system_router_entries);
1353 io_printf(
IO_BUF,
"[INFO] Saving application router entries from router\n");
1367 "[WARNING] Already loaded system router; ignoring but replying\n");
1379 "[WARNING] Received unknown SDP packet in data in speed up port"
1380 " with command id %d\n", msg->
cmd_rc);
1463 .length_words = n_words
1562 i < length;
i++,
j++) {
1564#ifdef DEBUG_DATA_OUT
1588 data[POSITION_OF_NO_MISSING_SEQ_PACKETS];
1607 "[ERROR] Can't allocate SDRAM for missing seq nums\n");
1610#ifdef DEBUG_DATA_OUT
1627#ifdef DEBUG_DATA_OUT
1629 io_printf(
IO_BUF,
"[WARNING] Unable to save missing sequence number\n");
1701#ifdef DEBUG_DATA_OUT
1704 "[WARNING] Got some bad seq num here; max is %d, got %d\n",
1721#ifdef DEBUG_DATA_OUT
1744 "[WARNING] received start message with unexpected "
1745 "transaction id %d; mine is %d\n",
1785 "[WARNING] received data from a different transaction for "
1786 "start of missing. expected %d got %d\n",
1793#ifdef DEBUG_DATA_OUT
1809 "[WARNING] received data from different transaction for "
1810 "more missing; expected %d, got %d\n",
1843 "[WARNING] received data from different transaction for "
1844 "clear; expected %d, got %d\n",
1848#ifdef DEBUG_DATA_OUT
1920void __real_sark_int(
void *
pc);
1923void __wrap_sark_int(
void *
pc) {
1927 __real_sark_int(
pc);
1947#ifdef DEBUG_REINJECTOR
1948 io_printf(IO_BUF,
"[DEBUG] timeout when sending reinjection reply\n");
1953 case DATA_SPEED_UP_OUT_PORT:
1962 io_printf(IO_BUF,
"[DEBUG] timeout when sending speedup ctl reply\n");
1968 io_printf(IO_BUF,
"[WARNING] unexpected port %d\n",
1969 (msg->
dest_port & PORT_MASK) >> PORT_SHIFT);
1971 "[INFO] from:%04x:%02x to:%04x:%02x cmd:%04x len:%d iam:%04x\n",
2018#ifdef DEBUG_DATA_OUT
2020 "[INFO] new seq key = %d, first data key = %d, transaction id key = %d, "
2021 "end flag key = %d, basic_data_key = %d\n",
2037 .clear_done_int =
true,
2038 .clear_timeout_int =
true,
2039 .clear_write_buffer_int =
true
2045 .clear_done_int =
true
2050 .transfer2_done_interrupt =
true,
2051 .timeout_interrupt =
true,
2052 .crc_error_interrupt =
true,
2053 .tcm_error_interrupt =
true,
2054 .axi_error_interrupt =
true,
2055 .user_abort_interrupt =
true,
2056 .soft_reset_interrupt =
true,
2057 .write_buffer_error_interrupt =
true
2067 "[ERROR] failed to allocate SDRAM for application mc router entries\n");
2122 .router_dump =
true,
2125 .dma_timeout =
true,
2145 .interrupt_enable =
true,
2146 .periodic_mode =
true,
@ DMA
DMA processing is lowest priority.
@ SDP
Responding to communications from host is next highest.
callback_priorities
values for the priority for each callback
Data type definitions for SpiNNaker Neuron-modelling.
uint32_t * address_t
A generic pointer to a word.
Common definitions for the non-SCAMP system binaries.
static void initialise_reinjection_mc_api(uint32_t base_mc_key)
sets up the multicast keys for the reinjection multicast API
static uint reinject_clear_mc_key
the multicast key used for clear reinjector queue to all extra monitors
@ CMD_DPRI_SET_ROUTER_EMERGENCY_TIMEOUT
Set the router's wait2 timeout.
@ CMD_DPRI_RESET_COUNTERS
Reset the reinjection counters.
@ CMD_DPRI_SET_ROUTER_TIMEOUT
Set the router's wait1 timeout.
@ CMD_DPRI_GET_STATUS
Get the status of the reinjector.
@ CMD_DPRI_EXIT
Stop doing reinjection.
@ CMD_DPRI_CLEAR
Clear the reinjection queue.
@ CMD_DPRI_SET_PACKET_TYPES
Set what packet types are reinjected.
static uint reinject_emergency_timeout_mc_key
the multicast key used for emergency timeouts to all extra monitors
static uint reinject_timeout_mc_key
the multicast key used for basic timeouts to all extra monitors
#define TRANSACTION_CAP
Flag for cap on transaction id.
static void reflect_sdp_message(sdp_msg_t *msg, uint body_length)
Updates an SDP message so its content (a response to the message) goes back to where the message came...
Data Specification region access API.
data_specification_metadata_t * data_specification_get_data_address(void)
Gets the location of the data for this core using the user0 entry of the SARK VCPU structure.
bool data_specification_read_header(data_specification_metadata_t *ds_regions)
Reads the header from the address given and checks if the parameters are of the correct values.
static void * data_specification_get_region(uint32_t region, data_specification_metadata_t *ds_regions)
Gets the address of a region.
static uint32_t data[ITEMS_PER_DATA_PACKET]
functionality_to_port_num_map
values for port numbers this core will respond to
@ REINJECTION_PORT
Reinjection control messages.
@ DATA_SPEED_UP_IN_PORT
Data Speed Up Inbound messages.
static uint32_t transaction_id
The Data In transaction ID. Used to distinguish streams of packets.
static uint32_t packets_sent
The number of packets sent so far this timestamp.
static uint32_t mask
Mask for keys to determine if the key matches the key_space.
The configuration parameters for the application.
void sark_delay_us(uint delay)
void * sark_xalloc(heap_t *heap, uint size, uint tag, uint flag)
void io_printf(char *stream, char *format,...)
uint rtr_alloc_id(uint size, uint app_id)
void cpu_int_restore(uint cpsr)
uint sark_msg_send(sdp_msg_t *msg, uint timeout)
volatile uchar mbox_ap_cmd
void rtr_free(uint entry, uint clear)
void sark_shmsg_free(sdp_msg_t *msg)
uint cpu_fiq_disable(void)
uint rtr_mc_set(uint entry, uint key, uint mask, uint route)
void sark_msg_free(sdp_msg_t *msg)
void sark_cpu_state(cpu_state state)
uint sark_heap_max(heap_t *heap, uint flag)
sdp_msg_t * sark_msg_get(void)
void rt_error(uint code,...)
void sark_msg_cpy(sdp_msg_t *to, sdp_msg_t *from)
uint rtr_mc_get(uint entry, rtr_entry_t *r)
void sark_xfree(heap_t *heap, void *ptr, uint flag)
uint16_t length
Length (measured from flags field start)
uint32_t data[ITEMS_PER_DATA_PACKET]
User data (272 bytes when no SCP header)
@ ITEMS_PER_DATA_PACKET
How many multicast packets are to be received per SDP packet.
An SDP message with purely data, no SCP header.
cback_t callback[NUM_EVENTS]
static void wait_for_interrupt(void)
Wait for any interrupt to occur.