22#include "local_only/local_only_impl.h"
86 uint32_t packets_this_time_step;
129 for (uint32_t i =
n_spikes; i > 0; i--) {
165 uint32_t n_rec_regions_used, uint16_t **ring_buffers_ptr) {
168 if (!local_only_impl_initialise(local_only_params_addr)) {
178 log_error(
"Error setting up input buffer of size %u",
179 config.input_buffer_size);
182 log_info(
"Created input buffer with %u entries",
config.input_buffer_size);
189 log_info(
"synapse_index_bits = %u, synapse_type_index_bits = %u, "
198 log_error(
"Could not allocate %u entries for ring buffers",
202 log_info(
"Created ring buffer with %u entries at 0x%08x",
227 uint32_t n_spikes_left = circular_buffer_size(
input_buffer);
229 if (
config.clear_input_buffer) {
uint32_t time
The current timer tick value.
circular_buffer circular_buffer_initialize(uint32_t size)
void log_error(const char *message,...)
void log_info(const char *message,...)
static uint32_t key
Base multicast key for sending messages.
uint32_t n_spikes[2]
Spike buffer counters.
static volatile bool process_loop_running
uint32_t log_max_delay
Log_2 of the maximum delay supported.
static uint32_t n_spikes_dropped
The number of spikes discarded in total during the run.
uint32_t log_n_synapse_types
Log_2 of the number of synapse types.
uint32_t clear_input_buffer
Whether to clear the input buffer.
uint32_t synapse_delay_mask
The mask to get the synaptic delay from a "synapse".
void local_only_clear_input(uint32_t time)
Clear the spikes for the last time step.
void mc_rcv_payload_callback(uint key, uint n_spikes)
Multicast packet with payload received callback.
static uint32_t max_spikes_received
The maximum number of spikes received in any time step.
static uint16_t * ring_buffers
Ring buffers to add weights to on spike processing.
uint32_t synapse_type_index_bits
The number of bits used by the synapse type and post-neuron index.
static uint32_t max_input_buffer_size
The maximum size of the input buffer during the run.
uint32_t input_buffer_size
The size to reserve for the input buffer of spikes.
uint32_t synapse_index_bits
The number of bits used by just the post-neuron index.
static void run_next_process_loop(void)
Start the process loop.
static uint32_t local_time
The local time step counter.
uint32_t p_per_ts_region
The region where packets-per-timestep are stored.
void local_only_store_provenance(struct local_only_provenance *prov)
Store provenance gathered during run.
static uint32_t n_spikes_received
The number of spikes received in total in the last time step.
bool local_only_initialise(void *local_only_addr, void *local_only_params_addr, uint32_t n_rec_regions_used, uint16_t **ring_buffers_ptr)
Set up local-only processing of spikes.
static struct @8 p_per_ts_struct
The number of packets received this time step for recording.
void mc_rcv_callback(uint key, uint unused)
Multicast packet without payload received callback.
uint32_t log_n_neurons
Log_2 of the number of neurons.
static circular_buffer input_buffer
The input buffer for spikes received.
static void update_max_input_buffer(void)
Update the maximum size of the input buffer.
void process_callback(uint time, uint unused1)
User callback; performs spike processing loop.
Defines the "local-only" processing of spikes, that is, the processing of spikes without using transf...
uint32_t max_input_buffer_size
The maximum size of the spike input queue at any time.
uint32_t n_spikes_lost_from_input
The number of spikes dropped due to the queue having no space.
uint32_t n_spikes_dropped
The number of spikes dropped due to running out of time in a time step.
uint32_t max_spikes_received_per_timestep
The maximum number of spikes received in a time step.
bool recording_record(channel_index_t channel, void *data, size_t size_bytes)
A region of SDRAM used to transfer synapses.
uint spin1_trigger_user_event(uint arg0, uint arg1)
uint spin1_int_disable(void)
void spin1_mode_restore(uint value)
void spin1_callback_on(uint event_id, callback_t cback, int priority)
static uint32_t ring_buffer_size
Ring buffer size.
uint32_t synapse_delay_bits
Number of bits in the delay.