SpiNNFrontEndCommon 7.3.1
Common support code for user-facing front end systems.
Loading...
Searching...
No Matches
Data Structures | Functions | Variables
recording.c File Reference

implementation of recording.h More...

#include <recording.h>
#include <simulation.h>
#include <buffered_eieio_defs.h>
#include <sark.h>
#include <circular_buffer.h>
#include <spin1_api_params.h>
#include <debug.h>
#include <wfi.h>

Go to the source code of this file.

Data Structures

struct  recording_channel_t
 Structure that defines a channel in memory. More...
 
struct  recording_region_t
 Data for an individual region. More...
 
struct  recording_regions_t
 header of general structure describing all recordings More...
 

Functions

static bool has_been_initialised (recording_channel_t *rec)
 checks that a channel has been initialised
 
static void close_channel (recording_channel_t *rec)
 closes a channel
 
static void copy_data (void *restrict target, const void *source, uint n_words)
 copy data in word-size chunks
 
bool recording_record (uint8_t channel, void *data, uint32_t size_bytes)
 records some data into a specific recording channel.
 
void recording_bad_offset (void *data, uint32_t size)
 Stop the program because of a bad recording request.
 
void recording_finalise (void)
 Finishes recording - should only be called if recording_flags is not 0.
 
bool recording_initialize (void **recording_data_address, uint32_t *recording_flags)
 initialises the recording of data
 
void recording_reset (void)
 resets recording to the state just after initialisation
 

Variables

static recording_channel_tchannels
 Array containing all possible channels.
 
static recording_regions_tregions
 The parameters of the recording.
 

Detailed Description

implementation of recording.h

Definition in file recording.c.


Data Structure Documentation

◆ recording_channel_t

struct recording_channel_t

Structure that defines a channel in memory.

Channels are implemented using a circular buffer.

Definition at line 38 of file recording.c.

Data Fields
uint8_t * start The first byte of the buffer.
uint8_t * end One byte past the end of the buffer.
uint8_t * write Where to write to next.
uint32_t space: 31 The space remaining in the channel.
uint32_t missing: 1 Flag indicating if recording missed data.

◆ recording_region_t

struct recording_region_t

Data for an individual region.

Definition at line 47 of file recording.c.

Data Fields
uint32_t space The size of the region to record into.
uint32_t size:31 The size of the region after recording.
uint32_t missing: 1 Flag indicating if any data is missing.
uint8_t * data Pointer to the recorded data.

◆ recording_regions_t

struct recording_regions_t

header of general structure describing all recordings

Definition at line 59 of file recording.c.

Data Fields
uint32_t n_regions The number of recording regions.
recording_region_t regions[] Item for each region.

Function Documentation

◆ has_been_initialised()

static bool has_been_initialised ( recording_channel_t rec)
inlinestatic

checks that a channel has been initialised

Parameters
[in]recthe channel data to check
Returns
True if the channel has been initialised or false otherwise

Definition at line 81 of file recording.c.

◆ close_channel()

static void close_channel ( recording_channel_t rec)
inlinestatic

closes a channel

Parameters
[in]recthe channel to close

Definition at line 88 of file recording.c.

◆ copy_data()

static void copy_data ( void *restrict  target,
const void source,
uint  n_words 
)
inlinestatic

copy data in word-size chunks

Parameters
[in]targetwhere to write the data to
[in]sourcewhere to read the data from
[in]n_wordsthe number of words to copy

Definition at line 96 of file recording.c.

◆ recording_record()

bool recording_record ( channel_index_t  channel,
void data,
size_t  size_bytes 
)

records some data into a specific recording channel.

Parameters
[in]channelthe channel to store the data into.
[in]datathe data to store into the channel.
[in]size_bytesthe number of bytes that this data will take up. This may be any number of bytes, not just whole words.
Returns
boolean which is True if the data has been stored in the channel, False otherwise.

Definition at line 105 of file recording.c.

◆ recording_bad_offset()

void recording_bad_offset ( void data,
uint32_t  size 
)

Stop the program because of a bad recording request.

Parameters
[in]dataThe address we were seeking to record from
[in]sizeThe amount of data we were seeking to record

Definition at line 133 of file recording.c.

◆ recording_finalise()

void recording_finalise ( void  )

Finishes recording - should only be called if recording_flags is not 0.

Definition at line 139 of file recording.c.

◆ recording_initialize()

bool recording_initialize ( void **  recording_data_address,
uint32_t recording_flags 
)

initialises the recording of data

Parameters
[in,out]recording_data_addressThe start of the data about the recording, updated to point to just after the data if return True. Data is:
{
// number of potential recording regions
uint32_t n_regions;
// one of these for each region
{
// flag to indicate missing data
uint32_t missing: 1;
// size of region to be recorded
// pointer region to be filled in (can be read after recording is
// complete)
}[n_regions]
}
static uint32_t packets_sent
The number of packets sent so far this timestamp.
[out]recording_flagsOutput of flags which can be used to check if a channel is enabled for recording
Returns
True if the initialisation was successful, false otherwise

Definition at line 161 of file recording.c.

◆ recording_reset()

void recording_reset ( void  )

resets recording to the state just after initialisation

Definition at line 212 of file recording.c.

Variable Documentation

◆ channels

recording_channel_t* channels
static

Array containing all possible channels.

Definition at line 72 of file recording.c.

◆ regions

recording_regions_t* regions
static

The parameters of the recording.

Definition at line 75 of file recording.c.