22#ifndef _TIMING_RECURRENT_COMMON_H_
23#define _TIMING_RECURRENT_COMMON_H_
74static inline void _no_op(
void) {
84 UNUSED uint32_t time, UNUSED uint32_t
last_time,
125 uint32_t time, UNUSED
pre_trace_t trace, uint32_t last_pre_time,
126 UNUSED
pre_trace_t last_pre_trace, uint32_t last_post_time,
128 bool update_state =
false;
129 switch (previous_state.
state) {
139 uint32_t time_since_last_pre =
time - last_pre_time;
153 uint32_t time_since_last_post =
time - last_post_time;
155 log_debug(
"\tTime_since_last_post_event=%u", time_since_last_post);
158 time_since_last_post, previous_state)) {
167 log_debug(
"\t\tDecrementing accumulator=%d",
193 return previous_state;
207 uint32_t time, UNUSED
post_trace_t trace, uint32_t last_pre_time,
208 UNUSED
pre_trace_t last_pre_trace, uint32_t last_post_time,
210 bool update_state =
false;
211 switch (previous_state.
state) {
221 uint32_t time_since_last_post =
time - last_post_time;
224 time_since_last_post, previous_state)) {
236 uint32_t time_since_last_pre =
time - last_pre_time;
238 log_debug(
"\tTime_since_last_pre_event=%u", time_since_last_pre);
240 if (time_since_last_pre == 0) {
246 time_since_last_pre, previous_state)) {
255 log_debug(
"\t\tIncrementing accumulator=%d",
281 return previous_state;
uint32_t time
The current timer tick value.
void log_debug(const char *message,...)
uint32_t last_time
The time of the most recently-considered spike.
Support functions for STDP.
Utility function for random number generation.
Basic definitions for STDP.
#define STDP_FIXED_POINT_ONE
The number 1.0 in the fixed point math used by STDP.
weight_state_t weight_state
The weight staet.
int32_t state
State machine state.
int32_t accumulator
The accumulator (in ARM-friendly format)
static post_trace_t timing_add_post_spike(uint32_t time, uint32_t last_time, post_trace_t last_trace)
Add a post spike to the post trace.
static update_state_t timing_apply_pre_spike(uint32_t time, pre_trace_t trace, uint32_t last_pre_time, pre_trace_t last_pre_trace, uint32_t last_post_time, post_trace_t last_post_trace, update_state_t previous_state)
Apply a pre-spike timing rule state update.
static pre_trace_t timing_add_pre_spike(uint32_t time, uint32_t last_time, pre_trace_t last_trace)
Add a pre spike to the pre trace.
static update_state_t timing_recurrent_calculate_post_window(update_state_t previous_state)
API: Update the state with the post-window information.
static update_state_t timing_recurrent_calculate_pre_window(update_state_t previous_state)
API: Update the state with the pre-window information.
static bool timing_recurrent_in_pre_window(uint32_t time_since_last_event, update_state_t previous_state)
API: Check if there was an event in the pre-window.
static update_state_t timing_apply_post_spike(uint32_t time, post_trace_t trace, uint32_t last_pre_time, pre_trace_t last_pre_trace, uint32_t last_post_time, post_trace_t last_post_trace, update_state_t previous_state)
Apply a post-spike timing rule state update.
recurrent_state_machine_state_t
Synapse states.
@ STATE_POST_OPEN
Post-window is open.
@ STATE_IDLE
Initial state; neither window is open.
@ STATE_PRE_OPEN
Pre-window is open.
static post_trace_t timing_get_initial_post_trace(void)
Get an initial post-synaptic timing trace.
static bool timing_recurrent_in_post_window(uint32_t time_since_last_event, update_state_t previous_state)
API: Check if there was an event in the post-window.
plasticity_trace_region_data_t plasticity_trace_region_data
Global plasticity parameter data.
The type of post-spike traces.
The type of pre-spike traces.
int32_t accumulator_potentiation_minus_one
Threshold below which we won't hit potentiation trigger after increment.
int32_t accumulator_depression_plus_one
Threshold above which we won't hit depression trigger after decrement.
Configuration information about plasticity traces.
static weight_state_t weight_one_term_apply_depression(weight_state_t state, int32_t a2_minus)
Apply the depression rule to the weight state.
static weight_state_t weight_one_term_apply_potentiation(weight_state_t state, int32_t a2_plus)
Apply the potentiation rule to the weight state.
API for single-term weight dependence rules.