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 ConceptsConstraint code generation if part of the Behavior Layer in Figure 1 and is produced during the behavior code generation. ![]() The Behavior layer is composed of components see [1] for more details. If we zoom in the Behavior Layer and more specifically on Component1, it is composed as displayed in the Figure 2. ![]() As displayed the code of the component is composed of multiple layers:
This document focuses on the behavior part and more specifically on the C code generation for the constraints. We need a schema of principle on the constraints usage by behavior Constraints are used directly in the various behaviors accessing variables connected to the constraint blocks automatically. 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.
Validation Constraints- Code Generator Specification
This section is divided in 2 parts:
Files Specifications
The Constraint blocks generation is composed of:
General requirements related to file content are described in [2]. <Class name>_Constraints.hThis file declares the list of functions implementing the constraints offered by the constraint blocks referenced via a Constraint Property in the Class. Include to <Class name>.h is inserted after header. Macro definition is inserted to open the C functions declaration section. (This requirement may be removed) A function is declared for each constraint property. See Chapter 9.2 for more details depending on the elements. Macro definition is inserted to close the C functions declaration section. (This requirement may be removed)
#include "<Class name>.h"
#ifdef __cplusplus
extern "C" {
#endif
<CONSTRAINT_FCT_DECLARATION – see chapter 9.2>
#ifdef __cplusplus
}
#endif
Example: Include and C functions section. <Class name>_Constraints.cThis file implements the list of functions implementing the constraints offered by the constraint blocks referenced via a Part Property in the Class. Include to <Class name>_Constraints.h is inserted after header. A function is implemented for each Constraint property. See Chapter 9.2 for more details depending on the elements. #include "<Class name>_Constraints.h" <CONSTRAINT_FCT_IMPLEMENTATION – see chapter 9.2> Example: Include and implementation of constraints Semantic Code Specifications
This section describes the behavior of the code generator depending on the UML/SysML element. Constraint PropertyCONSTRAINT_FCT_DECLARATIONA function is declared for each Constraint property. A documentation is generated for each function. Function name is composed of the constraint property name if any and the constraint block name. (Validation rule required: constraint block name) Function takes a pointer to the top class structure as unique argument. Function returns a pointer to the top class structure. /** * Constraint block declaration : <Constraint property>_<Constraint block> * @generated from: <constraint block uuid> */ <Class name> * <Constraint property>_<Constraint_block>(<Class name> * inst); Example: Function declaration CONSTRAINT_FCT_IMPLEMENTATIONA function is declared for each Constraint property. A documentation is generated for each function. Function name is composed of the constraint property name if any and the constraint block name. (Validation rule required: constraint block name) Function takes a pointer to the top class structure as unique argument. Function returns a pointer to the top class structure. Function starts by initiating parameters with the data connected to parameters. Constraint specification is printed after parameters initialization. Each parameter value is replicated to data connected to parameter.
/**
* Constraint block declaration : <Constraint property>_<Constraint block>
* @generated from: <constraint block uuid>
*/
<Class name> * <Constraint property>_<Constraint_block>(<Class name> * inst){
/* Init constraint parameters */
<INIT_PARAMETERS>
/* Constraint specification */
out=in1+in2;
/* Update binded data */
<REPLICATE_PARAMETERS>
return inst;
}
Example: Constraint Function implementation Constraint ParameterINIT_PARAMETERSA variable is created for each constraint parameter with the name of the parameter and its type. The constraint parameter variable is initiated with the value of the connected property or flow ports. These values are stored in the Top Class entity. <Type> <param name> = inst-><property name>; Example: Parameter creation REPLICATE_PARAMETERSThe constraint parameter variable value is copied to the connected property or flow ports. inst-><property name> = <param name>; Example: Parameter value replication | |||||||||||||||||||||||||||||||||||