sPyNNaker neural_modelling 7.3.1
Loading...
Searching...
No Matches
send_spike.h
1/*
2 * Copyright (c) 2021 The University of Manchester
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * https://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#ifndef __SEND_SPIKE_H__
17#define __SEND_SPIKE_H__
18
20#include <common/send_mc.h>
21
23extern bool use_key;
24
26extern uint32_t *neuron_keys;
27
29extern uint32_t earliest_send_time;
30
32extern uint32_t latest_send_time;
33
35extern uint32_t colour;
36
41static inline void send_spike(UNUSED uint32_t timer_count, uint32_t time,
42 uint32_t neuron_index) {
43 // Do any required synapse processing
44 synapse_dynamics_process_post_synaptic_event(time, neuron_index);
45
46 if (use_key) {
47 send_spike_mc(neuron_keys[neuron_index] | colour);
48
49 // Keep track of provenance data
50 uint32_t clocks = tc[T1_COUNT];
51 if (clocks > earliest_send_time) {
52 earliest_send_time = clocks;
53 }
54 if (clocks < latest_send_time) {
55 latest_send_time = clocks;
56 }
57 }
58}
59
60#endif // __SEND_SPIKE_H__
uint32_t colour
The colour of the time step to handle delayed spikes.
Definition neuron.c:42
bool use_key
Whether to use key from neuron.c.
Definition neuron.c:33
uint32_t * neuron_keys
The keys to be used by the neurons (one per neuron)
Definition neuron.c:29
#define T1_COUNT
API for synapse dynamics.