Lesson 3: Implementing SWC by using RIMBOs
You can implement an atomic SWC type using Rhapsody Implementation Objects (RIMBOs).
About this task
Procedure
- Create a SWC implementation diagram under an ARBMT package. Right-click on the package, and select Add New > Diagrams > SWCImplDiagram.
- Drag the SWC type to be implemented into the diagram.
- Drag a RIMBO from the toolbox inside the SWC type box.
- Type the RIMBO by an existing RIMB.
- Connect the ports on the SWC type to ports on the RIMB
with the connectors from the toolbox.
- Use data connectors to connect sender/receiver ports
- Use service connectors to connect client/server ports
Note: Several RIMBOs may be placed and connected inside a given SWC type. AUTOSAR interface elements and implementation block interface elements are matched according to names. Therefore, when an AUTOSAR port connects to a implementation block port, an element in the interface for an AUTOSAR port is matched to an element in the interface for the implementation block according to the names of those elements.Restriction: You can place and connect several implementation block objects inside a given software component type, but not between each other.RIMB implementation code structure depends on the Internal-Behavior tag: “SupportMultipleInstamtiation”. When the tag “SupportMultipleInstantiation” is “False”, RIMB will not use context pointers (“me”, “self”). Generating RIMB as a singleton or file, for example, not generating a struct and not having “me” “self” pointers.
When the tag “SupportMultipleInstantiation” is “True”, RIMB will use context pointers (“me”, “self”):Encapsulate data in the C-structure of the RIMB
Have “me” argument for all operation except ActiveOperation
Have “Rte_Instance self’ parameter with the following operations:
User model operations
Statechart dispatchEvent & takeEvent operations
Triggered operations
Active operations
Add code in the beginning of each Active Operation, to extract the “me” pointer from the “Rte_Instance self” parameter, by calling Rte_PIM API
ARBMT accessor helper operation
mxf RiCReactive operations: RiCReactive_consumeEvent, RiCReactive_takeEvent, RiCReactive_takeTrigger, runToCompletion
No RIMBO data/instance declaration
No RIMB_Init operation
Integrator must call the <RIMB-class>_Init, <RIMB-class>_startBehavior
Create ARXML definition for the RIMB PIM under the InternalBehavior
Create a related typedefs in generated code
Limitations:-
The code can have circular dependency on types, as a result of the
Specification of the RTE
specifications. Those will have to be manually handled by theintegrator
. -
The “Rte_Instance self” parameter is not added to Statechart “entDef” operations
-
Optimized Statechart is not supported
-
All Runnable Entities must be in
Run in Exclusive Area
mode - A RIMB can type only a single RIMBO
- All elements related to the implementation of one Atomic SW/C, RIMB, RIMB Interfaces, and so on, must be in separate packages, and not mixed with those related to another Atomic SW/C
Related new properties:-
C_CG::Operation::OSContextName
-
C_CG::Operation::OSContextDeclType
-
C_CG::Operation::ActiveOperationExtractMeCall