Glossary
| Acronym | Definition |
|---|---|
| SPO | Software Production Operation |
| BL | Behavior Layer |
| ML | Middleware Layer |
| BSM | Behavior Specific Middleware |
| TSM | Target Specific Middleware |
Glossary
Referenced Documents
General ConceptsUML & SysML to AUTOSAR Runnable Code generator is an operation generating C code from AUTOSAR architecture designed following UML and SysML standards. This specification document is focused on the generation of code resulting on UML model allocation to AUTOSAR design. Supported ElementsHere is an exhaustive list of elements used by the operation UML & SysML to AUTOSAR Runnable Code to produce the artefacts with a summary of the purpose and impact.
Validation ConstraintsNo validation constraints Code Generator Specification
This section is divided in 2 parts:
Files Specifications<ARComponentName>.cFile Naming and Structure
See chapter Code Generator Specification / Files
Specifications /
In the following requirements:
In the context of UML model allocation to the AUTOSAR design,
the file
#include "<UMLClassName>_cls.h"
#include "<UMLInterfaceName>_itf.h"
#include "Tal_struct.h" #include "tal_Timer.h" #include "Tal_Events_Handler.h"
#include "Cse_cfg.h" #include "Cse_objects.h"
#include "Rte_<ARComponentName>.h" Following standard headers are also included: #include <stdbool.h> #include <string.h> Semantic Code Specifications
In the following requirements:
Target Abstraction Layer (TAL)
The Target Abstraction Layer (TAL) provides an abstraction of target services, enabling the implementation of behavior independent of any specific target platform. It abstracts a set of services that may be required by the generated code. The generated code relies on a TAL instance local to the atomic component. This TAL manages local timing for the dispatching of timing events and the overall event dispatch mechanism. The definition of the TAL for the current component is implemented in a dedicated code section. /********************************************************************************** * Target Abstraction Layer Section **********************************************************************************/ Variables, macros, and functions related to the TAL are generated within this code section. Event Triggering Function trigSignalThe generator creates a function that handles incoming events and triggers the targeted RunnableEntities according to the AUTOSAR configuration.
The generated function is named
The function The function processes each incoming event in the event pool and triggers the appropriate RunnableEntities according to the AUTOSAR configuration.
/**********************************************************************************
* Function triggering signals
**********************************************************************************/
void trigSignal(Tal_EventPool *pool, Tal_Event* ev) {
// Trigger signals transmitted to other behaviors
if(pool == &pmyButton->button_cls_btn_stm_eventPool){
switch(ev->eventId) {
default: {
/* default */
break;
}
}
}
if(pool == &pmyController->controller_cls_ctl_stm_eventPool){
switch(ev->eventId) {
case CONTROLLER_CLS_EVENT_T_evPushPressedAndReleased: {
Rte_IrTrigger_Flashlight_button_run_itp_ctl_stm_se_evPushPressedAndReleased();
break;
}
case CONTROLLER_CLS_EVENT_T_TE_controller_cls_ctl_stm_1: {
Rte_IrTrigger_Flashlight_controller_run_itp_ctl_stm_te_5000ms();
break;
}
case CONTROLLER_CLS_EVENT_T_TE_controller_cls_ctl_stm_3: {
Rte_IrTrigger_Flashlight_controller_run_itp_ctl_stm_te_500ms();
break;
}
default: {
/* default */
break;
}
}
}
}
Example: Definition of
TAL_Handler_<ARComponentName>The TAL Handler Runnable Entity is an extra periodic runnable added by the generator and required by the TAL.
The Runnable Entity function is named:
The function
FUNC(void, <ARComponentName>_CODE) TAL_Handler_<ARComponentName>(void){
/* Instantiate the Target Abstraction Layer */
initRun();
/* Timer Service */
tal_incrementTick();
/* Events Handler Service */
tal_dispatchEvents();
}
Example: Definition of
Component initializationThe generator creates a function for invoking the initialization of:
The generated function is named
The initialization performed by
The definition of
/**********************************************************************************
* Component Initialization
**********************************************************************************/
static void initRun(void){
static bool initDone = false;
if(!initDone){
// Instantiate the Target Abstraction Layer
Tal_init(&TAL_NAME);
// Initialize the Communication Scheduling Environment
Cse_component_instances_init();
Cse_component_relations_init();
Cse_components_init();
initDone=true;
}
}
where:
The function initRun() is called by every RunnableEntity function. The call to initRun() occurs after the declaration of variables related to RTE APIs and before the invocation of input RTE APIs.
FUNC(void, <ARComponentName>_CODE) <RunnableName>(void)
{
/* Local data declaration */
VAR(<TypeName>, AUTOMATIC) data_<RteApiRootName>_<PortName>_<DataName>;
/* Runnable Initialization */
initRun();
/********************************************************************************/
/* BEG_USER_CODE(user_data_declaration_<RunnableId>) do not remove */
/* Add your data declarations here */
/* END_USER_CODE(user_data_declaration_<RunnableId>) do not remove */
/********************************************************************************/
data_<RteApiRootName>_<PortName>_<DataName> = Rte_IRead_<PortName>_<DataName>();
...
}
Example: Call of Properties or Operations allocation to AUTOSAR Access Points
The following figure illustrates how a Property or an Operation can be allocated in CATIA Magic. Allocation of properties and operations to AUTOSAR access points UMLandSysMLtoARAllocation_Properties_Operations_to_AUTOSAR_Access_Points The allocation of a class instance to an AUTOSAR software component is represented in the CATIA Magic model by a UML Software Mapping relation between the class instance and the AUTOSAR software component. A Software Mapping relation is derived from Abstraction relation, with two additional parameters: - context: refers to a class instance which classifier must be class which owns property/operation - orderId: sets order in which mapping information is handled in runnable entity Properties allocationIf the allocation fulfills the following conditions:
then the property is assigned as follows: VAR(<TypeName>, AUTOMATIC) data_<DataName>; data_<DataName> = Rte_<RteApiName>(); <PointerNameToClassInstance>-><Property> = data_<DataName>; where:
If the allocation fulfills the following conditions:
then the property is assigned as follows: P2CONST(<TypeName>, AUTOMATIC, RTE_APPL_DATA) data_<DataName>; data_<DataName> = Rte_<RteApiName>(); <PointerNameToClassInstance>-><Property> = *data_<DataName>; where:
If the allocation fulfills the following conditions:
then the assignment is performed according to the direction of the AUTOSAR Data Access as follows:
where:
If the allocation fulfills the following conditions:
then the assignment is performed according to the direction of the AUTOSAR Data Access as follows:
where:
Operations allocationIn the following requirements:
Function pointers to
typedef struct {
void (*<UMLOperationName>_)(struct <UMLClassInterfaceName>_itf_* self);
void (*<UMLOperationNotARName>_)(struct <UMLClassInterfaceName>_itf_* self);
...
} <UMLClassInterfaceName>_vtable;
typedef struct {
void (*<UMLOperationName>_)(struct <UMLClassInterfaceName>_* self);
void (*<UMLOperationNotARName>_)(struct <UMLClassInterfaceName>_* self);
} Led_vtable;
Both functions void <UMLOperationName>(struct <UMLClassInterfaceName>_* self); void <UMLOperationNotARName>(struct <UMLClassInterfaceName>_* self);
Both functions
If a UML Operation is allocated to an AUTOSAR Operation Access
(and therefore depends on AUTOSAR), then the definition of the
UML Operation
void <UMLOperationName>(struct <UMLClassInterfaceName>_* self)
{
Rte_Call_<AUTOSAROperationName>();
Rte_Result_<AUTOSAROperationName>();
}
Example: Definition of AUTOSAR dependent function
If a UML Operation is allocated to an AUTOSAR Operation Access
(and therefore depends on AUTOSAR), then the UML Operation
extern void <UMLOperationName>(struct <UMLClassInterfaceName>_* self); Behaviors allocation to Runnable Entities![]() The allocation of a behavior to an AUTOSAR runnable entity is represented in the CATIA Magic model by a UML Abstraction relation between the behavior and the corresponding AUTOSAR runnable entity.
If a UML Statemachine is allocated to an AUTOSAR runnable
entity, its main function
FUNC(void, <ARComponentName>_CODE) <ARRunnableEntityName>(void)
{
...
// Invocation of input RTE APIs
data_<DataName1> = Rte_<RteApiName1>();
<PointerNameToClassInstance>-><Property1> = data_<DataName1>;
// appel statemachine button
<StatemachineName>_main(<PointerNameToClassInstance>);
// Invocation of output RTE APIs
data_<DataName2> = <PointerNameToClassInstance>-><Property2>;
retdata_<RteApiName2> = Rte_<RteApiName2>(data_<DataName2>);
}
where:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||