Releases: esa/asn1scc
Maintenance release
Bugfix in Ada backend (_Init function)
Maintenance release
minor bugfix
Maintenance release
- Bugfix on the command line with parameter ordering
- Bugfix: missing include in Ada generated code
- Bugfix in OCTET STRING (CONTAINING Other-Type)
- Use "long" for the .exist field (for optional fields) in C to align with Ada
- Fix cppcheck findings
- Detect inconsistencies in WITH COMPONENTS subtypes
- Support IA5String values according to the standard
- Generate const globals with -ig for type initialization
- Improve stack usage for Ada initialization functions
Subtyping bugfix and upgrade to .NET7 runtime
This version is the first version based on the .NET7 runtime. This does not have any visible impact to end users.
The language server protocol (LSP) binary is included in this release (it used to be a separate file).
In addition the following bug has been fixed:
- Subtyping integer could change the sign of the type, e.g. if
T1 ::= INTEGER(-10..10)andT2 ::= T1 (0..5), the compiler was generating a signed int forT1and an unsigned int type forT2, which was incorrect. Now subtypes are always derived from their parent in C and Ada code.
Type initialization
This release introduces
- a new flag
-igto generate constants that can be used to initialize types with default values (in C). - a refactored set of _Initialize function in the Ada backend that don't make use of stack (much more compact code is generated)
- the removal of anonymous union types in the C backend (this was causing issues when interfacing with other languages such as Nim)
- parser performance improvements in presence of large arrays (SEQUENCE OF) - up to 3x speedup
UPDATE version 4.4.0.1
- Bugfix with constant initializers - Arrays were initialized with the wrong size field
UPDATE version 4.4.0.2
- Bugfix in generated code when using complex subtyping / enumerated names were not always correct
Introduction of the -slim flag
Use the new -slim flag to generate code with lower memory footprint for INTEGER and REAL types.
Depending on the ASN.1 range used, the compiler will generate the smallest datatype needed to hold the set of values.
For example INTEGER (0..255) will translate to a uint_8 type, i.e. occupy only 1 byte in memory at runtime. By default, i.e. in the absence of the -slim flag, all integer types use 64 or 32 bits in C and Ada.
For REAL types, the feature has to be combined with an ACN directive specifying the encoding size for the type - as the size type depends on the precision and not on the range.
If you have such type:
T ::= REAL (-10.0 .. 1000.0) -- in ASN.1
You may have one of the following directives in ACN:
T [encoding IEEE754-1985-32] -- asn1scc will generate a float
or
T [encoding IEEE754-1985-64] -- asn1scc will generate a double
ACN Encoding speed improvement (BIT STRING and OCTET STRING)
This release contains the following:
- Major speed improvement for ACN encodings of
BIT STRINGandOCTET STRINGtypes - First release of the LSP (Language Server Protocol) for ASN.1 and ACN
Details about the ACN speedup:
Completed the optimization work for BIT STRINGs as well as the function that appends a byte array even when the bit steam is not byte aligned (when it is, we simply call mempcy).
Now, the encoding of bit and octet strings is about 2 to 3 times faster than before for big octet strings.
The automatic test cases generation were also improved to print in the console the execution time of each. So, it's easier to have some metrics.
Example:
PUS DEFINITIONS ::=
BEGIN
BA-OCT-STR ::= SEQUENCE {
a OCTET STRING (SIZE(4000000))
}
NA-OCT-STR ::= SEQUENCE {
a BOOLEAN,
b OCTET STRING (SIZE(4000000))
}
BA-BIT-STR ::= SEQUENCE {
a BIT STRING (SIZE(8000004))
}
NA-BIT-STR ::= SEQUENCE {
a BOOLEAN,
b BIT STRING (SIZE(8000004))
}
END
Then this command:
$ asn1scc -c -ACN -o c_out/ -atc a.asn && (cd c_out/; make coverage; cd ..)
provides the following output:
test case 'BA_OCT_STR/test_case_ACN_000001' succeeded, duration was 5 ms
test case 'NA_OCT_STR/test_case_ACN_000002' succeeded, duration was 40 ms
test case 'NA_OCT_STR/test_case_ACN_000003' succeeded, duration was 39 ms
test case 'BA_BIT_STR/test_case_ACN_000004' succeeded, duration was 1 ms
test case 'NA_BIT_STR/test_case_ACN_000005' succeeded, duration was 8 ms
test case 'NA_BIT_STR/test_case_ACN_000006' succeeded, duration was 9 ms
All test cases (6) run successfully.
The original time for the BA_OCT_STR (Byte Aligned octet string with 4.000.000 octets) was around 90 ms. Now, the encoding/decoding time is 5 ms.
The NA_OCT_STR (Non byte-aligned octet string with 4.000.000 octets) takes now about 40 ms.
Encoding speed improvement
When using ACN, the encoding speed of OCTET STRINGs has been greatly improved (up to 30x speedup!)
In past versions and in the absence of custom directives, ACN was using uPER encodings for OCTET STRINGs. However this encoding is sub-optimal for large packets as it requires segmentation. This prevented fast memcpy encoding for sequence of bytes (when fields are aligned).
ACN encoding does not use this segmentation and ensures that OCTET STRING encodings are as fast as they could be.
The same logic will be applied to BIT STRING types in coming versions.
Version 4.3 - Update of the renaming policy to avoid name clashes
When using the -renamePolicy 3 option some code patterns were incorrectly generated in previous versions of the tool.
This concerns the automatic renaming of enumerated values and choice discriminants.
Updating the tool may have impact on your code if you were using this option before and in combination with the -typePrefix option.
There were cases where the type prefix appeared twice in the enumerated values.
Because the fix may break existing code, the version number has been increased (4.3).
The impact and the changes to update should be minimal however.
New features and bugfixes in ICDs (2022/05)
- Support for units in ICDs
Foo ::= SEQUENCE {
a Distance --{ km }--, -- units wil be reported in a dedicated column in the ICDs
...
}
- Fix issue with hyperlinks in ICDs
- Maintain comments in generated ASN.1 grammars when using -asn1 flag