60 #if !defined(_CURRENT_SOURCE_DC_H_) && !defined(_CURRENT_SOURCE_AC_H) && \
61 !defined(_CURRENT_SOURCE_STEP_H_) && !defined(_CURRENT_SOURCE_NOISY_H_)
68 n_current_sources = cs_address[0];
71 if (n_current_sources != 0) {
73 neuron_current_source = spin1_malloc(
n_neurons *
sizeof(uint32_t*));
78 uint32_t n_sources = (uint32_t) cs_address[next];
79 uint32_t struct_size = (1 + (2 * n_sources)) *
sizeof(uint32_t);
80 neuron_current_source[n] = spin1_malloc(struct_size);
81 spin1_memcpy(neuron_current_source[n], &cs_address[next], struct_size);
83 next += 1 + (n_sources * 2);
88 n_dc_sources = (uint32_t) cs_address[next++];
89 n_ac_sources = (uint32_t) cs_address[next++];
90 n_step_sources = (uint32_t) cs_address[next++];
91 n_noisy_sources = (uint32_t) cs_address[next++];
94#ifdef _CURRENT_SOURCE_DC_H_
95 if (!current_source_dc_init(n_dc_sources, &next)) {
99 if (n_dc_sources > 0) {
100 log_error(
"DC current source is not supported for this build");
105#ifdef _CURRENT_SOURCE_AC_H_
106 if (!current_source_ac_init(n_ac_sources, &next)) {
110 if (n_ac_sources > 0) {
111 log_error(
"AC current source is not supported for this build");
116#ifdef _CURRENT_SOURCE_STEP_H_
117 if (!current_source_step_init(cs_address, n_step_sources, &next)) {
121 if (n_step_sources > 0) {
122 log_error(
"Step current source is not supported for this build");
127#ifdef _CURRENT_SOURCE_NOISY_H_
128 if (!current_source_noisy_init(n_noisy_sources, &next)) {
132 if (n_noisy_sources > 0) {
133 log_error(
"Noisy current source is not supported for this build");
151 #if !defined(_CURRENT_SOURCE_DC_H_) && !defined(_CURRENT_SOURCE_AC_H) && \
152 !defined(_CURRENT_SOURCE_STEP_H_) && !defined(_CURRENT_SOURCE_NOISY_H_)
158 n_current_sources = cs_address[0];
161 if (n_current_sources != 0) {
165 for (uint32_t n=0; n < n_neurons_on_core; n++) {
166 uint32_t n_sources = (uint32_t) cs_address[next];
167 uint32_t struct_size = (1 + (2 * n_sources)) *
sizeof(uint32_t);
168 neuron_current_source[n] = spin1_malloc(struct_size);
169 spin1_memcpy(neuron_current_source[n], &cs_address[next], struct_size);
171 next += 1 + (n_sources * 2);
175 n_dc_sources = (uint32_t) cs_address[next++];
176 n_ac_sources = (uint32_t) cs_address[next++];
177 n_step_sources = (uint32_t) cs_address[next++];
178 n_noisy_sources = (uint32_t) cs_address[next++];
181#ifdef _CURRENT_SOURCE_DC_H_
182 current_source_dc_load_parameters(cs_address, n_dc_sources, &next);
184#ifdef _CURRENT_SOURCE_AC_H_
185 current_source_ac_load_parameters(cs_address, n_ac_sources, &next);
187#ifdef _CURRENT_SOURCE_STEP_H_
188 current_source_step_load_parameters(cs_address, n_step_sources, &next);
190#ifdef _CURRENT_SOURCE_NOISY_H_
191 current_source_noisy_load_parameters(cs_address, n_noisy_sources, &next);
209 #if !defined(_CURRENT_SOURCE_DC_H_) && !defined(_CURRENT_SOURCE_AC_H) && \
210 !defined(_CURRENT_SOURCE_STEP_H_) && !defined(_CURRENT_SOURCE_NOISY_H_)
217 if (n_current_sources != 0) {
218 uint32_t n_current_sources_neuron =
219 neuron_current_source[neuron_index]->n_current_sources;
220 if (n_current_sources_neuron > 0) {
221 for (uint32_t n_cs=0; n_cs < n_current_sources_neuron; n_cs++) {
223 neuron_current_source[neuron_index]->cs_id_index_list[n_cs].cs_id;
225 neuron_current_source[neuron_index]->cs_id_index_list[n_cs].cs_index;
227 #ifdef _CURRENT_SOURCE_DC_H_
229 current_offset += current_source_dc_get_offset(cs_index,
time);
232 #ifdef _CURRENT_SOURCE_AC_H_
234 current_offset += current_source_ac_get_offset(cs_index,
time);
237 #ifdef _CURRENT_SOURCE_STEP_H_
239 current_offset += current_source_step_get_offset(cs_index,
time);
242 #ifdef _CURRENT_SOURCE_NOISY_H_
244 current_offset += current_source_noisy_get_offset(cs_index,
time);
252 return current_offset;
uint32_t time
The current timer tick value.