20#ifndef _NEURON_IMPL_STOC_EXP_
21#define _NEURON_IMPL_STOC_EXP_
30#define V_RECORDING_INDEX 0
31#define EX_INPUT_INDEX 1
32#define IN_INPUT_INDEX 2
34#define N_RECORDED_VARS 4
36#define SPIKE_RECORDING_BITFIELD 0
37#define N_BITFIELD_VARS 1
91static bool neuron_impl_initialise(uint32_t
n_neurons) {
95 log_error(
"Unable to allocate neuron array - Out of DTCM");
102static inline void neuron_model_initialise(
123static void neuron_impl_load_neuron_parameters(
128 for (uint32_t i = 0; i <
n_neurons; i++) {
134 if (save_initial_state) {
140static void neuron_impl_store_neuron_parameters(
143 for (uint32_t i = 0; i <
n_neurons; i++) {
148static void neuron_impl_add_inputs(
150 input_t weights_this_timestep) {
155 neuron->
inputs[synapse_type_index] += weights_this_timestep;
159static inline void do_refrac_update(uint32_t timer_count, uint32_t time,
175 send_spike(timer_count, time, neuron_index);
178static inline void do_non_refrac_update(uint32_t timer_count, uint32_t time,
189 neuron->inputs[0] =
ZERO;
190 neuron->inputs[1] =
ZERO;
203 neuron->refract_timer = neuron->t_refract - 1;
205 send_spike(timer_count, time, neuron_index);
209static void neuron_impl_do_timestep_update(
210 uint32_t timer_count, uint32_t time, uint32_t
n_neurons) {
211 for (uint32_t neuron_index = 0; neuron_index <
n_neurons; neuron_index++) {
217 do_refrac_update(timer_count, time, neuron_index, neuron);
219 do_non_refrac_update(timer_count, time, neuron_index, neuron);
224#if LOG_LEVEL >= LOG_DEBUG
226 log_debug(
"-------------------------------------\n");
231 log_debug(
"-------------------------------------\n");
240 if (synapse_type == 0) {
242 }
else if (synapse_type == 1) {
General API of a current source implementation.
Implement all current sources.
void log_error(const char *message,...)
void log_debug(const char *message,...)
maths-util.h - first created 7/10/2013 version 0.1
unsigned accum UREAL
Type used for "unsigned real" numbers.
accum REAL
Type used for "real" numbers.
unsigned long fract UFRACT
Type used for "unsigned fractional" numbers.
#define UREAL_CONST(x)
Define a constant of type UREAL.
static UREAL ukdivuk(UREAL a, UREAL b)
Divides an unsigned accum by another unsigned accum.
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.
void neuron_impl_print_synapse_parameters(uint32_t n_neurons)
Print the synapse parameters of the neurons.
const char * neuron_impl_get_synapse_type_char(uint32_t synapse_type)
Get the synapse type character for a synapse type.
void neuron_impl_print_inputs(uint32_t n_neurons)
Print the inputs to the neurons.
static neuron_impl_t * neuron_array
Array of neuron states.
UFRACT tau_recip
The reciprocal of the tau value.
uint32_t t_refract
The refractory timer countdown value.
input_t inputs[2]
The inputs to add in the next timestep.
mars_kiss64_seed_t random_seed
The random state.
uint32_t refract_timer
The refractory timer.
definition of neuron state
mars_kiss64_seed_t random_seed
Random seed to use.
UREAL tau_ms
The tau value of the neuron.
UREAL time_step
The timestep of the neuron being used.
uint32_t refract_init
The initial refractory timer.
definition of neuron parameters
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...
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...
uint32_t mars_kiss64_seed(mars_kiss64_seed_t seed)
uint32_t mars_kiss64_seed_t[4]
void validate_mars_kiss64_seed(mars_kiss64_seed_t seed)
void spin1_memcpy(void *dst, void const *src, uint len)
static uint32_t get_probability(UREAL tau, REAL p)
Calculates the probability as a uint32_t from 0 to 0xFFFFFFFF (which is 1)
static stdp_params params
Configuration parameters.