sPyNNaker neural_modelling 7.3.1
Loading...
Searching...
No Matches
Data Structures | Functions | Variables
local_only.c File Reference

Implements the "local-only" handling of synapses, that is the processing of spikes without the use of transfers from SDRAM. More...

#include "local_only.h"
#include "local_only/local_only_impl.h"
#include <debug.h>
#include <circular_buffer.h>
#include <recording.h>
#include <spin1_api.h>

Go to the source code of this file.

Data Structures

struct  local_only_config
 

Functions

static void run_next_process_loop (void)
 Start the process loop.
 
static void update_max_input_buffer (void)
 Update the maximum size of the input buffer.
 
void mc_rcv_callback (uint key, uint unused)
 Multicast packet without payload received callback.
 
void mc_rcv_payload_callback (uint key, uint n_spikes)
 Multicast packet with payload received callback.
 
void process_callback (uint time, uint unused1)
 User callback; performs spike processing loop.
 
bool local_only_initialise (void *local_only_addr, void *local_only_params_addr, uint32_t n_rec_regions_used, uint16_t **ring_buffers_ptr)
 Set up local-only processing of spikes.
 
void local_only_clear_input (uint32_t time)
 Clear the spikes for the last time step.
 
void local_only_store_provenance (struct local_only_provenance *prov)
 Store provenance gathered during run.
 

Variables

static struct local_only_config config
 A local copy of the configuration.
 
static circular_buffer input_buffer
 The input buffer for spikes received.
 
static uint16_t * ring_buffers
 Ring buffers to add weights to on spike processing.
 
static volatile bool process_loop_running = false
 
static uint32_t n_spikes_received = 0
 The number of spikes received in total in the last time step.
 
static uint32_t max_spikes_received = 0
 The maximum number of spikes received in any time step.
 
static uint32_t n_spikes_dropped = 0
 The number of spikes discarded in total during the run.
 
static uint32_t max_input_buffer_size = 0
 The maximum size of the input buffer during the run.
 
static uint32_t local_time
 The local time step counter.
 
uint32_t synapse_delay_mask
 The mask to get the synaptic delay from a "synapse".
 
uint32_t synapse_type_index_bits
 The number of bits used by the synapse type and post-neuron index.
 
uint32_t synapse_index_bits
 The number of bits used by just the post-neuron index.
 
uint32_t p_per_ts_region
 The region where packets-per-timestep are stored.
 
struct { 
 
uint32_t time
 
uint32_t packets_this_time_step
 
p_per_ts_struct 
 The number of packets received this time step for recording.
 

Detailed Description

Implements the "local-only" handling of synapses, that is the processing of spikes without the use of transfers from SDRAM.

Definition in file local_only.c.


Data Structure Documentation

◆ local_only_config

struct local_only_config

Definition at line 29 of file local_only.c.

Data Fields
uint32_t log_n_neurons Log_2 of the number of neurons.
uint32_t log_n_synapse_types Log_2 of the number of synapse types.
uint32_t log_max_delay Log_2 of the maximum delay supported.
uint32_t input_buffer_size The size to reserve for the input buffer of spikes.
uint32_t clear_input_buffer Whether to clear the input buffer.

Function Documentation

◆ run_next_process_loop()

static void run_next_process_loop ( void  )
inlinestatic

Start the process loop.

Definition at line 90 of file local_only.c.

◆ update_max_input_buffer()

static void update_max_input_buffer ( void  )
inlinestatic

Update the maximum size of the input buffer.

Definition at line 97 of file local_only.c.

◆ mc_rcv_callback()

void mc_rcv_callback ( uint  key,
uint  unused 
)

Multicast packet without payload received callback.

Parameters
[in]keyThe key received
[in]unusedShould be 0

Definition at line 107 of file local_only.c.

◆ mc_rcv_payload_callback()

void mc_rcv_payload_callback ( uint  key,
uint  n_spikes 
)

Multicast packet with payload received callback.

Parameters
[in]keyThe key received
[in]n_spikesThe payload; the number of times to repeat the key

Definition at line 124 of file local_only.c.

◆ process_callback()

void process_callback ( uint  time,
uint  unused1 
)

User callback; performs spike processing loop.

Definition at line 145 of file local_only.c.

◆ local_only_initialise()

bool local_only_initialise ( void *  local_only_addr,
void *  local_only_params_addr,
uint32_t  n_rec_regions_used,
uint16_t **  ring_buffers 
)

Set up local-only processing of spikes.

Parameters
[in]local_only_addrThe address from which to read common data
[in]local_only_params_addrThe address from which to read implementation-specific data
[in]n_rec_regions_usedThe number of recording regions used before here
[out]ring_buffersPointer to the ring buffers that hold future inputs
Returns
Whether the set up was done or not

Definition at line 164 of file local_only.c.

◆ local_only_clear_input()

void local_only_clear_input ( uint32_t  time)

Clear the spikes for the last time step.

Parameters
[in]timeThe time step at which the request is asked

Definition at line 218 of file local_only.c.

◆ local_only_store_provenance()

void local_only_store_provenance ( struct local_only_provenance prov)

Store provenance gathered during run.

Parameters
[out]provPointer to the struct to store the provenance in

Definition at line 234 of file local_only.c.

Variable Documentation

◆ config

struct local_only_config config
static

A local copy of the configuration.

Definition at line 43 of file local_only.c.

◆ input_buffer

circular_buffer input_buffer
static

The input buffer for spikes received.

Definition at line 46 of file local_only.c.

◆ ring_buffers

uint16_t* ring_buffers
static

Ring buffers to add weights to on spike processing.

Definition at line 49 of file local_only.c.

◆ process_loop_running

volatile bool process_loop_running = false
static

Whether the loop of processing is currently running (if not, it needs to be restarted on the next spike received)

Definition at line 53 of file local_only.c.

◆ n_spikes_received

uint32_t n_spikes_received = 0
static

The number of spikes received in total in the last time step.

Definition at line 56 of file local_only.c.

◆ max_spikes_received

uint32_t max_spikes_received = 0
static

The maximum number of spikes received in any time step.

Definition at line 59 of file local_only.c.

◆ n_spikes_dropped

uint32_t n_spikes_dropped = 0
static

The number of spikes discarded in total during the run.

Definition at line 62 of file local_only.c.

◆ max_input_buffer_size

uint32_t max_input_buffer_size = 0
static

The maximum size of the input buffer during the run.

Definition at line 65 of file local_only.c.

◆ local_time

uint32_t local_time
static

The local time step counter.

Definition at line 68 of file local_only.c.

◆ synapse_delay_mask

uint32_t synapse_delay_mask

The mask to get the synaptic delay from a "synapse".

Mask to pick out the delay.

Definition at line 71 of file local_only.c.

◆ synapse_type_index_bits

uint32_t synapse_type_index_bits

The number of bits used by the synapse type and post-neuron index.

Number of bits needed for the synapse type and index.

Definition at line 74 of file local_only.c.

◆ synapse_index_bits

uint32_t synapse_index_bits

The number of bits used by just the post-neuron index.

Number of bits in the synapse index.

Definition at line 77 of file local_only.c.

◆ p_per_ts_region

uint32_t p_per_ts_region

The region where packets-per-timestep are stored.

Definition at line 80 of file local_only.c.