32 uint32_t *synaptic_matrix;
34 uint32_t synaptic_matrix_offset;
36 uint32_t max_row_n_words;
37 uint32_t max_row_n_synapses;
38 uint32_t n_pre_neurons;
40 uint32_t synapse_type;
55 uint32_t fixed_plastic_data[];
60static const unsigned long accum WEIGHT_SCALE = 2048.0ulk;
92static void setup_nm_rows(uint32_t *matrix, uint32_t n_rows, uint32_t max_row_n_words,
93 uint32_t is_reward, uint32_t synapse_type) {
95 for (uint32_t i = 0; i < n_rows; i++) {
116 void *synaptic_matrix) {
123 *conf = *params_sdram;
124 *
region = ¶ms_sdram[1];
127 uint32_t *syn_mat = synaptic_matrix;
128 conf->synaptic_matrix = &(syn_mat[conf->synaptic_matrix_offset]);
129 setup_nm_rows(conf->synaptic_matrix, conf->n_pre_neurons, conf->max_row_n_words,
130 conf->is_reward, conf->synapse_type);
143static bool matrix_generator_neuromodulation_write_synapse(
void *generator,
144 uint32_t pre_index, uint16_t post_index, accum weight,
145 UNUSED uint16_t delay, UNUSED
unsigned long accum weight_scale) {
148 conf->max_row_n_words, pre_index);
151 if (pos >= conf->max_row_n_synapses) {
152 log_warning(
"Row %u at 0x%08x, 0x%08x of matrix 0x%08x is already full (%u of %u)",
153 pre_index, plastic_row, fixed_row, conf->synaptic_matrix, pos,
154 conf->max_row_n_synapses);
void log_warning(const char *message,...)
Declarations for delay extensions.
General types associated with generators.
static uint16_t rescale_weight(accum weight, unsigned long accum weight_scale)
Rescales a weight to account for weight granularity and type-converts it.
Common functions for matrix generation.
#define N_HEADER_WORDS
The number of header words per row.
static row_nm_plastic_t * get_nm_row(uint32_t *synaptic_matrix, uint32_t max_row_n_words, uint32_t pre_index)
Get a synaptic row for a given neuron.
uint32_t synapse_type
the synapse type of the row
uint32_t fixed_fixed_size
the fixed-fixed size within the fixed region
static row_nm_fixed_t * get_nm_fixed_row(row_nm_plastic_t *plastic_row)
Get the fixed part of a row that comes after the plastic part.
uint32_t fixed_plastic_data[]
the fixed-plastic data within the fixed region
uint32_t plastic_plastic_size
the plastic-plastic size within the row
uint32_t fixed_plastic_size
the fixed-plastic size within the fixed region
void * matrix_generator_neuromodulation_initialize(void **region, void *synaptic_matrix)
Initialise the Neuromodulation synaptic matrix generator.
static void setup_nm_rows(uint32_t *matrix, uint32_t n_rows, uint32_t max_row_n_words, uint32_t is_reward, uint32_t synapse_type)
Set up the rows so that they are ready for writing to.
uint32_t is_reward
is the row reward
void matrix_generator_neuromodulation_free(void *generator)
Free any data for the STDP synaptic matrix generator.
uint32_t is_neuromodulation
is the row neuromodulation
The layout of the fixed synapse region of the row; the fixed-fixed region is empty.
The layout of the initial plastic synapse part of the row.
void sark_free(void *ptr)
region
spike source array region IDs in human readable form