it 606 embedded systems software
Download
Skip this Video
Download Presentation
IT-606 Embedded Systems (Software)

Loading in 2 Seconds...

play fullscreen
1 / 46

IT-606 Embedded Systems (Software) - PowerPoint PPT Presentation


  • 426 Views
  • Uploaded on

IT-606 Embedded Systems (Software) S . Ramesh Kavi Arya Krithi Ramamritham KReSIT/ IIT Bombay Esterel: Basic Features and Constructs S. Ramesh Layered Organization: Conventional View Application Tasks Scheduling, IP Communication OS I/O Handlers Hardware

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'IT-606 Embedded Systems (Software)' - jacob


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
it 606 embedded systems software
IT-606Embedded Systems(Software)

S. Ramesh

Kavi Arya

Krithi Ramamritham

KReSIT/ IIT Bombay

layered organization conventional view
Layered Organization:Conventional View

Application Tasks

Scheduling,

IP Communication

OS

I/O Handlers

Hardware

layered organization esterel view
Layered Organization:Esterel View

Esterel Program +

Data Handler

Esterel Application

I/O Handlers

Bare Machine

an esterel program
An Esterel program
  • Describes the behavior of the reactive kernel
    • Has rich set of constructs for programming the kernel
    • Kernel is typically finite state
  • Interacts with its environment through an abstract interface
    • Signals and Sensors are the means of communication
    • Input, Output and Local signals
    • Sensors are inputs only
an esterel program contd
An Esterel program (contd.)
  • Has minimal data processing functions
  • Uses the data handling part for major data processing
    • Functions and Tasks are the means of communication.
    • Global and Local variables are used for communication
    • Host language support - C,C++, Ada
signals and sensors
Signals and sensors
  • Signals are the novel means of communication
  • idea from hardware systems
  • software abstractions of the interface
  • Signals can be pure or valued
    • pure signals have two status 'presence' or 'absence‘
    • valued signals when present carry values
    • values are typed, like integer, boolean, string,float
  • Signals are transient! - reset at the end of a reaction
signals and sensors9
Signals and sensors
  • environment communicates bysetting input signals
  • program communicates back via output signals
  • local signals are used for communication between concurrent modules
  • has a no. of constructs for handling signals
    • emit S, await S, present S then …
  • tickis a special signal always present
  • sensors are special signals used as input only
variables and expressions
Variables and Expressions
  • Esterel is an imperative language and hence uses variables
  • variables can store different types of values
    • integer, boolean, string, float
  • variables retain values until updated (across reactions)
  • variables can be local to a block of statements, a procedure or function or global
  • no sharing of variables with the environment
variables and expressions11
Variables and Expressions
  • No sharing of variables between concurrent threads
  • Variables are means of communication along a single sequential thread
  • The 'race problem' is absent!
  • Expressions can be formed out of variables
types and functions
Types and Functions
  • Esterel is meant for controller applications
  • Has minimal number of types
  • Integer, boolean, float and string
  • All other types used should be defined in the host language
  • Functions and Procedures called during execution
functions and procedures
Functions and Procedures
  • Their type specifications given in the program
  • their definition is written in the host language
  • value and reference parameters (like Pascal)
modules
Modules

Basic programming unit

  • Declarations
    • types, variables, functions and procedures (Pascal syntax)
    • input and output signals
    • relation constraints
  • Body of a module
    • the statement executed
    • sequential and concurrent flow of control
    • preemption and exceptions
declaration
Declaration

module TIMER:

%declaration

type TIME;

var t:=0:integer;

procedure dec(TIME)();

function zorn()(TIME):boolean;

input SECOND, SET(TIME), RESET;

output ALARM

relation SECOND # RESET

modules16
Modules

loop abort await SET(t); trap T inloop[ if zorn(t) then exit Telse nothing|| await SECOND; call dec(t);] end end; emit ALARM;when RESET;

end

end module.

execution model
Execution Model
  • execution is a series of reactions
  • invoked from an external 'main' program repeatedly at discrete points of time
  • one reaction per invocation
  • control returns after each reaction
reaction
Reaction
  • Considered instantaneous!
  • Control flows from one statement to its next
  • Concurrent control flows
  • Input signals do not change in status nor in their values.
  • Output and local signals may change
  • Signal presence tested and variables updated
  • Reaction proceeds until pause is encountered
reaction19
Reaction
  • Reaction stops when pause is encountered in all active threads
  • Next reaction starts from the next statement
  • Status and values of input signals are reset at the end of reaction
  • New values are set by the environment
statements
Statements
  • Rich set of high level constructs
    • Basic Statements
    • Derived Statements
  • Basic statements
    • Nothing

does nothing, terminates instantaneously

    • Pause
      • special control statement
      • stops the current reaction
      • does not terminate in the current reaction
      • terminates in the next reaction
basic statements
Basic Statements
  • {x:=expr}
    • classical assignment statement
    • terminates instantaneously
  • emit S
    • terminates instantaneously generating a pure signal S
