Expand description
a2lfile is a library that allows you to read, modify and write a2l files.
It is fast, preserves the formatting of the input, and has support for files using standard version 1.71.
§Features
check
: perform a consistency check on the datacleanup
: remove unusedGROUP
s,RECORD_LAYOUTs
,COMPU_METHOD
s,COMPU_(V)TAB
s andUNIT
sifdata_cleanup
: remove anyIF_DATA
blocks that could not be parsed using either the specification provided during load or the specification in the A2ML block in the filemerge
: merge two a2l files on theMODULE
levelsort
: sort the data in the a2l file
Macros§
- a2ml_
specification - The
a2ml_specification
! macro enables application to conveniently decode and useIF_DATA
defined though A2ML. The macro uses an “enhanced A2ML” language to define the items. Rust data structures and associated code will be generated for items defined inside of the macro. - itemlist
Structs§
- A2lFile
- Contains all the objects of an A2lfile
- A2ml
- A2ML is a special case in the specification.
It contains the ASAP2 metalanguage code that describes the content of
IF_DATA
blocks - A2ml
Version - Contains AML code for description of interface specific description data.
- AddrEpk
- Address of the EPROM identifier
- Address
Type - Description of the addressing of table values or axis point values.
- Alignment
Byte - Defines the alignment of byte-sized values in complex objects (maps and axis)
- Alignment
Float16 Ieee - Defines the alignment of 16bit floats in complex objects (maps and axis)
- Alignment
Float32 Ieee - Defines the alignment of 32bit floats in complex objects (maps and axis)
- Alignment
Float64 Ieee - Defines the alignment of 64bit floats in complex objects (maps and axis)
- Alignment
Int64 - Defines the alignment of int64 values in complex objects (maps and axis)
- Alignment
Long - Defines the alignment of long-sized values in complex objects (maps and axis)
- Alignment
Word - Defines the alignment of word-sized values in complex objects (maps and axis)
- Annotation
- An extended description text
- Annotation
Label - The label or title of an annotation
- Annotation
Origin - Identify who or which system has created an annotation
- Annotation
Text - Text of an annotation
- ArComponent
- describes the Autosar component type of a function
- ArPrototype
Of - Describes the resationship of the component type to to a component prototype in the Autosar system
- Array
Size - marks a measurement object as an array of
<Number>
measurement values - Asap2
Version - Version of the ASAM MCD-2MC standard used by this file
- Axis
Descr - Axis description within an adjustable object
- AxisPts
- Parameters for the handling of an axis points distribution
- Axis
PtsDim - Description of the X, Y, Z, Z4 or Z5 axis points in memory
- Axis
PtsRef - Reference to an
AXIS_PTS
record - Axis
Rescale Dim - Description of rescaling the axis values of an adjustable object
- BitMask
- The
BIT_MASK
keyword can be used to mask out single bits of the value to be processed. - BitOperation
- Used to perform bit operation on a value
- Blob
- Special data object that can be used to handle domain specific data, which are processed inside the ECU in a dedicated way
- Block
Info - Describes the location and formatting of an a2l block within a file
- Byte
Order - Where the standard value does not apply this parameter can be used to specify the byte order
- Calibration
Access - Specifies the access of a CHARACTERISTIC or
AXIS_PTS
for calibration - Calibration
Handle - calibration method specific data
- Calibration
Handle Text - Additional text for a calibration handle
- Calibration
Method - Indicates the different methods of access that are implemented in the ECU
- Characteristic
- Specifies all the parameters of an adjustable object
- Coeffs
- Specifies the coefficients for the formula f(x) = (axx + bx + c) / (dxx + ex + f)
- Coeffs
Linear - Specifies the coefficients for the linear formula f(x) = ax + b
- Combination
Struct - Auto generated for repeating sequence combination in block
VAR_FORBIDDEN_COMB
- Comparison
Quantity - references a valid MEASUREMENT
- Compu
Method - Specification of a conversion method from internal values to physical values
- Compu
Tab - Conversion table for conversions that cannot be represented as a function
- Compu
TabRef - reference to a conversion table
- Compu
Vtab - Conversion table for the assignment of display strings to values. Typically used for enums.
- Compu
Vtab Range - Conversion table for the assignment of display strings to a value range
- Consistent
Exchange - indicates that an instance of a structure should always be handled completely
- Conversion
- CONVERSION is used inside OVERWRITE to override the default conversion method
- CpuType
- Identifies the CPU used in the ECU
- Curve
Axis Ref - Used to specify the adjustable CURVE CHARACTERISTIC that is used to normalize or scale the axis in an
AXIS_DESCR
- Customer
- Allows a customer name to be specified
- Customer
No - specify a customer number or identifier as a string
- Data
Size - Data size in bits
- DefCharacteristic
- Defines which adjustable objects are used by a FUNCTION
- Default
Value - Sets the default text value of
COMPU_TAB
,COMPU_VTAB
orCOMPU_VTAB_RANGE
- Default
Value Numeric - Sets the default numerical value of
COMPU_TAB
,COMPU_VTAB
orCOMPU_VTAB_RANGE
- Dependent
Characteristic - Specify characteristics that depend on a formula
- Deposit
- Specifies how the axis points of a characteristic are deposited in memory
- Discrete
- Indicates that a measurement or calibration object has discrete values which should not be interpolated
- Display
Identifier - Gives the display name of a CHARACTERISTIC or MEASUREMENT value
- Dist
OpDim - Description of the distance operand in the deposit structure to compute the axis points for fixed characteristic curves and fixed characteristic maps
- Ecu
- String for identification of the control unit.
- EcuAddress
- Provides the address of a MEASUREMENT
- EcuAddress
Extension - Used to specify additional address information
- EcuCalibration
Offset - Provide an address offset in order to handle near pointers or variant coding
- Encoding
- a CHARACTERISTIC of type ASCII can be configured to use a multi-byte encoding instead
- Epk
- EPROM identifier
- Error
Mask - Used to mask bits of a MEASUREMENT which indicate that the value is in error
- Extended
Limits - used to specify an extended range of values
- FixAxis
Par - Parameters for the calculation of fixed axis points: X_i = Offset + (i - 1)*2^shift
- FixAxis
ParDist - Parameters for the calculation of fixed axis points:
X_i
= Offset + (i - 1)*distance - FixAxis
ParList - A list of fixed axis point, as implemented on the ECU
- FixNo
Axis PtsDim - Specifies the number of axis points available to CURVE, MAP, CUBOID,
CUBE_4
orCUBE_5
- FncValues
- Description of the table values (function values) of an adjustable object
- Format
- Allows a display format string to be specified for a MEASUREMENT, CHARACTERISTIC or
AXIS_PTS
object - Formula
- Allows any kind of formula to be specified
- Formula
Inv - Allows an inverse formula to be specified
- Frame
- Defines a function frame to structure large amounts of measurement objects
- Frame
Measurement - Contains a list of identifiers of measurement objects
- Function
- Describes the input, local, and output variables of a function on the ECU
- Function
List - a list of FUNCTION objects
- Function
Version - A string containing the version of a FUNCTION
- Generic
IfData Tagged Item - A tagged item (of taggedstruct or taggedunion) in the generic
IfData
representation - Group
- Defines a group of releated CHARACTERISTIC and MEASUREMENT objects
- Guard
Rails - Used to indicate that an adjustable CURVE, MAP or
AXIS_PTS
uses guard rails - Header
- The header of a project
- Identification
- used to describe that an 'identifier' is deposited in a specific position in the adjustable object
- IfData
- The content of
IF_DATA
blocks is not directly described in the specification. Instead the content description is provided at runtime through the A2ML block. - InMeasurement
- Interface specific data A list of measurement objects that are used as the inputs of a function
- Input
Quantity - INPUT_QUANTITY is used inside OVERWRITE to override the input_quantity of an INSTANCE
- Instance
- Creates an instance of a type defined using TYPEDEF_STRUCTURE, TYPEDEF_MEASUREMENT or TYPEDEF_CHARACTERISTIC
- Item
List - A list of named a2l items
- Layout
- describes the layout of a multi-dimensional measurement array
- Left
Shift - Used within BIT_OPERATION to left-shift the bits of a value
- Limits
- LIMITS is used inside OVERWRITE to override the limits of an INSTANCE
- LocMeasurement
- A list of measurement objects that are local variables of a function
- MapList
- used to specify the list of MAPs which comprise a CUBOID
- Matrix
Dim - describes the dimensions of a multidimensional array of values
- MaxGrad
- specifies a maximum permissible gradient for an adjustable object
- MaxRefresh
- specifies the maximum refresh rate in the control unit
- Measurement
- describes the parameters for a measurement object
- Memory
Layout - describes the layout of the ECU memory
- Memory
Segment - describes a memory segment of the ECU program
- ModCommon
- defines default values for the entire module
- ModPar
- defines system information and management data for the module
- Model
Link - add a string to a CHARACTERISTIC linking it to a name in the model
- Module
- The MODULE keyword describes a complete ECU or device with all adjustable and measurement objects, conversion methods and functions
- Monotony
- specifies the monotony of an adjustment object
- NoAxis
PtsDim - Description of the number of axis points in an adjustable object
- NoOf
Interfaces - the number of interfaces
- NoRescale
Dim - number of rescaling axis point value pairs
- Number
- specifies the number of values in an array. Obsolete, replaced by
MATRIX_DIM
- Offset
Dim - Description of the 'offset' parameter in the deposit structure
- OutMeasurement
- defines output quantities of a function
- Overwrite
- override some default attributes of a type definition in a specific INSTANCE.
- PhoneNo
- contains a phone number, e.g. of the calibration engineer
- Phys
Unit - specifies the physical unit of a measurement or calibration object as a string
- Project
- Project description with project header and all modules belonging to the project. Required.
- Project
No - Gives the project identifier
- Read
Only - used to indicate that an adjustable object is read-only
- Read
Write - used to indicate that a measurement object is writeable
- Record
Layout - specifies the various data structures of an adjustable objects in memory
- RefCharacteristic
- defines a list of adjustable objects that can be referenced by a function or group
- RefGroup
- defines a list of groups for use by USER_RIGHTS
- RefMeasurement
- defines a list of measurement objects that can be referenced by a group
- RefMemory
Segment - reference to a
MEMORY_SEGMENT
- RefUnit
- reference to a UNIT
- Reserved
- indicates that the data at the given position is reserved and should not be interpreted by the MCD system
- Right
Shift - Used within BIT_OPERATION to right-shift the bits of a value
- RipAddr
Dim - Describes the storage of the ECU-internal result of interpolation (RIP)
- Root
- indicates that the current group is at the root of the navigation tree
- SRec
Layout - sets the standard record layout for the module
- Shift
OpDim - Description of the shift operand in the deposit structure to compute the axis points for fixed characteristic curves and fixed characteristic maps
- SiExponents
- the seven base dimensions required to define an extended SI unit
- Sign
Extend - used in
BIT_OPERATION
to specify that sign extension should be performed - SrcAddr
Dim - Description of the address of the input quantity in an adjustable object
- Static
Address Offsets - indicates that the start addresses of axes and function values of an adjustable object do not change when removing or inserting axis points
- Static
Record Layout - indicates that an adjustable object with dynamic number of axis points does not compact or expand data when removing or inserting axis points
- Status
String Ref - used to split up the value range of ECU internal values into a numerical and a verbal part
- Step
Size - step size when adjusting the value of a CHARACTERISTIC, AXIS_PTS or AXIS_DESCR
- Structure
Component - defines a single component of a TYPEDEF_STRUCTURE
- SubFunction
- a list of identifiers of functions which are sub-functions of the current function
- SubGroup
- a list of identifiers of groups which are subgroups of the current group
- Supplier
- Name of the ECU manufacturer
- Symbol
Link - specifes the name of a symbol within a linker map file that corresponds to the a2l object
- Symbol
Type Link - Specifies the name of a symbol within a linker map file or debug file that describes a class, class member, structure or structure component
- System
Constant - defines a system constant that can be used in conversion formulas
- TabEntry
Struct - Auto generated for repeating sequence tab_entry in block COMPU_TAB
- Transformer
- Definition of call to an external function (32-bit or 64-bit DLL) for converting calibration object values between their implementation format and physical format
- Transformer
InObjects - provides a list of inputs for a TRANSFORMER
- Transformer
OutObjects - provides a list of outputs for a TRANSFORMER
- Typedef
Axis - Type definition of an axis object
- Typedef
Blob - Type definition of a BLOB
- Typedef
Characteristic - Type definition of a calibration object
- Typedef
Measurement - Type definition of a measurement object
- Typedef
Structure - Definition of structured data types similar to the "typedef" command in C
- Unit
- Specification of a measurement unit
- Unit
Conversion - Specification of the linear relationship between two measurement units
- User
- Name of the user
- User
Rights - used to define groups accessible only for certain users
- Value
Pairs Struct - Auto generated for repeating sequence value_pairs in block COMPU_VTAB
- Value
Triples Struct - Auto generated for repeating sequence value_triples in block COMPU_VTAB_RANGE
- VarAddress
- define a list of start addresses of variant coded adjustable objects
- VarCharacteristic
- defines one adjustable object to be variant coded
- VarCriterion
- describes a variant criterion
- VarForbidden
Comb - describes a forbidden combination of values of different variant criteria
- VarMeasurement
- specify a special measurement object which indicates the currently active variant
- VarNaming
- defines the format of the variant extension (index) of adjustable object names
- VarSelection
Characteristic - used to specify a special characteristic object which can change the currently active variant
- VarSeparator
- defines the separating symbol between the two parts of an adjustable object name
- Variant
Coding - All information related to variant coding is grouped in this structure
- Version
- version identifier
- Virtual
- specification of the measurement objects for a virtual measurement channel
- Virtual
Characteristic - defines characteristics that are not deposited in the memory of the control unit, but can be used to indirectly calibrate other characteristic values
Enums§
- A2lError
- Addr
Type - Description of the addressing of table values or axis point values.
- Axis
Descr Attribute - Description of the axis points
- Byte
Order Enum - Byte ordering of a value on the ECU
- Calibration
Access Enum - Type of access that is possible for a CHARACTERISTIC or
AXIS_PTS
object - Character
Encoding - Describes the encoding of a string, if it is not ASCII
- Characteristic
Type - Specifies the type of an adjustable object
- Conversion
Type - Describes how to convert internal input values to physical values
- Data
Type - Description of the basic data types in the ECU program.
- Data
Type Size - Description of the word lengths in the ECU program.
- Deposit
Mode - Deposit of the axis points of a characteristic curve or map
- Generic
IfData - generic representation of data inside an
IF_DATA
block that can be loaded into application-specific data structures - Index
Mode - Describes how the 2-dimensional table values are mapped onto the 1-dimensional address space
- Index
Order - Description of the axis point sequence in the memory.
- Memory
Attribute - specifies if a given memory region is internal or external
- Memory
Type - describes the type of memory used
- Monotony
Type - describes the possible ways an adjustment object can be monotonous
- Parser
Error - PrgType
- Describes the types of data in the ECU program
- Prog
Type - describes the types of program segments
- Tokenizer
Error - Transformer
Trigger - the trigger conditions of a TRANSFORMER
- Unit
Type - Type of the UNIT
- VarNaming
Tag - intended to define the format of the variant extension. Currently only one format is supported
Traits§
- A2lObject
- The trait
A2lObject
is implemented for all a2l objects as well as all objects generated by thea2ml_specification
! macro. It gives access to layout and location data which is tracked for each object in an a2l file. - A2lObject
Name - The trait
A2lObjectName
is automatically implemented for named a2l objects - A2lObject
Name Setter - The trait
A2lObjectName
is automatically implemented for named a2l objects
Functions§
- load
- Load an a2l file
- load_
fragment - load an a2l fragment
- load_
fragment_ file - load an a2l fragment from a file
- load_
from_ string - load a2l data stored in a string
- new
- Create a new a2l file