Code Generation

The code generation for this ARXF-CP has been adapted to relief you from specifying AUTOSAR details needed by the ARXF-CP, yet allows you to modify the default behavior of the code generation.

We use string patterns which are replaced during code generation. These string patterns can be used in two locations:

We use the following string patterns which are replaced during code generation:

Examples:

SWCs

Code is generated to initialize the critical region handlers used by the ARXF-CP and add AUTOSAR details to an internal task structure. The RTE APIs used are function pointers which names are composed using the exclusive areas and inter-runnable variables.

To understand which inter-runnable variables belong to which runnables used for UML event dispatchers, the code generation needs two relations:

To understand which exclusive areas belong to which runnables, the code generation needs:




Active Classes

Code is generated to add AUTOSAR details to an internal task structure. The RTE APIs used are functions which names are composed using the inter-runnable variables and exclusive areas.

To understand which inter-runnable variables belong to which runnables used for UML event dispatchers, the code generation needs two relations:

To understand which exclusive areas belongs to runnables used for UML event dispatchers, the code generation needs:




On the the ARXF-CP Configuration Code Generation tab you can specify which RTE function must be called if a UML event is added to the event queue of an active class.
Use an empty property ARXF_CP::CodeGeneration::RTEtriggerUMLeventDispatcherActiveClass if the runnable is triggered already (for example cyclic) depending on the RTE configuration for this runnable.

Runnables

An SW-C modelled in Rhapsody using the ARXF-CP has different kinds of runnables:

ARXF-CP Event Dispatchers

Some runnables are used as UML event dispatchers: such runnable processes the UML event queue for that task. An SWC uses its own task and each active class uses its own task. When a UML event is added to the event queue of another task, that task must be triggered by the RTE in case that task is sleeping. For this, you must use a function provided by the RTE if that runnable is not already triggered for example:

You can specify the name of the RTE trigger on the the ARXF-CP Configuration Code Generation tab. The name of the RTE trigger is passed as function pointer to a RXF_Active_Init() generated to initialize an SWC or active class.