19 #ifndef _NEURON_MODEL_LIF_CURR_IMPL_H_
20 #define _NEURON_MODEL_LIF_CURR_IMPL_H_
88 int32_t bits = bitsk(value);
89 int32_t integer = bits >> 15;
90 int32_t fraction = bits & 0x7FFF;
143 uint16_t num_excitatory_inputs,
const input_t *exc_input,
144 uint16_t num_inhibitory_inputs,
const input_t *inh_input,
148 if (neuron->refract_timer <= 0) {
152 for (
int i=0; i < num_excitatory_inputs; i++) {
153 total_exc += exc_input[i];
155 for (
int i=0; i< num_inhibitory_inputs; i++) {
156 total_inh += inh_input[i];
160 total_exc - total_inh + external_bias + neuron->I_offset + current_offset;
166 neuron->refract_timer--;
168 return neuron->V_membrane;
176 neuron->V_membrane = neuron->V_reset;
179 neuron->refract_timer = neuron->T_refract;
192 log_info(
"V membrane = %11.4k mv", neuron->
V_membrane);
193 log_info(
"Refract timer = %u timesteps", neuron->
refract_timer);
197 log_info(
"V reset = %11.4k mv", neuron->
V_reset);
198 log_info(
"V rest = %11.4k mv", neuron->
V_rest);
200 log_info(
"I offset = %11.4k nA", neuron->
I_offset);
201 log_info(
"R membrane = %11.4k Mohm", neuron->
R_membrane);
203 log_info(
"exp(-ms/(RC)) = %11.4k [.]", neuron->
exp_TC);
205 log_info(
"T refract = %u timesteps", neuron->
T_refract);
accum REAL
Type used for "real" numbers.
static REAL kdivk(REAL a, REAL b)
Divides an accum by another accum.
static REAL kdivui(REAL a, uint32_t b)
Divides an accum by an unsigned integer.
REAL state_t
The type of a state variable.
REAL input_t
The type of an input.
static uint n_steps_per_timestep
The number of steps to run per timestep.
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 void neuron_model_initialise(neuron_t *state, neuron_params_t *params, uint32_t n_steps_per_timestep)
initialise the structure from the parameters
static void neuron_model_save_state(neuron_t *state, neuron_params_t *params)
save parameters and state back to SDRAM for reading by host and recovery on restart
static void neuron_model_print_parameters(const neuron_t *neuron)
printout of parameters i.e. those values that don't change
REAL V_init
membrane voltage [mV]
REAL V_reset
post-spike reset membrane voltage [mV]
REAL c_m
membrane capacitance [nF]
REAL V_reset
post-spike reset membrane voltage [mV]
REAL T_refract_ms
refractory time of neuron [ms]
REAL V_rest
membrane resting voltage [mV]
static state_t neuron_model_get_membrane_voltage(const neuron_t *neuron)
get the neuron membrane voltage for a given neuron parameter set
REAL V_rest
membrane resting voltage [mV]
REAL I_offset
offset current [nA]
int32_t T_refract
refractory time of neuron [timesteps]
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
UREAL time_step
The timestep of the neuron being used.
static void neuron_model_has_spiked(neuron_t *restrict neuron)
Indicates that the neuron has spiked.
REAL R_membrane
membrane resistance [MOhm]
static int32_t lif_ceil_accum(REAL value)
Performs a ceil operation on an accum.
int32_t refract_timer_init
initial refractory timer value (saved)
REAL tau_m
membrane decay time constant
static void lif_neuron_closed_form(neuron_t *neuron, REAL V_prev, input_t input_this_timestep)
simple Leaky I&F ODE
REAL V_membrane
membrane voltage [mV]
REAL I_offset
offset current [nA]
int32_t refract_timer
countdown to end of next refractory period [timesteps]
definition of neuron parameters
definition for LIF neuron state
static uint16_t * input_this_timestep
The inputs to be sent at the end of this timestep.
static stdp_params params
Configuration parameters.