sPyNNaker neural_modelling  7.4.2
synapses.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 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 
19 #ifndef _SYNAPSES_H_
20 #define _SYNAPSES_H_
21 
22 #include <common/neuron-typedefs.h>
23 #include <debug.h>
24 #include "synapse_row.h"
25 
31 extern uint32_t synapse_type_index_bits;
37 extern uint32_t synapse_type_index_mask;
39 extern uint32_t synapse_index_bits;
41 extern uint32_t synapse_index_mask;
43 extern uint32_t synapse_type_bits;
45 extern uint32_t synapse_type_mask;
47 extern uint32_t synapse_delay_bits;
49 extern uint32_t synapse_delay_mask;
50 
52 extern uint32_t synapses_saturation_count;
53 
56 extern uint32_t skipped_synapses;
57 
59 extern uint32_t late_spikes;
60 
62 extern uint32_t max_late_spike;
63 
64 
68 static inline void synapses_print_weight(
69  weight_t weight, uint32_t left_shift) {
70  if (weight != 0) {
71  io_printf(IO_BUF, "%12.6k",
72  synapse_row_convert_weight_to_input(weight, left_shift));
73  } else {
74  io_printf(IO_BUF, " ");
75  }
76 }
77 
92  address_t synapse_params_address,
93  uint32_t *n_neurons, uint32_t *n_synapse_types,
94  weight_t **ring_buffers,
95  uint32_t **ring_buffer_to_input_buffer_left_shifts,
96  bool* clear_input_buffers_of_late_packets_init,
97  uint32_t *incoming_spike_buffer_size);
98 
107  uint32_t time, uint32_t spike_colour, uint32_t colour_mask,
108  synaptic_row_t row, bool *write_back);
109 
114 uint32_t synapses_get_pre_synaptic_events(void);
115 
118 void synapses_resume(timer_t time);
119 
122 void synapses_flush_ring_buffers(timer_t time);
123 
124 #endif // _SYNAPSES_H_
static weight_t * ring_buffers
The ring buffers to be used in the simulation.
Definition: c_main.c:118
static uint32_t colour_mask
The mask to apply to get the colour from the current timestep or key.
static uint32_t time
Simulation time.
Data type definitions for SpiNNaker Neuron-modelling.
struct synaptic_row * synaptic_row_t
The type of a synaptic row.
static uint32_t n_neurons
The number of neurons on the core.
Definition: neuron.c:45
static uint32_t n_synapse_types
The number of synapse types.
Definition: neuron.c:51
implementation for handling the processing of synapse rows.
static input_t synapse_row_convert_weight_to_input(weight_t weight, uint32_t left_shift)
Converts a weight stored in a synapse row to an input.
Definition: synapse_row.h:238
uint32_t max_late_spike
The maximum lateness of a spike.
Definition: synapses.c:90
void synapses_flush_ring_buffers(timer_t time)
Reset the ring buffers to 0 at the given time.
Definition: synapses.c:336
uint32_t synapse_delay_mask
Mask to pick out the delay.
Definition: local_only.c:71
uint32_t synapse_type_index_bits
Number of bits needed for the synapse type and index.
Definition: local_only.c:74
uint32_t synapse_index_bits
Number of bits in the synapse index.
Definition: local_only.c:77
uint32_t synapse_index_mask
Mask to pick out the synapse index.
Definition: synapses.c:69
uint32_t synapses_saturation_count
Count of the number of times the synapses have saturated their weights.
Definition: synapses.c:80
void synapses_resume(timer_t time)
Resume processing of synapses after a pause.
Definition: synapses.c:410
static void synapses_print_weight(weight_t weight, uint32_t left_shift)
Print the weight of a synapse.
Definition: synapses.h:68
uint32_t synapses_get_pre_synaptic_events(void)
returns the counters for plastic and fixed pre synaptic events based on (if the model was compiled wi...
Definition: synapses.c:405
uint32_t synapse_delay_bits
Number of bits in the delay.
Definition: synapses.c:75
bool synapses_initialise(address_t synapse_params_address, uint32_t *n_neurons, uint32_t *n_synapse_types, weight_t **ring_buffers, uint32_t **ring_buffer_to_input_buffer_left_shifts, bool *clear_input_buffers_of_late_packets_init, uint32_t *incoming_spike_buffer_size)
Initialise the synapse processing.
Definition: synapses.c:268
uint32_t synapse_type_index_mask
Mask to pick out the synapse type and index.
Definition: synapses.c:65
uint32_t late_spikes
Count of the spikes that are received late.
Definition: synapses.c:87
bool synapses_process_synaptic_row(uint32_t time, uint32_t spike_colour, uint32_t colour_mask, synaptic_row_t row, bool *write_back)
process a synaptic row
Definition: synapses.c:351
uint32_t synapse_type_bits
Number of bits in the synapse type.
Definition: synapses.c:71
uint32_t skipped_synapses
Definition: synapses.c:84
uint32_t synapse_type_mask
Mask to pick out the synapse type.
Definition: synapses.c:73