sPyNNaker neural_modelling 7.3.1
Loading...
Searching...
No Matches
Data Structures | Macros | Functions | Variables
neuron_recording.h File Reference

Recording of the state of a neuron (spiking, voltage, etc.) More...

#include <common/neuron-typedefs.h>
#include <bit_field.h>
#include <recording.h>
#include <wfi.h>
#include <stddef.h>

Go to the source code of this file.

Data Structures

struct  recording_values_t
 A struct of the different types of recorded data. More...
 
struct  bitfield_values_t
 A struct for bitfield data. More...
 
struct  recording_info_t
 A struct for information for a non-bitfield recording. More...
 
struct  bitfield_info_t
 A struct for information on a bitfield recording. More...
 
struct  neuron_recording_header_t
 The heading of the neuron recording region. More...
 

Macros

#define FLOOR_TO_2   0xFFFFFFFE
 When bitwise anded with a number will floor to the nearest multiple of 2.
 
#define CEIL_TO_2   1
 Add to a number before applying floor to 2 to turn it into a ceil operation.
 

Functions

static void neuron_recording_record_value (uint32_t var_index, uint32_t neuron_index, void *value)
 stores a recording of a value of any type, except bitfield; use the functions below for common types as these will be faster.
 
static void neuron_recording_record_accum (uint32_t var_index, uint32_t neuron_index, accum value)
 stores a recording of an accum variable only; this is faster than neuron_recording_record_value for this type
 
static void neuron_recording_record_double (uint32_t var_index, uint32_t neuron_index, double value)
 stores a recording of a double variable only; this is faster than neuron_recording_record_value for this type
 
static void neuron_recording_record_float (uint32_t var_index, uint32_t neuron_index, float value)
 stores a recording of a float variable only; this is faster than neuron_recording_record_value for this type
 
static void neuron_recording_record_int32 (uint32_t var_index, uint32_t neuron_index, int32_t value)
 stores a recording of an int32_t variable only; this is faster than neuron_recording_record_value for this type
 
static void neuron_recording_record_bit (uint32_t var_index, uint32_t neuron_index)
 stores a recording of a set bit; this is the only way to set a bit in a bitfield; neuron_recording_record_value doesn't work for this!
 
static void neuron_recording_record (uint32_t time)
 does the recording process of handing over to basic recording
 
static void neuron_recording_setup_for_next_recording (void)
 sets up state for next recording.
 
static void reset_record_counter (void)
 resets all states back to start state.
 
static uint32_t bitfield_data_size (uint32_t n_neurons)
 the number of bytes used in bitfield recording for n_neurons
 
static bool neuron_recording_read_in_elements (void *recording_address, uint32_t n_neurons)
 reads recording data from SDRAM
 
bool neuron_recording_reset (uint32_t n_neurons)
 reads recording data from sdram on reset.
 
static bool allocate_word_dtcm (uint32_t n_neurons)
 handles all the DTCM allocations for recording words
 
static bool allocate_bitfield_dtcm (uint32_t n_neurons)
 handles all the DTCM allocations for recording bitfields
 
bool neuron_recording_initialise (void *recording_address, uint32_t n_neurons, uint32_t *n_rec_regions_used)
 sets up the recording stuff
 

Variables

static uint16_t ** neuron_recording_indexes
 The index to record each variable to for each neuron.
 
static uint16_t ** bitfield_recording_indexes
 The index to record each bitfield variable to for each neuron.
 
static recording_info_trecording_info
 An array of recording information structures.
 
static bitfield_info_tbitfield_info
 An array of bitfield information structures.
 
static uint8_t ** recording_values
 An array of spaces into which recording values can be written.
 
static uint32_t ** bitfield_values
 An array of spaces into which bitfields can be written.
 
static volatile uint32_t n_recordings_outstanding = 0
 The number of recordings outstanding.
 
static void * reset_address
 The address of the recording region to read on reset.
 

Detailed Description

Recording of the state of a neuron (spiking, voltage, etc.)

Definition in file neuron_recording.h.


Data Structure Documentation

◆ recording_values_t

struct recording_values_t

A struct of the different types of recorded data.

Definition at line 31 of file neuron_recording.h.

