sPyNNaker neural_modelling 7.1.1
Loading...
Searching...
No Matches
synapse_types_delta_impl.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 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
26#ifndef _SYNAPSE_TYPES_DELTA_IMPL_H_
27#define _SYNAPSE_TYPES_DELTA_IMPL_H_
28
29//---------------------------------------
30// Macros
31//---------------------------------------
34#define SYNAPSE_TYPE_BITS 1
37#define SYNAPSE_TYPE_COUNT 2
38
40#define NUM_EXCITATORY_RECEPTORS 1
42#define NUM_INHIBITORY_RECEPTORS 1
43
44#include <debug.h>
46#include "synapse_types.h"
47
48//---------------------------------------
49// Synapse parameters
50//---------------------------------------
54};
55
57struct synapse_types_t {
60};
61
67
68//---------------------------------------
69// Synapse shaping inline implementation
70//---------------------------------------
71
72static inline void synapse_types_initialise(synapse_types_t *state,
74 state->exc = params->exc;
75 state->inh = params->inh;
76}
77
78static void synapse_types_save_state(synapse_types_t *state, synapse_types_params_t *params) {
79 params->exc = state->exc;
80 params->inh = state->inh;
81}
82
91static inline void synapse_types_shape_input(
92 synapse_types_t *parameters) {
93 parameters->exc = ZERO;
94 parameters->inh = ZERO;
95}
96
104 index_t synapse_type_index, synapse_types_t *parameters,
105 input_t input) {
106 switch (synapse_type_index) {
107 case EXCITATORY:
108 parameters->exc += input;
109 break;
110 case INHIBITORY:
111 parameters->inh += input;
112 break;
113 }
114}
115
122 input_t *excitatory_response, synapse_types_t *parameters) {
123 excitatory_response[0] = parameters->exc;
124 return &excitatory_response[0];
125}
126
133 input_t *inhibitory_response, synapse_types_t *parameters) {
134 inhibitory_response[0] = parameters->inh;
135 return &inhibitory_response[0];
136}
137
143static inline const char *synapse_types_get_type_char(
144 index_t synapse_type_index) {
145 switch (synapse_type_index) {
146 case EXCITATORY:
147 return "X";
148 case INHIBITORY:
149 return "I";
150 default:
151 log_debug("did not recognise synapse type %i", synapse_type_index);
152 return "?";
153 }
154}
155
160static inline void synapse_types_print_input(
161 synapse_types_t *parameters) {
162 io_printf(IO_BUF, "%12.6k - %12.6k",
163 parameters->exc, parameters->inh);
164}
165
169 UNUSED synapse_types_t *parameters) {
170}
171
172#endif // _SYNAPSE_TYPES_DELTA_IMPL_H_
uint32_t index_t
void log_debug(const char *message,...)
#define ZERO
A REAL 0.0.
Definition maths-util.h:121
Data type definitions for SpiNNaker Neuron-modelling.
REAL input_t
The type of an input.
static uint n_steps_per_timestep
The number of steps to run per timestep.
void io_printf(char *stream, char *format,...)
#define IO_BUF
static stdp_params params
Configuration parameters.
API for synaptic behaviour types (see also src/neuron/input_types)
static const char * synapse_types_get_type_char(index_t synapse_type_index)
returns a human readable character for the type of synapse. examples would be X = excitatory types,...
static input_t * synapse_types_get_excitatory_input(input_t *excitatory_response, synapse_types_t *parameters)
extracts the excitatory input buffers from the buffers available for a given parameter set
static void synapse_types_add_neuron_input(index_t synapse_type_index, synapse_types_t *parameters, input_t input)
adds the inputs for a give timer period to a given neuron that is being simulated by this model
static void synapse_types_print_input(synapse_types_t *parameters)
prints the input for a neuron ID given the available inputs currently only executed when the models a...
static void synapse_types_print_parameters(synapse_types_t *parameters)
printer call
static void synapse_types_shape_input(synapse_types_t *parameters)
decays the stuff thats sitting in the input buffers as these have not yet been processed and applied ...
static input_t * synapse_types_get_inhibitory_input(input_t *inhibitory_response, synapse_types_t *parameters)
extracts the inhibitory input buffers from the buffers available for a given parameter set
synapse_delta_input_buffer_regions
The supported synapse type indices.
@ INHIBITORY
Inhibitory synaptic input.
@ EXCITATORY
Excitatory synaptic input.
alpha_state_t inh
Inhibitory synaptic input.
alpha_params_t exc
First excitatory synaptic input.
input_t inh
Inhibitory synaptic input.
alpha_state_t exc
Excitatory synaptic input.
input_t exc
Excitatory synaptic input.
Delta synapses support just a single excitatory and inhibitory input each.