STDP synaptic matrix implementation.
More...
Go to the source code of this file.
|
static uint32_t | plastic_half_words (uint32_t n_half_words_per_pp_header, uint32_t n_half_words_per_pp_synapse, uint32_t max_row_n_synapses) |
| Get the maximum number of plastic half-words in a row.
|
|
static row_fixed_t * | get_stdp_fixed_row (row_plastic_t *plastic_row, uint32_t n_half_words_per_pp_header, uint32_t n_half_words_per_pp_synapse, uint32_t max_row_n_synapses) |
| Get the fixed part of a row that comes after the plastic part. Note that this assumes the max row size in number of synapses.
|
|
static void | setup_stdp_rows (uint32_t *matrix, uint32_t n_rows, uint32_t n_half_words_per_pp_header, uint32_t n_half_words_per_pp_synapse, uint32_t max_row_n_synapses, uint32_t max_row_n_words, uint32_t first_header_word_is_row_index, uint32_t row_offset) |
| Set up the rows so that they are ready for writing to.
|
|
static uint16_t | build_fixed_plastic_half_word (uint16_t delay, uint32_t type, uint32_t post_index, uint32_t synapse_type_bits, uint32_t synapse_index_bits, uint32_t delay_bits) |
| Build a fixed-plastic half-word from its components.
|
|
void * | matrix_generator_stdp_initialize (void **region, void *synaptic_matrix) |
| Initialise the STDP synaptic matrix generator.
|
|
void | matrix_generator_stdp_free (void *generator) |
| Free any data for the STDP synaptic matrix generator.
|
|
static bool | matrix_generator_stdp_write_synapse (void *generator, uint32_t pre_index, uint16_t post_index, accum weight, uint16_t delay, unsigned long accum weight_scale) |
| How to write a synapse to a matrix.
|
|
STDP synaptic matrix implementation.
Definition in file matrix_generator_stdp.h.
◆ row_plastic_t
The layout of the initial plastic synapse part of the row.
Definition at line 32 of file matrix_generator_stdp.h.
Data Fields |
uint32_t |
plastic_plastic_size |
the plastic-plastic size within the row |
uint16_t |
plastic_plastic_data[] |
the plastic-plastic data within the row |
◆ row_fixed_t
The layout of the fixed synapse region of the row; the fixed-fixed region is empty.
Definition at line 38 of file matrix_generator_stdp.h.
Data Fields |
uint32_t |
fixed_fixed_size |
the fixed-fixed size within the fixed region |
uint32_t |
fixed_plastic_size |
the fixed-plastic size within the fixed region |
uint16_t |
fixed_plastic_data[] |
the fixed-plastic data within the fixed region |
◆ matrix_generator_stdp_data_t
struct matrix_generator_stdp_data_t |
Data for the generator.
Definition at line 45 of file matrix_generator_stdp.h.
Data Fields |
union matrix_generator_stdp_data_t.__unnamed25__ |
__unnamed__ |
|
union matrix_generator_stdp_data_t.__unnamed27__ |
__unnamed__ |
|
uint32_t |
max_row_n_synapses |
The maximum number of synapses on a row. |
uint32_t |
max_delayed_row_n_synapses |
The maximum number of synapses on a delayed row. |
uint32_t |
max_row_n_words |
The maximum number of words on a row. |
uint32_t |
max_delayed_row_n_words |
The maximum number of words on a delayed row. |
uint32_t |
synapse_type |
The matrix synapse type. |
uint32_t |
synapse_type_bits |
The number of bits needed to represent the synapse type. |
uint32_t |
synapse_index_bits |
The number of bits needed to represent the synapse neuron id. |
uint32_t |
max_stage |
The maximum delay stage, including 0 for no delay stage. |
uint32_t |
max_delay_per_stage |
The maximum delay per delay stage in time steps. |
uint32_t |
delay_bits |
The number of bits needed to represent the maximum delay per stage. |
uint32_t |
n_pre_neurons |
The number of pre-synaptic neurons. |
uint32_t |
n_pre_neurons_per_core |
The number of pre-synaptic neurons per core. |
uint32_t |
n_half_words_per_pp_row_header |
The number of half-words in a plastic-plastic row header. |
uint32_t |
n_half_words_per_pp_synapse |
The number of half-words in each plastic-plastic synapse. |
uint32_t |
weight_half_word |
The index of the half-word that will contain the weight. |
uint32_t |
first_word_is_row_index |
Whether to write the pre-neuron index in the first word of the header space (used for externally changeable synapses)
|
uint32_t |
row_offset |
The offset of the row index to use. |
◆ matrix_generator_stdp_data_t.__unnamed25__
union matrix_generator_stdp_data_t.__unnamed25__ |
Definition at line 46 of file matrix_generator_stdp.h.
Data Fields |
uint32_t * |
synaptic_matrix |
The address of the synaptic matrix (once initialised) |
uint32_t |
synaptic_matrix_offset |
The offset of the synaptic matrix (as read from SDRAM) |
◆ matrix_generator_stdp_data_t.__unnamed27__
union matrix_generator_stdp_data_t.__unnamed27__ |
Definition at line 52 of file matrix_generator_stdp.h.
Data Fields |
uint32_t * |
delayed_synaptic_matrix |
The address of the delayed synaptic matrix (once initialised) |
uint32_t |
delayed_matrix_offset |
The offset of the delayed synaptic matrix (as read from SDRAM) |
◆ plastic_half_words()
static uint32_t plastic_half_words |
( |
uint32_t |
n_half_words_per_pp_header, |
|
|
uint32_t |
n_half_words_per_pp_synapse, |
|
|
uint32_t |
max_row_n_synapses |
|
) |
| |
|
static |
Get the maximum number of plastic half-words in a row.
- Parameters
-
[in] | n_half_words_per_pp_header | the number of half-words at the start of each row |
[in] | n_half_words_per_pp_synapse | the number of half-words used by each synapse |
[in] | max_row_n_synapses | the maximum number of synapses in a row |
- Returns
- the number of plastic half-words in a maximum length row
Definition at line 104 of file matrix_generator_stdp.h.
◆ get_stdp_fixed_row()
static row_fixed_t * get_stdp_fixed_row |
( |
row_plastic_t * |
plastic_row, |
|
|
uint32_t |
n_half_words_per_pp_header, |
|
|
uint32_t |
n_half_words_per_pp_synapse, |
|
|
uint32_t |
max_row_n_synapses |
|
) |
| |
|
static |
Get the fixed part of a row that comes after the plastic part. Note that this assumes the max row size in number of synapses.
- Parameters
-
[in] | plastic_row | A pointer to the row to find the fixed part of |
[in] | n_half_words_per_pp_header | the (even) number of header words at the start of the plastic data |
[in] | n_half_words_per_pp_synapse | the number of half-words in each synapse, not necessarily even |
[in] | max_row_n_synapses | the maximum number of synapses in the row |
- Returns
- A pointer to the fixed part of the row assuming all synapses used
Definition at line 125 of file matrix_generator_stdp.h.
◆ setup_stdp_rows()
static void setup_stdp_rows |
( |
uint32_t * |
matrix, |
|
|
uint32_t |
n_rows, |
|
|
uint32_t |
n_half_words_per_pp_header, |
|
|
uint32_t |
n_half_words_per_pp_synapse, |
|
|
uint32_t |
max_row_n_synapses, |
|
|
uint32_t |
max_row_n_words, |
|
|
uint32_t |
first_header_word_is_row_index, |
|
|
uint32_t |
row_offset |
|
) |
| |
|
static |
Set up the rows so that they are ready for writing to.
- Parameters
-
[in] | matrix | The base address of the matrix to set up |
[in] | n_rows | The number of rows in the matrix |
[in] | n_half_words_per_pp_header | The number of half-words at the start of each row |
[in] | n_half_words_per_pp_synapse | The number of half-words used by each synapse |
[in] | max_row_n_synapses | The maximum number of synapses in a row |
[in] | max_row_n_words | The maximum number of words used by a row |
Definition at line 144 of file matrix_generator_stdp.h.
◆ build_fixed_plastic_half_word()
static uint16_t build_fixed_plastic_half_word |
( |
uint16_t |
delay, |
|
|
uint32_t |
type, |
|
|
uint32_t |
post_index, |
|
|
uint32_t |
synapse_type_bits, |
|
|
uint32_t |
synapse_index_bits, |
|
|
uint32_t |
delay_bits |
|
) |
| |
|
static |
Build a fixed-plastic half-word from its components.
- Parameters
-
[in] | delay | The delay of the synapse |
[in] | type | The synapse type |
[in] | post_index | The core-relative index of the target neuron |
[in] | synapse_type_bits | The number of bits for the synapse type |
[in] | synapse_index_bits | The number of bits for the target neuron id |
[in] | delay_bits | The number of bits for the synaptic delay |
- Returns
- A half-word fixed-plastic synapse
Definition at line 183 of file matrix_generator_stdp.h.
◆ matrix_generator_stdp_initialize()
void * matrix_generator_stdp_initialize |
( |
void ** |
region, |
|
|
void * |
synaptic_matrix |
|
) |
| |
Initialise the STDP synaptic matrix generator.
- Parameters
-
[in,out] | region | Region to read parameters from. Should be updated to position just after parameters after calling. |
[in] | synaptic_matrix | The base address of the synaptic matrix |
- Returns
- A data item to be passed in to other functions later on
Definition at line 207 of file matrix_generator_stdp.h.
◆ matrix_generator_stdp_free()
void matrix_generator_stdp_free |
( |
void * |
generator | ) |
|
Free any data for the STDP synaptic matrix generator.
- Parameters
-
[in] | generator | The generator to free |
Definition at line 249 of file matrix_generator_stdp.h.
◆ matrix_generator_stdp_write_synapse()
static bool matrix_generator_stdp_write_synapse |
( |
void * |
generator, |
|
|
uint32_t |
pre_index, |
|
|
uint16_t |
post_index, |
|
|
accum |
weight, |
|
|
uint16_t |
delay, |
|
|
unsigned long accum |
weight_scale |
|
) |
| |
|
static |
How to write a synapse to a matrix.
- Parameters
-
[in] | generator | The generator data |
[in] | pre_index | The index of the pre-neuron relative to the start of the matrix |
[in] | post_index | The index of the post-neuron on this core |
[in] | weight | The weight of the synapse in raw form |
[in] | delay | The delay of the synapse in time steps |
[in] | weight_scale | The scale to apply to the weight if needed |
Definition at line 263 of file matrix_generator_stdp.h.