Synchronous Statecharts. Christian Motika

Similar documents
Interactive Esterel to SyncCharts Transformation. Christian Motika

Executing SyncCharts with Ptolemy

SCCharts. Sequentially Constructive Charts

Updates on SCCharts Christian Motika Steven Smyth

Synchronous Dataflow Processong

Concurrent Models of Computation

Prof. Dr. Reinhard von Hanxleden. Christian-Albrechts Universität Kiel Department of Computer Science Real-Time Systems and Embedded Systems Group

The Esterel language

Introduction 2 The first synchronous language (early 80 s) Gérard Berry and his team (École des Mines de Paris / INRIA Sophia-Antipolis) Imperative, s

Compiling SCCharts A Case-Study on Interactive Model-Based Compilation

Interactive Transformations for Visual Models

States Transitions Connectors Esterel Studio

Overview. Synchronous Languages Lecture 12. Code Generation for Sequential Constructiveness. Compilation Overview. The 5-Minute Review Session

Reinhard v. Hanxleden 1, Michael Mendler 2, J. Aguado 2, Björn Duderstadt 1, Insa Fuhrmann 1, Christian Motika 1, Stephen Mercer 3 and Owen Brian 3

Modal Models in Ptolemy

Sequential Constructiveness, SCL and SCCharts

Predictable Timing of Cyber-Physical Systems Future Research Challenges

Synchronous Languages Lecture 07

EE382N.23: Embedded System Design and Modeling

Synchronous C + WCRT Algebra 101

Interactive Incremental Hardware Synthesis

Specifications Part 1

SyncCharts in C. Reinhard von Hanxleden

A SyncCharts Editor based on YAKINDU SCT

Cyber Physical System Verification with SAL

Reactive Web Programming

Embedded Software Engineering

Hierarchical FSMs with Multiple CMs

INSTITUT FÜR INFORMATIK

Using and Compiling Esterel

PRET-C: A New Language for Programming Precision Timed Architectures (extended abstract)

Compositionality in system design: interfaces everywhere! UC Berkeley

A Data-Flow Approach for Compiling the Sequentially Constructive Language (SCL)

Hardware Description Languages & System Description Languages Properties

Removing Cycles in Esterel Programs

Predictable multithreading of embedded applications using PRET-C

World Wide Web Server.

Analyzing Robustness of UML State Machines

Re-engineering engineering Home Service Robots Improving Software Reliability: A Case Study. Moonzoo Kim, etc

The Esterel Language. The Esterel Version. Basic Ideas of Esterel

Esterel and the Synchronous Approach

Safe Reactive Programming: the FunLoft Proposal

Lecture 2. The SCADE Language Data Flow Kernel. Daniel Kästner AbsInt GmbH 2012

A Simple Example. The Synchronous Language Esterel. A First Try: An FSM. The Esterel Version. The Esterel Version. The Esterel Version

Synchronous reactive programming

Orccad, a Model Driven Architecture and Environment for Real-Time Control. Soraya Arias Florine Boudin Roger Pissard-Gibollet Daniel Simon

Real-Time Programming Languages (ADA and Esterel as Examples)

A Multi-Threaded Reactive Processor

Introduction to Embedded Systems

Codesign Framework. Parts of this lecture are borrowed from lectures of Johan Lilius of TUCS and ASV/LL of UC Berkeley available in their web.

Synchronous Specification

Automatic Code Generation from Stateflow Models

Ptolemy II The automotive challenge problems version 4.1

Esterel. Software Environment

Section 8. The Basic Step Algorithm

A Generic Framework for Structure-Based Editing of Graphical Models in Eclipse

Early design phases. Peter Marwedel TU Dortmund, Informatik /10/11. technische universität dortmund. fakultät für informatik informatik 12

A Multi-Threaded Reactive Processor

ECL: A SPECIFICATION ENVIRONMENT FOR SYSTEM-LEVEL DESIGN

Esterel. Software Environment

System Level Design and Verification Using a Synchronous Language

Advanced Tool Architectures. Edited and Presented by Edward A. Lee, Co-PI UC Berkeley. Tool Projects. Chess Review May 10, 2004 Berkeley, CA

Synchronous Estelle: Just Another Synchronous Language?

INSTITUT FÜR INFORMATIK

The etrice Eclipse Project Proposal

Separate Translation of Synchronous Programs to Guarded Actions

SCXML State Chart XML

Principia lingua SystemJ

Introduction to Dependable Systems: Meta-modeling and modeldriven

Behavioral Specification of a Circuit using SyncCharts: A Case Study

XEVE, an ESTEREL Verification Environment

ESUIF: An Open Esterel Compiler

UC Berkeley Mobies Technology Project

