Example: User-Defined System Constants File
This example file is available as template file *.ascd.xml.template is provided in the Tools\System Constant subdirectory of your ASCET installation.
<?xml version="1.0"encoding="US-ASCII"?>
<OptionDeclarationsxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="..\..\Schemas\externalOptions.xsd">
<!-- mandatory, fixed options -->
<OptionDeclarationoptionCategory="FIXED"xmlCategory=""optionClass="EtasStringOption"attributeName="identifier">
<Group/>
<Description>Unique name for ASCET internal management of this system constant.</Description>
<Tooltip>Identifier for the system constant</Tooltip>
<DefaultValue>mySystemConstant</DefaultValue>
</OptionDeclaration>
<OptionDeclarationoptionCategory="FIXED"xmlCategory=""optionClass="EtasStringOption"attributeName="label">
<Group/>
<Description>Unique name to display the system constant in ASCET, e.g. as element property "kind".</Description>
<Tooltip>Name of the system constant</Tooltip>
<DefaultValue>My System Constant</DefaultValue>
</OptionDeclaration>
<!-- required, variable options -->
<OptionDeclarationoptionCategory="FILE"xmlCategory=""optionClass="EtasFileOption"attributeName="icon">
<Group/>
<Description>Specify an icon file used as overlay for this system constant in the outline tree, the properties grid etc. Leave empty if no overlay is needed.</Description>
<Tooltip>Overlay for specific system constant</Tooltip>
<DefaultValue></DefaultValue>
</OptionDeclaration>
<OptionDeclarationoptionCategory="FILE"xmlCategory=""optionClass="EtasEnumerationOption"attributeName="resolveSystemConstants">
<Group/>
<Label>Resolve System Constant</Label>
<Description><![CDATA[ASCET System Constants are resolved at a specific time during the build process. The following alternatives are supported by ASCET<br/>
<ul>
<li>Generation Time: The system constant behaves like a literal. It can be used by the code generation for optimization.</li>
<li>Compile Time: The system constants are generated as C code macros (via #define statements) and can be used by the compiler for optimizations. If code is generated for an AUTOSAR project, such system constants are generated through the RTE with the binding time specified in the AUTOSAR settings.</li>
<li>RTE Generation Time: The system constants are generated through the AUTOSAR RTE with binding time "RTE GenerationTime", if code is generated for an AUTOSAR project. Behaves like "Compile Time" otherwise.</li>
<li>RTE PreCompile Time: The system constants are generated through the AUTOSAR RTE with binding time "RTE PreCompileTime", if code is generated for an AUTOSAR project. Behaves like "Compile Time" otherwise.</li>
<li>Compile Time (No RTE): The system constants are generated as C code macros (via #define statements) and can be used by the compiler for optimizations. System constants are never generated through the RTE.</li>
<li>Run Time: The system constants behaves like a parameter, i.e. there is a memory address where the value of the system constant can be read from during run time.</li>
<li>Default: The system constants of this kind are resolved in the same way the ASCET build in system constants are resolved, i.e. per target option.</li>
</ul>
]]></Description>
<Tooltip>Binding Time</Tooltip>
<DefaultValue>default</DefaultValue>
<EnumerationOption>
<StringValues>
<StringValue>Default</StringValue>
<StringValue>Generation Time</StringValue>
<StringValue>Compile Time</StringValue>
<StringValue>RTE Generation Time</StringValue>
<StringValue>RTE PreCompile Time</StringValue>
<StringValue>Compile Time (No RTE)</StringValue>
<StringValue>Run Time</StringValue>
</StringValues>
<Values>
<Value>default</Value>
<Value>generationTime</Value>
<Value>compileTime</Value>
<Value>RTEGenerationTime</Value>
<Value>RTEPreCompileTime</Value>
<Value>compileTimeOnly</Value>
<Value>runTime</Value>
</Values>
</EnumerationOption>
</OptionDeclaration>
<OptionDeclaration optionCategory="FILE"xmlCategory=""optionClass="EtasEnumerationOption"attributeName="optimizeSystemConstants">
<Group/>
<Label>Optimization Level</Label>
<Description><![CDATA[ASCET System Constants have the following three optimization levels:<br/>
<ul>
<li>Constant Folding: The initial value of the system constant is used directly in the generated code and constant folded with other constants, if possible. Only available if the
resolution time is "Generation Time".</li>
<li>Case Distinction: Conditions with such system constants are used to create a case distinction (regular if or #if, depending on the resolution time), and the branches are optimized for these cases.</li>
<li>None: No optimizations are performed, the system constants are treated like a parameter.</li>
<li>Default: depending on the resolution time, this resolves as follows:<br/>Generation Time -> Constant Folding<br/>Compile Time -> Case Distinction<br/>Run Time -> None.</li>
</ul>
]]></Description>
<Tooltip>Optimization Level</Tooltip>
<DefaultValue>default</DefaultValue>
<EnumerationOption>
<StringValues>
<StringValue>Default</StringValue>
<StringValue>Constant Folding</StringValue>
<StringValue>Case Distinction</StringValue>
<StringValue>None</StringValue>
</StringValues>
<Values>
<Value>default</Value>
<Value>constantFolding</Value>
<Value>caseDistinction</Value>
<Value>none</Value>
</Values>
</EnumerationOption>
</OptionDeclaration>
<OptionDeclarationoptionCategory="FILE"xmlCategory=""optionClass="EtasContainerOption"attributeName="externalPackageNameUsed">
<Group/>
<Label>Autosar: Use external package with system constant definition</Label>
<Description>Enable, if the system constant is defined in an external package. The option is ignored for generation without Autosar. In case the Resolve Time of the System Constant is Generation Time or Run Time an error message is produced in case Autosar is used. </Description>
<Tooltip>System constant defined in external package</Tooltip>
<DefaultValue>false</DefaultValue>
<ContainerOptionchangeable="true">
<OptionDeclarations>
<OptionDeclarationoptionCategory="FILE"xmlCategory=""optionClass="EtasStringOption"attributeName="externalPackageName">
<Group/>
<Label>External Package Name</Label>
<Description>Package name, where the system constant is defined. The allowed parameters are the same as for the system constant package defined in the Project Options -> ARXML Configuration Settings -> PackageTemplates -> System Constant</Description>
<Tooltip/>
<DefaultValue>/ASCET_SystemConstants/%ELEMENT.CNAME%</DefaultValue>
</OptionDeclaration>
<OptionDeclarationoptionCategory="FILE"xmlCategory=""optionClass="EtasStringOption"attributeName="externalValueSetPackageName">
<Group/>
<Label>External Value Set Package Name</Label>
<Description>Package name, where the value of the system constant is defined. Allowed Template Parameter: %SWCOMPONENT.DATASET% - Name of dataset used for the associated AUTOSAR Software Component. </Description>
<Tooltip/>
<DefaultValue>/ASCET_SystemConstantValues/%SWCOMPONENT.DATASET%</DefaultValue>
</OptionDeclaration>
</OptionDeclarations>
</ContainerOption>
</OptionDeclaration>
</OptionDeclarations>