papyrusrt: modelling and code generation

21
© 2014 Zeligsoft Improving embedded software development productivity PapyrusRT: modelling and code generation Ernesto Posse Zeligsoft September 29, 2015 OSS4MDE’15 – Ottawa, Canada

Upload: ernesto-posse

Post on 10-Apr-2017

507 views

Category:

Software


0 download

TRANSCRIPT

Page 1: PapyrusRT: Modelling and Code Generation

© 2014 Zeligsoft

Improving embedded software development productivity

PapyrusRT: modelling and code generation

Ernesto PosseZeligsoftSeptember 29, 2015OSS4MDE’15 – Ottawa, Canada

Page 2: PapyrusRT: Modelling and Code Generation

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

Page 3: PapyrusRT: Modelling and Code Generation

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.)

Page 4: PapyrusRT: Modelling and Code Generation

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

Page 5: PapyrusRT: Modelling and Code Generation

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

Page 6: PapyrusRT: Modelling and Code Generation

Improving embedded software development productivity

© 2014 Zeligsoft

Why Papyrus?

• Already supports UML 2.5• Rich UI• Open-source• Rich Eclipse ecosystem

Page 7: PapyrusRT: Modelling and Code Generation

Improving embedded software development productivity

© 2014 Zeligsoft

UML-RT

• Object-Oriented• Concurrent• Real-Time systems• UML with constraints

– Composite Structure Diagrams– State Machine Diagrams

Page 8: PapyrusRT: Modelling and Code Generation

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)

Page 9: PapyrusRT: Modelling and Code Generation

Improving embedded software development productivity

© 2014 Zeligsoft

UML-RT: capsules

Page 10: PapyrusRT: Modelling and Code Generation

Improving embedded software development productivity

© 2014 Zeligsoft

UML-RT: state machines

Page 11: PapyrusRT: Modelling and Code Generation

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

Page 12: PapyrusRT: Modelling and Code Generation

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

Page 13: PapyrusRT: Modelling and Code Generation

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

Page 14: PapyrusRT: Modelling and Code Generation

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

Page 15: PapyrusRT: Modelling and Code Generation

Improving embedded software development productivity

© 2014 Zeligsoft

Demo (early adopters version)

Page 16: PapyrusRT: Modelling and Code Generation

Improving embedded software development productivity

© 2014 Zeligsoft

Code generation

• Transformation

• Implemented in Java and Xtend• Supports incremental generation

Page 17: PapyrusRT: Modelling and Code Generation

Improving embedded software development productivity

© 2014 Zeligsoft

Code generator structure

Page 18: PapyrusRT: Modelling and Code Generation

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

Page 19: PapyrusRT: Modelling and Code Generation

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

Page 20: PapyrusRT: Modelling and Code Generation

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?