Esterel Overview - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

Esterel Overview

Description:

Esterel is a reactive programming language. Esterel is also a Synchronous language. Everything proceeds in lock-step. 7/4/09. Esterel notes. 5. You might hear that... – PowerPoint PPT presentation

Number of Views:27
Avg rating:3.0/5.0
Slides: 24
Provided by: caden2
Category:

less

Transcript and Presenter's Notes

Title: Esterel Overview


1
Esterel Overview
  • Roberto Passerone
  • ee249 discussion section

2
Classes of applications
  • Transformational
  • Interactive
  • Reactive

3
Model of Time
  • Totally ordered sequence of instants
  • Instants are also called ticks
  • There is nothing in between instants

4
Esterel
  • Esterel is a reactive programming language
  • Esterel is also a Synchronous language
  • Everything proceeds in lock-step

5
You might hear that...
  • In Esterel computation takes zero time
  • Communication also takes zero time
  • In other words, reactions to events are
    instantaneous

6
Model of Execution
  • There is a set of events E
  • We have a sequence of instants
  • For each instant a subset of the events in E is
    present
  • Hence the execution is a totally ordered sequence
    of events

7
Model of a System
  • The System implicitly represents the execution
  • The System is a collection of processes executing
    concurrently
  • Processes are placed in parallel using the
    parallel operator

8
Interaction of Processes
  • Processes interact by through signals that carry
    events
  • Events in signals can be either Present or Absent
  • Processes do NOT interact through shared
    variables

9
Checking for presence
  • Processes can test for the presence or absence of
    events in signals
  • present A then else ...

10
Awaiting an event
  • Processes can stop their execution until an event
    is present in a signal
  • await A
  • await A or B

11
Emitting an event
  • Processes can emit an event to a signal to make
    it present
  • emit A
  • emit A, 10

12
Execution of the System
  • Input events are posted for the current instant
  • The System reacts to the input event in the
    current instant
  • The System posts the output events for the
    current instant
  • Only at this point does the instant increment

13
When things occur
  • present tests the presence of signals in the
    current reaction
  • await stops the execution for the current
    reaction, until at least the next instant
  • emit emits the event during the current reaction

14
Important
  • There is no ordering of events within a reaction
  • All events present during a reaction occur at the
    same exact time (instant)
  • Hence when executing a present
  • if the signal is present continue with the then
  • if absent, must wait until it either becomes
    present or can prove it will not be emitted
    during the current reaction

15
Atomicity of reaction
  • The triple (input, reaction, output) is executed
    atomically
  • Atomic means that others cannot observe the
    intermediate steps. It is not necessarily
    instantaneous
  • Intermediate steps are only necessary to compute
    the overall reaction
  • All goes as if the computation took zero time
  • There are micro-steps they converge to a fixed
    point

16
How to execute
  • Start with the input events present
  • Activate all processes awaiting a present event
  • If events are emitted, activate processes that
    may be waiting
  • If presence is tested, wait until you know the
    outcome
  • Stop a process when it reaches an await

17
Compiling Esterel
  • The interpreter does the previous procedure
  • might have to look ahead
  • The compiler computes the reaction for all
    possible patterns of events
  • it constructs a finite automaton
  • construction similar to the derivative
    construction

18
Causality Problems
  • A reaction ends when all processes arrive at an
    await
  • What if you never hit one?
  • Loop
  • emit A
  • X X 1
  • end loop
  • Same as combinational loops in hardware

19
The fixed point may not exist
  • There are no solutions
  • present X then nothing else emit X
  • There are too many solutions
  • present X then emit X end

20
Esterel supports exceptions
  • Useful to jump out of a fragment of code
  • Abort when an event occurs
  • abort
  • code
  • code
  • when A

21
Seat-belt
If the driver turns on the key, and does not
fasten the seat belt within 5 seconds then an
alarm beeps for 5 seconds, or until the driver
fastens the seat belt, or until the driver turns
off the key
If the driver turns on the key, and does not
fasten the seat belt within 5 seconds then an
alarm beeps for 5 seconds, or until the driver
fastens the seat belt, or until the driver turns
off the key
If the driver turns on the key, and does not
fasten the seat belt within 5 seconds then an
alarm beeps for 5 seconds, or until the driver
fastens the seat belt, or until the driver turns
off the key
If the driver turns on the key, and does not
fasten the seat belt within 5 seconds then an
alarm beeps for 5 seconds, or until the driver
fastens the seat belt, or until the driver turns
off the key
If the driver turns on the key, and does not
fasten the seat belt within 5 seconds then an
alarm beeps for 5 seconds, or until the driver
fastens the seat belt, or until the driver turns
off the key
input KEY_ON
, END_TIMER
, KEY_OFF, BELT_ON
, RESET
output START_TIMER
, BEEP
loop
abort
present KEY_ON then
emit START_TIMER(5) await END_TIMER
emit START_TIMER(5) abort sustain BEEP when
END_TIMER
end
when KEY_OFF or BELT_ON
each RESET
22
You can run examples
  • Compile with -simul to run textual simulation
  • Use xes for graphical debugging
  • If we have time we can look at a simple example

23
Immediate reactions
  • Alternative formulation of await
  • It doesnt wait until the next reaction if the
    signal is present
  • Often creates causality problems
  • loop
  • await immediate A
  • X X 1
  • end loop
Write a Comment
User Comments (0)
About PowerShow.com