SpiNNFrontEndCommon 7.2.2
Common support code for user-facing front end systems.
|
The implementation of the Command Sender Multicast Source. More...
#include <common-typedefs.h>
#include <data_specification.h>
#include <debug.h>
#include <simulation.h>
#include <stdbool.h>
Go to the source code of this file.
Data Structures | |
struct | command |
Command structure, describing a SpiNNaker multicast packet to be sent at some point. More... | |
struct | timed_command |
A command that happens at a particular simulation time. More... | |
struct | command_list |
A collection of commands to be sent in response to an event. More... | |
struct | timed_command_list |
A collection of commands to be sent at particular simulation times. More... | |
struct | cs_provenance_t |
custom provenance data More... | |
Enumerations | |
enum | callback_priorities { SDP = 0 , DMA = 1 , TIMER = 2 } |
values for the priority for each callback More... | |
enum | region_identifiers { SYSTEM_REGION = 0 , COMMANDS_WITH_ARBITRARY_TIMES , COMMANDS_AT_START_RESUME , COMMANDS_AT_STOP_PAUSE , PROVENANCE_REGION } |
region identifiers More... | |
enum | { FIRST_TIME = 0 } |
time ID More... | |
Functions | |
static void | transmit_command (command *command_to_send) |
Immediately sends SpiNNaker multicast packets in response to a command. | |
static void | run_stop_pause_commands (void) |
Sends all the commands registered for sending on simulation stop or pause. | |
static void | run_start_resume_commands (void) |
Sends all the commands registered for sending on simulation start or resume. | |
static bool | read_scheduled_parameters (timed_command_list *sdram_timed_commands) |
Copy the list of commands to run at particular times into DTCM. | |
static bool | read_start_resume_commands (command_list *sdram_commands) |
Copy the list of commands to run on start or resume into DTCM. | |
static bool | read_pause_stop_commands (command_list *sdram_commands) |
Copy the list of commands to run on stop or pause into DTCM. | |
static void | timer_callback (uint unused0, uint unused1) |
The timer tick callback. Sends those commands that are due in the current simulation state and time. | |
static void | write_provenance (address_t address) |
Write our provenance data into the provenance region. | |
static bool | initialize (uint32_t *timer_period) |
Initialises the core. | |
void | c_main (void) |
Entry point. | |
Variables | |
static uint32_t | time |
The simulation timer. | |
static uint32_t | simulation_ticks |
The number of ticks to run for. | |
static uint32_t | infinite_run |
Whether the simulation is running "forever" (robotics mode). | |
static timed_command * | timed_commands |
The commands to send at particular times. | |
static command * | start_resume_commands |
The commands to run when a simulation starts or resumes after pause. | |
static command * | pause_stop_commands |
The commands to run when a simulation stops or pauses. | |
static uint32_t | n_timed_commands |
The number of timed commands. | |
static uint32_t | n_start_resume_commands |
The number of commands to send on start/resume. | |
static uint32_t | n_pause_stop_commands |
The number of commands to send on stop/pause. | |
static uint32_t | next_timed_command |
The index of the next timed command to run. | |
static bool | resume = true |
Whether we are in the state where the next run will be a start/resume. | |
static uint32_t | n_commands_sent |
The number of commands sent. | |
The implementation of the Command Sender Multicast Source.
The purpose of this application is to inject SpiNNaker packets into the on-chip network at specified times. It is used (among other things) to implement the SpikeSourceArray model in sPyNNaker.
Definition in file command_sender_multicast_source.c.
struct command |
Command structure, describing a SpiNNaker multicast packet to be sent at some point.
Note that the delay actually comes after sending each mandated packet when repeats are requested rather than just between packets.
Definition at line 36 of file command_sender_multicast_source.c.
Data Fields | ||
---|---|---|
uint32_t | key | The key of the packet. |
bool | has_payload | Whether to send a payload with the packet. |
uint32_t | payload | The payload for the packet. |
uint32_t | repeats |
The number of times to repeat the packet. If zero, the packet is only sent once. |
uint32_t | delay | The time (in microseconds) to delay between sending each repeat. |
struct timed_command |
A command that happens at a particular simulation time.
Definition at line 51 of file command_sender_multicast_source.c.
Data Fields | ||
---|---|---|
uint32_t | time | The simulation time to send a packet. |
command | command | What to send. |
struct command_list |
A collection of commands to be sent in response to an event.
This is used for SDRAM only.
Definition at line 59 of file command_sender_multicast_source.c.
Data Fields | ||
---|---|---|
uint32_t | size | The number of commands to send. |
command | commands[] | The commands to send. |
struct timed_command_list |
A collection of commands to be sent at particular simulation times.
This is used for SDRAM only.
Definition at line 67 of file command_sender_multicast_source.c.
Data Fields | ||
---|---|---|
uint32_t | size | The number of commands to send. |
timed_command | commands[] | The commands to send, sorted in time order. |
struct cs_provenance_t |
custom provenance data
Definition at line 123 of file command_sender_multicast_source.c.
Data Fields | ||
---|---|---|
uint32_t | n_commands_sent | The number of commands sent. |
values for the priority for each callback
Enumerator | |
---|---|
SDP | Responding to network traffic is highest priority. |
DMA | Handling memory transfers is next highest. |
TIMER | Responding to timers is lowest priority, and most common. |
Definition at line 99 of file command_sender_multicast_source.c.
region identifiers
Enumerator | |
---|---|
SYSTEM_REGION | Where simulation system information is stored. |
COMMANDS_WITH_ARBITRARY_TIMES | Where to read timed commands from. The region is formatted as a timed_command_list. |
COMMANDS_AT_START_RESUME | Where to read start/resume commands from. The region is formatted as a command_list. |
COMMANDS_AT_STOP_PAUSE | Where to read stop/pause commands from. The region is formatted as a command_list. |
PROVENANCE_REGION | Where to record provenance data. (Format: cs_provenance_t) |
Definition at line 106 of file command_sender_multicast_source.c.
time ID
Definition at line 129 of file command_sender_multicast_source.c.
Immediately sends SpiNNaker multicast packets in response to a command.
[in] | command_to_send | The command to send. |
Definition at line 136 of file command_sender_multicast_source.c.
Sends all the commands registered for sending on simulation stop or pause.
Definition at line 183 of file command_sender_multicast_source.c.
Sends all the commands registered for sending on simulation start or resume.
Definition at line 192 of file command_sender_multicast_source.c.
|
static |
Copy the list of commands to run at particular times into DTCM.
[in] | sdram_timed_commands | The memory region containing the description of what commands to send and when. |
Definition at line 203 of file command_sender_multicast_source.c.
|
static |
Copy the list of commands to run on start or resume into DTCM.
[in] | sdram_commands | The memory region containing the description of what commands to send. |
Definition at line 232 of file command_sender_multicast_source.c.
|
static |
Copy the list of commands to run on stop or pause into DTCM.
[in] | sdram_commands | The memory region containing the description of what commands to send. |
Definition at line 257 of file command_sender_multicast_source.c.
The timer tick callback. Sends those commands that are due in the current simulation state and time.
unused0 | unused |
unused1 | unused |
Definition at line 284 of file command_sender_multicast_source.c.
Write our provenance data into the provenance region.
[in] | address | Where to write |
Definition at line 318 of file command_sender_multicast_source.c.
Initialises the core.
[out] | timer_period | The timer tick period. |
Definition at line 326 of file command_sender_multicast_source.c.
Entry point.
Definition at line 360 of file command_sender_multicast_source.c.
|
static |
The simulation timer.
Definition at line 74 of file command_sender_multicast_source.c.
|
static |
The number of ticks to run for.
Definition at line 76 of file command_sender_multicast_source.c.
|
static |
Whether the simulation is running "forever" (robotics mode).
Definition at line 78 of file command_sender_multicast_source.c.
|
static |
The commands to send at particular times.
Definition at line 80 of file command_sender_multicast_source.c.
|
static |
The commands to run when a simulation starts or resumes after pause.
Definition at line 82 of file command_sender_multicast_source.c.
|
static |
The commands to run when a simulation stops or pauses.
Definition at line 84 of file command_sender_multicast_source.c.
|
static |
The number of timed commands.
Definition at line 86 of file command_sender_multicast_source.c.
|
static |
The number of commands to send on start/resume.
Definition at line 88 of file command_sender_multicast_source.c.
|
static |
The number of commands to send on stop/pause.
Definition at line 90 of file command_sender_multicast_source.c.
|
static |
The index of the next timed command to run.
Definition at line 92 of file command_sender_multicast_source.c.
Whether we are in the state where the next run will be a start/resume.
Definition at line 94 of file command_sender_multicast_source.c.
|
static |
The number of commands sent.
Definition at line 96 of file command_sender_multicast_source.c.