Implementing Constructive Synchronous Programs on POLIS CFSM Networks G.Berry E.Sentovich Ecole des Mines de Paris / INRIA Cadence Berkeley Labs.

Slides:



Advertisements
Similar presentations
Modelos de Computação Básicos Prof. Dr. César Augusto Missio Marcon Parcialmente extraído de trabalhos de Axel Jantch, Edward Lee e Alberto Sangiovanni-Vincentelli.
Advertisements

Operating Systems Lecture 7.
Timed Distributed System Models  A. Mok 2014 CS 386C.
Impossibility of Distributed Consensus with One Faulty Process
© S. Ramesh / Kavi Arya / Krithi Ramamritham IT-606 Embedded Systems (Software) S. Ramesh Kavi Arya Krithi Ramamritham KReSIT/ IIT Bombay.
The Synchronous Model of Computation Stavros Tripakis UC Berkeley EE 249 Lecture – Sep 15, 2009 CE 290I Lecture – Oct 22, 2009.
Timed Automata.
Flip-Flops Last time, we saw how latches can be used as memory in a circuit. Latches introduce new problems: We need to know when to enable a latch. We.
Lecture 12 Latches Section , Block Diagram of Sequential Circuit gates New output is dependent on the inputs and the preceding values.
Synchronous Languages and System Design with Esterel Ellen Sentovich Cadence Berkeley Laboratories.
Synchronous & Asynchronous Models in Computing By: James Pauer.
Optimized State Encoding for Esterel Programs Dumitru POTOP-BUTUCARU.
Introduction to Modern Cryptography, Lecture 12 Secure Multi-Party Computation.
Requirements on the Execution of Kahn Process Networks Marc Geilen and Twan Basten 11 April 2003 /e.
28.2 Functionality Application Software Provides Applications supply the high-level services that user access, and determine how users perceive the capabilities.
Copyright 2001, Agrawal & BushnellDay-1 PM Lecture 4a1 Design for Testability Theory and Practice Lecture 4a: Simulation n What is simulation? n Design.
Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 3 – Distributed Systems.
7th Biennial Ptolemy Miniconference Berkeley, CA February 13, 2007 Leveraging Synchronous Language Principles for Hybrid System Models Haiyang Zheng and.
CPSC 668Set 16: Distributed Shared Memory1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
02/02/20091 Logic devices can be classified into two broad categories Fixed Programmable Programmable Logic Device Introduction Lecture Notes – Lab 2.
Esterel Overview Roberto Passerone ee249 discussion section.
ECE Synthesis & Verification1 ECE 667 Spring 2011 Synthesis and Verification of Digital Systems Verification Introduction.
AR vs. CFSM Abdallah Tabbara. CFSM Overview 4 CFSM has: –a finite state machine part –a data computation part –a locally synchronous behavior transitions.
Models of Computation for Embedded System Design Alvise Bonivento.
VHDL Intro What does VHDL stand for? VHSIC Hardware Description Language VHSIC = Very High Speed Integrated Circuit Developed in 1982 by Govt. to standardize.
1/31/20081 Logic devices can be classified into two broad categories Fixed Programmable Programmable Logic Device Introduction Lecture Notes – Lab 2.
Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 4 – Consensus and reliable.
CS533 - Concepts of Operating Systems
1 System Modeling. Models of Computation. System Specification Languages Alexandru Andrei.
Mahapatra-A&M-Sprong'021 Co-design Finite State Machines Many slides of this lecture are borrowed from Margarida Jacome.
01/27/2005 Combinationality of cyclic definitions EECS 290A – Spring 2005 UC Berkeley.
Comparing Models of Computation for Real-time, Distributed Control Systems Shawn Schaffert Bruno Sinopoli.
On the Cost of Fault-Tolerant Consensus When There are no Faults Idit Keidar & Sergio Rajsbaum Appears in SIGACT News; MIT Tech. Report.
Lecture 12 Synchronization. EECE 411: Design of Distributed Software Applications Summary so far … A distributed system is: a collection of independent.
Lecture 3. Boolean Algebra, Logic Gates
Models of Computation Reading Assignment: L. Lavagno, A.S. Vincentelli and E. Sentovich, “Models of computation for Embedded System Design”
A Mystery Esterel –small no type inference, subtyping, … no recursion, functions, … no pointers, malloc, GC, … no complex data structures, libraries,
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
1 Performance Evaluation of Computer Networks: Part II Objectives r Simulation Modeling r Classification of Simulation Modeling r Discrete-Event Simulation.
S. M. Farhad PhD Student Supervisor: Dr. Bernhard Scholz
Applications of Propositional Logic
Models of Computation: FSM Model Reading: L. Lavagno, A.S. Vincentelli and E. Sentovich, “Models of computation for Embedded System Design”
Distributed Algorithms – 2g1513 Lecture 9 – by Ali Ghodsi Fault-Tolerance in Distributed Systems.
An introduction to Esterel and its compilation
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
“Software” Esterel Execution (work in progress) Dumitru POTOP-BUTUCARU Ecole des Mines de Paris
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
Mahapatra-A&M-Fall'001 Co-design Finite State Machines Many slides of this lecture are borrowed from Margarida Jacome.
© S. Ramesh / Kavi Arya / Krithi Ramamritham 1 IT-606 Embedded Systems (Software) S. Ramesh Kavi Arya Krithi Ramamritham KReSIT/ IIT Bombay.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
1 Client-Server Interaction. 2 Functionality Transport layer and layers below –Basic communication –Reliability Application layer –Abstractions Files.
© S. Ramesh / Kavi Arya / Krithi Ramamritham 1 IT-606 Embedded Systems (Software ) S. Ramesh Kavi Arya Krithi Ramamritham KReSIT/ IIT Bombay.
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 16: Distributed Shared Memory 1.
1 COMP541 Finite State Machines - 1 Montek Singh Sep 22, 2014.
Fault tolerance and related issues in distributed computing Shmuel Zaks GSSI - Feb
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Agenda  Quick Review  Finish Introduction  Java Threads.
Introduction to distributed systems description relation to practice variables and communication primitives instructions states, actions and programs synchrony.
1 COMP541 Sequential Logic – 2: Finite State Machines Montek Singh Feb 29, 2016.
The consensus problem in distributed systems
CPE555A: Real-Time Embedded Systems
VLSI Testing Lecture 5: Logic Simulation
VLSI Testing Lecture 5: Logic Simulation
Timing Model Start Simulation Delay Update Signals Execute Processes
CSCI-100 Introduction to Computing
COMP541 Sequential Logic – 2: Finite State Machines
Vishwani D. Agrawal Department of ECE, Auburn University
Applications of Propositional Logic
Alternating Bit Protocol
Presentation transcript:

