Design and Use of CSP Meta-Model for Embedded Control Software - - PowerPoint PPT Presentation
Design and Use of CSP Meta-Model for Embedded Control Software - - PowerPoint PPT Presentation
Design and Use of CSP Meta-Model for Embedded Control Software Development Communicating Process Architectures 2012 Maarten Bezemer, Robert Wilterdink and Jan Broenink Robotics and Mechatronics, University of Twente, The Netherlands Outline
CSP Meta-Model for Embedded Control Software Development 2
Outline
- Introduction
- CSP Meta-Model
- Use Case
- Example
- Conclusions and Future Work
Demo afterwards!
CSP Meta-Model for Embedded Control Software Development 3
Introduction - Context
- Model-Driven Design tools help with development of complex
software
- CSP helps with development of concurrent software
- The combination helps with complex concurrent software
- Eg embedded control software for large(r) robots
CSP Meta-Model for Embedded Control Software Development 4
Introduction - Meta-Models
- Constituting elements of models is required
- Multiple tools (of a tool suite) need knowledge of the models
- Interchangeable models within a community
- A meta-model describes the format of a model
- A meta-meta-model describes the format of a meta-model
- etc.
- Models that conform to a meta-model use format that is known
- n before-hand
- No existing CSP meta-model available
with a focus on graphical modelling
CSP Meta-Model for Embedded Control Software Development 5
Base Meta-Model
- Modular design
- Base Meta-Model
- Component-Port-Connector (CPC) implementation
- Usable for multiple types of models
- Graph based models
- Communication based interfaces to external tools
- Basically any model having 'communicating' objects
BaseObject
name parent ...
BasePort BaseRelation BaseLink BaseDiagram IBaseContainerObject BaseModel
sub-model 0..1 parent links 0..1
- bjects
* 1 link ... ports container 1 1 * 2 relatedObjects
<<derived>>
2..*
CSP Meta-Model for Embedded Control Software Development 6
CSP Meta-Model
- Base Meta-Model + CSP constructs
CSPProcess CSPCompositionalGroup
groupedRelations
CSPCompositionalObject
relations
2 0..*
CSPCompositionalRelation
compositionalObjects group type
0..1 1..*
BaseObject BaseRelation
Base Meta-Model CSP Meta-Model
name ... relatedObjects 2..*
CSPWriter CSPReader
port variable
CSPPortVariableProcess BaseLink
ports
<<derived>>
CSPChannel
bufferSize
CSP Meta-Model for Embedded Control Software Development 7
CSP Meta-Model details
- Strict border between Base and
CSP Meta-Models
- Convenient for tools/editors
- All CSP objects/processes are
based on same CSP base object
- Even groups
- BaseRelation defines ANY relation
- Used to define compositional relations
- BaseLink defines a communicational relation
- Used to define communication channels
CSPProcess CSPCompositionalGroup
groupedRelations
CSPCompositionalObject
relations
2 0..*
CSPCompositionalRelation
compositionalObjects group type
0..1 1..*
BaseObject BaseRelation
Base Meta-Model CSP Meta-Model
name ... relatedObjects 2..*
CSPWriter CSPReader
port variable
CSPPortVariableProcess BaseLink
ports
<<derived>>
CSPChannel
bufferSize
CSP Meta-Model for Embedded Control Software Development 8
Use Case - TERRA
- Twente Embedded Real-time Robotic Application
- Eclipse based tool suite
- CSP Editor
- Model validation
- Model transformation
- CSP/FDR
→ Formal verification of model
- C++/LUNA →
Towards on target execution of model
CSP meta-model
(1.1.2)
CT meta-model FDR CSP meta-model Co-simulation engine
(3.3)
CSPm model CT model CSP model C++ code LUNA frame- work
+
conforms to conforms to conforms to
M2M (3.2) M2T
(3.1) based on based on
DE verification Simulation / CT verification Realisation
CSP Meta-Model for Embedded Control Software Development 9
Use Case – CSP Editor
- Graphical representation similar to gCSP
- More compact models, due to some changes
v
SYSTEM IO CONTROLLER
*
TILT SAFETY PAN
!
period
CSP Meta-Model for Embedded Control Software Development 10
Use Case – Model Validation
- Validation in editor
- Rules are defined by Meta-Model
'What to fill in where'
- Addition rules for transformations
- Keeps models compliant for model transformation
- Compatible with specific target transformation rules
- Object names must be correct and unique (CSP and C++ LUNA)
- Sub-models must be defined (CSP)
c
- n
t e x t C S P P r
- c
e s s { c r i t i q u e h a s S u b m
- d
e l { g u a r d : C
- d
e G e n D e s c r i p t i
- n
. i s U n d e f i n e d ( )
- r
C
- d
e G e n D e s c r i p t i
- n
= = " C S P " c h e c k : s e l f . s u b m
- d
e l . i s D e f i n e d ( ) m e s s a g e : " C S P c
- d
e g e n e r a t i
- n
w i l l f a i l : " + s e l f . n a m e + " d
- e
s n
- t
h a v e a s u b
- m
- d
e l s e t " } }
CSP Meta-Model for Embedded Control Software Development 11
Use Case – Model transformation
- Possible to use external expert tools
- FDR for formal verification of the models
- No need to reinvent these external tools!
- Put the models to actual use
- C++/LUNA code generation to execute model on target
- Prevent errors due to manual conversion of correct models
(The demo afterwards will show actual examples)
CSP Meta-Model for Embedded Control Software Development 12
Use Case – Model transformation
- Representation of model in CSP (FDR)
CSPm Meta-model representation Additional Attributes
p = ... CSPProcess CSPCompositionalGroup groupedRelations: relations that are grouped channel c CSPChannel ports: two connected ports / processes datatype <type> = <name> CSPVariableDescription
name: name of the variable type: boolean, integer...
c ! <var> CSPWriter
variable contains data link: channel to write to / read from
c ? <var> CSPReader p ; q CSPCompositionRelation type = SEQ or PAR or ALT compositionalObject: the two related objects p || q CSPCompositionRelation p [] q CSPCompositionRelation if-statement CSPRecursionProperty expression: true when another loop is required
CSP Meta-Model for Embedded Control Software Development 13
Example
- Corresponding CSP (FDR) code available in paper
- Real-life examples
- JIWY and Production Cell available
(JIWY will be showed in the demo afterwards)
v
APPLICATION THREAD2
*
READERS Calculations2 THREAD1
*
WRITERS Calculations1
!
firstValue
!
secondValue
?
readValue
?
readValue
! ?
Compositional Group Recursion Variable definition v
*
Writer Guarded Reader
LEGEND
<name>
<variable> <variable>
CSP Meta-Model for Embedded Control Software Development 14
Conclusions
- CSP Meta-Model usable to store CSP related models
- TERRA tool suite makes use of CSP Meta-Models
- Editors
- Validation
- Transformations to plain text
- Actual suitable for Embedded Control Software Development
- JIWY and Production Cell models are designed
- Used by students for their assignments
CSP Meta-Model for Embedded Control Software Development 15
Future Work
- Better integration between external modelling tools and TERRA
- 20-sim suitable for physics modelling
- Directly integrate 20-sim models as CSP sub-models
- Building blocks
- Provide standard Control Software functionality
- Generic Architecture Component as a template/skeleton block
- Simulation and co-simulation capabilities
- Better understand of models
- Able to test a control model using a dynamics model of the plant
CSP Meta-Model for Embedded Control Software Development 16
“Hopefully a standard meta-model will emerge that is suitable for the needs of the community and helping to improve interaction between multiple disciplinaries within the community.”
- Standard storage format
- Interchangeable with the tools developed within our community
- Tighter cooperation!
CSP Meta-Model for Embedded Control Software Development 17