sPyNNaker neural_modelling 7.2.2
|
implementation for handling the processing of synapse rows. More...
#include <common/neuron-typedefs.h>
Go to the source code of this file.
Data Structures | |
struct | synapse_row_plastic_part_t |
The type of the plastic-plastic part of the row. More... | |
struct | synapse_row_fixed_part_t |
The type of the fixed part of the row. The fixed-plastic part follows. More... | |
Macros | |
#define | SYNAPSE_WEIGHT_BITS 16 |
how many bits the synapse weight will take | |
#define | N_SYNAPSE_ROW_HEADER_WORDS 3 |
Number of header words per synaptic row. | |
Typedefs | |
typedef uint16_t | control_t |
Define the type of the control data. | |
Functions | |
static size_t | synapse_row_plastic_size (const synaptic_row_t row) |
Get the size of the plastic region. | |
static synapse_row_plastic_data_t * | synapse_row_plastic_region (synaptic_row_t row) |
Get the address of the plastic region. | |
static synapse_row_fixed_part_t * | synapse_row_fixed_region (synaptic_row_t row) |
Get the address of the non-plastic (or fixed) region. | |
static size_t | synapse_row_num_fixed_synapses (const synapse_row_fixed_part_t *fixed) |
Get the number of fixed synapses in the row. | |
static size_t | synapse_row_num_plastic_controls (const synapse_row_fixed_part_t *fixed) |
Get the number of plastic controls in the row. | |
static control_t * | synapse_row_plastic_controls (synapse_row_fixed_part_t *fixed) |
Get the array of plastic controls in the row. | |
static uint32_t * | synapse_row_fixed_weight_controls (synapse_row_fixed_part_t *fixed) |
The array of fixed weights in the row. | |
static index_t | synapse_row_sparse_index (uint32_t x, uint32_t synapse_index_mask) |
Get the index. | |
static index_t | synapse_row_sparse_type (uint32_t x, uint32_t synapse_index_bits, uint32_t synapse_type_mask) |
Get the type code. | |
static index_t | synapse_row_sparse_type_index (uint32_t x, uint32_t synapse_type_index_mask) |
Get the type and index. | |
static index_t | synapse_row_sparse_delay (uint32_t x, uint32_t synapse_type_index_bits, uint32_t synapse_delay_mask) |
Get the delay from an encoded synapse descriptor. | |
static weight_t | synapse_row_sparse_weight (uint32_t x) |
Get the weight from an encoded synapse descriptor. | |
static input_t | synapse_row_convert_weight_to_input (weight_t weight, uint32_t left_shift) |
Converts a weight stored in a synapse row to an input. | |
static index_t | synapse_row_get_ring_buffer_index (uint32_t simulation_timestep, uint32_t synapse_type_index, uint32_t neuron_index, uint32_t synapse_type_index_bits, uint32_t synapse_index_bits, uint32_t synapse_delay_mask) |
Get the index of the ring buffer for a given timestep, synapse type and neuron index. | |
static index_t | synapse_row_get_ring_buffer_index_time_0 (uint32_t synapse_type_index, uint32_t neuron_index, uint32_t synapse_index_bits) |
Get the index of the ring buffer for time 0, synapse type and neuron index. | |
static index_t | synapse_row_get_first_ring_buffer_index (uint32_t simulation_timestep, uint32_t synapse_type_index_bits, int32_t synapse_delay_mask) |
Get the index of the first ring buffer for a given timestep. | |
static index_t | synapse_row_get_ring_buffer_index_combined (uint32_t simulation_timestep, uint32_t combined_synapse_neuron_index, uint32_t synapse_type_index_bits, uint32_t synapse_delay_mask) |
Get the index of the ring buffer for a given timestep and combined synapse type and neuron index (as stored in a synapse row) | |
implementation for handling the processing of synapse rows.
The API interface supports:
The data structure layout supported by this API is designed for mixed plastic and fixed synapse rows.
The data structure is treated as an array of 32-bit words. Special meanings are ascribed to the 0th and 1st elements of the array.
We are expecting the original source address in SDRAM to be in row[0]
. The number of array elements in the plastic region is held in the upper part of row[1]
. A tag to indicate the nature of the synaptic row structure is held in the lower part of row[1]
.
Within the fixed-region extracted using the above API, fixed[0]
contains the number of 32-bit fixed synaptic words, fixed[1]
contains the number of 16-bit plastic synapse control words. (The weights for the plastic synapses are assumed to be stored in some learning-rule-specific format in the plastic region)
Note that P
is effectively rounded up to a multiple of two for storage purposes.
Definition in file synapse_row.h.
struct synapse_row_plastic_part_t |
The type of the plastic-plastic part of the row.
Definition at line 112 of file synapse_row.h.
Data Fields | ||
---|---|---|
size_t | size |
The number of plastic words in data |
uint32_t | data[] | The plastic words, followed by the fixed part. |
struct synapse_row_fixed_part_t |
The type of the fixed part of the row. The fixed-plastic part follows.
Definition at line 118 of file synapse_row.h.
Data Fields | ||
---|---|---|
size_t | num_fixed |
The number of fixed synapses in data |
size_t | num_plastic |
The number of plastic controls in data |
uint32_t | data[] | The data, first the fixed then the plastic. |
#define SYNAPSE_WEIGHT_BITS 16 |
how many bits the synapse weight will take
Definition at line 95 of file synapse_row.h.
#define N_SYNAPSE_ROW_HEADER_WORDS 3 |
Number of header words per synaptic row.
Definition at line 109 of file synapse_row.h.
typedef uint16_t control_t |
Define the type of the control data.
Definition at line 106 of file synapse_row.h.
|
inlinestatic |
Get the size of the plastic region.
[in] | row | The synaptic row |
Definition at line 129 of file synapse_row.h.
|
inlinestatic |
Get the address of the plastic region.
[in] | row | The synaptic row |
Definition at line 138 of file synapse_row.h.
|
inlinestatic |
Get the address of the non-plastic (or fixed) region.
[in] | row | The synaptic row |
Definition at line 147 of file synapse_row.h.
|
inlinestatic |
Get the number of fixed synapses in the row.
[in] | fixed | The fixed region of the synaptic row |
Definition at line 156 of file synapse_row.h.
|
inlinestatic |
Get the number of plastic controls in the row.
[in] | fixed | The fixed region of the synaptic row |
Definition at line 164 of file synapse_row.h.
|
inlinestatic |
Get the array of plastic controls in the row.
[in] | fixed | The fixed region of the synaptic row |
Definition at line 172 of file synapse_row.h.
|
inlinestatic |
The array of fixed weights in the row.
[in] | fixed | The fixed region of the synaptic row |
Definition at line 180 of file synapse_row.h.
|
inlinestatic |
Get the index.
[in] | x | The value to decode |
[in] | synapse_index_mask | Mask for the synapse index (depends on type) |
Definition at line 190 of file synapse_row.h.
|
inlinestatic |
Get the type code.
[in] | x | The value to decode |
[in] | synapse_index_bits | Number of bits for the synapse index (depends on type) |
[in] | synapse_type_mask | Mask for the synapse type (depends on type) |
Definition at line 201 of file synapse_row.h.
|
inlinestatic |
Get the type and index.
[in] | x | The value to decode |
[in] | synapse_type_index_mask | Mask for the synapse type and index (depends on type) |
Definition at line 211 of file synapse_row.h.
|
inlinestatic |
Get the delay from an encoded synapse descriptor.
[in] | x | The value to decode |
[in] | synapse_type_index_bits | Number of bits for the synapse type and index (depends on type) |
[in] | synapse_delay_mask | The mask for selecting the bits of the delay |
Definition at line 222 of file synapse_row.h.
|
inlinestatic |
Get the weight from an encoded synapse descriptor.
[in] | x | The value to decode |
Definition at line 230 of file synapse_row.h.
|
inlinestatic |
Converts a weight stored in a synapse row to an input.
[in] | weight | the weight to convert in synapse-row form |
[in] | left_shift | the shift to use when decoding |
Definition at line 238 of file synapse_row.h.
|
inlinestatic |
Get the index of the ring buffer for a given timestep, synapse type and neuron index.
[in] | simulation_timestep | The timestep |
[in] | synapse_type_index | The synapse type index |
[in] | neuron_index | The neuron index |
[in] | synapse_type_index_bits | Number of bits for type and index |
[in] | synapse_index_bits | Number of bits for index |
[in] | synapse_delay_mask | Mask for delay |
Definition at line 259 of file synapse_row.h.
|
inlinestatic |
Get the index of the ring buffer for time 0, synapse type and neuron index.
[in] | synapse_type_index | The synapse type index |
[in] | neuron_index | The neuron index |
[in] | synapse_index_bits | Number of bits for index |
Definition at line 274 of file synapse_row.h.
|
inlinestatic |
Get the index of the first ring buffer for a given timestep.
[in] | simulation_timestep | The timestep |
[in] | synapse_type_index_bits | Number of bits for type and index |
[in] | synapse_delay_mask | Mask for delay |
Definition at line 285 of file synapse_row.h.
|
inlinestatic |
Get the index of the ring buffer for a given timestep and combined synapse type and neuron index (as stored in a synapse row)
[in] | simulation_timestep | The timestep |
[in] | combined_synapse_neuron_index | |
[in] | synapse_type_index_bits | Number of bits for type and index |
[in] | synapse_delay_mask | Mask for delay |
Definition at line 298 of file synapse_row.h.