sPyNNaker neural_modelling 7.3.1
|
Implementation of non-inlined API in synapses.h. More...
#include "synapses.h"
#include "spike_processing.h"
#include "neuron.h"
#include "plasticity/synapse_dynamics.h"
#include <profiler.h>
#include <debug.h>
#include <spin1_api.h>
#include <utils.h>
Go to the source code of this file.
Data Structures | |
struct | synapse_params |
The layout of the synapse parameters region. More... | |
Functions | |
static const char * | get_type_char (uint32_t synapse_type) |
get the synapse type character | |
static void | print_synaptic_row (synaptic_row_t synaptic_row) |
Print a synaptic row. | |
static void | print_ring_buffers (uint32_t time) |
Print the contents of the ring buffers. | |
static bool | process_fixed_synapses (synapse_row_fixed_part_t *fixed_region, uint32_t time, uint32_t colour_delay) |
The "inner loop" of the neural simulation. | |
bool | synapses_initialise (address_t synapse_params_address, uint32_t *n_neurons_out, uint32_t *n_synapse_types_out, weight_t **ring_buffers_out, uint32_t **ring_buffer_to_input_buffer_left_shifts, bool *clear_input_buffers_of_late_packets_init, uint32_t *incoming_spike_buffer_size) |
Initialise the synapse processing. | |
void | synapses_flush_ring_buffers (timer_t time) |
Reset the ring buffers to 0 at the given time. | |
bool | synapses_process_synaptic_row (uint32_t time, uint32_t spike_colour, uint32_t colour_mask, synaptic_row_t row, bool *write_back) |
process a synaptic row | |
uint32_t | synapses_get_pre_synaptic_events (void) |
returns the counters for plastic and fixed pre synaptic events based on (if the model was compiled with SYNAPSE_BENCHMARK parameter) or returns 0 | |
void | synapses_resume (timer_t time) |
Resume processing of synapses after a pause. | |
Variables | |
uint32_t | num_fixed_pre_synaptic_events = 0 |
if using profiler import profiler tags | |
static uint32_t | n_neurons |
The number of neurons. | |
static uint32_t | n_synapse_types |
The number of synapse types. | |
static weight_t * | ring_buffers |
Ring buffers to handle delays between synapses and neurons. | |
static uint32_t | ring_buffer_size |
Ring buffer size. | |
static uint32_t | ring_buffer_mask |
Ring buffer mask. | |
static uint32_t * | ring_buffer_to_input_left_shifts |
Amount to left shift the ring buffer by to make it an input. | |
uint32_t | synapse_type_index_bits |
Number of bits needed for the synapse type and index. | |
uint32_t | synapse_type_index_mask |
Mask to pick out the synapse type and index. | |
uint32_t | synapse_index_bits |
Number of bits in the synapse index. | |
uint32_t | synapse_index_mask |
Mask to pick out the synapse index. | |
uint32_t | synapse_type_bits |
Number of bits in the synapse type. | |
uint32_t | synapse_type_mask |
Mask to pick out the synapse type. | |
uint32_t | synapse_delay_bits |
Number of bits in the delay. | |
uint32_t | synapse_delay_mask |
Mask to pick out the delay. | |
uint32_t | synapses_saturation_count = 0 |
Count of the number of times the ring buffers have saturated. | |
uint32_t | skipped_synapses = 0 |
uint32_t | late_spikes = 0 |
Count of the spikes that are received late. | |
uint32_t | max_late_spike = 0 |
The maximum lateness of a spike. | |
static uint32_t | n_neurons_peak |
Number of neurons. | |
static uint32_t | synapse_delay_mask_shifted = 0 |
The mask of the delay shifted into position i.e. pre-shift. | |
Implementation of non-inlined API in synapses.h.
Definition in file synapses.c.
struct synapse_params |
The layout of the synapse parameters region.
Definition at line 256 of file synapses.c.
|
inlinestatic |
get the synapse type character
[in] | synapse_type | the synapse type |
Definition at line 105 of file synapses.c.
|
inlinestatic |
Print a synaptic row.
Only does anything when debugging.
[in] | synaptic_row | The synaptic row to print |
Definition at line 114 of file synapses.c.
|
inlinestatic |
Print the contents of the ring buffers.
Only does anything when debugging.
[in] | time | The current timestamp |
Definition at line 165 of file synapses.c.
|
inlinestatic |
The "inner loop" of the neural simulation.
Every spike event could cause up to 256 different weights to be put into the ring buffer.
[in] | fixed_region | The fixed region of the synaptic matrix |
[in] | time | The current simulation time |
Definition at line 206 of file synapses.c.
bool synapses_initialise | ( | address_t | synapse_params_address, |
uint32_t * | n_neurons, | ||
uint32_t * | n_synapse_types, | ||
weight_t ** | ring_buffers, | ||
uint32_t ** | ring_buffer_to_input_buffer_left_shifts, | ||
bool * | clear_input_buffers_of_late_packets_init, | ||
uint32_t * | incoming_spike_buffer_size | ||
) |
Initialise the synapse processing.
[in] | synapse_params_address | Synapse configuration in SDRAM |
[out] | n_neurons | Number of neurons that will be simulated |
[out] | n_synapse_types | Number of synapse types that will be simulated |
[out] | ring_buffers | The ring buffers that will be used |
[out] | ring_buffer_to_input_buffer_left_shifts | Array of shifts to use when converting from ring buffer values to input buffer values |
[out] | clear_input_buffers_of_late_packets_init | Inicates whether to clear the input buffers each time step |
[out] | incoming_spike_buffer_size | The number of spikes to support in the incoming spike circular buffer |
Definition at line 268 of file synapses.c.
void synapses_flush_ring_buffers | ( | timer_t | time | ) |
Reset the ring buffers to 0 at the given time.
[in] | time | the simulated time to reset the buffers at |
Definition at line 336 of file synapses.c.
bool synapses_process_synaptic_row | ( | uint32_t | time, |
uint32_t | spike_colour, | ||
uint32_t | colour_mask, | ||
synaptic_row_t | row, | ||
bool * | write_back | ||
) |
process a synaptic row
[in] | time | the simulated time |
[in] | spike_colour | the colour extracted from the spike key |
[in] | colour_mask | the colour mask extracted from the pop table |
[in] | row | the synaptic row in question |
[out] | write_back | whether to write back to SDRAM |
Definition at line 351 of file synapses.c.
uint32_t synapses_get_pre_synaptic_events | ( | void | ) |
returns the counters for plastic and fixed pre synaptic events based on (if the model was compiled with SYNAPSE_BENCHMARK parameter) or returns 0
Definition at line 405 of file synapses.c.
void synapses_resume | ( | timer_t | time | ) |
Resume processing of synapses after a pause.
[in] | time | The time at which the simulation is to start |
Definition at line 410 of file synapses.c.
uint32_t num_fixed_pre_synaptic_events = 0 |
if using profiler import profiler tags
Globals required for synapse benchmarking to work.
Definition at line 34 of file synapses.c.
|
static |
The number of neurons.
Definition at line 37 of file synapses.c.
|
static |
The number of synapse types.
Definition at line 40 of file synapses.c.
|
static |
Ring buffers to handle delays between synapses and neurons.
Definition at line 43 of file synapses.c.
|
static |
Ring buffer size.
Definition at line 46 of file synapses.c.
|
static |
Ring buffer mask.
Definition at line 49 of file synapses.c.
|
static |
Amount to left shift the ring buffer by to make it an input.
Definition at line 52 of file synapses.c.
uint32_t synapse_type_index_bits |
Number of bits needed for the synapse type and index.
The number of bits used by the synapse type and post-neuron index.
Definition at line 59 of file synapses.c.
uint32_t synapse_type_index_mask |
Mask to pick out the synapse type and index.
Definition at line 65 of file synapses.c.
uint32_t synapse_index_bits |
Number of bits in the synapse index.
The number of bits used by just the post-neuron index.
Definition at line 67 of file synapses.c.
uint32_t synapse_index_mask |
Mask to pick out the synapse index.
Definition at line 69 of file synapses.c.
uint32_t synapse_type_bits |
Number of bits in the synapse type.
Definition at line 71 of file synapses.c.
uint32_t synapse_type_mask |
Mask to pick out the synapse type.
Definition at line 73 of file synapses.c.
uint32_t synapse_delay_bits |
Number of bits in the delay.
Definition at line 75 of file synapses.c.
uint32_t synapse_delay_mask |
Mask to pick out the delay.
The mask to get the synaptic delay from a "synapse".
Definition at line 77 of file synapses.c.
uint32_t synapses_saturation_count = 0 |
Count of the number of times the ring buffers have saturated.
Count of the number of times the synapses have saturated their weights.
Definition at line 80 of file synapses.c.
uint32_t skipped_synapses = 0 |
Count of the synapses that have been skipped because the delay wasn't big enough given how long the spike took to arrive
Definition at line 84 of file synapses.c.
uint32_t late_spikes = 0 |
Count of the spikes that are received late.
Definition at line 87 of file synapses.c.
uint32_t max_late_spike = 0 |
The maximum lateness of a spike.
Definition at line 90 of file synapses.c.
|
static |
Number of neurons.
Definition at line 93 of file synapses.c.
|
static |
The mask of the delay shifted into position i.e. pre-shift.
Definition at line 96 of file synapses.c.