Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spinncer update #1374

Draft
wants to merge 97 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
b6dab81
resolving weight scaling issues for purkinje cells
pabogdan Oct 31, 2019
a73821e
hardcoded right shift of 5 instead of 10
pabogdan Oct 31, 2019
7f13025
I should probably report weight scaling in a nicer way anyway
pabogdan Nov 6, 2019
2810213
Merge branch 'master' into spinncer
pabogdan Nov 6, 2019
0798b0c
BRINGING UP TO DATE WITH MASTER
pabogdan Nov 25, 2019
3fc8879
Merge remote-tracking branch 'origin/spinncer' into spinncer
pabogdan Nov 26, 2019
9193015
syn_info.weight -> weights, better call for weight variance
pabogdan Nov 26, 2019
15e5a0c
printing ring buffer left shifts
pabogdan Nov 26, 2019
cc11b09
correctly interrogating a GENERATOR
pabogdan Nov 26, 2019
a0b095a
MAX SPIKES PER TICK PROVENANCE
pabogdan Nov 28, 2019
7631383
[PROVENANCE] forgot to add spike profiling utility
pabogdan Nov 28, 2019
db6084f
passing syn_info instead of weights. That used to work simply because…
pabogdan Nov 28, 2019
53cc09b
I think this is enough to enable 64 delay slots per neuron
pabogdan Dec 9, 2019
00fe5bf
max delay in matrix generator
pabogdan Dec 11, 2019
f194f17
viridis based visualiser for a pushbot
pabogdan Jan 28, 2020
cc809b0
initial implementation of if_cond_alpha. Will probably go unused
pabogdan Feb 7, 2020
afecd18
correct reporting of max possible delays
pabogdan Feb 27, 2020
e9467bb
setting delay extensions to have more delay slots. NEEDS TESTING
pabogdan Feb 27, 2020
888f659
tested and fixed delay extension with more delay slots.
pabogdan Feb 28, 2020
7cc3a28
added support for setting RB left shift values
pabogdan Mar 6, 2020
70541be
much better handling of rb values
pabogdan Mar 6, 2020
c7c70b3
added check for additional_params being none
pabogdan Mar 9, 2020
897bb87
delays now work correctly
pabogdan Mar 13, 2020
648a941
Bring in changes to make the models work with multiple steps per ts
rowleya Apr 23, 2020
6eecc8b
Missed bits
rowleya Apr 23, 2020
70fe285
Fix things that have been fixed in main branch
rowleya May 11, 2020
bf6b7b5
Another fix
rowleya May 11, 2020
3802b28
tagged IMPLICIT WEIGHT SCALING with a comment
pabogdan Aug 3, 2020
7f11fbf
round to nearest wherever I can
pabogdan Aug 12, 2020
c06ecdd
exponential time constant is now an unsigned long fract
pabogdan Aug 12, 2020
2aa4f94
potentially fixed v recording
pabogdan Aug 14, 2020
129a45e
correct recording of v
pabogdan Aug 17, 2020
5aa6e47
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Dec 6, 2021
9d64eb2
moved function to header but not the associated header...
andrewgait Dec 6, 2021
f2aac78
Move IF_cond_alpha from spynnaker8 repo
andrewgait Dec 6, 2021
bcc4809
spinncer single cell experiment running
andrewgait Dec 6, 2021
db29ff8
add rb_left_shifts to tests
andrewgait Dec 6, 2021
44d569e
Can't take logs of something that could be zero
andrewgait Dec 6, 2021
bb735e6
fix to pass tests for now, but this constant was 64 earlier on branch...
andrewgait Dec 6, 2021
2a70830
flake8
andrewgait Dec 6, 2021
8318cb9
pylint caught a missed argument
andrewgait Dec 6, 2021
7b1789f
pylint, again I somehow missed this argument
andrewgait Dec 6, 2021
51196ab
Add copyright to spike_profiling.h
andrewgait Dec 6, 2021
3d1f36c
Allow up to 64 time slots for delays, update test accordingly
andrewgait Dec 7, 2021
f7de591
move send_spike out of sub-cycle; fix peak for n_atoms=1
andrewgait Dec 8, 2021
9714ba4
Add structured provenance filename reference
andrewgait Dec 16, 2021
4c4c090
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Apr 1, 2022
e8773dd
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Apr 20, 2022
00f589d
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Apr 22, 2022
b96bf3e
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait May 11, 2022
c87d501
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Jul 19, 2022
16422d9
Missed these prints
andrewgait Jul 19, 2022
caf6b48
Move print functions under log debug
andrewgait Jul 19, 2022
2c95c1f
Not sure how this file came back again...
andrewgait Jul 19, 2022
f8ec966
Turn off largest binaries for now
andrewgait Jul 19, 2022
e51cfed
Implement no current source; update Makefiles for large binaries
andrewgait Jul 20, 2022
9df970f
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Jul 26, 2022
683cbf7
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Aug 22, 2022
6e86dbd
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Aug 31, 2022
b11c316
Delay slots constant has been moved to the splitter
andrewgait Aug 31, 2022
9c154f5
Merge branch 'spinncer_update' of https://github.com/SpiNNakerManches…
andrewgait Aug 31, 2022
bbb2713
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Sep 21, 2022
125005e
Fit debug builds into ITCM
andrewgait Sep 22, 2022
df38557
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Sep 22, 2022
08f377e
Delete test no longer in master, go back to spinncer delay tics values
andrewgait Sep 22, 2022
4f0eaec
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Sep 26, 2022
1bcdb6e
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Sep 29, 2022
97ea253
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Sep 30, 2022
0418d8a
Attempt to catch possible issues with ring buffer DTCM for longer delays
andrewgait Oct 3, 2022
10d430c
Adjust DELAY_MASK calculations
andrewgait Oct 4, 2022
91ea67d
Revert "Adjust DELAY_MASK calculations"
andrewgait Oct 4, 2022
43f4178
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Oct 21, 2022
bd8e776
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Oct 27, 2022
f7fc478
Update to stop compiler warnings
andrewgait Nov 30, 2022
92333ae
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Nov 30, 2022
d7bf5de
missed in merge
andrewgait Nov 30, 2022
5905d56
Still trying to work out ITCM problems on this branch
andrewgait Dec 1, 2022
5261019
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Dec 1, 2022
1204c55
Seems like this UFRACT is the culprit
andrewgait Dec 1, 2022
2feb571
Only need to sum g_syn on the first step
andrewgait Dec 2, 2022
543e8f7
Put the rounding multiplications back in...
andrewgait Dec 2, 2022
001e4d9
Save ITCM
andrewgait Dec 5, 2022
c2de26b
vera remove trailing line
andrewgait Dec 5, 2022
6d52191
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Jan 17, 2023
7ea6378
Try 16 delay tics by default
andrewgait Jan 17, 2023
e4143f4
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Jan 18, 2023
13b2e10
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Feb 23, 2023
ed6aad6
Turn this error off for now
andrewgait Mar 6, 2023
30c0127
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Jul 7, 2023
c2cbfaa
Update license
andrewgait Jul 7, 2023
4012524
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Jul 21, 2023
220e866
Missed a license
andrewgait Jul 21, 2023
a047fea
Merge branch 'master' into spinncer_update
andrewgait Aug 2, 2023
5a62341
flake8
andrewgait Aug 2, 2023
e472a97
Merge branch 'spinncer_update' of https://github.com/SpiNNakerManches…
andrewgait Aug 2, 2023
bc54b55
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Sep 26, 2023
cd6fb87
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Sep 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions neural_modelling/makefiles/neuron/IF_cond_alpha/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) 2017 The University of Manchester
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

