papyrusrt: modelling and code generation
TRANSCRIPT
© 2014 Zeligsoft
Improving embedded software development productivity
PapyrusRT: modelling and code generation
Ernesto PosseZeligsoftSeptember 29, 2015OSS4MDE’15 – Ottawa, Canada
Improving embedded software development productivity
© 2014 Zeligsoft
What is PapyrusRT?
• A new open-source MDE environment for UML-RT
• Based on Papyrus, a Eclipse-based environment for UML
• UML-RT: UML-based language for real-time embedded systems
Improving embedded software development productivity
© 2014 Zeligsoft
Collaboration
• Zeligsoft (codegen, runtime, CDT int.)• CEA List (tooling, validation, import, CDT int.)• Bran Selic (profile)• Ericsson (req., C++ profile, interm. repr.)• Peter Cigéhn (req., testing)• IncQuery Labs (interm. repr.)
Improving embedded software development productivity
© 2014 Zeligsoft
Why?
• UML-RT history:– 1987: Telos project at BNR– 1992: ObjectTime– 1994: ROOM (Selic, B., Gullekson, G. and Ward, P.)– 1998: UML-RT (Selic, B., Rumbaugh, J.) – 2000: Rational RoseRT– 2006: IBM RSA Real Time Edition
Improving embedded software development productivity
© 2014 Zeligsoft
Why?
• Proprietary tools limit extensibility and customizability
• Need to support existing user base• Need of an open-source solution
Improving embedded software development productivity
© 2014 Zeligsoft
Why Papyrus?
• Already supports UML 2.5• Rich UI• Open-source• Rich Eclipse ecosystem
Improving embedded software development productivity
© 2014 Zeligsoft
UML-RT
• Object-Oriented• Concurrent• Real-Time systems• UML with constraints
– Composite Structure Diagrams– State Machine Diagrams
Improving embedded software development productivity
© 2014 Zeligsoft
UML-RT
• Capsules (Actors):– Active classes– Strong encapsulation and well defined interfaces
(ports typed by Protocols)– Behaviour: hierarchical state machines– Structure: May contain parts (sub-capsules)– Communication by message-passing (connectors)
Improving embedded software development productivity
© 2014 Zeligsoft
UML-RT: capsules
Improving embedded software development productivity
© 2014 Zeligsoft
UML-RT: state machines
Improving embedded software development productivity
© 2014 Zeligsoft
UML-RT cont.
• Protocols:– Port types– Protocol messages (signals):
• Input• Output• Input/output
– Protocol message parameters– Port role: base/conjugated
Improving embedded software development productivity
© 2014 Zeligsoft
UML-RT dynamic structure
• Capsule roles:
• Capsule instances are associated to threads• Services:
– SAPs and SPPs with dynamic wiring– Library: Timing, Log, Frame
Role Instantiation Ownership Life-time
Fixed static container = container
Optional dynamic container <= container
Plugin dynamic independent independent
Improving embedded software development productivity
© 2014 Zeligsoft
UML-RT execution semantics
• Runtime system• Controllers
– Each capsule is associated to a controller– A controller executes a “main” loop– Handles messages addressed to its capsules– Manages the capsule’s lifetimes
Improving embedded software development productivity
© 2014 Zeligsoft
Code generation
• Target language:– Now: C++03– Later: Java
• Target OS:– Now: Linux– Later: Windows, others
• Legacy applications
Improving embedded software development productivity
© 2014 Zeligsoft
Demo (early adopters version)
Improving embedded software development productivity
© 2014 Zeligsoft
Code generation
• Transformation
• Implemented in Java and Xtend• Supports incremental generation
Improving embedded software development productivity
© 2014 Zeligsoft
Code generator structure
Improving embedded software development productivity
© 2014 Zeligsoft
Some challenges
• Introducing an intermediate meta-model:– Designing the meta-model– Introducing an additional step– Transforming an existing step– … while development continues on the existing
transformation– … and the meta-model changes too
Improving embedded software development productivity
© 2014 Zeligsoft
Some more challenges
• Dealing with inter-element dependencies• Generating code from non-valid models• Dealing with partially defined models
Improving embedded software development productivity
© 2014 Zeligsoft
Wish list
• Impact analysis– Internal
• Dependency: E.g. How does changing the way we generate/transform protocols affect the way we generate/transform capsules?
• Consistency: E.g. Does a change break something?– External
E.g. How does changing the way we generate/transform protocols affect the runtime, and viceversa?
Improving embedded software development productivity
© 2014 Zeligsoft
Links• Website
https://www.eclipse.org/papyrus-rt/• Wiki
https://wiki.eclipse.org/Papyrus-RT• Bugzilla
https://bugs.eclipse.org• Git/Gerrit
https://git.eclipse.org/r/papyrus-rt/org.eclipse.papyrus-rt