Data Fields
uint32_t time
uint8_t data[]

◆ bitfield_values_t

struct bitfield_values_t

A struct for bitfield data.

Definition at line 37 of file neuron_recording.h.

Data Fields
uint32_t time
uint32_t bits[]

◆ recording_info_t

struct recording_info_t

A struct for information for a non-bitfield recording.

Definition at line 43 of file neuron_recording.h.

Data Fields
uint32_t element_size
uint32_t rate
uint32_t count
uint32_t increment
uint32_t size
recording_values_t * values

◆ bitfield_info_t

struct bitfield_info_t

A struct for information on a bitfield recording.

Definition at line 53 of file neuron_recording.h.

Data Fields
uint32_t rate
uint32_t count
uint32_t increment
uint32_t size
uint32_t n_words
bitfield_values_t * values

◆ neuron_recording_header_t

struct neuron_recording_header_t

The heading of the neuron recording region.

Definition at line 440 of file neuron_recording.h.

Data Fields
uint32_t n_recorded_vars The number of word-sized variables to record.
uint32_t n_bitfield_vars The number of bitfield variables to record.

Macro Definition Documentation

◆ FLOOR_TO_2

#define FLOOR_TO_2   0xFFFFFFFE

When bitwise anded with a number will floor to the nearest multiple of 2.

Definition at line 87 of file neuron_recording.h.

◆ CEIL_TO_2

#define CEIL_TO_2   1

Add to a number before applying floor to 2 to turn it into a ceil operation.

Definition at line 90 of file neuron_recording.h.

Function Documentation

◆ neuron_recording_record_value()

static void neuron_recording_record_value ( uint32_t  var_index,
uint32_t  neuron_index,
void *  value 
)
inlinestatic

stores a recording of a value of any type, except bitfield; use the functions below for common types as these will be faster.

Parameters
[in]var_indexwhich recording variable to write this is
[in]neuron_indexthe neuron id for this recorded data
[in]valuepointer to the value to record for this neuron.

Definition at line 97 of file neuron_recording.h.

◆ neuron_recording_record_accum()

static void neuron_recording_record_accum ( uint32_t  var_index,
uint32_t  neuron_index,
accum  value 
)
inlinestatic

stores a recording of an accum variable only; this is faster than neuron_recording_record_value for this type

Parameters
[in]var_indexwhich recording variable to write this is
[in]neuron_indexthe neuron id for this recorded data
[in]valuethe results to record for this neuron.

Definition at line 110 of file neuron_recording.h.

◆ neuron_recording_record_double()

static void neuron_recording_record_double ( uint32_t  var_index,
uint32_t  neuron_index,
double  value 
)
inlinestatic

stores a recording of a double variable only; this is faster than neuron_recording_record_value for this type

Parameters
[in]var_indexwhich recording variable to write this is
[in]neuron_indexthe neuron id for this recorded data
[in]valuethe results to record for this neuron.

Definition at line 122 of file neuron_recording.h.

◆ neuron_recording_record_float()

static void neuron_recording_record_float ( uint32_t  var_index,
uint32_t  neuron_index,
float  value 
)
inlinestatic

stores a recording of a float variable only; this is faster than neuron_recording_record_value for this type

Parameters
[in]var_indexwhich recording variable to write this is
[in]neuron_indexthe neuron id for this recorded data
[in]valuethe results to record for this neuron.

Definition at line 134 of file neuron_recording.h.

◆ neuron_recording_record_int32()

static void neuron_recording_record_int32 ( uint32_t  var_index,
uint32_t  neuron_index,
int32_t  value 
)
inlinestatic

stores a recording of an int32_t variable only; this is faster than neuron_recording_record_value for this type

Parameters
[in]var_indexwhich recording variable to write this is
[in]neuron_indexthe neuron id for this recorded data
[in]valuethe results to record for this neuron.

Definition at line 146 of file neuron_recording.h.

◆ neuron_recording_record_bit()

static void neuron_recording_record_bit ( uint32_t  var_index,
uint32_t  neuron_index 
)
inlinestatic

stores a recording of a set bit; this is the only way to set a bit in a bitfield; neuron_recording_record_value doesn't work for this!

