sPyNNaker neural_modelling 7.1.1
Loading...
Searching...
No Matches
Data Structures | Functions | Variables
neuron.c File Reference

implementation of the neuron.h interface. More...

#include "neuron.h"
#include "neuron_recording.h"
#include "implementations/neuron_impl.h"
#include "current_sources/current_source.h"
#include "plasticity/synapse_dynamics.h"
#include <debug.h>

Go to the source code of this file.

Data Structures

struct  neuron_core_parameters
 parameters that reside in the neuron_parameter_data_region More...
 

Functions

static bool neuron_load_neuron_parameters (uint32_t time)
 does the memory copy for the neuron parameters
 
bool neuron_resume (uint32_t time)
 Prepare to resume simulation of the neurons.
 
bool neuron_initialise (void *core_params_address, void *neuron_params_address, void *current_sources_address, void *recording_address, void *initial_values_address, uint32_t *n_rec_regions_used)
 translate the data stored in the NEURON_PARAMS data region in SDRAM and convert it into c based objects for use.
 
void neuron_pause (void)
 Perform steps needed before pausing a simulation.
 
void neuron_do_timestep_update (timer_t time, uint timer_count)
 executes all the updates to neural parameters when a given timer period has occurred.
 
void neuron_transfer (weight_t *syns)
 Add inputs to the neurons.
 
void neuron_print_inputs (void)
 Print the inputs to the neurons.
 
void neuron_print_synapse_parameters (void)
 Print the neurons' synapse parameters.
 
const char * neuron_get_synapse_type_char (uint32_t synapse_type)
 Get the synapse type description character.
 

Variables

uint32_t * neuron_keys
 The keys to be used by the neurons (one per neuron)
 
bool use_key
 Whether to use key from neuron.c.
 
uint32_t latest_send_time = 0xFFFFFFFF
 Latest time in a timestep that any neuron has sent a spike.
 
uint32_t earliest_send_time = 0
 Earliest time in a timestep that any neuron has sent a spike.
 
uint32_t colour = 0
 The colour of the time step to handle delayed spikes.
 
static uint32_t n_neurons
 The number of neurons on the core.
 
static uint32_t n_neurons_peak
 The closest power of 2 >= n_neurons.
 
static uint32_t n_synapse_types
 The number of synapse types.
 
static uint32_t colour_mask
 The mask of the colour.
 
static uint32_t * ring_buffer_to_input_left_shifts
 Amount to left shift the ring buffer by to make it an input.
 
static void * saved_neuron_params_address
 The address where the actual neuron parameters start.
 
static void * current_source_address
 The address for the current source parameters.
 
static void * saved_initial_values_address
 The address to save initial values to.
 

Detailed Description

implementation of the neuron.h interface.

Definition in file neuron.c.


Data Structure Documentation

◆ neuron_core_parameters

struct neuron_core_parameters

parameters that reside in the neuron_parameter_data_region

Definition at line 69 of file neuron.c.

Data Fields
uint32_t has_key
uint32_t n_neurons_to_simulate
uint32_t n_neurons_peak
uint32_t n_colour_bits
uint32_t n_synapse_types
uint32_t ring_buffer_shifts[]

Function Documentation

◆ neuron_load_neuron_parameters()

static bool neuron_load_neuron_parameters ( uint32_t  time)
static

does the memory copy for the neuron parameters

Parameters
[in]timethe current time step
Returns
true if the memory copies worked, false otherwise

Definition at line 83 of file neuron.c.

◆ neuron_resume()

bool neuron_resume ( uint32_t  time)

Prepare to resume simulation of the neurons.

Parameters
[in]timeThe time of the resume
Returns
bool which is true if the resume was successful or not

Definition at line 93 of file neuron.c.

◆ neuron_initialise()

bool neuron_initialise ( void *  core_params_address,
void *  neuron_params_address,
void *  current_sources_address,
void *  recording_address,
void *  initial_values_address,
uint32_t *  n_rec_regions_used 
)

translate the data stored in the NEURON_PARAMS data region in SDRAM and convert it into c based objects for use.

