19#ifndef _TIMING_RECURRENT_DUAL_FSM_IMPL_H_
20#define _TIMING_RECURRENT_DUAL_FSM_IMPL_H_
71 UNUSED uint32_t time, UNUSED uint32_t
last_time,
76 uint32_t
random = mars_kiss_fixed_point();
78 log_debug(
"\t\tResetting post-window: random=%d, window_length=%u",
97 UNUSED uint32_t time, UNUSED uint32_t
last_time,
102 uint32_t
random = mars_kiss_fixed_point();
104 log_debug(
"\t\tResetting pre-window: random=%d, window_length=%u",
108 return window_length;
122 uint32_t time, UNUSED
pre_trace_t trace, UNUSED uint32_t last_pre_time,
123 UNUSED
pre_trace_t last_pre_trace, uint32_t last_post_time,
126 uint32_t time_since_last_post =
time - last_post_time;
128 log_debug(
"\t\t\ttime_since_last_post:%u, post_window_length:%u",
129 time_since_last_post, last_post_trace);
131 if (time_since_last_post < last_post_trace) {
137 log_debug(
"\t\t\t\tDecrementing accumulator=%d",
141 log_debug(
"\t\t\t\tApplying depression");
149 return previous_state;
163 uint32_t time, UNUSED
post_trace_t trace, uint32_t last_pre_time,
164 pre_trace_t last_pre_trace, UNUSED uint32_t last_post_time,
167 uint32_t time_since_last_pre =
time - last_pre_time;
169 log_debug(
"\t\t\ttime_since_last_pre:%u, pre_window_length:%u",
170 time_since_last_pre, last_pre_trace);
173 if (time_since_last_pre > 0) {
175 if (time_since_last_pre < last_pre_trace) {
181 log_debug(
"\t\t\t\tIncrementing accumulator=%d",
185 log_debug(
"\t\t\t\tApplying potentiation");
194 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.
Synapses made of weight and accumulator.
weight_state_t weight_state
The weight staet.
int32_t accumulator
The accumulator (in ARM-friendly format)
uint16_t pre_exp_dist_lookup[STDP_FIXED_POINT_ONE]
Lookup table for picking exponentially distributed random value for pre-traces.
uint16_t post_exp_dist_lookup[STDP_FIXED_POINT_ONE]
Lookup table for picking exponentially distributed random value for post-traces.
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_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.
uint16_t post_trace_t
The type of post-traces.
plasticity_trace_region_data_t plasticity_trace_region_data
Global plasticity parameter data.
static post_trace_t timing_get_initial_post_trace(void)
Get an initial post-synaptic timing trace.
uint16_t pre_trace_t
The type of pre-traces.
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.