Implementing Constructive Synchronous Programs on POLIS CFSM Networks G.Berry E.Sentovich Ecole des Mines de Paris / INRIA Cadence Berkeley Labs

Concurrency : The Compositionality Principle P Q R P || Q

P Q R t d t’ t’’ t’’ = t + d + t’ t’’ ~ t ~ d ~ t’ t ~ t + t

3 principal solutions : t arbitrary asynchrony t = 0 synchrony t fixed or bounded propagation

t arbitrary : Brownian Motion Chemical reaction H + H + Cl _ H + _ _ HCL H + Internet Routing H + Cl _ HCL +

t = 0 : Perfect Synchrony Synchronous = zero delay Communication by instantaneous broadcast Concurrency + determinism Reference: Newtonian Mechanics

T fixed or bounded : Vibration Propagation of Sound Light Heat Wind

TRY PASS REQ OK GET_TOKENPASS_TOKEN Synchronous Digital Circuits OK = REQ and GO PASS = not REQ and GO GO = TRY or GET_TOKEN PASS_TOKEN = reg(GET_TOKEN) GO

Synchronous view : magically solve equations 0-delay Vibration view : propagate voltages speed of light Acyclic circuits : stabilization in predictable time Wait long enough, same result as 0-delay !

module Sender : type Message input MESSAGE : Message; output SEND : Message, SENT; input MS, ACK; loop await MESSAGE ; abort every 100 MS do emit SEND (?MESSAGE) end every when ACK ; emit SENT end loop end module

POLIS : a GALS model Globally Asynchronous Locally Synchronous CFSM Input buffer

Input Buffer = presence + value - A CFSM is runnable when an input comes in - Several inputs may come in before actual run - Presence / absence can be tested for each input - Value can be accessed for present signals - Transition in 0-delay - Output broadcast by the network, with delay - 1-place buffers can be overwritten CFSM

Synchronous programs - nice semantics / mathematics - concurrency + deterministic - optimization + verification feasible - limited in scope : compact systems CFSM networks - POLIS implementation model - good for hardware / software codesign - formal semantics, but can be wild - semantics purely operational (scheduler)

Can we implement synchronous languages on CFSM networks? Run large-scale synchronous programs on networks Study classes of “well-behaved” CFSM networks Study progressive relaxation of synchrony Previous work : P. Caspi and A. Girault E,. Ledinot et.al., Dassault Aviation

Constructive Circuits Esterel -> circuits, combinational cycles allowed 3 kinds of cyclic circuits: - Well-behaved X = I and Y Y = not I and X - Outlaws X = X X = not X Y X I

ToBe = ToBe or not ToBe ToBe Strange Circuits Unique Boolean solution No electrical stabilization for some delays Electrons cannot reason by contradiction => Constructive Boolean Logic

Fact : E=0 or E=1 E=0 E and F = 0 F=0 E and F = 0 E=1 F=1 E and F = 1 E=0 not E = 1 E=1 not E = 0 X=E E=b X=b Constructive Boolean Logic E or not E = 1 not provable unless E=0 or E=1 FACTS! NO GUESS!

X Y I J X = I and not Y Y = J and not X OK unless I = J = 1 Running Example

