sPyNNaker neural_modelling 7.3.1
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions | Variables
c_main.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_synapse_common.h"
#include "c_main_common.h"
#include "regions.h"
#include "profile_tags.h"
#include "spike_processing.h"

Go to the source code of this file.

Data Structures

struct  combined_provenance
 The combined provenance from synapses and neurons. More...
 

Enumerations

enum  callback_priorities {
  MC = -1 , DMA = 0 , USER = 0 , TIMER = 0 ,
  SDP = 1 , BACKGROUND = 1
}
 Identify the priorities for all tasks. More...
 

Functions

static void c_main_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 process_ring_buffers (void)
 Process the ring buffers for the next time step.
 
void background_callback (uint timer_count, uint local_time)
 Background activities called from timer.
 
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, extract those that are common.
 
const struct common_priorities COMMON_PRIORITIES
 Identify the priorities of the common tasks.
 
const struct neuron_regions NEURON_REGIONS
 From the regions, extract those that are neuron-specific.
 
const struct synapse_regions SYNAPSE_REGIONS
 From the regions, extract those that are synapse-specific.
 
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 uint32_t n_backgrounds_queued = 0
 The number of background tasks queued / running.
 
static uint32_t n_background_overloads = 0
 The number of times the background couldn't be added.
 
static uint32_t max_backgrounds_queued = 0
 The maximum number of background tasks queued.
 
static weight_t * ring_buffers
 The ring buffers to be used in the simulation.
 

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

Enumeration Type Documentation

◆ callback_priorities

Identify the priorities for all tasks.

Definition at line 54 of file c_main.c.

Function Documentation

◆ c_main_store_provenance_data()

static void c_main_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 122 of file c_main.c.

◆ resume_callback()

void resume_callback ( void  )

the function to call when resuming a simulation

Definition at line 132 of file c_main.c.

◆ process_ring_buffers()

static void process_ring_buffers ( void  )
inlinestatic

Process the ring buffers for the next time step.

Definition at line 150 of file c_main.c.

◆ background_callback()

void background_callback ( uint  timer_count,
uint  local_time 
)

Background activities called from timer.

Parameters
timer_countthe number of times this call back has been executed since start of simulation
[in]local_timeThe time step being executed

Definition at line 165 of file c_main.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 181 of file c_main.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 237 of file c_main.c.

◆ c_main()

void c_main ( void  )

The entry point for this model.

Definition at line 284 of file c_main.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, extract those that are common.

Definition at line 59 of file c_main.c.

◆ COMMON_PRIORITIES

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

Identify the priorities of the common tasks.

Definition at line 67 of file c_main.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, extract those that are neuron-specific.

Definition at line 74 of file c_main.c.

◆ SYNAPSE_REGIONS

const struct synapse_regions SYNAPSE_REGIONS
Initial value:
= {
.synapse_params = SYNAPSE_PARAMS_REGION,
.synaptic_matrix = SYNAPTIC_MATRIX_REGION,
.pop_table = POPULATION_TABLE_REGION,
.synapse_dynamics = SYNAPSE_DYNAMICS_REGION,
.structural_dynamics = STRUCTURAL_DYNAMICS_REGION,
.bitfield_filter = BIT_FIELD_FILTER_REGION
}

From the regions, extract those that are synapse-specific.

Definition at line 83 of file c_main.c.

◆ time

uint32_t time

The current timer tick value.

Declare that time exists.

Definition at line 94 of file c_main.c.

◆ timer_period

uint32_t timer_period
static

timer tick period (in microseconds)

Definition at line 97 of file c_main.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 100 of file c_main.c.

◆ infinite_run

uint32_t infinite_run
static

Determines if this model should run for infinite time.

Definition at line 103 of file c_main.c.

◆ recording_flags

uint32_t recording_flags = 0
static

The recording flags indicating if anything is recording.

Definition at line 106 of file c_main.c.

◆ n_backgrounds_queued

uint32_t n_backgrounds_queued = 0
static

The number of background tasks queued / running.

Definition at line 109 of file c_main.c.

◆ n_background_overloads

uint32_t n_background_overloads = 0
static

The number of times the background couldn't be added.

Definition at line 112 of file c_main.c.

◆ max_backgrounds_queued

uint32_t max_backgrounds_queued = 0
static

The maximum number of background tasks queued.

Definition at line 115 of file c_main.c.

◆ ring_buffers

weight_t* ring_buffers
static

The ring buffers to be used in the simulation.

Definition at line 118 of file c_main.c.