sPyNNaker neural_modelling 7.1.1
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions | Variables
c_main_neurons.c File Reference

This file contains the main function of the application framework, which the application programmer uses to configure and run applications. More...

#include "c_main_neuron_common.h"
#include "c_main_common.h"
#include "profile_tags.h"
#include "dma_common.h"
#include <spin1_api_params.h>

Go to the source code of this file.

Data Structures

struct  sdram_config
 A region of SDRAM used to transfer synapses. More...
 
struct  neurons_provenance
 Provenance for this specific core. More...
 

Macros

#define N_SYNAPTIC_BUFFERS   2
 The number of buffers for synaptic data (one processing, one in progress)
 

Enumerations

enum  callback_priorities { DMA = -2 , SDP = 0 , TIMER = 0 }
 values for the priority for each callback More...
 
enum  regions {
  SYSTEM_REGION , CORE_PARAMS_REGION , PROVENANCE_DATA_REGION , PROFILER_REGION ,
  RECORDING_REGION , NEURON_PARAMS_REGION , CURRENT_SOURCE_PARAMS_REGION , NEURON_RECORDING_REGION ,
  SDRAM_PARAMS_REGION , INITIAL_VALUES_REGION
}
 Overall regions to be used by the neuron core. More...
 

Functions

static void store_provenance_data (address_t provenance_region)
 Callback to store provenance data (format: neuron_provenance).
 
void resume_callback (void)
 the function to call when resuming a simulation
 
static void sum (weight_t *syns)
 Add up all the synaptic contributions into a global buffer.
 
void timer_callback (uint timer_count, uint unused)
 Timer interrupt callback.
 
static bool initialise (void)
 Initialises the model by reading in the regions and checking recording data.
 
void c_main (void)
 The entry point for this model.
 

Variables

const struct common_regions COMMON_REGIONS
 From the regions, select those that are common.
 
const struct common_priorities COMMON_PRIORITIES
 Identify the priority of certain tasks.
 
const struct neuron_regions NEURON_REGIONS
 
uint32_t time
 The current timer tick value.
 
static uint32_t timer_period
 timer tick period (in microseconds)
 
static uint32_t simulation_ticks = 0
 The number of timer ticks to run for before being expected to exit.
 
static uint32_t infinite_run
 Determines if this model should run for infinite time.
 
static uint32_t recording_flags = 0
 The recording flags indicating if anything is recording.
 
static struct sdram_config sdram_inputs
 The SDRAM input configuration data.
 
static weight_t * synaptic_contributions [N_SYNAPTIC_BUFFERS]
 The inputs from the various synapse cores.
 
static uint32_t timer_overruns = 0
 The timer overruns.
 
