Synchronous Reactive Systems

Similar documents
Using the Principles of Synchronous Languages in Discrete-event and Continuous-time Models

Automata-Theoretic Model Checking of Reactive Systems

Dynamic Semantics. Dynamic Semantics. Operational Semantics Axiomatic Semantics Denotational Semantic. Operational Semantics

Decentralized Control of Discrete Event Systems with Bounded or Unbounded Delay Communication

Embedded Systems 5. Synchronous Composition. Lee/Seshia Section 6.2

Using the Principles of Synchronous Languages in Discrete-event and Continuous-time Models

Causality Interfaces and Compositional Causality Analysis

Absence of Global Clock

Binary Decision Diagrams and Symbolic Model Checking

Module - 19 Gated Latches

Concurrent Models of Computation in System Level Design

Sequential Circuits Sequential circuits combinational circuits state gate delay

Semantic Foundation of the Tagged Signal Model

A Deterministic Logical Semantics for Esterel

Recursion and Intro to Coq

Latches. October 13, 2003 Latches 1

A Thread Algebra with Multi-level Strategic Interleaving

Embedded Systems Development

Sequential Logic. Handouts: Lecture Slides Spring /27/01. L06 Sequential Logic 1

Lecture 6: Time-Dependent Behaviour of Digital Circuits

Operational Semantics

Communicating Parallel Processes. Stephen Brookes

Logical Analysis of. The Importance of Being Constructive.

Time and Schedulability Analysis of Stateflow Models

Composition for Component-Based Modeling

Simulation & Modeling Event-Oriented Simulations

Integrating Induction and Deduction for Verification and Synthesis

Causality Interfaces for Actor Networks

On the Design of Adaptive Supervisors for Discrete Event Systems

Agreement. Today. l Coordination and agreement in group communication. l Consensus

Sequential Logic (3.1 and is a long difficult section you really should read!)

The State Explosion Problem

An Operational Semantics for the Dataflow Algebra. A. J. Cowling

Applications of Petri Nets

Reasoning About Imperative Programs. COS 441 Slides 10b

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Digital Logic

Temporal logics and explicit-state model checking. Pierre Wolper Université de Liège

Introduction to Model Checking. Debdeep Mukhopadhyay IIT Madras

EECS 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization

MTAT Complexity Theory September 15th, Lecture 3

CptS 464/564 Fall Prof. Dave Bakken. Cpt. S 464/564 Lecture January 26, 2014

Limitations of OCAML records

The Underlying Semantics of Transition Systems

Acknowledgements. Control System. Tracking. CS122A: Embedded System Design 4/24/2007. A Simple Introduction to Embedded Control Systems (PID Control)

EE 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization Fall 2016

INF 4140: Models of Concurrency Series 3

Clock Synchronization

Software Verification

Module 7. Software Engineering Issues. Version 2 EE IIT, Kharagpur 1

Lecture 7: Logic design. Combinational logic circuits

Definition: Alternating time and space Game Semantics: State of machine determines who

Time. To do. q Physical clocks q Logical clocks

Relational Interfaces and Refinement Calculus for Compositional System Reasoning

Fundamental Algorithms for System Modeling, Analysis, and Optimization

UNIT 1. SIGNALS AND SYSTEM

Formal Techniques for Software Engineering: Denotational Semantics

Distributed Algorithms (CAS 769) Dr. Borzoo Bonakdarpour

User Requirements, Modelling e Identification. Lezione 1 prj Mesa (Prof. Ing N. Muto)

An Introduction to Temporal Logics

Model Checking: An Introduction

CS 301. Lecture 17 Church Turing thesis. Stephen Checkoway. March 19, 2018

OBEUS. (Object-Based Environment for Urban Simulation) Shareware Version. Itzhak Benenson 1,2, Slava Birfur 1, Vlad Kharbash 1

Chapter 9. PSPACE: A Class of Problems Beyond NP. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.

Abstractions and Decision Procedures for Effective Software Model Checking

Synthesis of Winning Strategies for Interaction under Partial Information

Description of Systems

7. Queueing Systems. 8. Petri nets vs. State Automata

9. PSPACE 9. PSPACE. PSPACE complexity class quantified satisfiability planning problem PSPACE-complete

Let us first give some intuitive idea about a state of a system and state transitions before describing finite automata.

Decentralized Control of Discrete Event Systems with Bounded or Unbounded Delay Communication 1

Embedded Systems 2. REVIEW: Actor models. A system is a function that accepts an input signal and yields an output signal.

Multicore Semantics and Programming

9. PSPACE. PSPACE complexity class quantified satisfiability planning problem PSPACE-complete

Embedded Systems Development

Recognizing Safety and Liveness by Alpern and Schneider

Bridging the Gap between Reactive Synthesis and Supervisory Control

Operations and Supply Chain Management Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Concurrent Models of Computation

Semantic Equivalences and the. Verification of Infinite-State Systems 1 c 2004 Richard Mayr