Parameters
[in]var_indexwhich bitfield recording variable to write this is
[in]neuron_indexwhich neuron to set the bit for

Definition at line 157 of file neuron_recording.h.

◆ neuron_recording_record()

static void neuron_recording_record ( uint32_t  time)
inlinestatic

does the recording process of handing over to basic recording

Parameters
[in]timethe time to put into the recording stamps.

Definition at line 166 of file neuron_recording.h.

◆ neuron_recording_setup_for_next_recording()

static void neuron_recording_setup_for_next_recording ( void  )
inlinestatic

sets up state for next recording.

Definition at line 207 of file neuron_recording.h.

◆ reset_record_counter()

static void reset_record_counter ( void  )
static

resets all states back to start state.

Definition at line 218 of file neuron_recording.h.

◆ bitfield_data_size()

static uint32_t bitfield_data_size ( uint32_t  n_neurons)
inlinestatic

the number of bytes used in bitfield recording for n_neurons

Parameters
[in]n_neuronsThe number of neurons to create a bitfield for
Returns
the size of the bitfield data structure for the number of neurons

Definition at line 258 of file neuron_recording.h.

◆ neuron_recording_read_in_elements()

static bool neuron_recording_read_in_elements ( void *  recording_address,
uint32_t  n_neurons 
)
static

reads recording data from SDRAM

Parameters
[in]recording_addressSDRAM location for the recording data
[in]n_neuronsthe number of neurons to setup for
Returns
Whether the read was successful

Definition at line 266 of file neuron_recording.h.

◆ neuron_recording_reset()

bool neuron_recording_reset ( uint32_t  n_neurons)

reads recording data from sdram on reset.

Parameters
[in]n_neuronsthe number of neurons to setup for
Returns
bool stating if the read was successful or not

Definition at line 350 of file neuron_recording.h.

◆ allocate_word_dtcm()

static bool allocate_word_dtcm ( uint32_t  n_neurons)
inlinestatic

handles all the DTCM allocations for recording words

Parameters
[in]n_neuronshow many neurons to set DTCM for
Returns
True on success

Definition at line 361 of file neuron_recording.h.

◆ allocate_bitfield_dtcm()

static bool allocate_bitfield_dtcm ( uint32_t  n_neurons)
inlinestatic

handles all the DTCM allocations for recording bitfields

Parameters
[in]n_neuronshow many neurons to set DTCM for
Returns
True on success

Definition at line 401 of file neuron_recording.h.

◆ neuron_recording_initialise()

bool neuron_recording_initialise ( void *  recording_address,
uint32_t  n_neurons,
uint32_t *  n_rec_regions_used 
)

sets up the recording stuff

Parameters
[in]recording_addresssdram location for the recording data
[in]n_neuronsthe number of neurons to setup for
[out]n_rec_regions_usedOutput the number of regions used by neuron recording
Returns
bool stating if the init was successful or not

Definition at line 453 of file neuron_recording.h.

Variable Documentation

◆ neuron_recording_indexes

uint16_t** neuron_recording_indexes
static

The index to record each variable to for each neuron.

Definition at line 63 of file neuron_recording.h.

◆ bitfield_recording_indexes

uint16_t** bitfield_recording_indexes
static

The index to record each bitfield variable to for each neuron.

Definition at line 66 of file neuron_recording.h.

◆ recording_info

recording_info_t* recording_info
static

An array of recording information structures.

Definition at line 69 of file neuron_recording.h.

◆ bitfield_info

bitfield_info_t* bitfield_info
static

An array of bitfield information structures.

Definition at line 72 of file neuron_recording.h.

◆ recording_values

uint8_t** recording_values
static

An array of spaces into which recording values can be written.

Definition at line 75 of file neuron_recording.h.

◆ bitfield_values

uint32_t** bitfield_values
static

An array of spaces into which bitfields can be written.

Definition at line 78 of file neuron_recording.h.

◆ n_recordings_outstanding

volatile uint32_t n_recordings_outstanding = 0
static

The number of recordings outstanding.

Definition at line 81 of file neuron_recording.h.

◆ reset_address

void* reset_address
static

The address of the recording region to read on reset.

Definition at line 84 of file neuron_recording.h.