sPyNNaker neural_modelling 7.2.2
|
Implementation of delay extensions. More...
#include "delay_extension.h"
#include <common/neuron-typedefs.h>
#include <common/in_spikes.h>
#include <bit_field.h>
#include <data_specification.h>
#include <debug.h>
#include <simulation.h>
#include <spin1_api.h>
#include <common/send_mc.h>
Go to the source code of this file.
Data Structures | |
struct | delay_extension_provenance |
Structure of the provenance data. More... | |
Macros | |
#define | IN_BUFFER_SIZE 256 |
the size of the circular queue for packets. | |
#define | COUNTER_SATURATION_VALUE 255 |
the point where the count has saturated. | |
Enumerations | |
enum | delay_extension_callback_priorities { MC_PACKET = -1 , TIMER = 0 , USER = 0 , SDP = 1 , BACKGROUND = 1 , DMA = 2 } |
values for the priority for each callback More... | |
Functions | |
static void | zero_spike_counters (uint8_t *counters, uint32_t num_items) |
Sets an array of counters to zero. | |
static uint32_t | round_to_next_pot (uint32_t v) |
Rounds up to the next power of two. | |
static bool | read_parameters (struct delay_parameters *params) |
Read the configuration region. | |
static void | store_provenance_data (address_t provenance_region) |
Writes the provenance data. | |
static bool | initialize (void) |
Read the application configuration. | |
static void | incoming_spike_callback (uint key, uint payload) |
Handles incoming spikes (FIQ) | |
static index_t | key_n (key_t k) |
Gets the neuron ID of the incoming spike. | |
static void | spike_process (void) |
Processes spikes queued by incoming_spike_callback() | |
static void | user_callback (uint unused0, uint unused1) |
User event callback. | |
static void | background_callback (uint local_time, uint timer_count) |
Background event callback. | |
static void | timer_callback (uint timer_count, uint unused1) |
Main timer callback. | |
void | c_main (void) |
Entry point. | |
Variables | |
static bool | has_key |
bool in int form for if there is a key | |
static uint32_t | key = 0 |
Base multicast key for sending messages. | |
static uint32_t | incoming_key = 0 |
Key for receiving messages. | |
static uint32_t | incoming_mask = 0 |
Mask for incoming_key to say which messages are for this program. | |
static uint32_t | incoming_neuron_mask = 0 |
Mask for key (that matches incoming_key/incoming_mask) to extract the neuron ID from it. | |
static uint32_t | num_neurons = 0 |
Number of neurons supported. | |
static uint32_t | max_keys = 0 |
number of possible keys. | |
static bool | clear_input_buffers_of_late_packets |
Whether to clear packets each timestep. | |
static uint32_t | time = UINT32_MAX |
Simulation time. | |
static uint32_t | simulation_ticks = 0 |
Simulation speed. | |
static uint32_t | infinite_run |
True if we're running forever. | |
static uint8_t ** | spike_counters = NULL |
The spike counters, as a 2D array. | |
static uint32_t | num_delay_stages = 0 |
The number of delay stages. | |
static uint32_t | n_delay_in_a_stage = 0 |
The number of delays within a delay stage. | |
static uint32_t | num_delay_slots = 0 |
The total number of delay slots. | |
static uint32_t | num_delay_slots_mask = 0 |
Mask for converting time into the current delay slot. | |
static uint32_t | neuron_bit_field_words = 0 |
Size of each bitfield in ::neuron_delay_stage_config. | |
static uint32_t | n_in_spikes = 0 |
Number of input spikes. | |
static uint32_t | n_processed_spikes = 0 |
Number of spikes transferred via queue. | |
static uint32_t | n_spikes_sent = 0 |
Number of spikes sent. | |
static uint32_t | n_spikes_added = 0 |
Number of spikes added to delay processing. | |
static uint32_t | n_delays = 0 |
Number of times we had to back off because the comms hardware was busy. | |
static uint32_t | saturation_count = 0 |
Number of packets dropped due to count saturation. | |
static uint32_t | n_packets_dropped_due_to_invalid_neuron_value = 0 |
number of packets dropped due to invalid neuron id | |
static uint32_t | n_packets_dropped_due_to_invalid_key = 0 |
number of packets dropped due to invalid key | |
static uint32_t | count_input_buffer_packets_late |
number of packets late | |
static uint32_t | timer_period = 0 |
Used for configuring the timer hardware. | |
static bool | spike_processing = false |
Is spike processing happening right now? | |
static uint32_t | n_backgrounds_queued = 0 |
The number of background tasks queued / running. | |
static uint32_t | n_background_overloads = 0 |
The number of times the background couldn't be added. | |
static uint32_t | max_backgrounds_queued = 0 |
The maximum number of background tasks queued. | |
static uint32_t | n_colour_bits = 0 |
The number of colour bits (both from source and to send) | |
static uint32_t | colour_mask = 0 |
The mask to apply to get the colour from the current timestep or key. | |
static uint32_t | colour = 0 |
The colour for the current time step. | |
Implementation of delay extensions.
Definition in file delay_extension.c.
struct delay_extension_provenance |
Structure of the provenance data.
Definition at line 48 of file delay_extension.c.
#define IN_BUFFER_SIZE 256 |
the size of the circular queue for packets.
Definition at line 32 of file delay_extension.c.
#define COUNTER_SATURATION_VALUE 255 |
the point where the count has saturated.
Definition at line 35 of file delay_extension.c.
values for the priority for each callback
Definition at line 38 of file delay_extension.c.
|
inlinestatic |
Sets an array of counters to zero.
This is basically just bzero()
[out] | counters | The array to zero |
[in] | num_items | The size of the array |
Definition at line 179 of file delay_extension.c.
|
inlinestatic |
Rounds up to the next power of two.
[in] | v | The value to round up |
Definition at line 189 of file delay_extension.c.
|
static |
Read the configuration region.
[in] | params | The configuration region. |
Definition at line 203 of file delay_extension.c.
|
static |
Writes the provenance data.
[out] | provenance_region | Where to write the provenance |
Definition at line 265 of file delay_extension.c.
|
static |
Read the application configuration.
Definition at line 289 of file delay_extension.c.
Handles incoming spikes (FIQ)
Adds the spikes to the circular buffer handling spikes for later handling by spike_process()
[in] | key | the key of the multicast message |
payload | ignored |
Definition at line 333 of file delay_extension.c.
Gets the neuron ID of the incoming spike.
[in] | k | The key |
Definition at line 355 of file delay_extension.c.
|
inlinestatic |
Processes spikes queued by incoming_spike_callback()
Definition at line 360 of file delay_extension.c.
User event callback.
Delegates to spike_process()
[in] | unused0 | unused |
[in] | unused1 | unused |
Definition at line 414 of file delay_extension.c.
Background event callback.
Handles sending delayed spikes at the right time.
[in] | local_time | current simulation time |
[in] | timer_count | unused |
Definition at line 422 of file delay_extension.c.
Main timer callback.
[in] | timer_count | The current time |
unused1 | unused |
Definition at line 482 of file delay_extension.c.
void c_main | ( | void | ) |
Entry point.
Definition at line 538 of file delay_extension.c.
|
static |
bool in int form for if there is a key
Definition at line 77 of file delay_extension.c.
|
static |
Base multicast key for sending messages.
Definition at line 79 of file delay_extension.c.
|
static |
Key for receiving messages.
Definition at line 81 of file delay_extension.c.
|
static |
Mask for incoming_key to say which messages are for this program.
Definition at line 83 of file delay_extension.c.
|
static |
Mask for key (that matches incoming_key/incoming_mask) to extract the neuron ID from it.
Definition at line 86 of file delay_extension.c.
|
static |
Number of neurons supported.
Definition at line 89 of file delay_extension.c.
|
static |
number of possible keys.
Definition at line 92 of file delay_extension.c.
|
static |
Whether to clear packets each timestep.
Definition at line 95 of file delay_extension.c.
|
static |
Simulation time.
Definition at line 98 of file delay_extension.c.
|
static |
Simulation speed.
Definition at line 100 of file delay_extension.c.
|
static |
True if we're running forever.
Definition at line 102 of file delay_extension.c.
|
static |
The spike counters, as a 2D array.
Time slots are the time of reception of the spike, masked by num_delay_slots_mask, and neuron IDs are extracted from the spike key by masking with incoming_neuron_mask
Definition at line 111 of file delay_extension.c.
|
static |
The number of delay stages.
Definition at line 113 of file delay_extension.c.
|
static |
The number of delays within a delay stage.
Definition at line 115 of file delay_extension.c.
|
static |
The total number of delay slots.
Definition at line 117 of file delay_extension.c.
|
static |
Mask for converting time into the current delay slot.
Definition at line 119 of file delay_extension.c.
|
static |
Size of each bitfield in ::neuron_delay_stage_config.
Definition at line 121 of file delay_extension.c.
|
static |
Number of input spikes.
Definition at line 124 of file delay_extension.c.
|
static |
Number of spikes transferred via queue.
Definition at line 126 of file delay_extension.c.
|
static |
Number of spikes sent.
Definition at line 128 of file delay_extension.c.
|
static |
Number of spikes added to delay processing.
Definition at line 130 of file delay_extension.c.
|
static |
Number of times we had to back off because the comms hardware was busy.
Definition at line 133 of file delay_extension.c.
|
static |
Number of packets dropped due to count saturation.
Definition at line 136 of file delay_extension.c.
|
static |
number of packets dropped due to invalid neuron id
Definition at line 139 of file delay_extension.c.
|
static |
number of packets dropped due to invalid key
Definition at line 142 of file delay_extension.c.
|
static |
number of packets late
Definition at line 145 of file delay_extension.c.
|
static |
Used for configuring the timer hardware.
Definition at line 148 of file delay_extension.c.
|
static |
Is spike processing happening right now?
Definition at line 151 of file delay_extension.c.
|
static |
The number of background tasks queued / running.
Definition at line 154 of file delay_extension.c.
|
static |
The number of times the background couldn't be added.
Definition at line 157 of file delay_extension.c.
|
static |
The maximum number of background tasks queued.
Definition at line 160 of file delay_extension.c.
|
static |
The number of colour bits (both from source and to send)
Definition at line 163 of file delay_extension.c.
|
static |
The mask to apply to get the colour from the current timestep or key.
Definition at line 166 of file delay_extension.c.
|
static |
The colour for the current time step.
Definition at line 169 of file delay_extension.c.