Creator
Automatically create A2L files from C/C++ source code and ELF
Creator is a unique algorithm which creates A2L files from C and C++ code. This approach minimizes developer effort, maximizing efficiency and quality and freeing up resources which can be focussed on value-adding activities.
Creator is integrated in the build just like a compiler. This approach makes for the completely automated creation of A2L files.
A typical flowchart for Creator is shown below.
Highlights of Creator
- A unique algorithm analyses the build products. The A2L information is derived from this analysis hence minimizing the information which the developer needs to provide.
- Handles any combination of structs, classes, arrays and enums.
- Full support for C++ including inheritance, templates and namespaces.
- Variables that will be made available in the A2L file are written as comments in the code by the developer. A2L information and source code is kept together which makes for high quality and fast development.
-
Required information which cannot be derived from build products is written as tagged information in source code comments.
- A2l properties can be specified both per instance and per type. This applies to classes, structs, typdefs of scalars and enums.
- Can co-exist seamless with other documentation tools such as doxygen.
Example
Consider the following code:
typedef enum {State_1, State_2} StateType; typedef struct { StateType enumArray[3]; uint8 scalarArray[4]; uint32 plainScalar; } StructType; StructType aStruct;
And the corresponding A2L:
/begin CHARACTERISTIC aStruct.enumArray "Test aStructArray" VAL_BLK 0x0 UEA2LCREATOR_SLONG 0 COMPUMETHOD_StateType -2147483648 2147483647 MATRIX_DIM 3 1 1 /end CHARACTERISTIC /begin CHARACTERISTIC aStruct.scalarArray "Test aStructArray" VAL_BLK 0x0 UEA2LCREATOR_UBYTE 0 NO_COMPU_METHOD 0 255 MATRIX_DIM 4 1 1 /end CHARACTERISTIC /begin CHARACTERISTIC aStruct.plainScalar "Test aStructArray" VALUE 0x0 UEA2LCREATOR_ULONG 0 NO_COMPU_METHOD 0 4294967295 /end CHARACTERISTIC /begin COMPU_METHOD COMPUMETHOD_StateType "StateType" TAB_VERB "%.0" "" COMPU_TAB_REF COMPU_VTAB_StateType /end COMPU_METHOD /begin COMPU_VTAB COMPU_VTAB_StateType "StateType" 2 0 "State_1" 1 "State_2" /end COMPU_VTAB /begin RECORD_LAYOUT UEA2LCREATOR_ULONG FNC_VALUES 1 ULONG COLUMN_DIR DIRECT /end RECORD_LAYOUT
The A2L contains just as much information as the C-code which means that whenever the C-code is updated the A2L needs to be updated as well. This is a slow and error-prone process which is easily automated with Creator.
Imagine the entire code and A2L replaced by
typedef enum {State_1, State_2} StateType; typedef struct { StateType enumArray[3]; uint8 scalarArray[4]; uint32 plainScalar; } StructType; /** * @a2l on */ StructType aStructArray[2];
Note the @a2l on tag in the comment. That lets Creator know that A2L shall be generated for the variable.
Additional information can be added as tags in source code comments
Not all A2L information can be derived from the build products simply because the build products don’t contain this information, for example the limits the number of cylinders in an engine. Such information is entered by the developer as tags in source code comments.
Some examples of tagged A2L information in comment blocks follow below. Complete documentation of Creator comment tags is found in the Acam user guideline.
/** * This first line will be the description in the A2L file. * * @a2l on * @a2l-min 0 * @a2l-max 20 */ float32 vehicle_length; // A description of bar. // @a2l on uint8 bar; ///////////////////////////////////////////////////////////// // A description of foobar // // Only the first line of the comment becomes the A2L // one-line description so additional comments documenting // the variable can be written here. // // Note that this is an example of putting the documentation // of the variable at the exern declaration in a header file. // // @a2l on // ///////////////////////////////////////////////////////////// extern float32 foobar;