sPyNNaker neural_modelling 7.1.1
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
matrix_generator_static.h File Reference

Static 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  static_row_t
 The layout of a purely static row of a synaptic matrix. More...
 
struct  matrix_genetator_static_data_t
 The stored data used to generate rows. More...
 
union  matrix_genetator_static_data_t.__unnamed21__
 
union  matrix_genetator_static_data_t.__unnamed23__
 

Macros

#define SYNAPSE_WEIGHT_SHIFT   16
 The shift of the weight within a synaptic word.
 
#define SYNAPSE_WEIGHT_MASK   0xFFFF
 The mask of a weight before shifting.
 

Functions

static void setup_rows (uint32_t *matrix, uint32_t n_rows, uint32_t max_row_n_words)
 Set up the rows so that they are ready for writing to.
 
static uint32_t build_static_word (uint16_t weight, uint16_t delay, uint32_t type, uint16_t post_index, uint32_t synapse_type_bits, uint32_t synapse_index_bits, uint32_t delay_bits)
 Build a static synaptic word from components.
 
static void * matrix_generator_static_initialize (void **region, void *synaptic_matrix)
 How to initialise the static synaptic matrix generator.
 
static void matrix_generator_static_free (void *generator)
 How to free any data for the static synaptic matrix generator.
 
static bool matrix_generator_static_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.
 

Detailed Description

Static synaptic matrix implementation.

Definition in file matrix_generator_static.h.


Data Structure Documentation

◆ static_row_t

struct static_row_t

The layout of a purely static row of a synaptic matrix.

Definition at line 30 of file matrix_generator_static.h.

Data Fields
uint32_t plastic_plastic_size the plastic-plastic size within a row
uint32_t fixed_fixed_size the fixed-fixed size within a row
uint32_t fixed_plastic_size the fixed-plastic size within a row
uint32_t fixed_fixed_data[] the fixed-fixed data within a row

◆ matrix_genetator_static_data_t

struct matrix_genetator_static_data_t

The stored data used to generate rows.

Definition at line 48 of file matrix_generator_static.h.

Data Fields
union matrix_genetator_static_data_t.__unnamed21__ __unnamed__
union matrix_genetator_static_data_t.__unnamed23__ __unnamed__
uint32_t max_row_n_words The maximum number of words (excluding headers) on a row.
uint32_t max_delayed_row_n_words The maximum number of words (excluding headers) 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.

◆ matrix_genetator_static_data_t.__unnamed21__

union matrix_genetator_static_data_t.__unnamed21__

Definition at line 49 of file matrix_generator_static.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_genetator_static_data_t.__unnamed23__

union matrix_genetator_static_data_t.__unnamed23__

Definition at line 55 of file matrix_generator_static.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)

Macro Definition Documentation

◆ SYNAPSE_WEIGHT_SHIFT

#define SYNAPSE_WEIGHT_SHIFT   16

The shift of the weight within a synaptic word.

Definition at line 40 of file matrix_generator_static.h.

◆ SYNAPSE_WEIGHT_MASK

#define SYNAPSE_WEIGHT_MASK   0xFFFF

The mask of a weight before shifting.

Definition at line 45 of file matrix_generator_static.h.

Function Documentation

◆ setup_rows()

static void setup_rows ( uint32_t *  matrix,
uint32_t  n_rows,
uint32_t  max_row_n_words 
)
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_static.h.

◆ build_static_word()

static uint32_t build_static_word ( uint16_t  weight,
uint16_t  delay,
uint32_t  type,
uint16_t  post_index,
uint32_t  synapse_type_bits,
uint32_t  synapse_index_bits,
uint32_t  delay_bits 
)
static

Build a static synaptic word from components.

Parameters
[in]weightThe weight of the synapse
[in]delayThe delay of the synapse
[in]typeThe synapse type
[in]post_indexThe core-relative index of the target neuron
[in]synapse_type_bitsThe number of bits for the synapse type
[in]synapse_index_bitsThe number of bits for the target neuron id
[in]delay_bitsThe number of bits for the synaptic delay
Returns
a synaptic word

Definition at line 110 of file matrix_generator_static.h.

◆ matrix_generator_static_initialize()

static void * matrix_generator_static_initialize ( void **  region,
void *  synaptic_matrix 
)
static

How to initialise the static synaptic matrix generator.

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

Definition at line 133 of file matrix_generator_static.h.

◆ matrix_generator_static_free()

static void matrix_generator_static_free ( void *  generator)
static

How to free any data for the static synaptic matrix generator.

Parameters
[in]generatorThe data to free

Definition at line 166 of file matrix_generator_static.h.

◆ matrix_generator_static_write_synapse()

static bool matrix_generator_static_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]generatorThe generator data
[in]pre_indexThe index of the pre-neuron relative to the start of the matrix
[in]post_indexThe index of the post-neuron on this core
[in]weightThe weight of the synapse in raw format
[in]delayThe delay of the synapse in time steps
[in]weight_scaleThe scale to apply to the weight if needed
Returns
whether the synapses was added or not

Definition at line 181 of file matrix_generator_static.h.