basic statements contd
Basic Statements (contd.)
  • emit S(exp)
    • evaluate `exp' and emit S with the expression value
  • sustain S
    • sustains the signal S, i.e. emits the signal in each instant
classical control structures
Classical control structures
  • stat1; stat2
    • when stat1 terminates stat2 start instantaneously
  • if expr then stat1 else stat2
    • evaluation of the expression and the execution of the branch done in the same instance
classical control structures contd
Classical control structures (contd.)
  • call A(arg1)(arg2)
    • procedure call statement
    • transfer of control to the procedure, execution of the body and the return all done instantaneously!
  • var x in stat
    • block statement
    • xis local in this block
loop statement
Loop statement

loop stat end

  • repeated execution of stat
  • when stat terminates it is restarted
  • stat should not terminate instantaneously
  • one or more pause should be there
  • Consider

loop pause end

  • What is the behavior of this?
  • halt is a derived statement that stands for this
signal testing
Signal testing

present S then stat1 else stat2

  • Similar to conditional statement
  • tests the presence of a signal at the current reaction
  • testing, branching and executing are instantaneous
  • one of the branches could be absent
synchronous parallelism
Synchronous Parallelism

[stat1 || stat2 || stat3]

  • simultaneous (not concurrent) execution of all the statements
  • signals are used for communication
  • signal emitted by one thread is broadcast to all other threads
  • terminates when every stati terminates
  • no sharing of variables
  • compare with asynchronous parallelism
synchronous parallelism28
Synchronous Parallelism

Example:

[ emit S

||present S then emit O1 else emit O2

||

present S then emit O3 else emit O4

]

What is the behaviour of this program?

preemption statements
Preemption Statements
  • Strong abort primitive - watchdog

abort

stat

when S

  • The body stat is executed only when S is not present
  • Presence of S instantaneously kills the body
  • No statement in stat is executed when Sis present
  • terminates either when either stat terminates or when S is present
example
Example

abort pause; emit S1; pause; emit S2

when S

  • emits S1 in the second instant and S2 in third instant if S is not present during these instants.
  • if S is present in second instant then nothing happens; the whole statement exits.
example31
Example
  • if S is not present in the second instant but present in third instant then
    • S1 is emitted in the second instant, terminates in the third instant; no S2 is emitted in the third instant
  • S in the first instant is ignored
  • S in the first instant is not ignored if you write

abort stat when immediate S

await statements
Await statements

Consider

abort

halt

when S

This can be abbreviated as

await S

await tick

  • waits for the special signal tick
  • tick is present in every instant
  • equivalent to pause
a generalized await statement
A generalized await statement

awaitcase S1 do stat1case S2 do stat2case S3 do stat3

end

waits for one of the signals to be present

selects one of stati for execution

selects stati only if Si is present

selection is deterministic

nesting of aborts
Nesting of aborts

Consider

abort

abort

stat1

when S1;

stat2

when S2

  • when S1 is present, stat1is killed and stat2 is started
  • when S2 is present, what happens?
  • when both S1,S2 are present, the outer abort statement is exited
weak abort
Weak Abort

weak abort

stat

when S

  • A weaker form of watchdog
  • The strong abort statement prevented the execution of body in the instant when it was aborted
  • many time the body would like to write the last will at the time of aborting-some book keeping activity
  • weak abort statement allows computation of the body at the instant of aborting
example36
Example

weak abort

pause;

emit S1;

pause;

emit S2

when S

What is the difference? 

Weak abort statements can be nested. 

weak and strong statements can be nested

traps and exits
Traps and exits

trap T in

stat1

handle T do

stat2

end trap

  • Another weak preemption primitive
  • The body stat1 may contain exit statement

exit T

traps and exits38
Traps and exits
  • execution starts with execution of stat1 
  • when exit T is encountered the control jumps to the handle statement
  • handle statement is optional - control then returns to the statement following the trap statement
  • if stat1 is terminated then the whole trap statement is exited - stat2 is not executed
traps and exits contd
Traps and exits (contd.)
  • Concurrent traps

trap T,U,V in

stat1

handle T do

stat2

handle U do

stat3

handle V do

stat4

end trap

traps and exits contd40
Traps and exits (contd.)
  • Nested traps

trap T in

trap U in

stat1

handle U do

stat2

end trap U

stat3

handle T do

stat4

end trap T

process suspension
Process Suspension
  • Abort statements are like ctrl-C of Unix
  • Suspension inspired by ctrl-Z

suspend

stat

when S

  • behaves like stat so long as S is not present; if stat terminates then the whole terminates
process suspension contd
Process Suspension (contd.)
  • stat is not executed in the instants when S is present
  • execution is resumed at the suspended point, when S is present
  • S in the first instant is ignored; use immediate S to avoid this
local signal declarations
Local Signal Declarations

signal S in

stat

end signal

signal S is local in stat

stat does not react to any external S

S emitted in stat not visible outside

module instantiation
Module Instantiation
  • A program is a collection of modules
  • Any module can be main module, defined by the user at the time of compilation
  • modules can be instantiatedin other modules
  • module instantiation is a macro expansion
module instantiation contd
Module Instantiation (contd.)

run M

  • is the simplest instantiation.
  • during compilation, this statement is replaced by the body
  • all signal declarations discarded
  • data declarations exported to the parent module
a more general instantiation
A More General Instantiation

run M[X1/Y1, X2/Y2, . . . , Xn/Yn]

  • X/Y means that `X renames Y'
  • X can be a type, constant, function
  • X can be a variable or a signal
  • X should be declared in the module
ad