19#ifndef _NEURON_IMPL_STANDARD_H_
20#define _NEURON_IMPL_STANDARD_H_
89 log_error(
"Unable to allocate neuron array - Out of DTCM");
98 log_error(
"Unable to allocate input type array - Out of DTCM");
108 log_error(
"Unable to allocate additional input array"
119 log_error(
"Unable to allocate threshold type array - Out of DTCM");
129 log_error(
"Unable to allocate synapse types array - Out of DTCM");
144 input_t weights_this_timestep) {
148 parameters, weights_this_timestep);
155 return (size + (
sizeof(uint32_t) - 1)) /
sizeof(uint32_t);
171 log_error(
"bad number of steps per timestep: 0");
177 for (uint32_t i = 0; i <
n_neurons; i++) {
186 for (uint32_t i = 0; i <
n_neurons; i++) {
195 for (uint32_t i = 0; i <
n_neurons; i++) {
204 for (uint32_t i = 0; i <
n_neurons; i++) {
213 for (uint32_t i = 0; i <
n_neurons; i++) {
222 if (save_initial_state) {
223 spin1_memcpy(save_initial_state, address, next *
sizeof(uint32_t));
226#if LOG_LEVEL >= LOG_DEBUG
240 uint32_t timer_count, uint32_t time, uint32_t
n_neurons) {
242 for (uint32_t neuron_index = 0; neuron_index <
n_neurons; neuron_index++) {
280 total_exc += exc_input_values[i];
283 total_inh += inh_input_values[i];
298 exc_input_values, input_types, soma_voltage);
300 inh_input_values, input_types, soma_voltage);
307 additional_inputs, soma_voltage);
313 external_bias, current_offset, this_neuron);
333 send_spike(timer_count,
time, neuron_index);
340 #if LOG_LEVEL >= LOG_DEBUG
359 for (uint32_t i = 0; i <
n_neurons; i++) {
367 for (uint32_t i = 0; i <
n_neurons; i++) {
375 for (uint32_t i = 0; i <
n_neurons; i++) {
383 for (uint32_t i = 0; i <
n_neurons; i++) {
391 for (uint32_t i = 0; i <
n_neurons; i++) {
398#if LOG_LEVEL >= LOG_DEBUG
408 empty = empty && (0 == bitsk(
420 input_t input = exc_input[0] - inh_input[0];
421 if (bitsk(input) != 0) {
422 log_debug(
"Neuron %3u: input %12.6k (= ", i, input);
uint32_t time
The current timer tick value.
General API of a current source implementation.
static REAL current_source_get_offset(uint32_t time, uint32_t neuron_index)
Calculate the current offset from all injected current sources.
void log_error(const char *message,...)
void log_debug(const char *message,...)
accum REAL
Type used for "real" numbers.
REAL state_t
The type of a state variable.
REAL input_t
The type of an input.
static uint32_t n_neurons
The number of neurons on the core.
General API of a neuron implementation.
bitfield_recording_indices
Indices for recording of bitfields.
word_recording_indices
Indices for recording of words.
@ SPIKE_RECORDING_BITFIELD
Spike event recording index.
@ N_BITFIELD_VARS
Number of recorded bitfields.
void neuron_impl_print_synapse_parameters(uint32_t n_neurons)
Print the synapse parameters of the neurons.
static neuron_t * neuron_array
Array of neuron states.
static input_type_t * input_type_array
Input states array.
const char * neuron_impl_get_synapse_type_char(uint32_t synapse_type)
Get the synapse type character for a synapse type.
static threshold_type_t * threshold_type_array
Threshold states array.
static void neuron_impl_do_timestep_update(uint32_t timer_count, uint32_t time, uint32_t n_neurons)
Do the timestep update for the particular implementation.
static void neuron_impl_load_neuron_parameters(address_t address, uint32_t next, uint32_t n_neurons, address_t save_initial_state)
Load in the neuron parameters.
@ GSYN_INH_RECORDING_INDEX
Gsyn_inh (excitatory synaptic conductance/current) recording index.
@ GSYN_EXC_RECORDING_INDEX
Gsyn_exc (excitatory synaptic conductance/current) recording index.
@ N_RECORDED_VARS
Number of recorded word-sized state variables.
@ V_RECORDING_INDEX
V (somatic potential) recording index.
static uint32_t n_words_needed(size_t size)
The number of words required to hold an object of given size.
static void neuron_impl_add_inputs(index_t synapse_type_index, index_t neuron_index, input_t weights_this_timestep)
Add inputs to the neuron.
static additional_input_t * additional_input_array
Additional input array.
void neuron_impl_print_inputs(uint32_t n_neurons)
Print the inputs to the neurons.
static bool neuron_impl_initialise(uint32_t n_neurons)
Initialise the particular implementation of the data.
static uint n_steps_per_timestep
The number of steps to run per timestep.
static synapse_types_t * synapse_types_array
The synapse shaping parameters.
static void neuron_impl_store_neuron_parameters(address_t address, uint32_t next, uint32_t n_neurons)
Stores neuron parameters back into SDRAM.
The API for neuron models themselves.
static void neuron_model_print_state_variables(const neuron_t *neuron)
printout of state variables i.e. those values that might change
static state_t neuron_model_get_membrane_voltage(const neuron_t *neuron)
get the neuron membrane voltage for a given neuron parameter set
static state_t neuron_model_state_update(uint16_t num_excitatory_inputs, const input_t *exc_input, uint16_t num_inhibitory_inputs, const input_t *inh_input, input_t external_bias, REAL current_offset, neuron_t *restrict neuron)
primary function called in timer loop after synaptic updates
static void neuron_model_has_spiked(neuron_t *restrict neuron)
Indicates that the neuron has spiked.
static void neuron_model_print_parameters(const neuron_t *neuron)
printout of parameters i.e. those values that don't change
definition of neuron parameters
definition for LIF neuron state
Recording of the state of a neuron (spiking, voltage, etc.)
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 t...
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_re...
void rt_error(uint code,...)
void spin1_memcpy(void *dst, void const *src, uint len)
static stdp_params params
Configuration parameters.
API for synaptic behaviour types (see also src/neuron/input_types)
static void synapse_types_save_state(synapse_types_t *state, synapse_types_params_t *params)
save parameters and state back to SDRAM for reading by host and recovery on restart
static const char * synapse_types_get_type_char(index_t synapse_type_index)
returns a human readable character for the type of synapse.
static input_t * synapse_types_get_excitatory_input(input_t *excitatory_response, synapse_types_t *parameters)
extracts the excitatory input buffers from the buffers available for a given neuron ID
static void synapse_types_initialise(synapse_types_t *state, synapse_types_params_t *params, uint32_t n_steps_per_time_step)
initialise the structure from the parameters
static void synapse_types_add_neuron_input(index_t synapse_type_index, synapse_types_t *parameters, input_t input)
adds the inputs for a give timer period to a given neuron that is being simulated by this model
static void synapse_types_print_input(synapse_types_t *parameters)
prints the input for a neuron ID given the available inputs currently only executed when the models a...
static void synapse_types_print_parameters(synapse_types_t *parameters)
prints the parameters of the synapse type
static void synapse_types_shape_input(synapse_types_t *parameters)
decays the stuff thats sitting in the input buffers as these have not yet been processed and applied ...
static input_t * synapse_types_get_inhibitory_input(input_t *inhibitory_response, synapse_types_t *parameters)
extracts the inhibitory input buffers from the buffers available for a given neuron ID
Delta synapses support just a single excitatory and inhibitory input each.
static void threshold_type_initialise(threshold_type_t *state, threshold_type_params_t *params, uint32_t n_steps_per_timestep)
initialise the state from the parameters
static void threshold_type_save_state(threshold_type_t *state, threshold_type_params_t *params)
save parameters and state back to SDRAM for reading by host and recovery on restart
static bool threshold_type_is_above_threshold(state_t value, threshold_type_t *threshold_type)
Determines if the value given is above the threshold value.
Stochastic threshold parameters.
Stochastic threshold configuration.