Banners in the Generated Code

ASCET provides the possibility to insert user-defined banners in the *.c and *.h files generated via the File > Export > Generated Code menu option or via the Build > View Generated Code, > Experiment, or – in the project editor – > Build All or > Rebuild All menu options.

For that purpose, two banner template files (named, e.g., banner.template.c for generated *.c files and banner.template.h for *.h files) can be assigned to a project or default project, in the Build node of the Project Properties window.

The default location for banner template files is the target root directory ETAS\ASCET6.4\target. If you use the default location, but no banner.template.c or banner.template.h files are found when one of the menu options mentioned above is called, default template files will be generated for both. You can adapt these files to create your own banners.

Note

If you enter a non-default location, or non-default file names, in the Build node, and these files are not found during code generation, no default files are created.

A banner template file can contain fixed text and macros. The macros will be expanded when the banner is inserted into a code or header file. In addition to the macros in the default template file, the macros listed in the Closedfollowing table can be used.

Macro

Remarks

$(COMPONENT.KIND)

one of the following: Project, Module, Class, CtClass, Statemachine, BooleanTable, ConditionalTable, Software Component

$(COMPONENT.NAME)

model name of the component

$(COMPONENT.SPECIFICATION)

one of the following: Block_Diagram, ESDL, C Code, Operating System, Boolean Table, Record, State Machine;

<not applicable> for projects.

$(COMPONENT.VERSION)

version string if the component is subject to version management (<empty string> otherwise)

$(COMPONENT.IMPLEMENTATION)

currently used implementation

$(COMPONENT.DATASET)

currently used dataset

$(FILE.NAME)

name of the generated file

$(FILE.EXTENSION)

extension of the generated file

$(FILE.DESCRIPTION)

description of the generated file

$(FILE.DATE)

creation date of the generated file

$(FILE.TIME)

creation time of the generated file

$(ASCET.USER)

current user

$(ASCET.VERSION)

ASCET version used to create the generated file

$(ASCET.MD.VERSION)

ASCET‑MD version used to create the generated file

$(ASCET.RP.VERSION)

ASCET‑RP version used to create the generated file

$(ASCET.SE.VERSION)

ASCET‑SE version used to create the generated file

Note

Changes in a banner template file apply to all projects that use this particular banner template file.

In previous ASCET versions, the inserted banners could not be modified by the user. To provide compatibility with previous versions, this behavior can be re-activated for individual targets in ASCET‑SE (see Activating Old Behavior for Banners). The cs_overload.pm file in the ETAS\ASCET6.4\target\trg_<targetname>\cp_rules\ custom directory contains the switch to the old behavior.

See also

Default Banner Template File

Example: Banner With All Macros

Activating Old Behavior for Banners