APP = $(notdir $(CURDIR))

NEURON_MODEL = $(NEURON_DIR)/neuron/models/neuron_model_lif_impl.c
NEURON_MODEL_H = $(NEURON_DIR)/neuron/models/neuron_model_lif_impl.h
INPUT_TYPE_H = $(NEURON_DIR)/neuron/input_types/input_type_conductance.h
NEURON_IMPL_H = $(NEURON_DIR)/neuron/implementations/neuron_impl_standard.h
THRESHOLD_TYPE_H = $(NEURON_DIR)/neuron/threshold_types/threshold_type_static.h
SYNAPSE_TYPE_H = $(NEURON_DIR)/neuron/synapse_types/synapse_types_alpha_impl.h
SYNAPSE_DYNAMICS = $(NEURON_DIR)/neuron/plasticity/synapse_dynamics_static_impl.c

include ../neural_build.mk
8 changes: 4 additions & 4 deletions neural_modelling/src/common/send_mc.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ static inline void wait_for_cc(void) {
spin1_delay_us(1);
n_loops++;
}
if (!(cc[CC_TCR] & TX_NOT_FULL_MASK)) {
log_error("Couldn't send spike; TCR=0x%08x\n", cc[CC_TCR]);
rt_error(RTE_SWERR);
}
// if (!(cc[CC_TCR] & TX_NOT_FULL_MASK)) {
// log_error("Couldn't send spike; TCR=0x%08x\n", cc[CC_TCR]);
// rt_error(RTE_SWERR);
// }
}