Parameters
[in]core_params_addressthe absolute address in SDRAM for the start of the core parameters data region in SDRAM
[in]neuron_params_addressThe absolute address in SDRAM for the start of the neuron parameters data region in SDRAM
[in]current_sources_addressThe absolute address in SDRAM for the start of the current sources data region in SDRAM
[in]recording_addressthe recording parameters in SDRAM (contains which regions are active and how big they are)
[in]initial_values_addressThe address where initial values can be written to for later reading.
[out]n_rec_regions_usedThe number of regions used by neuron recording
Returns
True if the translation was successful, otherwise False

Definition at line 105 of file neuron.c.

◆ neuron_pause()

void neuron_pause ( void  )

Perform steps needed before pausing a simulation.

Stores neuron parameters back into SDRAM.

Definition at line 184 of file neuron.c.

◆ neuron_do_timestep_update()

void neuron_do_timestep_update ( timer_t  time,
uint  timer_count 
)

executes all the updates to neural parameters when a given timer period has occurred.

Parameters
[in]timethe timer tick value currently being executed
[in]timer_countused for detecting a wrapping timer

Definition at line 190 of file neuron.c.

◆ neuron_transfer()

void neuron_transfer ( weight_t *  syns)

Add inputs to the neurons.

Parameters
[in]synsThe inputs to be added; this is an array of size n_synapse_types * 2^ceil(log_2(n_neurons)).

Definition at line 204 of file neuron.c.

◆ neuron_print_inputs()

void neuron_print_inputs ( void  )

Print the inputs to the neurons.

Only available in debug mode.

Definition at line 230 of file neuron.c.

◆ neuron_print_synapse_parameters()

void neuron_print_synapse_parameters ( void  )

Print the neurons' synapse parameters.

Only available in debug mode.

Definition at line 234 of file neuron.c.

◆ neuron_get_synapse_type_char()

const char * neuron_get_synapse_type_char ( uint32_t  synapse_type)

Get the synapse type description character.

Only available in debug mode.

Parameters
[in]synapse_typeThe synapse type.
Returns
a single character that describes the synapse.

Definition at line 238 of file neuron.c.

Variable Documentation

◆ neuron_keys

uint32_t* neuron_keys

The keys to be used by the neurons (one per neuron)

Keys for each neuron.

Definition at line 29 of file neuron.c.

◆ use_key

bool use_key

Whether to use key from neuron.c.

A checker that says if this model should be transmitting. If set to false by the data region, then this model should not have a key.

Definition at line 33 of file neuron.c.

◆ latest_send_time

uint32_t latest_send_time = 0xFFFFFFFF

Latest time in a timestep that any neuron has sent a spike.

Latest time from neuron.c.

Definition at line 36 of file neuron.c.

◆ earliest_send_time

uint32_t earliest_send_time = 0

Earliest time in a timestep that any neuron has sent a spike.

Earliest time from neuron.c.

Definition at line 39 of file neuron.c.

◆ colour

uint32_t colour = 0

The colour of the time step to handle delayed spikes.

The time step colour to account for delay.

Definition at line 42 of file neuron.c.

◆ n_neurons

uint32_t n_neurons
static

The number of neurons on the core.

Definition at line 45 of file neuron.c.

◆ n_neurons_peak

uint32_t n_neurons_peak
static

The closest power of 2 >= n_neurons.

Definition at line 48 of file neuron.c.

◆ n_synapse_types

uint32_t n_synapse_types
static

The number of synapse types.

Definition at line 51 of file neuron.c.

◆ colour_mask

uint32_t colour_mask
static

The mask of the colour.

Definition at line 54 of file neuron.c.

◆ ring_buffer_to_input_left_shifts

uint32_t* ring_buffer_to_input_left_shifts
static

Amount to left shift the ring buffer by to make it an input.

Definition at line 57 of file neuron.c.

◆ saved_neuron_params_address

void* saved_neuron_params_address
static

The address where the actual neuron parameters start.

Definition at line 60 of file neuron.c.

◆ current_source_address

void* current_source_address
static

The address for the current source parameters.

Definition at line 63 of file neuron.c.

◆ saved_initial_values_address

void* saved_initial_values_address
static

The address to save initial values to.

Definition at line 66 of file neuron.c.