35#define MAX_DMA_CALLBACK_TAG 16
40 uint32_t application_magic_number;
41 uint32_t timer_period;
42 uint32_t control_sdp_port;
43 uint32_t num_timing_detail_words;
48 uint32_t transmission_event_overflow;
49 uint32_t callback_queue_overloads;
50 uint32_t dma_queue_overloads;
51 uint32_t user_queue_overloads;
52 uint32_t timer_tic_has_overrun;
53 uint32_t max_num_timer_tic_overrun;
54 uint32_t provenance_data_elements[];
113 address_t address, uint32_t expected_application_magic_number,
114 uint32_t* timer_period, uint32_t *simulation_ticks_pointer,
115 uint32_t *infinite_run_pointer, uint32_t *time_pointer,
116 int sdp_packet_callback_priority,
int dma_transfer_complete_priority);
143 address_t address, uint32_t expected_application_magic_number,
144 uint32_t *simulation_steps_pointer, uint32_t *infinite_steps_pointer,
145 uint32_t *step_pointer,
int sdp_packet_callback_priority,
146 int dma_transfer_complete_priority) {
148 uint32_t unused_timer_period;
150 &unused_timer_period, simulation_steps_pointer, infinite_steps_pointer,
151 step_pointer, sdp_packet_callback_priority,
152 dma_transfer_complete_priority);
Data type definitions for SpiNNaker Neuron-modelling.
uint32_t * address_t
A generic pointer to a word.
static callback_t sdp_callback[NUM_SDP_PORTS]
the list of SDP callbacks for ports
void simulation_handle_pause_resume(resume_callback_t callback)
cleans up the house keeping, falls into a sync state and handles the resetting up of states as requir...
bool simulation_sdp_callback_on(uint sdp_port, callback_t sdp_callback)
Registers an additional SDP callback on a given SDP port. This is required when using simulation_regi...
void simulation_set_provenance_function(prov_callback_t provenance_function, address_t provenance_data_address)
Set an additional callback function to store extra provenance data.
void simulation_set_provenance_data_address(address_t provenance_data_address)
Set the address of the data region where provenance data is to be stored.
void(* resume_callback_t)(void)
the definition of the callback used by pause and resume
void(* exit_callback_t)(void)
void simulation_exit(void)
a helper method for people not using the auto pause and resume functionality
void simulation_set_start_function(start_callback_t start_function)
Set an additional function to call before starting the binary.
void simulation_set_uses_timer(bool sim_uses_timer)
set whether the simulation uses the timer. By default it will be assumed that simulations use the tim...
resume_callback_t start_callback_t
the definition of the callback used to call a function once at start
void simulation_set_exit_function(exit_callback_t exit_function)
Set an additional function to call before exiting the binary when running without a fixed duration of...
bool simulation_is_finished(void)
determine if the simulation is finished. Will also pause the simulation for resynchronisation if requ...
void(* prov_callback_t)(address_t)
the definition of the callback used by provenance data functions
bool simulation_dma_transfer_done_callback_on(uint tag, callback_t callback)
registers a DMA transfer callback to the simulation system
void simulation_ready_to_read(void)
Indicates that all data has been written and the core is going idle, so any data can now be read.
void simulation_sdp_callback_off(uint sdp_port)
disables SDP callbacks on the given port
void simulation_set_sync_steps(uint32_t n_steps)
sets the simulation to enter a synchronisation barrier repeatedly during the simulation....
static bool simulation_steps_initialise(address_t address, uint32_t expected_application_magic_number, uint32_t *simulation_steps_pointer, uint32_t *infinite_steps_pointer, uint32_t *step_pointer, int sdp_packet_callback_priority, int dma_transfer_complete_priority)
initialises the simulation interface for step-based simulation, which involves:
void simulation_dma_transfer_done_callback_off(uint tag)
turns off a registered callback for a given DMA transfer done tag
simulation_commands
the commands that the simulation control protocol may send
@ CMD_STOP
Asks the simulation loop to stop as soon as possible.
@ CMD_GET_TIME
Get the current simulation time.
@ PROVENANCE_DATA_GATHERING
Asks the application to gather provenance data.
@ CMD_RUNTIME
Tells the simulation loop how long to run for.
@ IOBUF_CLEAR
Clears the IOBUF.
void simulation_run(void)
Starts the simulation running, returning when it is complete,.
bool simulation_initialise(address_t address, uint32_t expected_application_magic_number, uint32_t *timer_period, uint32_t *simulation_ticks_pointer, uint32_t *infinite_run_pointer, uint32_t *time_pointer, int sdp_packet_callback_priority, int dma_transfer_complete_priority)
initialises the simulation interface which involves:
the position and human readable terms for each element from the region containing the timing details.
elements that are always grabbed for provenance if possible when requested