You are on page 1of 3

eDRS XML Format v2.

0
Copyright 1999-2015 The MathWorks, Inc.

1 Syntax description – XML Marks


The following marks are recognized:
<global>: This mark is used to declare the global scope. It must be the root element of the XML file.
It may contain any other recognized mark. Global variables may be defined right under this mark. It has
no attributes.
<file>: This mark is used to declare a file scope. This mark must be enclosed in the <global> mark,
and may enclose any variable or function declaration mark. Static variables must be enclosed in a file
mark to avoid conflicts. For the attributes description, see the next section.
<scalar>: This mark is used to declare an integer or a floating point variable. It may be enclosed in
any recognized mark, but cannot enclose any mark. This mark is used to set init/permanent/global asserts
on variables. For the attributes description, see the next section.
<pointer>: This mark is used to declare a pointer variable. It may enclose any other variable
declaration mark including itself, to define the pointed objects. It is used to set what value will be written
into pointer (NULL or not), how many objects will be allocated and how the pointed objects will be
initialized. For the attributes description, see the next section.
<array>: This mark is used to declare an array variable. It may enclose any other variable definition
mark including itself, to define the elements of the array. Arrays can also be declared directly with their
element type mark. For the attributes description, see the next section.
<struct>: This mark is used to declare a structure variable or object (instance of class). It may enclose
any other variable definition mark including itself, to define the fields of the struct. For the attributes
description, see the next section.
<function>: This mark is used to declare a function or class method scope. It may enclose any variable
definition mark, to define the arguments and the return value of the function. Arguments should be named
“arg1, arg2, …argn” and the return value should be called “return”. For the attributes description, see
the next section.

2 Syntax description – XML Attributes


<file> mark:

Attributes
name (**) comment(*)
name comment

<scalar> mark:

Attributes
Name line(*) base_type(* Attributes complet init_mode init_mode init_range global_ assert assert_range comment(*)
(**) ) (***) e_type( s_allowed
*) (*)
name line intx volatile MAIN_GENE single range YES range comment
uintx extern RATOR value disabled NO disabled
floatx static IGNORE (****) unsupporte disabled unsupported
const INIT d unsupported
PERMANEN
T
disabled
unsupporte
d
<pointer> mark:
Attributes
name (**) Line attributes complete init_mode init_modes_allowed(*) initialize_ number_ init_pointed comment(*)
(*) (***) _type(*) pointer allocated (*****)
name line volatile MAIN_GENERATOR single value (****) May-be NULL single value MAIN_GENERATOR comment
extern IGNORE Not NULL disabled NONE
static INIT NULL unsupported SINGLE
const PERMANENT MULTI
disabled SINGLE_CERTAIN_W
unsupported RITE (******)
MULTI_CERTAIN_W
RITE (******)
disabled

<array> and <struct> marks:

Attributes
name(**) line(*) complete_type(*) attributes(***) comment(*)
name line type volatile comment
extern
static
const

<function> mark:

Attributes
name(**) line(*) main_generator_called attributes(***) comment(*)
name line MAIN_GENERATOR static comment
YES extern
NO unused
disabled

Remarks:

(*) Attributes used only for display by the GUI. Those attributes are not mandatory for the ranges to be accepted
by the Verifier. The attribute line contains the line number where the variable is declared in the source code,
complete_type contains a string with the complete variable type, and base_type is used by the GUI to compute
the max and min values. The attribute comment is used to add information about any node.
(**) The attribute name is mandatory for scope marks <file> and <function> (except for function pointers). For
other marks, name must be specified when declaring a root symbol or a struct field.
(***) Values in the field attributes must be separated by white spaces. Only the static attribute is mandatory, to
avoid conflicts between static variables having the same name. An attribute can be defined multiple times
without impact.
(****) The attribute init_modes_allowed is used only by the GUI to determine which init modes are allowed for
the current element according to its type. The value works as a mask, where the following values are added to
specify which modes are allowed:
1: The mode “NO” is allowed.
2: The mode “INIT” is allowed.
4: The mode “PERMANENT” is allowed.
8: The mode “MAIN_GENERATOR” is allowed.
For example, the value “10” means that modes “INIT” and “MAIN_GENERATOR” are allowed. To see how
this value is computed, refer to next section.
(*****) Note that a sub-element of a pointer (i.e. a pointed object) will be taken into account only if init_pointed
is equal to SINGLE, MULTI, SINGLE_CERTAIN_WRITE or MULTI_CERTAIN_WRITE.
(******) SINGLE_CERTAIN_WRITE or MULTI_CERTAIN_WRITE are available for parameters and return
values of stubbed functions if they are pointers. If a parameter points to a structure or a return value is a structure
and this structure has a pointer field, they are available for the pointer field.
3 Allowed modes and default values

Gassert Initialize
Scope Type Init modes mode pointer Init allocated Default
MAIN_GENERATOR
IGNORE
Unqualified/static/const INIT YES Main generator
Base scalar PERMANENT NO dependant
type
Volatile scalar PERMANENT disabled PERMANENT min..max
INIT YES
Extern scalar PERMANENT NO INIT min..max
Struct Struct field Refer to field type
Array Array element Refer to element type
May-be
MAIN_GENERATOR NULL NONE
Unqualified/static/const IGNORE Not NULL SINGLE Main generator
pointer INIT NULL MULTI dependant
Global
variables Volatile pointer unsupported unsupported unsupported
May-be
NULL NONE
IGNORE Not NULL SINGLE INIT May-be NULL max
Extern pointer INIT NULL MULTI MULTI
Pointer
Pointed volatile scalar unsupported unsupported
Pointed extern scalar INIT unsupported INIT min..max
MAIN_GENERATOR Main generator
Pointed other scalars INIT unsupported dependant
May-be
NULL NONE
MAIN_GENERATOR Not NULL SINGLE Main generator
Pointed pointer INIT unsupported NULL MULTI dependant
Pointed function unsupported unsupported
MAIN_GENERATOR
Scalar parameters INIT unsupported INIT min..max
May-be
Userdef NULL NONE
function MAIN_GENERATOR Not NULL SINGLE INIT May-be NULL max
Pointer parameters INIT unsupported NULL MULTI MULTI

Other parameters Refer to parameter type


Function
Scalar parameter disabled unsupported
parameters
NONE
SINGLE
MULTI
Stubbed
Pointer SINGLE_CERTAIN_WRITE
function
parameters disabled disabled MULTI_CERTAIN_WRITE MULTI_CERTAIN_WRITE

Pointed parameters PERMANENT unsupported PERMANENT min..max


Pointed const
parameters disabled unsupported
Userdef
function Return disabled unsupported disabled disabled
Scalar return PERMANENT unsupported PERMANENT min..max
Function NONE
return Stubbed May-be SINGLE
function NULL MULTI
Not NULL SINGLE_CERTAIN_WRITE PERMANENT May-be
Pointer return PERMANENT unsupported NULL MULTI_CERTAIN_WRITE NULL max MULTI

You might also like