sPyNNaker neural_modelling 7.3.1
Loading...
Searching...
No Matches
Data Structures | Functions
matrix_generator_weight_changer.h File Reference

Weight-changer synaptic matrix implementation. More...

#include <stdbool.h>
#include <debug.h>
#include <delay_extension/delay_extension.h>
#include "matrix_generator_common.h"
#include <synapse_expander/generator_types.h>
#include <utils.h>

Go to the source code of this file.

Data Structures

struct  matrix_generator_weight_changer
 
struct  row_changer_plastic_t
 The layout of the initial plastic synapse part of the row. More...
 
struct  row_changer_fixed_t
 The layout of the fixed synapse region of the row; the fixed-fixed region is empty. More...
 
union  matrix_generator_weight_changer.__unnamed29__
 

Functions

static row_changer_plastic_tget_changer_row (uint32_t *synaptic_matrix, uint32_t max_row_n_words, uint32_t pre_index)
 Get a synaptic row for a given neuron.
 
static row_changer_fixed_tget_changer_fixed_row (row_changer_plastic_t *plastic_row)
 Get the fixed part of a row that comes after the plastic part.
 
static void setup_changer_rows (uint32_t *matrix, uint32_t n_rows, uint32_t max_row_n_words, uint32_t row_offset)
 Set up the rows so that they are ready for writing to.
 
void * matrix_generator_changer_initialize (void **region, void *synaptic_matrix)
 Initialise the Changer synaptic matrix generator.
 
void matrix_generator_changer_free (void *generator)
 Free any data for the matrix generator.
 
static uint32_t build_changer_word (uint32_t type, uint32_t post_index, uint32_t synapse_type_bits, uint32_t synapse_index_bits, int16_t weight)
 
static bool matrix_generator_changer_write_synapse (void *generator, uint32_t pre_index, uint16_t post_index, accum weight, uint16_t delay, unsigned long accum weight_scale)
 

Detailed Description

Weight-changer synaptic matrix implementation.

Definition in file matrix_generator_weight_changer.h.


Data Structure Documentation

◆ matrix_generator_weight_changer

struct matrix_generator_weight_changer

Definition at line 29 of file matrix_generator_weight_changer.h.

Data Fields
union matrix_generator_weight_changer.__unnamed29__ __unnamed__
uint32_t max_row_n_words
uint32_t max_row_n_synapses
uint32_t n_pre_neurons
uint32_t synapse_type
uint32_t synapse_type_bits
uint32_t synapse_index_bits
uint32_t row_offset

◆ row_changer_plastic_t

struct row_changer_plastic_t

The layout of the initial plastic synapse part of the row.

Definition at line 46 of file matrix_generator_weight_changer.h.

Data Fields
uint32_t plastic_plastic_size the plastic-plastic size within the row
uint32_t pre_spike: 31
uint32_t is_update: 1

◆ row_changer_fixed_t

struct row_changer_fixed_t

The layout of the fixed synapse region of the row; the fixed-fixed region is empty.

Definition at line 53 of file matrix_generator_weight_changer.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
int32_t fixed_plastic_data[] the fixed-plastic data within the fixed region

◆ matrix_generator_weight_changer.__unnamed29__

union matrix_generator_weight_changer.__unnamed29__

Definition at line 30 of file matrix_generator_weight_changer.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)

Function Documentation

◆ get_changer_row()

static row_changer_plastic_t * get_changer_row ( uint32_t *  synaptic_matrix,
uint32_t  max_row_n_words,
uint32_t  pre_index 
)
static

Get a synaptic row for a given neuron.

Parameters
[in]synaptic_matrixthe address of the synaptic matrix
[in]max_row_n_wordsthe maximum number of words (excluding headers) in each row of the table
[in]pre_indexthe index of the pre-neuron relative to the start of the matrix
Returns
A pointer to the row of the matrix to write to

Definition at line 68 of file matrix_generator_weight_changer.h.

◆ get_changer_fixed_row()

static row_changer_fixed_t * get_changer_fixed_row ( row_changer_plastic_t plastic_row)
static

Get the fixed part of a row that comes after the plastic part.

Parameters
[in]plastic_rowA pointer to the row to find the fixed part of
Returns
A pointer to the fixed part of the matrix to write to

Definition at line 79 of file matrix_generator_weight_changer.h.

◆ setup_changer_rows()

static void setup_changer_rows ( uint32_t *  matrix,
uint32_t  n_rows,
uint32_t  max_row_n_words,
uint32_t  row_offset 
)
static

Set up the rows so that they are ready for writing to.

Parameters
[in]matrixThe base address of the matrix to set up
[in]n_rowsThe number of rows in the matrix
[in]max_row_n_wordsThe maximum number of words used by a row

Definition at line 89 of file matrix_generator_weight_changer.h.

◆ matrix_generator_changer_initialize()

void * matrix_generator_changer_initialize ( void **  region,
void *  synaptic_matrix 
)

Initialise the Changer synaptic matrix generator.

Parameters
[in,out]regionRegion to read parameters from. Should be updated to position just after parameters after calling.
[in]synaptic_matrixThe base address of the synaptic matrix
Returns
A data item to be passed in to other functions later on

Definition at line 110 of file matrix_generator_weight_changer.h.

◆ matrix_generator_changer_free()

void matrix_generator_changer_free ( void *  generator)

Free any data for the matrix generator.

Parameters
[in]generatorThe generator to free

Definition at line 134 of file matrix_generator_weight_changer.h.

◆ build_changer_word()

static uint32_t build_changer_word ( uint32_t  type,
uint32_t  post_index,
uint32_t  synapse_type_bits,
uint32_t  synapse_index_bits,
int16_t  weight 
)
static

Definition at line 138 of file matrix_generator_weight_changer.h.

◆ matrix_generator_changer_write_synapse()

static bool matrix_generator_changer_write_synapse ( void *  generator,
uint32_t  pre_index,
uint16_t  post_index,
accum  weight,
uint16_t  delay,
unsigned long accum  weight_scale 
)
static

Definition at line 152 of file matrix_generator_weight_changer.h.