Introduction to Digital Signal Processing

DRAFT - do not circulate

CS357: CTL Model Checking (two lectures worth) David Dill

Bridging the Semantic Gap Between Heterogeneous Modeling Formalisms and FMI

Separation Logic and Graphical Models

What Makes the XmR Chart Work?

Modeling Synchronous Systems in BIP

A most elegant philosophy about the Theory Of Everything

Parallel Performance Evaluation through Critical Path Analysis

ELCT201: DIGITAL LOGIC DESIGN

APGAN and RPMC: Complementary Heuristics for Translating DSP Block Diagrams into Efficient Software Implementations ABSTRACT

Robust and Extensible Task Implementations of Synchronous Finite State Machines

The Discrete EVent System specification (DEVS) formalism

Slide Set 6. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

Simulation of Spiking Neural P Systems using Pnet Lab

Game Theory with Information: Introducing the Witsenhausen Intrinsic Model

CS 580: Algorithm Design and Analysis. Jeremiah Blocki Purdue University Spring 2018

Design of Distributed Systems Melinda Tóth, Zoltán Horváth

(a) Definition of TMs. First Problem of URMs

MA Lesson 23 Notes 2 nd half of textbook, Section 5.1 Increasing and Decreasing Functions

Job Scheduling and Multiple Access. Emre Telatar, EPFL Sibi Raj (EPFL), David Tse (UC Berkeley)

Transcription:

Synchronous Reactive Systems Stephen Edwards sedwards@synopsys.com Synopsys, Inc.

Outline Synchronous Reactive Systems Heterogeneity and Ptolemy Semantics of the SR Domain Scheduling the SR Domain 2

Reactive Embedded Systems Run at the speed of their environment When as important as what Concurrency for controlling the real world Determinism desired Limited resources (e.g., memory) Discrete-valued, time-varying Examples: Systems with user interfaces Digital Watches CD Players Real-time controllers Anti-lock braking systems Industrial process controllers 3

The Digital Approach Why do we build digital systems? Voltage noise is unavoidable Discretization plus non-linearity can filter out low-level noise completely Complex systems becomes predictable and controllable Incredibly successful engineering practice 4

The Synchronous Approach Idea: Use the same trick to filter out time noise. Noise: Uncontrollable and unpredictable delays Discretization global synchronization The synchrony hypothesis: Things compute instantaneously Already widespread: Synchronous digital systems Finite-state machines 5

The Synchronous Model of Time Synchronous: time is an ordered sequence of instants Reactive: Instants initiated by environmental events System responds to each instant Nothing happens between instants Time A system only needs to be fast enough to simulate synchronous behavior Time 6

Who Uses This Stuff? Virtually all digital logic designed this way In software, Dassult (French aircraft manufacturer) builds avionics with synchronous software Polis (Berkeley HW/SW codesign project) uses Esterel for specifying EFSMs Cadence built product (Cierto VCC) based on Polis TI exploring using synchronous software for specifying/simulating DSPs 7

Outline Synchronous Reactive Systems Heterogeneity and Ptolemy Semantics of the SR Domain Scheduling the SR Domain 8

Heterogeneity Why are there so many system description languages? Want a succinct description for my system. Let the language fit the problem Bigger systems have more diverse problems; use a fitting language for each subproblem. Want a heterogeneous coordination scheme that allows many languages to communicate. 9

Heterogeneity in Ptolemy Ptolemy: A system for rapid prototyping of heterogeneous systems A Ptolemy domain (model of computation): Set of blocks: Atomic pieces of computation that can be fired (evaluated). A C D Scheduler: B Determines block firing order before or during system execution. A B C D 10

Schedulers Support Heterogeneity Scheduler does not know block contents, only how to fire Block contents may be anything Wormhole : A block in one domain that behaves as a system in another Hierarchical heterogeneity: Any system may contain subsystems described in different domains 11

Outline Synchronous Reactive Systems Heterogeneity and Ptolemy Semantics of the SR Domain Scheduling the SR Domain 12

The SR Domain Reactive systems need concurrency The synchronous model makes for deterministic concurrency No interleaving semantics Events are totally-ordered Before, after, at the same time all well-defined and controllable Embedded systems need boundedness; dynamic process creation a problem SR system: fixed set of synchronized, communicating processes 13

The SR Domain (2) Zero-delay blocks Instantaneous communication with feedback Single driver, multiple receiver channels Block functions may change between instants for time-varying behavior Blocks may be specified in any language 14

Zero Delay and Feedback How to maintain determinism? A B Which goes first? Need an order-invariant semantics Contradictory! Need to attach meaning to such systems. 15

Dealing with Feedback Why bother at all? Answer: Heterogeneity Cycles are usually broken by delay elements at the lowest level Some schemes insist on this False feedback often appears at higher levels Data dependent cycles can appear when sharing resources Virtually all cycles are false, yet must be dealt with. 16

