sPyNNaker neural_modelling 7.3.1
Loading...
Searching...
No Matches
param_generator_constant.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
23#include <stdfix.h>
24#include <spin1_api.h>
26
31 accum value;
32};
33
41 // Allocate space for the parameters
43 spin1_malloc(sizeof(struct param_generator_constant));
44
45 // Read parameters from SDRAM
46 struct param_generator_constant *params_sdram = *region;
47 *params = *params_sdram;
48 *region = &params_sdram[1];
49 log_debug("Constant value %k", params->value);
50 return params;
51}
52
57static void param_generator_constant_free(void *generator) {
58 sark_free(generator);
59}
60
66static accum param_generator_constant_generate(void *generator) {
67 // Generate a constant for each index
68 struct param_generator_constant *params = generator;
69 return params->value;
70}
void log_debug(const char *message,...)
General types associated with generators.
static void * param_generator_constant_initialize(void **region)
How to initialise the constant parameter generator.
static accum param_generator_constant_generate(void *generator)
How to generate values with the constant parameter generator.
static void param_generator_constant_free(void *generator)
How to free any data for the constant parameter generator.
The data for the constant value generation.
void sark_free(void *ptr)
region
spike source array region IDs in human readable form
static stdp_params params
Configuration parameters.