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 ConceptsActivity code generation is part of the Components generation as presented in [1] is invoked during execution of UML to C operation as presented in [3]. This document focuses on the C code generation for the activity. Supported ElementsHere is an exhaustive list of elements used by the code generator to produce the Code with a summary of the purpose and impact.
Note: An activity is expected to be executed via a PeriodicExecution. So neither a ChangeEvent, nor a TimeEvent, nor a SignalEvent can be used to wakeup the activity. Instead during the periodic execution, the activity pools the events fired between execution 2 cycles. Code Generator Specification
This section is divided in 2 parts:
Files Specifications
The activity code is composed of 2 files:
General requirements releated to file content are described in [2]. <Behavior>.c<Behavior>.c file implements the activity structure. This structure is implemented via a function mainly containing a switch block. Each case represents a state. Transitions are manages via if conditions at end of case. Opaque behavior associated to each state or transition is implemented in the separated <Behavior>_usr.c. File <Behavior>.c is generated for each statemachine which is either the classifier behavior or is a behavior called directly or indirectly by the classifier behavior. Name of File <Behavior>.c is described in [1]. 3 basic functions are generated as following:
<Behavior>.h<Behavior>.h file implements the statemachine opaque behaviors. The opaque behavior of each state or transition is generated in a dedicated function. File <Behavior>.h is generated for each statemachine which is either the classifier behavior or is a behavior called directly or indirectly by the classifier behavior. Name of File <Behavior>.h is described in [1]. Behavior Code Specifications
This section describes the behavior of the code generator depending on the UML/SysML element. Pseudo State InitialExample: The pseudo state initial is the entry point of a statemachine. One initial state is mandatory in a statemachine. Call Operation ActionA Call Operation Action is used to invoke a Operation from an Action. A node is generated for each Call Operation Action part of the Activity. Local variables are declared for each input and output parameter of the node. For input parameters, local variables are assigned with the value transmitted by the flows. The operation referenced the call operation action is invoked with the variables declared previously. Parameters having a Type Modifier * are transmitted via their address. For output parameters, output flows are assigned with the value of the local variables. Return type can be part of the output parameters, in this case, this parameter does not have any name.
/* node CallOperationAction */
/* @generated_from _2024x_2_16600ad_1719502041513_429240_19001 */
if(12u == (instance->flow[0] & 12u)) { /* TST_FLOW<-s1 & result */
{
Integer in1 = instance->data0;
Integer in2 = instance->data1;
Integer retVal = add(in1, in2);
instance->data2 = retVal;
}
instance->flow[0] ^= 12u; /* CLR_FLOW<-s1,result */
instance->flow[0] |= 16u; /* SET_FLOW->s1 : Integer */
}
Example: Node for a call operation action | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||