SpiNNFrontEndCommon 7.2.2
Common support code for user-facing front end systems.
Loading...
Searching...
No Matches
Macros | Enumerations | Functions
data_specification.c File Reference

implementation of data_specification.h More...

#include "data_specification.h"
#include <sark.h>
#include <debug.h>

Go to the source code of this file.

Macros

#define N_REGIONS   32
 

Enumerations

enum  { DATA_SPECIFICATION_MAGIC_NUMBER = 0xAD130AD6 , DATA_SPECIFICATION_VERSION = 0x00010000 , VERSION_MASK = 0xFFFF , VERSION_SHIFT = 16 }
 Misc constants. More...
 

Functions

static void verify_checksum (data_specification_metadata_t *ds_regions, uint32_t region)
 Verify the checksum of a region; on failure, RTE.
 
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.
 

Detailed Description

implementation of data_specification.h

Definition in file data_specification.c.

Macro Definition Documentation

◆ N_REGIONS

#define N_REGIONS   32

Definition at line 40 of file data_specification.c.

Enumeration Type Documentation

◆ anonymous enum

Misc constants.

Enumerator
DATA_SPECIFICATION_MAGIC_NUMBER 

A magic number that identifies the start of an executed data specification

DATA_SPECIFICATION_VERSION 

The version of the spec we support; only one was ever supported.

VERSION_MASK 

The mask to apply to the version number to get the minor version.

VERSION_SHIFT 

The amount of shift to apply to the version number to get the major version

Definition at line 27 of file data_specification.c.

Function Documentation

◆ verify_checksum()

static void verify_checksum ( data_specification_metadata_t ds_regions,
uint32_t  region 
)
inlinestatic

Verify the checksum of a region; on failure, RTE.

Parameters
[in]ds_regionsThe array of region metadata
[in]regionThe region to verify

Definition at line 48 of file data_specification.c.

◆ 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.