Compiling Esterel. Dumitru Potop-Butucaru. Stephen A. Edwards Gérard Berry

Predictable Execution with IEC 61499

The Synchronous Languages 12 Years Later

Remote Control. IMMS.de

A PRIMITIVE EXECUTION MODEL FOR HETEROGENEOUS MODELING

Deterministic Concurrency: A Clock-Synchronised Shared Memory Approach

CIS 1.5 Course Objectives. a. Understand the concept of a program (i.e., a computer following a series of instructions)

Programming Deterministic Reactive Systems with Synchronous Java

An Introduction to Lustre

Tsmart-BIPEX: An Integrated Graphical Design Toolkit for Software Systems

Embedded software design with Polychrony

Building Synchronous DataFlow graphs with UML & MARTE/CCSL

Łabiak G., Miczulski P. (IIE, UZ, Zielona Góra, Poland)

Reactive Parallel Processing for Synchronous Dataflow

Compilation of Imperative Synchronous Programs with Refined Clocks

The Synchronous Hypothesis and Synchronous Languages

Concurrent Models of Computation for Embedded Software

Hardware Description Languages & System Description Languages Properties

Removing Cycles in Esterel Programs

Simulink/Stateflow. June 2008

FROM SYNCHRONOUS SPECIFICATIONS TO ASYNCHRONOUS DISTRIBUTED IMPLEMENTATIONS Technische Universitiit Miinchen Peter Scholz

Chapter 2 Synchronous Programming: Overview

Building Unreliable Systems out of Reliable Components: The Real Time Story

Concurrent Models of Computation

Modular code generation from synchronous models:

HW/SW Design Space Exploration on the Production Cell Setup

Fusing Dataflow with Finite State Machines

Transcription:

Execution (KlePto) Esterel to transformation (KIES) Synchronous Statecharts for executing Esterel with Ptolemy Christian Motika Real-Time Systems and Embedded Systems Group Department of Computer Science Christian-Albrechts-Universität zu Kiel, Germany KIEL ER DREAMS Seminar, 03. OCT 2011 Christian Motika Synchronous Statecharts 1 / 36

Execution (KlePto) Esterel to transformation (KIES) Motivation Embedded Systems Designed for dedicated applications inside a surrounding system A computer that is not perceived as such Often non-terminating SW, continuous interaction w/ HW Reactive Systems Often safety-critical systems Christian Motika Synchronous Statecharts 2 / 36

Execution (KlePto) Esterel to transformation (KIES) Motivation Reactive Systems surrounding system (mechanic, electronic, pneumatic,...) analog hardware (actors) software digitale hardware analog hardware (sensors) Continuous, non-terminating interaction Pace is controlled by the environment Computation (output) of steps of the reactive system Reaction vs. interaction When to produce outputs? In real-time! WCRT Christian Motika Synchronous Statecharts 3 / 36

Execution (KlePto) Esterel to transformation (KIES) Motivation Synchronous Languages Separate concerns 1. Functionality 2. Timing Specify functionality, logical timing only (order) Goal: Fully deterministic behavior Assume zero reaction time perfect synchrony w/ interaction Christian Motika Synchronous Statecharts 4 / 36

Execution (KlePto) Esterel to transformation (KIES) Motivation Motivation Synchronous model of computation (MoC): Esterel,, SC (control flow) Lustre, Signal, SCADE (data flow) Ptolemy (SR domain) a synchronous statechart dialect Primary example for KIELER framework KlePto: Executing w/ Ptolemy KIES: Esterel to transformation Execute Esterel w/ Ptolemy Christian Motika Synchronous Statecharts 5 / 36

Execution (KlePto) Esterel to transformation (KIES) Motivation Esterel Execution (KlePto) Esterel to transformation (KIES) Demo Summary Christian Motika Synchronous Statecharts 6 / 36

Execution (KlePto) Esterel to transformation (KIES) Synchrony Concepts ABRO Example What is Esterel? Synchronous language Imperative Control flow oriented Deterministic programs History Developed by J.-P. Marmorat and J.-P. Rigault (at Ecole des Mines de Paris) G. Berry developed a formal semantics for Esterel in 1983 Esterel v5: Has been stable since late 1990s Esterel v7: same principles as in v5, several extensions Christian Motika Synchronous Statecharts 7 / 36

Execution (KlePto) Esterel to transformation (KIES) Synchrony Concepts ABRO Example Synchrony in Esterel Definition[Perfect Synchrony] A system works in perfect synchrony, if all reactions of the system are executed in zero time. Hence, outputs are generated at the same time, when the inputs are read. In practice, zero time means before the next interaction Macro steps consist of only finitely many micro steps No data dependent loops in a macro step WCET (high-level, low-level) to meet real-time constraints Christian Motika Synchronous Statecharts 8 / 36

