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;
97static inline void neuron_model_initialise(
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;
191static inline void neuron_model_print_state_variables(
const neuron_t *neuron) {
196static inline void neuron_model_print_parameters(
const neuron_t *neuron) {
void log_info(const char *message,...)
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.
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.