Fixed-point Semantics are Natural for Synchronous Specifications with Feedback Why a fixed point? Self-reference: The essence of a cycle f (x t )=x t System function (composition of block functions) Vector of signals at time t (zero delay) fixed point stable state determinism unique solution 17

Unique Least Fixed Point Theorem A monotonic function on a complete partial order (with ) has a unique least fixed point. What does it mean to make the system function f monotonic and the signal values a CPO? 18

The Least Fixed Point of What? A C B D I f O Interpret as Take LFP B(I, f (I)) = f (I) B I O A B C D O 19

Vector of Signals is a CPO Values along an upward path grow more defined. 1 0 Undefined element More Defined Less Defined Incomparable 11 01 10 00 1 1 0 0 vector-valued extension Formally, x y if y is at least as defined as x. 20

Adding Is Enough Any set {a 1,a 2,...,a n,...} can easily be lifted to give a flat partial order: a 1 a 2 a 3 a n A CPO for signals with pure events: absent present A CPO for valued events: absent v 1 v 2 v n Why not absent present? present A then... else... end Violates monotonicity 21

Monotonic Block Functions Giving a more defined input to a monotonic function always gives a more defined output. f ( f ( f ( f ( )))) f ( f ( f ( ))) f ( f ( )) f ( ) Formally, x y implies f (x) f (y). A monotonic function never recants ( changes its mind ). 22

Many Languages Use Strict Functions, Which Are Monotonic A strict function: g(...,,... )=(,..., ) }{{}}{{} inputs outputs Outside: A strict monotonic function Inside: Simple function call semantics Most common imperative languages only compute strict functions. Danger: Cycles of strict functions deadlock fixed point is all need some non-strict functions. 23

Outline Synchronous Reactive Systems Heterogeneity and Ptolemy Semantics of the SR Domain Scheduling the SR Domain 24

A Simple Way to Find the Least Fixed Point f ( ) f ( f ( )) LFP = LFP = For each instant, 1. Start with all signals at 2. Evaluate all blocks (in some order) 3. If any change their outputs, repeat Step 2 f 0 a f 1 b f 2 c (a,b,c) = (,, ) f 0 (,, ) = (0,, ) f 1 (0,, ) = (0,1, ) f 2 (0,1, ) = (0,1,0) f 2 ( f 1 ( f 0 (0,1,0))) = (0,1,0) 25

The Dependency Graph Transform into single-output functions: A 1 2 C 5 B 3 4 D 6 7 1 2 5 3 6 4 7 26

The Scheduling Algorithm 1. Decompose into strongly-connected components 2. Remove a head (set of vertices) from each SCC, leaving a tail 3. Recurse on each tail 27

Evaluating SCCs Split a strongly-connected graph into a head and tail: H T T H T Good heads break T s strong connectivity. 28

Example System A 0 1 C 5 6 4 B 3 2 1 2 Graph 4 0 6 5 3 Head 1 2 4 0 Tail 6 5 3 29

Schedules 1 2 4 0 6 4 5 0 3 6 5 3 ( head {}}{ 12. tail {}}{ head head {}}{{}}{ tail {}}{ 5 ) ( } 4. {{ } SCC 6 ( tail {}}{ 3 ) } 0. {{ } SCC ) 545 6 303 12 545 6 303 12 545 6 303 30

Finding Good Heads Must break strong connectivity remove a border of a set of vertices: D H A E B F I C G border of { A, B, C } (vertices with incoming edges) H A B I C 31

Choosing Good Border Sets Heuristic: Grow a set starting from a vertex and greedily include the best border vertex: 2 5 3 6 1 4 7 Set Border 1 5 15 23 152 3 1523 7 15237 46 152374 6 2 is better (3 would increase border) 32

Scheduling Results Time to Compute Schedule 100s 10s 1s 0.1s Speedup Over Exact sweep exact 0 20 40 60 80 100 120 Number of Outputs 1000 100 10 1 0.1 0.1s 1s 10s 100s Time to Compute Exact 33

The Cost of Using the Heuristic Fraction of Runs Number of Outputs 25%20%15%10% 5% 0% 0 20 40 60 80 50% 100% 150% Increase in Cost of Schedule 34

Asymptotic Schedule Cost 1 10 100 1000 1 10 100 n n 1.5 n 2 Number of Outputs Optimal Schedule Cost 35

Conclusions Reactive embedded systems Run at the speed of their environment When as important as what Concurrent, deterministic, bounded, discrete-valued The synchronous approach Discrete instants, globally synchronized Assumes instantaneous computation Heterogeneity in Ptolemy Domain: Blocks and Scheduler Hierarchical heterogeneity through domain embedding 36

Conclusions (2) The SR domain Concurrent zero-delay blocks Semantics: the least fixed point of a monotonic function on a CPO Values include undefined ( ) Scheduling the SR Domain Use single-output dependency graph Decompose into SCCs; remove a head from each; recurse Head is the border of the tail Choose a head by greedily growing a set of vertices Fast, efficient. O(n 1.25 ) execution 37