sPyNNaker neural_modelling  7.4.2
Data Structures | Enumerations | Functions | Variables
c_main_synapses.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_synapse_common.h"
#include "c_main_common.h"
#include "spike_processing_fast.h"
#include "structural_plasticity/synaptogenesis_dynamics.h"
#include <spin1_api_params.h>

Go to the source code of this file.

Data Structures

struct  provenance_data
 Provenance data region layout. More...
 

Enumerations

enum  callback_priorities {
  MC = -1 , DMA = 0 , USER = 0 , TIMER = 0 ,
  SDP = 1 , BACKGROUND = 1 , MC = -1 , DMA = 0 ,
  USER = 0 , TIMER = 0 , SDP = 1 , BACKGROUND = 1 ,
  DMA = -2 , SDP = 0 , TIMER = 0 , MC = -1 ,
  DMA = -2 , TIMER = 0 , SDP = 0 , MULTICAST = -1 ,
  SDP = 0 , DMA = 1 , TIMER = 2
}
 values for the priority for each callback More...
 
enum  regions {
  SYSTEM_REGION , PROVENANCE_DATA_REGION , PROFILER_REGION , RECORDING_REGION ,
  CORE_PARAMS_REGION , NEURON_PARAMS_REGION , CURRENT_SOURCE_PARAMS_REGION , NEURON_RECORDING_REGION ,
  LOCAL_ONLY_REGION , LOCAL_ONLY_PARAMS_REGION , NEURON_BUILDER_REGION , INITIAL_VALUES_REGION ,
  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 , SYSTEM_REGION , PROVENANCE_DATA_REGION ,
  PROFILER_REGION , RECORDING_REGION , SYNAPSE_PARAMS_REGION , SYNAPTIC_MATRIX_REGION ,
  POPULATION_TABLE_REGION , SYNAPSE_DYNAMICS_REGION , STRUCTURAL_DYNAMICS_REGION , BIT_FIELD_FILTER_REGION ,
  SDRAM_PARAMS_REGION , KEY_REGION
}
 Overall regions used by the synapse core.
 

Functions

static void store_provenance_data (address_t provenance_region)
 Callback to store provenance data (format: neuron_provenance). More...
 
void resume_callback (void)
 the function to call when resuming a simulation
 
void timer_callback (uint unused0, uint unused1)
 Timer event callback. More...
 
static bool initialise (void)
 Initialises the model by reading in the regions and checking recording data. More...
 
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. More...
 
const struct common_priorities COMMON_PRIORITIES
 Identify the priority of common tasks. More...
 
const struct synapse_regions SYNAPSE_REGIONS
 From the regions, select those that are used for synapse-specific things. More...
 
uint32_t time
 The current timer tick value. More...
 
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.
 

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_synapses.c.


Data Structure Documentation

◆ provenance_data

struct provenance_data

Provenance data region layout.

Definition at line 47 of file c_main_synapses.c.

Data Fields
struct synapse_provenance synapse_prov
struct spike_processing_fast_provenance spike_processing_prov

Enumeration Type Documentation

◆ callback_priorities

values for the priority for each callback

Enumerator
MULTICAST 

Multicast packet reception uses the FIQ.

SDP 

SDP handling is highest ordinary priority.

DMA 

DMA complete handling is medium priority.

TIMER 

Regular timer interrupt is lowest priority.

Definition at line 42 of file c_main_synapses.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 111 of file c_main_synapses.c.

◆ timer_callback()

void timer_callback ( uint  unused0,
uint  unused1 
)

Timer event callback.

Parameters
[in]unused0unused
[in]unused1unused

Definition at line 131 of file c_main_synapses.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 151 of file c_main_synapses.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
}
@ RECORDING_REGION
general recording data; 15
Definition: regions.h:41

From the regions, select those that are common.

Definition at line 1 of file c_main_synapses.c.

◆ COMMON_PRIORITIES

const struct common_priorities COMMON_PRIORITIES
Initial value:
= {
.sdp = SDP,
.dma = DMA,
.timer = TIMER
}
@ TIMER
Call timer at 0 to keep it quick.
@ DMA
DMA is not actually used.
@ SDP
SDP handling is queued.

Identify the priority of common tasks.

Definition at line 1 of file c_main_synapses.c.

◆ SYNAPSE_REGIONS

const struct synapse_regions SYNAPSE_REGIONS
Initial value:
= {
.synapse_params = SYNAPSE_PARAMS_REGION,
.synaptic_matrix = SYNAPTIC_MATRIX_REGION,
.synapse_dynamics = SYNAPSE_DYNAMICS_REGION,
.structural_dynamics = STRUCTURAL_DYNAMICS_REGION,
.bitfield_filter = BIT_FIELD_FILTER_REGION
}
@ BIT_FIELD_FILTER_REGION
bitfield filter; 14
Definition: regions.h:40
@ SYNAPSE_PARAMS_REGION
synapse parameters; 4
Definition: regions.h:30
@ POPULATION_TABLE_REGION
master population table; 5
Definition: regions.h:31
@ SYNAPSE_DYNAMICS_REGION
synapse dynamics; 7
Definition: regions.h:33
@ STRUCTURAL_DYNAMICS_REGION
structural dynamics; 8
Definition: regions.h:34
@ SYNAPTIC_MATRIX_REGION
synaptic matrix; 6
Definition: regions.h:32

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

Definition at line 1 of file c_main_synapses.c.

◆ time

uint32_t time

The current timer tick value.

Declare that time exists.

Definition at line 95 of file c_main_synapses.c.