97 void *restrict target,
const void *source,
uint n_words) {
99 const uint *from = source;
100 while (n_words-- > 0) {
109 if (rec->
space >= size_bytes) {
110 if ((((
int)
data & 0x3) != 0) || ((size_bytes & 0x3) != 0)) {
115 rec->
space -= size_bytes;
116 rec->
write += size_bytes;
121 log_warning(
"WARNING: recording channel %u out of space", channel);
129__attribute__((noreturn))
134 log_error(
"DMA transfer of non-word data quantity in recording! "
135 "(data=0x%08x, size=0x%x)",
data, size);
140 log_debug(
"Finalising recording channels");
148 log_info(
"Recording channel %u, start=0x%08x, end=0x%08x, write=0x%08x, space=%u",
153 log_info(
"Recording channel %u - has missing data", channel);
155 log_info(
"Recording channel %u wrote %u bytes", channel, reg->
size);
164 regions = *recording_data_address;
173 log_error(
"Not enough space to allocate recording channels");
185 for (uint32_t i = 0; i < n_regions; i++) {
187 uint32_t space = region->
space;
190 sv->sdram_heap, space, 0,
193 log_error(
"Could not allocate recording region %u of %u bytes,"
194 " available was %u bytes", i, space,
198 log_info(
"Allocated %u bytes for recording channel %u at 0x%08x",
199 space, i, region->
data);
217 uint32_t space = region->
space;
222 channel->
space = space;
226 log_info(
"Recording channel %u configured to use %u byte memory block"
227 " starting at 0x%08x", i, channel->
space, channel->
start);
230 log_info(
"Recording channel %u left uninitialised", i);
Definitions for the streaming-over-EIEIO buffering protocol.
static uint32_t recording_flags
General recording flags. (Unused by this code.)
static uint32_t data[ITEMS_PER_DATA_PACKET]
SpiNNaker debug header file.
void log_error(const char *message,...)
This function logs errors. Errors usually indicate a serious fault in the program,...
void log_warning(const char *message,...)
This function logs warnings.
void log_debug(const char *message,...)
This function logs debugging messages. This level of message is normally not printed except when the ...
void log_info(const char *message,...)
This function logs informational messages. This is the lowest level of message normally printed.
uint32_t space
The size of the region to record into.
uint8_t * write
Where to write to next.
recording_region_t regions[]
Item for each region.
uint32_t size
The size of the region after recording.
static bool has_been_initialised(recording_channel_t *rec)
checks that a channel has been initialised
bool recording_initialize(void **recording_data_address, uint32_t *recording_flags)
initialises the recording of data
static recording_regions_t * regions
The parameters of the recording.
static recording_channel_t * channels
Array containing all possible channels.
uint32_t missing
Flag indicating if recording missed data.
void recording_finalise(void)
Finishes recording - should only be called if recording_flags is not 0.
uint8_t * data
Pointer to the recorded data.
uint32_t space
The space remaining in the channel.
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
uint32_t missing
Flag indicating if any data is missing.
uint8_t * end
One byte past the end of the buffer.
uint32_t n_regions
The number of recording regions.
bool recording_record(uint8_t channel, void *data, uint32_t size_bytes)
records some data into a specific recording channel.
void recording_reset(void)
resets recording to the state just after initialisation
void recording_bad_offset(void *data, uint32_t size)
Stop the program because of a bad recording request.
uint8_t * start
The first byte of the buffer.
Structure that defines a channel in memory.
Data for an individual region.
header of general structure describing all recordings
interface for recording data into "channels" on the SDRAM in a standard way, and storing buffers to b...
void * sark_xalloc(heap_t *heap, uint size, uint tag, uint flag)
uint sark_heap_max(heap_t *heap, uint flag)
void rt_error(uint code,...)
Simulation Functions Header File.
void spin1_memcpy(void *dst, void const *src, uint len)