OS Integration

The ARXF-CP has been adapted to AUTOSAR compatible Operating System.

Message Queues

The AUTOSAR OS supports no message queue, but the ARXF-CP uses an event queue per task which operates as a FIFO mechanism. Events are allocated in the static memory pools, allocated per SW-C instance. When one object sends a UML event to another object, only the pointer to the event is sent. Moreover, the message queue is implemented as a head and a tail pointer; it can grow dynamically and is not allocated as such.

Task

For each active class, an OS task is used. All sequential classes run in the so-called swc task. See Concurrency

Task details including stack and priority are specified in an AUTOSAR tool as part of the Basic Software or BSW. OS tasks are configured statically: tasks are not created at runtime when an active class is created.

The properties CG::Class::ActiveMessageQueueSize and CG::Class::ActiveStackSize are not used in ARXF_CP_V8.0.1.

Critical Region Handler

By default, the ARXF-CP uses the AUTOSAR mechanism of an exclusive area for critical region handlers: the RTE will generate a entry- and exit function for each exclusive area defined.

An exclusive area must be specified at the AUTOSAR level per SWC. Code generation for composing RTE function pointers require:

The enter- and exit functions are generated by the RTE: within the RTE configuration it is defined which interrupts are blocked: this is ALL_INTERRUPT_BLOCKING or OS_INTERRUPT_BLOCKING, but also the BSW scheduler configuration and OS task types are of influence.

The ARXF-CP requires at least three exclusive areas:

When the ARXF-CP is initialized, usually at SW-C initialization time, a call to RXF_SWC_Init() is performed, passing the function pointers to the RTE generated entry- and exit functions as arguments.

It is possible to safeguard critical regions yourselves:

You can also use the properties to specify your own critical region handler. This is done via properties set on the Code Generation tab of the ARXF-CP Configuration.

Timer

The ARXF-CP does not set any timer, but it does need a regular heartbeat. In the Getting Started examples, the runnable <swc>_eventDispatcherSwc is used, which is called by the RTE every 10 msec.

The timer granularity must match the value of RXF_MS_PER_TICK, see List of Defines

The ARXF-CP uses a global counter which is local per SW-C instance. This counter needs to be incremented. The resolution determines the timeouts you can effectively specify in your model: if the runnable is called every 100 msec, specifying tm(10) makes no sense..
See Realtime behavior for further details.

sample code snippet taken from a <swc>_eventDispatcherSwc:


Explanation: