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 Introduction CSP Meta-Model Use Case Example Conclusions and Future Work Demo afterwards! CSP Meta-Model for Embedded Control Software Development 2
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 3
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 on before-hand No existing CSP meta-model available with a focus on graphical modelling CSP Meta-Model for Embedded Control Software Development 4
Base Meta-Model Modular design Base Meta-Model Component-Port-Connector (CPC) implementation BaseObject IBaseContainerObject BaseRelation relatedObjects name objects 2..* * parent 1 ... <<derived>> BaseDiagram BaseLink BasePort BaseModel ports link sub-model parent 2 1 0..1 0..1 container ... links 1 * Usable for multiple types of models Graph based models Communication based interfaces to external tools Basically any model having 'communicating' objects CSP Meta-Model for Embedded Control Software Development 5
CSP Meta-Model Base Meta-Model + CSP constructs Base Meta-Model CSP Meta-Model CSPReader CSPWriter CSPProcess CSPPortVariableProcess port variable CSPCompositionalObject BaseObject 0..* relations name ... CSPCompositionalGroup groupedRelations 1..* CSPCompositionalRelation compositionalObjects 2 BaseRelation group 0..1 type relatedObjects 2..* <<derived>> BaseLink CSPChannel ports bufferSize CSP Meta-Model for Embedded Control Software Development 6
CSP Meta-Model details Base Meta-Model CSP Meta-Model CSPReader CSPWriter Strict border between Base and CSP Meta-Models CSPProcess CSPPortVariableProcess port variable Convenient for tools/editors BaseObject CSPCompositionalObject 0..* relations name ... CSPCompositionalGroup All CSP objects/processes are groupedRelations 1..* based on same CSP base object CSPCompositionalRelation compositionalObjects 2 BaseRelation group Even groups 0..1 type relatedObjects 2..* <<derived>> BaseLink CSPChannel ports bufferSize BaseRelation defines ANY relation Used to define compositional relations BaseLink defines a communicational relation Used to define communication channels CSP Meta-Model for Embedded Control Software Development 7
Use Case - TERRA Twente Embedded Real-time Robotic Application CSP FDR CSP CT meta-model meta-model meta-model (1.1.2) conforms to based on based on conforms to conforms to M2M (3.2) Co-simulation CSP CSPm CT engine model model model (3.3) DE verification Simulation / CT verification M2T (3.1) C++ code Eclipse based tool suite + CSP Editor LUNA Model validation frame- work Model transformation Realisation CSP/FDR → Formal verification of model C++/LUNA → Towards on target execution of model CSP Meta-Model for Embedded Control Software Development 8
Use Case – CSP Editor v SYSTEM * CONTROLLER PAN SAFETY IO TILT ! period Graphical representation similar to gCSP More compact models, due to some changes CSP Meta-Model for Embedded Control Software Development 9
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 o n t e x t C S P P r o c e s s { e l { c r i t i q u e h a s S u b m o d " C S P " r d : C o d e G e n D e s c r i p t i o n . i s U n d e f i n e d ( ) o r C o d e G e n D e s c r i p t i o n = = g u a c h e c k : s e l f . s u b m o d e l . i s D e f i n e d ( ) " + s e l f . n a m e + " d o e s n o t m e s s a g e : " C S P c o d e g e n e r a t i o n w i l l f a i l : h a v e a s u b - m o d e l s e t " } } CSP Meta-Model for Embedded Control Software Development 10
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 11
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> CSPVariableDescription name : name of the variable = <name> 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 p || q CSPCompositionRelation compositionalObject : the two related objects p [] q CSPCompositionRelation if-statement CSPRecursionProperty expression : true when another loop is required CSP Meta-Model for Embedded Control Software Development 12
Example v APPLICATION * * THREAD1 THREAD2 LEGEND WRITERS READERS <name> Compositional Group ! ? ! Writer firstValue readValue <variable> Calculations1 Calculations2 ? Guarded Reader ! ? <variable> * Recursion secondValue readValue v Variable definition Corresponding CSP (FDR) code available in paper Real-life examples JIWY and Production Cell available (JIWY will be showed in the demo afterwards) CSP Meta-Model for Embedded Control Software Development 13
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 14
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 15
“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 16
CSP Meta-Model for Embedded Control Software Development 17
Recommend
More recommend