sPyNNaker neural_modelling 7.2.2
|
Implementation of non-inlined API in spike_processing.h. More...
#include "spike_processing.h"
#include "population_table/population_table.h"
#include "synapse_row.h"
#include "synapses.h"
#include "structural_plasticity/synaptogenesis_dynamics.h"
#include <simulation.h>
#include <debug.h>
#include <common/in_spikes.h>
#include <recording.h>
Go to the source code of this file.
Data Structures | |
struct | dma_buffer |
Macros | |
#define | N_DMA_BUFFERS 2 |
The number of DMA Buffers to use. | |
Enumerations | |
enum | spike_processing_dma_tags { DMA_TAG_READ_SYNAPTIC_ROW , DMA_TAG_WRITE_PLASTIC_REGION } |
DMA tags. More... | |
Functions | |
static void | do_dma_read (spike_t spike, pop_table_lookup_result_t *result) |
Perform a DMA read of a synaptic row. | |
static bool | is_something_to_do (spike_t *spike, pop_table_lookup_result_t *result, uint32_t *n_rewire, uint32_t *n_process_spike) |
Check if there is anything to do. If not, DMA is not busy. | |
static bool | setup_synaptic_dma_read (dma_buffer *current_buffer, uint32_t *n_rewires, uint32_t *n_synapse_processes) |
Set up a new synaptic DMA read. | |
static void | setup_synaptic_dma_write (uint32_t dma_buffer_index, bool plastic_only) |
Set up a DMA write of synaptic data. | |
static void | start_dma_loop (void) |
Start the DMA processing loop if not already running. | |
static void | multicast_packet_received_callback (uint key, uint unused) |
Called when a multicast packet is received. | |
static void | multicast_packet_pl_received_callback (uint key, uint payload) |
Called when a multicast packet is received. | |
static void | dma_complete_callback (uint unused, uint tag) |
Called when a DMA completes. | |
void | user_event_callback (uint unused0, uint unused1) |
Called when a user event is received. | |
void | spike_processing_clear_input_buffer (timer_t time) |
clears the input buffer of packets | |
bool | spike_processing_initialise (size_t row_max_n_words, uint mc_packet_callback_priority, uint user_event_priority, uint incoming_spike_buffer_size, bool clear_input_buffers_of_late_packets_init, uint32_t packets_per_timestep_region) |
Initialise the spike processing system. | |
void | spike_processing_store_provenance (struct spike_processing_provenance *prov) |
Get provenance data for Spike processing. | |
bool | spike_processing_do_rewiring (int number_of_rewires) |
Set the number of times spike_processing has to attempt rewiring. | |
Variables | ||
uint32_t | time | |
The current timer tick value. | ||
static volatile bool | dma_busy | |
True if the DMA "loop" is currently running. | ||
static dma_buffer | dma_buffers [N_DMA_BUFFERS] | |
The DTCM buffers for the synapse rows. | ||
static uint32_t | next_buffer_to_fill | |
The index of the next buffer to be filled by a DMA. | ||
static uint32_t | buffer_being_read | |
The index of the buffer currently being filled by a DMA read. | ||
static volatile uint32_t | rewires_to_do = 0 | |
Number of outstanding synaptogenic rewires. | ||
static uint32_t | dma_n_rewires | |
The number of rewires to do when the DMA completes. | ||
static uint32_t | dma_n_spikes | |
The number of spikes to do when the DMA completes. | ||
static uint32_t | dma_complete_count | |
the number of DMA completes (used in provenance generation) | ||
static uint32_t | spike_processing_count | |
the number of spikes that were processed (used in provenance generation) | ||
static uint32_t | n_successful_rewires | |
The number of successful rewires. | ||
static uint32_t | count_input_buffer_packets_late | |
How many packets were lost from the input buffer because of late arrival. | ||
static uint32_t | biggest_fill_size_of_input_buffer | |
tracker of how full the input buffer got. | ||
static bool | clear_input_buffers_of_late_packets | |
Whether if we should clear packets from the input buffer at the end of a timer tick. | ||
struct { | ||
uint32_t | time | |
uint32_t | packets_this_time_step | |
} | p_per_ts_struct | |
the number of packets received this time step | ||
static uint32_t | p_per_ts_region | |
the region to record the packets per timestep in | ||
Implementation of non-inlined API in spike_processing.h.
Definition in file spike_processing.c.
#define N_DMA_BUFFERS 2 |
The number of DMA Buffers to use.
Definition at line 53 of file spike_processing.c.
DMA tags.
Enumerator | |
---|---|
DMA_TAG_READ_SYNAPTIC_ROW | Tag of a DMA read of a full synaptic row. |
DMA_TAG_WRITE_PLASTIC_REGION | Tag of a DMA write of the plastic region of a synaptic row. |
Definition at line 56 of file spike_processing.c.
|
inlinestatic |
Perform a DMA read of a synaptic row.
[in] | spike | The spike that triggered this read |
[in] | result | The result of the lookup |
Definition at line 125 of file spike_processing.c.
|
inlinestatic |
Check if there is anything to do. If not, DMA is not busy.
[out] | spike | The spike being processed |
[out] | result | The result of the pop table lookup |
[in,out] | n_rewire | Accumulator of number of rewires |
[in,out] | n_process_spike | Accumulator of number of processed spikes |
Definition at line 153 of file spike_processing.c.
|
static |
Set up a new synaptic DMA read.
If a current_buffer is passed in, any spike found that matches the originating spike of the buffer will increment a count, and the DMA of that row will be skipped. The number of times a row should be rewired and the number of times synaptic processing should be done on a row is returned.
Calls is_something_to_do(), do_direct_row() and do_dma_read()
[in] | current_buffer | The current buffer, if any. |
[in,out] | n_rewires | Accumulator of number of rewires |
[in,out] | n_synapse_processes | Accumulator of number of synapses processed |
Definition at line 220 of file spike_processing.c.
|
inlinestatic |
Set up a DMA write of synaptic data.
[in] | dma_buffer_index | Index of DMA buffer to use |
[in] | plastic_only | If false, write the whole synaptic row. If true, only write the plastic data region of the synaptic row. |
Definition at line 260 of file spike_processing.c.
|
inlinestatic |
Start the DMA processing loop if not already running.
Definition at line 285 of file spike_processing.c.
Called when a multicast packet is received.
[in] | key | The key of the packet. The spike. |
[in] | unused | Only specified to match API |
Definition at line 301 of file spike_processing.c.
Called when a multicast packet is received.
[in] | key | The key of the packet. The spike. |
[in] | payload | the payload of the packet. The count. |
Definition at line 311 of file spike_processing.c.
Called when a DMA completes.
unused | unused | |
[in] | tag | What sort of DMA has finished? |
Definition at line 327 of file spike_processing.c.
Called when a user event is received.
unused0 | unused |
unused1 | unused |
Definition at line 396 of file spike_processing.c.
void spike_processing_clear_input_buffer | ( | timer_t | time | ) |
clears the input buffer of packets
[in] | time | The current timestep |
Definition at line 413 of file spike_processing.c.
bool spike_processing_initialise | ( | size_t | row_max_n_bytes, |
uint | mc_packet_callback_priority, | ||
uint | user_event_priority, | ||
uint | incoming_spike_buffer_size, | ||
bool | clear_input_buffers_of_late_packets_init, | ||
uint32_t | packets_per_timestep_region | ||
) |
Initialise the spike processing system.
[in] | row_max_n_bytes | The maximum size of a synaptic row |
[in] | mc_packet_callback_priority | Multicast packet receive interrupt priority |
[in] | user_event_priority | User event interrupt priority |
[in] | incoming_spike_buffer_size | Size of buffer for receiving spikes |
[in] | clear_input_buffers_of_late_packets_init | Whether packets that are left at the end of a time step are wiped |
[in] | packets_per_timestep_region | The recording region to use for the packets per timestep |
Definition at line 430 of file spike_processing.c.
void spike_processing_store_provenance | ( | struct spike_processing_provenance * | prov | ) |
Get provenance data for Spike processing.
[in] | prov | The structure to store the provenance data in |
Definition at line 467 of file spike_processing.c.
bool spike_processing_do_rewiring | ( | int | number_of_rewires | ) |
Set the number of times spike_processing has to attempt rewiring.
[in] | number_of_rewires | The number of rewires to perform |
Definition at line 476 of file spike_processing.c.
|
extern |
|
static |
True if the DMA "loop" is currently running.
Definition at line 67 of file spike_processing.c.
|
static |
The DTCM buffers for the synapse rows.
Definition at line 70 of file spike_processing.c.
|
static |
The index of the next buffer to be filled by a DMA.
Definition at line 73 of file spike_processing.c.
|
static |
The index of the buffer currently being filled by a DMA read.
Definition at line 76 of file spike_processing.c.
|
static |
Number of outstanding synaptogenic rewires.
Definition at line 79 of file spike_processing.c.
|
static |
The number of rewires to do when the DMA completes.
When a DMA is first set up, only this or dma_n_spikes can be 1 with the other being 0.
Definition at line 84 of file spike_processing.c.
|
static |
The number of spikes to do when the DMA completes.
When a DMA is first set up, only this or dma_n_rewires can be 1 with the other being 0.
Definition at line 89 of file spike_processing.c.
|
static |
the number of DMA completes (used in provenance generation)
Definition at line 92 of file spike_processing.c.
|
static |
the number of spikes that were processed (used in provenance generation)
Definition at line 95 of file spike_processing.c.
|
static |
The number of successful rewires.
Definition at line 98 of file spike_processing.c.
|
static |
How many packets were lost from the input buffer because of late arrival.
Definition at line 102 of file spike_processing.c.
|
static |
tracker of how full the input buffer got.
Definition at line 105 of file spike_processing.c.
|
static |
Whether if we should clear packets from the input buffer at the end of a timer tick.
Definition at line 109 of file spike_processing.c.
|
static |
the region to record the packets per timestep in
Definition at line 118 of file spike_processing.c.