Execution (KlePto) Esterel to transformation (KIES) Synchrony Concepts ABRO Example Basic Concepts Imperative language Statement (mostly instantanous) Sequence of statements is a statement s1 ;s 2 Control flow oriented pause statement Modules Signals Esterel programs are a list of modules Module body is a statement Communication Emission, Test emit S, present S, await S Concurrency [ s 1 s 2... s n ] Preemption [weak] abort s when S Christian Motika Synchronous Statecharts 9 / 36

Execution (KlePto) Esterel to transformation (KIES) Synchrony Concepts ABRO Example Signals Definition[Signal Coherence] A signal is either present or absent within a macro tick but never both. Present iff emitted, absent otherwise iff emitted means iff an emit statement must be executed Constructiveness Speculative executions are not allowed E.g., present S then emit S else emit S Christian Motika Synchronous Statecharts 10 / 36

Execution (KlePto) Esterel to transformation (KIES) Synchrony Concepts ABRO Example Example: ABRO module ABRO: input A, B, R; output O; loop abort [ await A await B ]; emit O; halt when R end loop The system has boolean valued inputs A, B, R, and an output O. Output O shall be true as soon as both inputs A and B have been true. This behavior should be restarted if R is true. end module Christian Motika Synchronous Statecharts 11 / 36

Execution (KlePto) Esterel to transformation (KIES) Concepts vs. Statecharts ABRO Example Esterel Execution (KlePto) Esterel to transformation (KIES) Demo Summary Christian Motika Synchronous Statecharts 12 / 36

Execution (KlePto) Esterel to transformation (KIES) Concepts vs. Statecharts ABRO Example What are? Statechart dialect (Statecharts proposed by David Harel [1987]) Built on Esterel semantics Invented by Charles André Safe State Machines Was supported by the commercial tool Esterel Studio, which uses Esterel as intermediate step in code generation Christian Motika Synchronous Statecharts 13 / 36

Execution (KlePto) Esterel to transformation (KIES) Concepts vs. Statecharts ABRO Example Statechart dialect Mealy machine with Parallelism, hierarchy, compound events, broadcast Synchrony hypothesis Discrete ticks Computations take no time Christian Motika Synchronous Statecharts 14 / 36

Execution (KlePto) Esterel to transformation (KIES) Concepts vs. Statecharts ABRO Example Harel-Statecharts vs. Similarities are made up of elements common to most Statecharts dialects: States Initial/terminal states Transitions Signals/Events Hierarchy Modularity Parallelism Christian Motika Synchronous Statecharts 15 / 36

Execution (KlePto) Esterel to transformation (KIES) Concepts vs. Statecharts ABRO Example Harel-Statecharts vs. Differences differ from other implementations of Statecharts: Synchronous framework Determinism Compilation into backend language Esterel No interpretation for simulations No hidden behaviour Multiple events Negation of events No inter-level transitions Christian Motika Synchronous Statecharts 16 / 36

Execution (KlePto) Esterel to transformation (KIES) Concepts vs. Statecharts ABRO Example Example: ABRO module ABRO: input A, B, R; output O; loop abort [ await A await B ]; emit O; halt when R end loop end module Christian Motika Synchronous Statecharts 17 / 36

Execution (KlePto) Esterel to transformation (KIES) in KIELER in Ptolemy Esterel Execution (KlePto) Esterel to transformation (KIES) Demo Summary Christian Motika Synchronous Statecharts 18 / 36

Execution (KlePto) Esterel to transformation (KIES) in KIELER in Ptolemy What is KIELER? Kiel Integrated Environment for Layout Eclipse Rich Client Modeling platform and test bed Improve pragmatics Open source and Eclipse based (plug-ins) General concepts: Generic approaches Symbiosis w/ Eclipse technologies (e.g., EMF, GMF, TMF, Xpand, Xtend) Interfaces to other tools (Ptolemy, Papyrus) Christian Motika Synchronous Statecharts 19 / 36

Execution (KlePto) Esterel to transformation (KIES) in KIELER in Ptolemy Execution in KIELER KIES Xtend2 Xtend2 Xtend2 KlePto S Xtend2 Xpand2/ Xtend2 Esterel RC Ptolemy SC SJ Christian Motika Synchronous Statecharts 21 / 36

Execution (KlePto) Esterel to transformation (KIES) KlePto in KIELER in Ptolemy M2M description dsl2moml.xtend produce moml.ecore Xtend M2M model.pto dsl.ecore metamodels model.dsl model to simulate Ptolemy Simulator Data Producer Data Observer load & execute simulation data, model outputs commands, model inputs Execution Manager [Semantics and Execution of Domain Specific Models, MEMWe 2010] Christian Motika Synchronous Statecharts 22 / 36

