Implementation specifics
Naming rules
The prefix "goal_" is used by the GOAL system for:
global variables
GOAL function names
The prefix "GOAL_CONFIG_" is used by the GOAL system for:
compiler-defines to configure the GOAL system by the user
The prefix "GOAL_TARGET_" is used by the GOAL system for:
compiler-defines to configure hardware-dependent settings
The prefix "GOAL_" is used by the GOAL system for:
compiler-defines for configuration
compiler-defines for GOAL status values
compiler-defines for specific constant values
GOAL data types
macros used by the GOAL system
GOAL data types
The GOAL system uses different classes of data types:
GOAL basic data types: used in the source code
CM-variable data types: used for CM-variables
LM-parameter data types: used for parameters in a log message
Table: GOAL data types
GOAL basic data type | CM-variable data type | LM-parameter data type | Description |
---|---|---|---|
int8_t | GOAL_CM_VAR_INT8 | INT8 | signed integer, 8 bit |
int16_t | GOAL_CM_VAR_INT16 | INT16 | signed integer, 16 bit |
int32_t | GOAL_CM_VAR_INT32 | INT32 | signed integer, 32 bit |
int64_t | – | – | signed integer, 64 bit |
uint8_t | GOAL_CM_VAR_UINT8 | UINT8 | unsigned integer, 8 bit |
uint16_t | GOAL_CM_VAR_UINT16 | UINT16 | unsigned integer, 16 bit |
uint32_t | GOAL_CM_VAR_UINT32 | UINT32 | unsigned integer, 32 bit |
uint64_t | – | – | unsigned integer, 64 bit |
GOAL_BOOL_T | – | – | boolean: 0 = GOAL_FALSE, 1 = GOAL_TRUE |
PtrCast | – | – | pointer casting helper |
– | STRING | – | char array, not zero terminated |
– | – | STRING0 | char array, zero terminated |
– | IPV4 | IPV4 | IP-addresses vvv.xxx.yyy.zzz as uint32_t value: |
– | – | MAC | MAC-address ss-tt-uu-xx-yy-zz as byte array value |
– | GENERIC | GENERIC | byte array |
Please do not rely on generic data types like char or int because the behavior and the width is compiler-specific and platform-specific and use the GOAL basic data types in the source code!
GOAL status
GOAL defines the data type GOAL_STATUS_T
most used as function return value. The values of GOAL status are defined in …\goal\goal\goal_types.h. GOAL provides the following macros for the symbolic evaluation:
GOAL_RES_OK():
0: The GOAL status reports an error.
1: The GOAL status reports success.
GOAL_RES_ERR():
0: The GOAL status reports success.
1: The GOAL status reports an error.
Alignment
The alignment can be specified:
for the processor about the compiler-define
GOAL_TARGET_MEM_ALIGN_CPU
orfor network transfers about the compiler-define
GOAL_TARGET_MEM_ALIGN_NET
Only the values 2, 4 and 8 are supported.
Static heap memory size
The size of the static heap memory must be specified about the compiler-define GOAL_CONFIG_HEAP_SIZE
.
The heap memory size is determined by the GOAL system according to the following order:
The heap memory size can be specified application-specific. The compiler-define
GOAL_CONFIG_HEAP_SIZE
must be set in …\goal\appl\...\goal_config.h or in the compiler-project to guarantee that the definition is taken first.The heap memory size is specified platform-specific in …\goal\plat\arch\...\goal_target.h. This value is valid if there is no application-specific setting.
The heap memory size is specified module-specific in …\goal\goal*.h if necessary. This value is valid if there is no application-specific and no platform-specific setting.