//! \brief Perform direct spike sending with hardware for speed
Expand Down
3 changes: 3 additions & 0 deletions neural_modelling/src/delay_extension/delay_extension.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

#include <common-typedefs.h>

//! Constants
#define DELAY_STAGE_LENGTH 64

//! region identifiers
typedef enum region_identifiers {
//! General simulation system control
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static inline input_t additional_input_get_input_value_as_current(
additional_input->i_ca2 *= additional_input->exp_tau_ca2;

// Return the Ca2
return -additional_input->i_ca2;
return additional_input->i_ca2;
}

//! \brief Notifies the additional input type that the neuron has spiked
Expand Down
25 changes: 22 additions & 3 deletions neural_modelling/src/neuron/c_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@
#include "c_main_common.h"
#include "regions.h"
#include "profile_tags.h"
//#include "spike_profiling.h"
#include "spike_processing.h"

//struct spike_holder_t spike_counter;
//struct spike_holder_t spike_cache;
//struct spike_holder_t spike_counter_inh;
//struct spike_holder_t spike_cache_inh;

//! The combined provenance from synapses and neurons
struct combined_provenance {
struct neuron_provenance neuron_provenance;
Expand Down Expand Up @@ -70,6 +76,7 @@ const struct common_priorities COMMON_PRIORITIES = {
.timer = TIMER
};


//! From the regions, extract those that are neuron-specific
const struct neuron_regions NEURON_REGIONS = {
.core_params = CORE_PARAMS_REGION,
Expand Down Expand Up @@ -153,9 +160,9 @@ static inline void process_ring_buffers(void) {
neuron_transfer(&ring_buffers[first_index]);

// Print the neuron inputs.
#if LOG_LEVEL >= LOG_DEBUG
neuron_print_inputs();
#endif // LOG_LEVEL >= LOG_DEBUG
#if LOG_LEVEL >= LOG_DEBUG
neuron_print_inputs();
#endif // LOG_LEVEL >= LOG_DEBUG
}

//! \brief Background activities called from timer
Expand All @@ -179,6 +186,18 @@ void background_callback(uint timer_count, uint local_time) {
//! executed since start of simulation
//! \param[in] unused: unused parameter kept for API consistency
void timer_callback(uint timer_count, UNUSED uint unused) {

// // Get number of spikes in last tick, and reset spike counter
// spike_processing_get_and_reset_spikes_this_tick();
// spike_processing_get_and_reset_dmas_this_tick();
// spike_processing_get_and_reset_pipeline_restarts_this_tick();
//
// // cache and flush spike counters
// spike_profiling_cache_and_flush_spike_holder(&spike_counter,
// &spike_cache);
// spike_profiling_cache_and_flush_spike_holder(&spike_counter_inh,
// &spike_cache_inh);

// Disable interrupts to stop DMAs and MC getting in the way of this bit
uint32_t state = spin1_int_disable();

Expand Down
22 changes: 22 additions & 0 deletions neural_modelling/src/neuron/c_main_synapses.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,20 @@
#include "c_main_synapse_common.h"
#include "c_main_common.h"
#include "spike_processing_fast.h"
#include "spike_profiling.h"
#include "structural_plasticity/synaptogenesis_dynamics.h"
#include <spin1_api_params.h>

//! spike profiling
struct spike_holder_t spike_counter;
struct spike_holder_t spike_cache;
struct spike_holder_t spike_counter_inh;
struct spike_holder_t spike_cache_inh;

//// FLUSH SPIKES ??
//bool timer_callback_active = false;
//extern volatile bool dma_busy;

//! values for the priority for each callback
typedef enum callback_priorities {
MC = -1, DMA = -2, TIMER = 0, SDP = 0
Expand Down Expand Up @@ -129,6 +140,17 @@ void resume_callback(void) {
//! \param[in] unused0: unused
//! \param[in] unused1: unused
void timer_callback(UNUSED uint unused0, UNUSED uint unused1) {
// Get number of spikes in last tick, and reset spike counter
spike_processing_get_and_reset_spikes_this_tick();
spike_processing_get_and_reset_dmas_this_tick();
spike_processing_get_and_reset_pipeline_restarts_this_tick();

// cache and flush spike counters
spike_profiling_cache_and_flush_spike_holder(&spike_counter,
&spike_cache);
spike_profiling_cache_and_flush_spike_holder(&spike_counter_inh,
&spike_cache_inh);

time++;
if (simulation_is_finished()) {
// Enter pause and resume state to avoid another tick
Expand Down
5 changes: 2 additions & 3 deletions neural_modelling/src/neuron/current_sources/current_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ SOMETIMES_UNUSED // Marked unused as only used sometimes
static bool current_source_initialise(address_t cs_address, uint32_t n_neurons) {
// Avoid the loops if no current sources
#if !defined(_CURRENT_SOURCE_DC_H_) && !defined(_CURRENT_SOURCE_AC_H) && \
!defined(_CURRENT_SOURCE_STEP_H_) && !defined(_CURRENT_SOURCE_NOISY_H_)
!defined(_CURRENT_SOURCE_STEP_H_) && !defined(_CURRENT_SOURCE_NOISY_H_)
return true;
#else

Expand Down Expand Up @@ -150,7 +150,6 @@ static bool current_source_load_parameters(address_t cs_address) {
// Avoid the loops if no current sources
#if !defined(_CURRENT_SOURCE_DC_H_) && !defined(_CURRENT_SOURCE_AC_H) && \
!defined(_CURRENT_SOURCE_STEP_H_) && !defined(_CURRENT_SOURCE_NOISY_H_)
io_printf(IO_BUF, "no current sources defined \n");
return true;
#else

Expand Down Expand Up @@ -207,7 +206,7 @@ SOMETIMES_UNUSED // Marked unused as only used sometimes
static inline REAL current_source_get_offset(uint32_t time, uint32_t neuron_index) {
// Avoid the loops if no current sources defined
#if !defined(_CURRENT_SOURCE_DC_H_) && !defined(_CURRENT_SOURCE_AC_H) && \
!defined(_CURRENT_SOURCE_STEP_H_) && !defined(_CURRENT_SOURCE_NOISY_H_)
!defined(_CURRENT_SOURCE_STEP_H_) && !defined(_CURRENT_SOURCE_NOISY_H_)
return ZERO;
#else

Expand Down
36 changes: 23 additions & 13 deletions neural_modelling/src/neuron/implementations/neuron_impl_standard.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ SOMETIMES_UNUSED // Marked unused as only used sometimes
static void neuron_impl_load_neuron_parameters(
address_t address, uint32_t next, uint32_t n_neurons,
address_t save_initial_state) {

// Read the number of steps per timestep
n_steps_per_timestep = address[next++];
if (n_steps_per_timestep == 0) {
Expand Down Expand Up @@ -252,6 +251,8 @@ static void neuron_impl_do_timestep_update(
additional_input_t *additional_inputs = &additional_input_array[neuron_index];
synapse_types_t *the_synapse_type = &synapse_types_array[neuron_index];

// bool spike = false;

// Loop however many times requested; do this in reverse for efficiency,
// and because the index doesn't actually matter
for (uint32_t i_step = n_steps_per_timestep; i_step > 0; i_step--) {
Expand All @@ -265,26 +266,25 @@ static void neuron_impl_do_timestep_update(
input_t inh_values[NUM_INHIBITORY_RECEPTORS];
input_t *inh_syn_values =
synapse_types_get_inhibitory_input(inh_values, the_synapse_type);

// Call functions to obtain exc_input and inh_input
input_t *exc_input_values = input_type_get_input_value(
exc_syn_values, input_types, NUM_EXCITATORY_RECEPTORS);
input_t *inh_input_values = input_type_get_input_value(
inh_syn_values, input_types, NUM_INHIBITORY_RECEPTORS);

// Sum g_syn contributions from all receptors for recording
REAL total_exc = ZERO;
REAL total_inh = ZERO;

for (int i = 0; i < NUM_EXCITATORY_RECEPTORS; i++) {
total_exc += exc_input_values[i];
}
for (int i = 0; i < NUM_INHIBITORY_RECEPTORS; i++) {
total_inh += inh_input_values[i];
}

// Do recording if on the first step
if (i_step == n_steps_per_timestep) {
// Sum g_syn contributions from all receptors for recording
REAL total_exc = ZERO;
REAL total_inh = ZERO;

for (int i = 0; i < NUM_EXCITATORY_RECEPTORS; i++) {
total_exc += exc_input_values[i];
}
for (int i = 0; i < NUM_INHIBITORY_RECEPTORS; i++) {
total_inh += inh_input_values[i];
}

neuron_recording_record_accum(
V_RECORDING_INDEX, neuron_index, soma_voltage);
neuron_recording_record_accum(
Expand Down Expand Up @@ -319,6 +319,8 @@ static void neuron_impl_do_timestep_update(
// If spike occurs, communicate to relevant parts of model
if (spike_now) {

// spike = true;

// Call relevant model-based functions
// Tell the neuron model
neuron_model_has_spiked(this_neuron);
Expand All @@ -340,6 +342,14 @@ static void neuron_impl_do_timestep_update(
#if LOG_LEVEL >= LOG_DEBUG
neuron_model_print_state_variables(this_neuron);
#endif // LOG_LEVEL >= LOG_DEBUG

// if (spike) {
// // Record the spike
// neuron_recording_record_bit(SPIKE_RECORDING_BITFIELD, neuron_index);
//
// // Send the spike
// send_spike(timer_count, time, neuron_index);
// }
}
}

Expand Down
11 changes: 10 additions & 1 deletion neural_modelling/src/neuron/input_types/input_type_conductance.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define _INPUT_TYPE_CONDUCTANCE_H_

#include "input_type.h"
//#include "round.h"

//! Conductance input parameters
struct input_type_params_t {
Expand Down Expand Up @@ -59,7 +60,7 @@ static inline input_t *input_type_get_input_value(
input_t *restrict value, UNUSED input_type_t *input_type,
uint16_t num_receptors) {
for (int i = 0; i < num_receptors; i++) {
value[i] = value[i] >> 10;
value[i] = value[i] >> 5;
}
return &value[0];
}
Expand All @@ -74,8 +75,12 @@ static inline void input_type_convert_excitatory_input_to_current(
input_t *restrict exc_input, const input_type_t *input_type,
state_t membrane_voltage) {
for (int i=0; i < NUM_EXCITATORY_RECEPTORS; i++) {
// accum = accum * (accum - accum)
exc_input[i] = exc_input[i] *
(input_type->V_rev_E - membrane_voltage);
// RTN accum
// exc_input[i] = MULT_ROUND_NEAREST_ACCUM(exc_input[i],
// (input_type->V_rev_E - membrane_voltage));
}
}

Expand All @@ -89,8 +94,12 @@ static inline void input_type_convert_inhibitory_input_to_current(
input_t *restrict inh_input, const input_type_t *input_type,
state_t membrane_voltage) {
for (int i=0; i < NUM_INHIBITORY_RECEPTORS; i++) {
// accum = accum * (accum - accum)
inh_input[i] = -inh_input[i] *
(input_type->V_rev_I - membrane_voltage);
// RTN accum
// inh_input[i] = MULT_ROUND_NEAREST_ACCUM(-inh_input[i],
// (input_type->V_rev_I - membrane_voltage));
}
}

Expand Down
2 changes: 1 addition & 1 deletion neural_modelling/src/neuron/models/neuron_model_izh_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ static inline state_t neuron_model_state_update(
}

input_t input_this_timestep = total_exc - total_inh
+ external_bias + neuron->I_offset + current_offset;
- external_bias + neuron->I_offset + current_offset;

// the best AR update so far
rk2_kernel_midpoint(neuron->this_h, neuron, input_this_timestep);
Expand Down
13 changes: 10 additions & 3 deletions neural_modelling/src/neuron/models/neuron_model_lif_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define _NEURON_MODEL_LIF_CURR_IMPL_H_

#include "neuron_model.h"
#include "round.h"

//! definition for LIF neuron parameters
struct neuron_params_t {
Expand Down Expand Up @@ -118,10 +119,16 @@ static inline void neuron_model_save_state(neuron_t *state, neuron_params_t *par
//! \param[in] input_this_timestep: The input to apply
static inline void lif_neuron_closed_form(
neuron_t *neuron, REAL V_prev, input_t input_this_timestep) {
REAL alpha = input_this_timestep * neuron->R_membrane + neuron->V_rest;
// accum = accum * accum + accum
// REAL alpha = (input_this_timestep * neuron->R_membrane) + neuron->V_rest;
REAL alpha = MULT_ROUND_NEAREST_ACCUM(
input_this_timestep, neuron->R_membrane) + neuron->V_rest;

// update membrane voltage
neuron->V_membrane = alpha - (neuron->exp_TC * (alpha - V_prev));
// accum - (ufract * (accum - accum))
// neuron->V_membrane = alpha - (neuron->exp_TC * (alpha - V_prev));
neuron->V_membrane = alpha - MULT_ROUND_NEAREST_ACCUM(
neuron->exp_TC, (alpha - V_prev));
}

//! \brief primary function called in timer loop after synaptic updates
Expand Down Expand Up @@ -157,7 +164,7 @@ static inline state_t neuron_model_state_update(
}
// Get the input in nA
input_t input_this_timestep =
total_exc - total_inh + external_bias + neuron->I_offset + current_offset;
total_exc - total_inh - external_bias + neuron->I_offset + current_offset;

lif_neuron_closed_form(
neuron, neuron->V_membrane, input_this_timestep);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ bool population_table_load_bitfields(filter_region_t *filter_region) {
return false;
}
uint32_t useful = !(filters[mp_i].merged || filters[mp_i].all_ones);

if (useful) {
// Try to allocate all the bitfields for this entry
uint32_t n_words = get_bit_field_size(filters[mp_i].n_atoms);
Expand Down Expand Up @@ -337,5 +336,3 @@ bool population_table_get_next_address(spike_t *spike, pop_table_lookup_result_t

return is_valid;
}

//! \}
Loading