SpiNNFrontEndCommon 7.1.1
Common support code for user-facing front end systems.
Loading...
Searching...
No Matches
Data Structures | Functions
data_specification.h File Reference

Data Specification region access API. More...

#include <stdbool.h>
#include "common-typedefs.h"

Go to the source code of this file.

Data Structures

struct  region_desc_t
 

Functions

data_specification_metadata_tdata_specification_get_data_address (void)
 Gets the location of the data for this core using the user0 entry of the SARK VCPU structure.
 
bool data_specification_read_header (data_specification_metadata_t *ds_regions)
 Reads the header from the address given and checks if the parameters are of the correct values.
 
static voiddata_specification_get_region (uint32_t region, data_specification_metadata_t *ds_regions)
 Gets the address of a region.
 

Detailed Description

Data Specification region access API.

Specifies functions that can be used to read an executed Data Specification, including checking the header and extracting the regions.

Definition in file data_specification.h.


Data Structure Documentation

◆ region_desc_t

struct region_desc_t

Definition at line 31 of file data_specification.h.

Data Fields
void * pointer
uint32_t checksum Simple checksum which is rounded 32-bit unsigned sum of words.
uint32_t n_words The number of valid words in the region.

◆ data_specification_metadata_t

struct data_specification_metadata_t

The central structure that the DSE writes.

A pointer to this will be placed in user0 before the application launches. The number of entries in the table is application-specific, and is not checked.

Definition at line 44 of file data_specification.h.

Data Fields
uint32_t magic_number A magic number, used to verify that the pointer is sane.
uint32_t version The version of the DSE data layout specification being followed.
region_desc_t regions[] The regions; as many as required.

Function Documentation

◆ data_specification_get_data_address()

data_specification_metadata_t * data_specification_get_data_address ( void  )

Gets the location of the data for this core using the user0 entry of the SARK VCPU structure.

Locates the start address for a core in SDRAM. This value is loaded into the user0 register of the core during the tool chain loading.

Does not validate the value! That's data_specification_read_header()

Returns
The address of the generated data

Definition at line 76 of file data_specification.c.

◆ data_specification_read_header()

bool data_specification_read_header ( data_specification_metadata_t ds_regions)

Reads the header from the address given and checks if the parameters are of the correct values.

Reads the header written by a DSE and checks that the magic number which is written by every DSE is consistent. Inconsistent DSE magic numbers would reflect a model being used with an different DSE interface than the DSE used by the host machine.

Parameters
[in]ds_regionsThe address of the start of the data generated
Returns
true if a valid header was found, or false if was not

Definition at line 95 of file data_specification.c.

◆ data_specification_get_region()

static void * data_specification_get_region ( uint32_t  region,
data_specification_metadata_t ds_regions 
)
inlinestatic

Gets the address of a region.

Parameters
[in]regionthe ID of the region, starting at 0
[in]ds_regionsThe address of the start of the data generated; it is the caller's job to validate this first.
Returns
The address of the specified region. This function does not know the actual type of the region.

Definition at line 81 of file data_specification.h.