26#ifndef _TIMING_PFISTER_TRIPLET_IMPL_H_
27#define _TIMING_PFISTER_TRIPLET_IMPL_H_
36 uint32_t last_spike_time;
86 int32_t next_spike_time = last_trace.last_spike_time;
87 if (last_trace.last_spike_time == 0) {
91 uint32_t o2_delta =
time - last_trace.last_spike_time;
97 .last_spike_time = next_spike_time};
111 next_trace.last_spike_time =
time;
142 log_debug(
"\tdelta_time=%u, r1=%d, r2=%d\n", delta_time, new_r1, new_r2);
160 uint32_t time,
pre_trace_t trace, UNUSED uint32_t last_pre_time,
161 UNUSED
pre_trace_t last_pre_trace, uint32_t last_post_time,
164 uint32_t time_since_last_post =
time - last_post_time;
171 log_debug(
"\t\t\ttime_since_last_post_event=%u, decayed_o1=%d, r2=%d,"
172 "decayed_o1_r2=%d\n",
173 time_since_last_post, decayed_o1, trace.r2, decayed_o1_r2);
177 previous_state, decayed_o1, decayed_o1_r2);
191 uint32_t time,
post_trace_t trace, uint32_t last_pre_time,
192 pre_trace_t last_pre_trace, UNUSED uint32_t last_post_time,
195 uint32_t time_since_last_pre =
time - last_pre_time;
196 if (time_since_last_pre > 0) {
203 log_debug(
"\t\t\ttime_since_last_pre_event=%u, decayed_r1=%d, o2=%d,"
204 "decayed_r1_o2=%d\n",
205 time_since_last_pre, decayed_r1, trace.o2, decayed_r1_o2);
209 previous_state, decayed_r1, decayed_r1_o2);
211 return previous_state;
uint32_t time
The current timer tick value.
void log_debug(const char *message,...)
#define decay(x, d)
This is a type-generic decay "function".
uint32_t last_time
The time of the most recently-considered spike.
Support functions for STDP.
static int32_t maths_lut_exponential_decay(uint32_t time, const int16_lut *lut)
Get value from lookup table.
Lookup Table of 16-bit integers.
Basic definitions for STDP.
#define STDP_FIXED_POINT_ONE
The number 1.0 in the fixed point math used by STDP.
#define STDP_FIXED_MUL_16X16(a, b)
Multiply two STDP fixed point numbers.
Synapses just hold weight.
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.
int16_lut * tau_x_lookup
Lookup table for τx exponential decay.
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.
int16_lut * tau_minus_lookup
Lookup table for τ- exponential decay.
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.
static post_trace_t timing_get_initial_post_trace(void)
Get an initial post-synaptic timing trace.
int16_lut * tau_plus_lookup
Lookup table for τ+ exponential decay.
int16_lut * tau_y_lookup
Lookup table for τy exponential decay.
The type of post-spike traces.
The type of pre-spike traces.
static weight_state_t weight_two_term_apply_depression(weight_state_t state, int32_t a2_minus, int32_t a3_minus)
Apply the depression rule to the weight state.
static weight_state_t weight_two_term_apply_potentiation(weight_state_t state, int32_t a2_plus, int32_t a3_plus)
Apply the potentiation rule to the weight state.
API for dual-term weight dependence rules.