X = I and not Y Y = J and not X (1) I=0 (2) J=1 (3) X=0 from (1) (4) not X=1 from (3) (5) Y=1 from (2) and (4) (1) I=1 (2) J=0 (3) Y=0 from (2) (4) not Y=1 from (3) (5) X=1 from (2) and (4) No proof of X and Y if I=J=1 Topological ordering : data independent Proof ordering : data dependent Proofs

Theorem (Berry-Shiple) : equivalence of 3 views Constructive semantics convergence = provability of a fact for each wire Delay-independent electrical behavior convergence = stabilization for any delay assignment Scott’s denotational semantics - 3-valued logic solve equation by least fixpoint in {, 0, 1} convergence = all wire values in {0,1} => compositionality T

X = I and not Y Y = J and not X I=0. J=1X : 2 Y : 2 I=0. J=1. X=0X : 1 Y : 2 I=0. J=1. X=0X : 1 Y : 1 I=0. J=1. X=0. Y=1X : 1 Y : 0 I=0. J=1. X=0X : 1 Y : 0 I=0. J=1. X=0. Y=1X : 0 Y : 0 Esterel v5 Algorithm

X = I and not Y Y = J and not X I=0. J=0X : 2 Y : 2 I=0. J=0. X=0X : 1 Y : 2 I=0. J=0. X=0. Y=0X : 1 Y : 1 I=0. J=0. X=0. Y=0X : 0 Y : 0 I=0. J=0. X=0. Y=0X : 1 Y : 0 Esterel v5 Algo.

Encode facts in CFSM events Use one CFSM per gate Use the network to propagate the facts POLIS Implementation Combinational gates -> sequential CFSMs Synchronous cycle -> full network execution

Constructive and not gate as a CFSM - v1 A B C input A: boolean, B : boolean; output C : boolean; [ await A; if not ?A then emit C(false) end || await B; if ?B then emit C(false) end ]; if ?A and not ?B then emit C(true) end

signal Caux : combine boolean with and in [ await A; if not ?A then emit Caux(false) end || await B; if ?B then emit Caux(false) end ]; if ?A and not ?B then emit Caux(true) end || await Caux; emit C(?Caux) end signal V2 : protecting double emission

Given an input assignment, the network builds a proof Each gate buffer is written at most once - no buffer overwriting - bounded time (linear) Termination when no more runnable CFSM - #events = #fanins -> constructive - else non-constructive Any scheduling gives the right answer!

But works only for one global tick! Macro-cycles - give synchronous events successively - logical timing by stream ordering a0 a1 a2 a3 a4 b0 b1 b2 b3 b4 c0 c1 c2 c3 c4

Four basic solutions : 1. Wait long enough (as for circuits) 2. Compute explicit termination signal 3. Let the scheduler report termination 4. Use a flow control protocol -> pipelining

Flow Control A B C A_Free B_Free C_Free

loop signal Caux : combine boolean with and in [ await A; emit A_Free; if not ?A then emit Caux(false) end || await B; emit B_Free; if ?B then emit Caux(false) end ]; if ?A and not ?B then emit Caux(true) end || [ await Caux || await C_Free ] ; emit C(?Caux) end signal end loop V3 : flow control

A gate resets for next tick when it has received all its input. No additional protocol needed! A=0 A_Free C_Free C=0 B=1 B_Free loop A=1 A_Free C_Free B=1 B_Free C=1 loop Automatic Gate Reset

Pipelining Problem : out-of-order data for next cycle A(0) -> A_Free C_Free -> C(0) A(1) -> B(1) -> B_Free 3. Tell the scheduler that only arrival of B matters => sensitivity lists 1. Memorize A(1) in the CFSM - heavy! 2. Write back 1 in the A buffer but gate immediately made runnable again!

module AndNot : % Boolean IO input A : boolean, B : boolean; output X : boolean; % Flow control IO output A_Free, B_Free; input C_Free; % Scheduling IO output A_Wait, B_Wait; output C_Free_Wait;

loop signal Caux : combine boolean with and in || end signal end loop

[ abort sustain A_Wait when A; emit A_Free; if not ?A then emit Caux(false) end || abort sustain B_Wait when B; emit B_Free; if ?B then emit Caux(false) end ]; if ?A and not ?B then emit Caux(true)

[ await Caux || abort sustain C_Free_Wait when C_Free ]; emit C(?Caux)

Temporary Summary One can implement a constructive circuit in POLIS by translating each gate into a CFSM Therefore, on can implement Esterel by first translating Esterel programs into gates Of course, this is inefficient : too fine grain But, we did not use compositionality yet!

Using Compositionality Any network of gates acts just as a gate Group gates either synchronously, using v5 algo., or asynchronously, in the network Adjust grouping according to geographical and performance requirements

Optimisation Group messages going from A to B Precompute the transitive effect of messages X=0 Y=1 X=0 Y=1

Summary Constructive logic semantics facts as information quanta Propagate facts synchronously in CFSM nodes asynchronously in the network Correct by construction Applicable to (some) real problems A step to mixed 0-delay / vibration language design

Termination signal X Y I J DONE Too expensive Non-local