union { 
 
uint32_t * as_int
 
weight_t * as_weight
 
all_synaptic_contributions 
 All the synaptic contributions for adding up in 2 formats.
 

Detailed Description

This file contains the main function of the application framework, which the application programmer uses to configure and run applications.

This is the main entrance class for most of the neural models. The following Figure shows how all of the c code interacts with each other and what classes are used to represent over arching logic (such as plasticity, spike processing, utilities, synapse types, models)

Definition in file c_main_neurons.c.


Data Structure Documentation

◆ sdram_config

struct sdram_config

A region of SDRAM used to transfer synapses.

Definition at line 87 of file c_main_neurons.c.

Data Fields
uint8_t * address The start address of the input data to be transferred.

The address of the input data to be transferred.

uint32_t size_in_bytes The size of the input data to be transferred per core.

The size of the input data to be transferred.

uint32_t n_synapse_cores The number of synapse cores feeding into here.
uint32_t * address The address of the input data to be transferred.
uint32_t time_for_transfer_overhead The time of the transfer in us.
uint32_t offset

The offset into the data to write the weights (to account for different synapse types)

uint16_t weights[] The weight to send for each active Poisson source.

◆ neurons_provenance

struct neurons_provenance

Provenance for this specific core.

Definition at line 97 of file c_main_neurons.c.

Data Fields
uint32_t n_timer_overruns

Macro Definition Documentation

◆ N_SYNAPTIC_BUFFERS

#define N_SYNAPTIC_BUFFERS   2

The number of buffers for synaptic data (one processing, one in progress)

Definition at line 102 of file c_main_neurons.c.

Enumeration Type Documentation

◆ callback_priorities

values for the priority for each callback

Definition at line 42 of file c_main_neurons.c.

◆ regions

enum regions

Overall regions to be used by the neuron core.

Definition at line 47 of file c_main_neurons.c.

Function Documentation

◆ store_provenance_data()

static void store_provenance_data ( address_t  provenance_region)
static

Callback to store provenance data (format: neuron_provenance).

Parameters
[out]provenance_regionWhere to write the provenance data

Definition at line 138 of file c_main_neurons.c.

◆ resume_callback()

void resume_callback ( void  )

the function to call when resuming a simulation

Definition at line 147 of file c_main_neurons.c.

◆ sum()

static void sum ( weight_t *  syns)
inlinestatic

Add up all the synaptic contributions into a global buffer.

Parameters
[in]synsThe weights to be added

Definition at line 162 of file c_main_neurons.c.

◆ timer_callback()

void timer_callback ( uint  timer_count,
uint  unused 
)

Timer interrupt callback.

Parameters
[in]timer_countthe number of times this call back has been executed since start of simulation
[in]unusedunused parameter kept for API consistency

Definition at line 175 of file c_main_neurons.c.

◆ initialise()

static bool initialise ( void  )
static

Initialises the model by reading in the regions and checking recording data.

Returns
True if it successfully initialised, false otherwise

Definition at line 251 of file c_main_neurons.c.

◆ c_main()

void c_main ( void  )

The entry point for this model.

Definition at line 307 of file c_main_neurons.c.

Variable Documentation

◆ COMMON_REGIONS

const struct common_regions COMMON_REGIONS
Initial value:
= {
.system = SYSTEM_REGION,
.provenance = PROVENANCE_DATA_REGION,
.profiler = PROFILER_REGION,
.recording = RECORDING_REGION
}
SYSTEM_REGION

From the regions, select those that are common.

Definition at line 61 of file c_main_neurons.c.

◆ COMMON_PRIORITIES

const struct common_priorities COMMON_PRIORITIES
Initial value:
= {
.sdp = SDP,
.dma = DMA,
.timer = TIMER
}
TIMER
DMA
SDP

Identify the priority of certain tasks.

Definition at line 69 of file c_main_neurons.c.

◆ NEURON_REGIONS

const struct neuron_regions NEURON_REGIONS
Initial value:
= {
.core_params = CORE_PARAMS_REGION,
.neuron_params = NEURON_PARAMS_REGION,
.current_source_params = CURRENT_SOURCE_PARAMS_REGION,
.neuron_recording = NEURON_RECORDING_REGION,
.initial_values = INITIAL_VALUES_REGION
}

From the regions, select those that are used for neuron-specific things

Definition at line 78 of file c_main_neurons.c.

◆ time

uint32_t time

The current timer tick value.

Declare that time exists.

Definition at line 106 of file c_main_neurons.c.

◆ timer_period

uint32_t timer_period
static

timer tick period (in microseconds)

Definition at line 109 of file c_main_neurons.c.

◆ simulation_ticks

uint32_t simulation_ticks = 0
static

The number of timer ticks to run for before being expected to exit.

Definition at line 112 of file c_main_neurons.c.

◆ infinite_run

uint32_t infinite_run
static

Determines if this model should run for infinite time.

Definition at line 115 of file c_main_neurons.c.

◆ recording_flags

uint32_t recording_flags = 0
static

The recording flags indicating if anything is recording.

Definition at line 118 of file c_main_neurons.c.

◆ sdram_inputs

struct sdram_config sdram_inputs
static

The SDRAM input configuration data.

Definition at line 121 of file c_main_neurons.c.

◆ synaptic_contributions

weight_t* synaptic_contributions[N_SYNAPTIC_BUFFERS]
static

The inputs from the various synapse cores.

Definition at line 124 of file c_main_neurons.c.

◆ timer_overruns

uint32_t timer_overruns = 0
static

The timer overruns.

Definition at line 127 of file c_main_neurons.c.