Execution (KlePto) Esterel to transformation (KIES) in KIELER in Ptolemy Ptolemy The Ptolemy project studies heterogeneous modeling, simulation, and design of concurrent systems. Introduction to Ptolemy II, UC Berkeley Executable Models to describe behavior of reactive systems Ptolemy models are a set of interacting components Actor-Oriented Design Christian Motika Synchronous Statecharts 23 / 36

Execution (KlePto) Esterel to transformation (KIES) in KIELER in Ptolemy in Ptolemy - Today m Christian Motika Synchronous Statecharts 24 / 36

Execution (KlePto) Esterel to transformation (KIES) in KIELER in Ptolemy in Ptolemy - ModalModels and SR ModalModels do cannot analysis to expose signals that cannot be emitted Signals can then be set to absent ModalModels can do this hierarchically Ptolemy models can be heterogeneous: State refinement does not need to be a state machine (e.g., SR) Currently limits this approach Ptolemy Control Flow Domain (w/ Chris Shaver) Christian Motika Synchronous Statecharts 25 / 36

Execution (KlePto) Esterel to transformation (KIES) Motivation Concept Transformation Rules Optimization Esterel Execution (KlePto) Esterel to transformation (KIES) Demo Summary Christian Motika Synchronous Statecharts 26 / 36

Execution (KlePto) Esterel to transformation (KIES) Motivation Concept Transformation Rules Optimization Model transformations Applications Drawbacks Synthesize multiple (graphical/textual) views from one model Edit a model (refactoring, optimization) Code generation Simulation desires Large and inflexible Hard to visualize Hard to debug Not interactive Goal of KIES: Address the above drawbacks Use case: KIELER Esterel to transformation Christian Motika Synchronous Statecharts 27 / 36

Execution (KlePto) Esterel to transformation (KIES) Motivation Concept Transformation Rules Optimization Esterel to [ await A aw emit O each R Transformation end module Optimization Christian Motika Synchronous Statecharts 28 / 36

Execution (KlePto) Esterel to transformation (KIES) Motivation Concept Transformation Rules Optimization Transformation Rule A transformation rule is a description of how one or more constructs in the source language can be transformed into one or more constructs in the target language (Mens and Gorp) Esterel to One rule for each Esterel statement Optimization One rule for a certain state Rules presented by Lars Kühl (also formal proofs for Esterel to ) Christian Motika Synchronous Statecharts 29 / 36

Execution (KlePto) Esterel to transformation (KIES) Motivation Concept Transformation Rules Optimization Implementation ButtonTrigger XtendFacade current model Xtend rule Combination XtendTransformationContext Transformation- Descriptor model elements name binding step step Transformation- Effect [Interactive Transformations for Visual Models, MEMWe 2011] Christian Motika Synchronous Statecharts 30 / 36

Execution (KlePto) Esterel to transformation (KIES) Motivation Concept Transformation Rules Optimization Esterel to emit loop-each Christian Motika Synchronous Statecharts 31 / 36

Execution (KlePto) Esterel to transformation (KIES) Motivation Concept Transformation Rules Optimization Optimization Christian Motika Synchronous Statecharts 32 / 36

Execution (KlePto) Esterel to transformation (KIES) Summary To Go Further The End KIELER Demo LIVE DEMO Christian Motika Synchronous Statecharts 33 / 36

Execution (KlePto) Esterel to transformation (KIES) Summary To Go Further The End Summary Reasearch goals (long term) Investigate on synchronous languages Bringing together graphical and textual syntax Integrate Esterel in KIELER Improve pragmatics Validation purposes (SC and ControlFlow Domain) Reasearch goals (near term) Modular and interactive transformations Understand Debug Teaching Acknowledgements: Reinhard v. Hanxleden, Ulf Rüegg Christian Motika Synchronous Statecharts 34 / 36

Execution (KlePto) Esterel to transformation (KIES) Summary To Go Further The End To Go Further CHARLES ANDRÉ. Semantics of, 2003. GÉRARD BERRY. The Esterel v5 Language Primer, 2000. MOTIKA, C. Semantics and execution of domain specific models KlePto and an execution framework. UC BERKELEY, EECS DEPT. Ptolemy webpage. http://ptolemy.eecs.berkeley.edu/. UNI KIEL, REAL-TIME AND EMBEDDED SYSTEMS GROUP. KIELER webpage. http://www.informatik.uni-kiel.de/en/rtsys/kieler/. Christian Motika Synchronous Statecharts 35 / 36

Execution (KlePto) Esterel to transformation (KIES) Summary To Go Further The End Thank you for your attention and participation! Any questions or suggestions? Christian Motika Synchronous Statecharts 36 / 36