19#ifndef _NEURON_MODEL_IF_TRUNC_H_
20#define _NEURON_MODEL_IF_TRUNC_H_
77 int32_t bits = bitsk(value);
78 int32_t integer = bits >> 15;
79 int32_t fraction = bits & 0x7FFF;
86static inline void neuron_model_initialise(
118 uint16_t num_excitatory_inputs,
const input_t *exc_input,
119 uint16_t num_inhibitory_inputs,
const input_t *inh_input,
123 if (neuron->refract_timer <= 0) {
127 for (
int i=0; i < num_excitatory_inputs; i++) {
128 total_exc += exc_input[i];
130 for (
int i=0; i< num_inhibitory_inputs; i++) {
131 total_inh += inh_input[i];
135 total_exc - total_inh + external_bias + neuron->I_offset + current_offset;
141 if (neuron->V_membrane < neuron->V_reset) {
142 neuron->V_membrane = neuron->V_reset;
146 neuron->refract_timer--;
148 return neuron->V_membrane;
156 neuron->V_membrane = neuron->V_reset;
159 neuron->refract_timer = neuron->T_refract;
171static inline void neuron_model_print_state_variables(
const neuron_t *neuron) {
176static 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.
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 int32_t lif_ceil_accum(REAL value)
Performs a ceil operation on an accum.
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 I_offset
offset current [nA]
int32_t T_refract
refractory time of neuron [timesteps]
REAL time_step
The time step in milliseconds.
REAL R_membrane
membrane resistance [MOhm]
int32_t refract_timer_init
initial refractory timer value (saved)
REAL tau_m
membrane decay time constant
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.