Behavioral Models and Specification Languages

Behavioral Models and
Specification Languages
TECHNISCHE
UNIVERSITÄT
ILMENAU
Basic
BasicConcepts
Concepts
ƒ
Integrated Hard- and Software Systems
http://www.tu-ilmenau.de/ihs
ƒ
ƒ
Behavioral
BehavioralModels
Models
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
Finite
FiniteState
StateMachine
Machine
(FSM)
(FSM)
NDFSM
NDFSM
composed
composedFSM
FSM
Petri
PetriNet
Net(PN)
(PN)
Data
Flow
Data FlowGraph
Graph(DFG)
(DFG)
Control
Flow
Graph
Control Flow Graph(CFG)
(CFG)
Control/Data
Flow
Graph
Control/Data Flow Graph
(CDFG)
(CDFG)
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
concurrency
concurrency
hierarchy
hierarchy
communication
communication
synchronisation
synchronisation
exception
exceptionhandling
handling
non-determinism
non-determinism
timing
timing
Specification
SpecificationLanguages
Languages
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
StateCharts
StateCharts
SDL
SDL
VHDL
VHDL
SystemC
SystemC
......
Why do we need Behavioral Models?
Models abstract from the real world to some extent (describing part of the system
from a specific view)
ƒ
Models may serve very different purposes, e.g. to describe, document or reason
about
ƒ the behavior of a system
ƒ the performance of a system
ƒ or some other purpose (safety, reliability, shock, temperature, ...)
Behavioral Models (or Models of Computation) represent formal frameworks to
describe the behavior of systems or parts hereof
ƒ
Formal definitions ease reasoning and refinement
ƒ
The description of the behavior may be abstract or concrete, e.g.
ƒ
ƒ
an abstract state machine describing the behavior of an elevator control
ƒ
a C program, assembler program or VHDL description
Behavioral models may concentrate on
ƒ
the externally-visibly behavior (analysis phase) or/and
ƒ
the internal details of the system (design and implementation phase)
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
2
Behavioral Models and Specification Languages
Behavior models (e.g. FSM, PN, DFG) represent well defined basic mechanisms
with underlying syntax and semantics to model specific aspects of a system or
parts hereof
Specification languages (e.g. Statecharts, SDL, VHDL) employ a set of basic
modeling mechanisms useful to specify systems of a specific application domain
Behavioral models and specification languages allow to:
ƒ
capture unambiguously the required functionality
ƒ
verify correctness of the functional specification wrt. given properties
ƒ
synthesize part of the specification
ƒ
use a variety of tools
Important characteristics of behavior models and specification languages
ƒ Expressiveness
ƒ Generality/applicability
ƒ Simplicity
ƒ Compilability/synthesizability
ƒ Verifiability
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
3
Behavioral Models (discrete time and state)
State-oriented models (behavior)
ƒ Finite State Machines
reactive
systems
ƒ Petri Nets
ƒ Hierarchical concurrent FSM
Action-oriented models (behavior)
ƒ data flow graph
transformational
systems
ƒ control flow graph
Structural Models
ƒ Structure-oriented models
ƒ component connectivity graph
ƒ Data-oriented models
ƒ entity relationship diagram
ƒ Jackson´s diagram
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
Heterogeneous models
ƒ
control/data flow graph
ƒ
structure chart
ƒ
programming language
paradigm
ƒ
object-oriented model
ƒ
program-state machine
ƒ
queueing model
6-Apr-06
4
More Models and Languages ... to complete the confusion!
More models ...
ƒ continuous time
ƒ continuous state
ƒ structure-oriented
ƒ data-oriented
ƒ ...
Each of these provides a formal
framework for reasoning about
certain aspects of the system
Focus here
Tower of Babel, Bruegel, 1563
ƒ
behavior rather that structure
ƒ
discrete time rather than continuous
ƒ
discrete state (digital) rather than continuous (analog)
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
5
Behavioral Models – Application Needs
Telecommunication
ƒ Heterogeneous specifications
including
ƒ data processing
ƒ control functions
ƒ
ƒ
Data processing, e.g. encryption,
forward error correction, …
ƒ computations done at regular
(often short) intervals
ƒ efficiently specified and
synthesized using Data Flow
models
Control functions (data-dependent
and real-time)
ƒ say when and how data
computation is done
ƒ efficiently specified and
synthesized using FSM models
Reactive Real-Time Systems
ƒ “react” to external environment
ƒ maintain permanent interaction
ƒ ideally never terminate
ƒ timing constraints (real-time)
ƒ As opposed to
ƒ transformational systems
ƒ interactive systems
Need a common model to perform
global system analysis and optimization
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
6
Finite State Machines (FSM)
Functional decomposition into states of operation
ƒ finite states
ƒ transitions between states
ƒ event triggered transitions
ƒ neither concurrency nor time (sequential FSMs)
Typical applications:
ƒ reactive (control) systems
ƒ protocols (telecom, computers, ...)
WAIT
KEY_ON => START_TIMER
OFF
KEY_OFF or
BELT _ON =>
END_TIMER_10 or
BELT_ON or
KEY_OFF => ALARM_OFF
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
END_TIMER_5 =>
ALARM_ON
ALARM
7
FSM Example: Seat Belt Control
Informal specification:
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
Formal specification:
WAIT
KEY_ON => START_TIMER
OFF
If none of the conditions is
satisfied, implicit self-loop in
the current state
Integrated HW/SW-Systems
KEY_OFF or
BELT _ON =>
END_TIMER_10 or
BELT_ON or
KEY_OFF => ALARM_OFF
Andreas Mitschele-Thiel
6-Apr-06
END_TIMER_5 =>
ALARM_ON
ALARM
8
Non-deterministic FSM (NDFSM): Incomplete Specification
Example: error checking
ƒ Partially specified (incomplete):
0
BIT or not BIT =>
1
BIT or not BIT =>
...
BIT or not BIT => ERR
7
BIT or not BIT =>
8
SYNC =>
Focus on synchronisation after 8th bit, not on parity
Completely specified as even parity:
ƒ
not BIT =>
0
BIT =>
p1
not BIT =>
BIT =>
d1
BIT =>
not BIT =>
...
...
p7
BIT => ERR
not BIT =>
not BIT => ERR
d7
BIT =>
8
SYNC =>
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
9
NDFSM: Unknown Behavior
Modeling the environment
ƒ Nondeterminism is useful to:
ƒ optimize (don’t care conditions)
ƒ verify (exclude impossible cases)
Example: driver model
s0
ƒ
=> KEY_ON or
KEY_OFF or
BELT_ON
Can be refined
e.g. introducing timing constraints
(minimum reaction time of 0.1 s between actions)
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
10
NDFSM: Time Range
Special case of unspecified/unknown behavior, but so common to deserve
special treatment for efficiency
Example: nondeterministic delay (between 6 and 10 s)
START =>
1
SEC =>
2
SEC =>
3
SEC =>
4
SEC =>
START =>
SEC => END
SEC =>
END
9
SEC =>
Integrated HW/SW-Systems
8
0
SEC => END
SEC =>
END
SEC =>
Andreas Mitschele-Thiel
6
7
5
SEC =>
SEC =>
6-Apr-06
11
NDFSMs and FSMs
ƒ
ƒ
Formally FSMs and NDFSMs are equivalent
(Rabin-Scott construction, Rabin ‘59)
In practice, NDFSMs are often more compact
(exponential blowup for determinization)
Example: non-deterministic selection
of transition a in state s1
Equivalent deterministic FSM
s1
s1
a
a
b
s2
c
c
s2,s3
s3
c
a
a
b
s3
a
b
a
s2
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
12
Finite State Machines – Discussion
Advantages:
ƒ Easy to use (graphical languages)
ƒ Powerful algorithms for
ƒ synthesis (SW and HW)
ƒ verification
Disadvantages:
ƒ Sometimes over-specify implementation
(sequencing is fully specified)
ƒ Number of states can be unmanageable
ƒ Numerical computations cannot be specified compactly (need
Extended FSMs)
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
13
Modeling Concurrency
Systems are typically composed of chunks of rather independent functionalities,
e.g. seat belt control || timer || driver
Systems may be physically distributed,
e.g. peer protocol automata
Need to compose parts described by sequential FSMs
ƒ
construct a complete model of the system
ƒ
building the cartesian product results in state explosion
Approach
ƒ
Describe the system using a number of separate FSMs and interconnect them
Issue
ƒ
How do the interconnected FSMs talk to each other?
Fundamental hypothesis:
all the FSMs change state together (synchronicity)
System state = Cartesian product of component states
(state explosion may be a problem...)
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
14
FSM Composition – Example
Example: seat belt control || timer
WAIT
KEY_ON => START_TIMER
KEY_OFF or
BELT _ON =>
OFF
Belt
Timer
Control
START_TIMER =>
START_TIMER =>
0
SEC =>
END_TIMER_10
Integrated HW/SW-Systems
END_TIMER_10 or
BELT_ON or
ALARM
KEY_OFF => ALARM_OFF
SEC =>
SEC =>
1
2
SEC =>
9
END_TIMER_5 =>
ALARM_ON
SEC =>
3
SEC =>
8
Andreas Mitschele-Thiel
4
SEC =>
7
SEC =>
6
6-Apr-06
SEC =>
END_TIMER_5
5
15
FSM Composition – Example
Cartesian product
KEY_ON and START_TIMER =>
must be coherent
START_TIMER
OFF, 0
WAIT, 1
not SEC and
(KEY_OFF or BELT_ON) =>
OFF, 1
SEC and
not (KEY_OFF or BELT_ON) =>
WAIT, 2
SEC and
(KEY_OFF or BELT_ON) =>
OFF, 2
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
16
Moore vs. Mealy Automata
Theoretically, same computational power
In practice, different characteristics
ƒ Moore machines:
ƒ non-reactive
(response delayed by 1 cycle –
clocked change of output only)
ƒ easy to design
(always well-defined)
ƒ good for SW implementation
ƒ
ƒ
ƒ
ƒ
n
Z
τ
a
Z
μ
Y
software is always “slow”
Mealy machines:
ƒ reactive (immediate response
to changes of input)
ƒ hard to compose
ƒ problematic SW implementation
ƒ
X
δ
a
X
δ
n
Z
τ
Z
λ
Y
due to immediate response to changes of input (interrupts/polling)
software must be “fast enough”
may be needed in hardware, for speed
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
17
Hierarchical FSM models – StateCharts
Problem: how to reduce the size of the representation?
Harel’s classical papers on StateCharts (language) and bounded concurrency
(model): 3 orthogonal exponential reductions
ƒ
ƒ
ƒ
Hierarchy:
ƒ
state a “encloses” an FSM
ƒ
being in a means FSM in a is active
ƒ
states of a are called OR states
ƒ
used to model preemption and exceptions
a
odd
a1
Concurrency:
ƒ
two or more FSMs are simultaneously active
ƒ
states are called AND states
even
done
Non-determinism:
ƒ
a2
error
used to abstract behavior
recovery
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
18
StateCharts – Basic Principles
Basic principles:
ƒ An extension of conventional FSMs
ƒ Conventional FSMs are inappropriate for the behavioral description of complex
control
ƒ flat and unstructured
ƒ inherently sequential in nature
ƒ StateCharts support
ƒ repeated decomposition of states into sub-states in an AND/OR fashion,
combined with a
ƒ synchronous communication mechanism (instantaneous broadcast)
State decomposition:
ƒ OR-States have sub-states that are related to each other by exclusive-or
ƒ AND-States have orthogonal state components (synchronous FSM composition)
ƒ AND-decomposition can be carried out on any level of states (more
convenient than allowing only one level of communicating FSMs)
ƒ Basic States have no sub-states (bottom of hierarchy)
ƒ Root State have no parent states (top of hierarchy)
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
19
StateCharts – OR Decomposition
State U is an abstraction of states S and T
To be in state U the system must
be either in state S or in state T
e
U
f
S
S
e
f
V
V
g
g
T
f
T
h
h
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
20
StateCharts – AND Decomposition
V,W
k
To be in state U the system
must be both in states S and T
U
V.Y
V,Z
S
V
e
X.Z
X,Y
T
Z
k
e
W
X
e
Y
X,W
Q
Q
R
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
R
6-Apr-06
21
StateCharts – Syntax
ƒ
ƒ
The general syntax of an expression labeling a transition in a StateChart is e[c]/a
where
ƒ e is the event that triggers the transition
ƒ c is the condition that guards the transition
(cannot be taken unless c is true when e occurs)
ƒ a is the action that is carried out if and when the transition is taken
For each transition label:
ƒ condition and action are optional
ƒ an event can be the changing of a value
ƒ standard comparisons (e.g. x > y) are allowed as conditions
ƒ assignment statements (e.g. x := 10) are allowed as actions
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
22
StateCharts – Actions and Events
ƒ
ƒ
An action a on the edge leaving a state may also appear as an event triggering
a transition going into an orthogonal state:
ƒ a state transition broadcasts an event visible immediately to all other FSMs,
that can make transitions immediately and so on
ƒ executing the first transition will immediately cause the second transition to
be taken simultaneously
Actions and events may be associated to the execution of orthogonal
components: start(A), stopped(B)
Statecharts will be covered in detail in IHS 2
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
23
Synchronous vs. Asynchronous FSMs
Synchronous FSMs (e.g. StateCharts):
ƒ communication by shared variables that are read and written in zero time
ƒ communication and computation happens instantaneously at discrete time
instants
ƒ all FSMs execute a transition simultaneously (lock-step)
ƒ may be difficult to implement
ƒ multi-rate specifications
ƒ distributed/heterogeneous architectures
Asynchronous FSMs (e.g. SDL, CSP) :
ƒ free to proceed independently
ƒ do not execute a transition at the same time (except for CSP rendezvous)
ƒ may need to share notion of time: synchronization
ƒ easy to implement
Multitude of commercial and non-commercial graphical languages and tools:
ƒ
StateCharts, UML, SDL, StateFlow
ƒ
tool support for design, simulation, validation, code generation, HW
synthesis, …
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
24
Asynchronous Communication
Blocking vs. non-Blocking
ƒ
ƒ
A
B
blocking read (receiver waits for sender)
ƒ
reading process can not test for emptiness of input
ƒ
must wait for input to arrive before proceeding
blocking write (sender waits for receiver)
ƒ
writing process must wait for successful write before continue
Languages
ƒ
blocking write/blocking read (CSP, CCS)
ƒ
non-blocking write/blocking read (FIFO, CFSMs, SDL)
ƒ
non-blocking write/non-blocking read (shared variables)
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
25
Asynchronous Communication – Buffering
A
B
ƒ
Buffers used to adapt when sender and receiver have different rate
ƒ size of buffer?
ƒ
Lossless vs. lossy
ƒ events/tokens may be lost
ƒ bounded memory: overflow or overwriting
ƒ need to block the sender
ƒ
Single vs. multiple read
ƒ result of each write can be read at most once or several times
Pure FIFO
ƒ prioritized events
ƒ out of order access to FIFO
ƒ
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
26
Communication Mechanisms
ƒ
Rendez-Vous (CSP)
ƒ No space is allocated for shared data, processes need to synchronize in
some specific points to exchange data
ƒ Read and write occur simultaneously
ƒ
Shared memory
ƒ Multiple non-destructive reads are possible
ƒ Writes delete previously stored data
ƒ
Buffered (FIFO)
ƒ Bounded (ECFSMs, CFSMs)
ƒ Unbounded (SDL, ACFSMs, Kahn Process Networks, Petri Nets)
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
27
Communication Models
writer is blocked (e.g.
if buffer is full)
reader is blocked
(e.g. if buffer is empty)
data may be
read once only
Blocking
Reads
Blocking
Writes
Single
Reads
Senders
Receivers
Buffer
Size
Unsynchronized
many
many
one
no
no
no
Read-Modify-write
many
many
one
yes
yes
no
Unbounded FIFO
one/many
one
unbounded
yes
no
yes
Bounded FIFO
one/many
one
bounded
yes
may be
yes
one
one
one
yes
yes
yes
Rendezvous
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
28
Petri Nets (PNs)
ƒ
ƒ
ƒ
ƒ
ƒ
Model introduced by C.A. Petri in 1962
ƒ Ph.D. Thesis: “Communication with Automata”
Applications: distributed computing, manufacturing, control, communication
networks, transportation, …
PNs describe explicitly and graphically:
ƒ sequencing/causality
ƒ conflict/non-deterministic choice
ƒ concurrency
Asynchronous model (partial ordering)
Main drawback: no hierarchy
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
29
Petri Net
ƒ
A PN (N,M0) is a Petri Net Graph N
ƒ
places: represent distributed state by holding tokens
ƒ
ƒ
ƒ
ƒ
marking (state) M is an n-vector (m1,m2,m3…), where mi is the non-negative
number of tokens in place pi.
initial marking (M0) is initial state
transitions: represent actions/events
ƒ
enabled transition: enough tokens in predecessors
ƒ
firing transition: modifies marking
p2
… and an initial marking M0
t2
p1
t1
p4
t3
p3
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
30
Concurrency, causality, choice
t1
Concurrency
t2
t5
Causality, sequencing
t3
Choice,
conflict
t4
t6
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
31
Communication Protocol
Send msg
Process 1
Process 2
Send Ack
Receive Ack
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
32
Producer-Consumer Problem
Produce
Buffer
Consume
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
33
Petri Nets - Properties
ƒ
Behavioral properties: depend on the initial marking (most interesting)
ƒ Reachability (of marking M from marking Mo)
ƒ Boundedness (number of tokens is limited)
ƒ Conservation (number of tokens remains constant)
ƒ Liveness (any transition can be fired from any marking M)
ƒ Schedulability
ƒ
Structural properties: do not depend on the initial marking (often too
restrictive)
ƒ Consistency
ƒ Structural boundedness
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
34
Control vs. Data Flow Applications
Rough classification:
ƒ control:
ƒ don’t know when data arrive
(quick reaction)
ƒ time of arrival often matters
more than value
ƒ data:
ƒ data arrive in regular streams
(samples)
ƒ values matter most
Distinction is important for:
ƒ specification (language, model, ...)
ƒ synthesis (scheduling,
optimization, ...)
ƒ validation (simulation, formal
verification, ...)
Integrated HW/SW-Systems
Specification, synthesis and validation
methods emphasize:
ƒ for control:
ƒ event/reaction relation
ƒ response time
(real-time scheduling for
deadline satisfaction)
ƒ priority among events and
processes
ƒ for data:
ƒ functional dependency between
input and output
ƒ memory/time efficiency
(data-flow scheduling for
efficient pipelining)
ƒ all events and processes are
Andreas Mitschele-Thiel
equal
6-Apr-06
35
Data Flow Graph (DFG)
Powerful formalism for data-dominated applications
DFG support the specification of transformational systems:
ƒ
output is a function of the input
ƒ
set of actors (nodes) connected by a set of arcs representing the data flow
ƒ
no states, no external events to trigger state changes
ƒ
unbounded FIFO queues (main data store)
ƒ
no control nodes, e.g. branch, loop
DFG represent a partial ordered model of the computation
=> specification of problem-inherent dependencies only
=> suitable for scheduling and code generation
=> there is a relation between buffer dimensioning and scheduling
(static scheduling minimizes the number of buffers required)
Languages:
ƒ
graphical: Ptolemy (UCB), GRAPE (U. Leuven), SPW (Cadence), COSSAP
(Synopsys)
ƒ
textual: Silage (UCB, Mentor), Haskell, Lucid
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
36
DFG
Semantics (informal)
ƒ
actors perform computation (often stateless)
ƒ
firing of actors when all needed inputs are available
ƒ
unbounded FIFOs for unidirectional exchange of data between actors
(integer, floats, arrays, etc.)
ƒ
extensions to model decisions
Example: FIR (finite impuls response) filter
ƒ
single input sequence i(n)
ƒ
single output sequence o(n)
ƒ
o(n) = c1 * i(n) + c2 * i(n-1)
* c2
i
i(-1)
* c1
+
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
o
6-Apr-06
37
DFG – Example
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
38
Control Flow Graph (CFG)
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
also called flow chart (abstract description of program designs)
focus on control aspect of a system
set of nodes and arcs
trigger of an activity (node) when a particular preceding activity is completed
different triggers for transitions
suitable for well defined tasks that do not depend on external events
imposes a complete order on the execution of activities
=> close to implementation (on conventional computer architecture)
various variants with various levels of details
ƒ simple operator level (addition, multiplication, etc)
ƒ abstract function/procedure level
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
39
CFG – Example (detailed level)
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
40
Control/Data Flow Graph (CDFG)
ƒ
ƒ
ƒ
ƒ
ƒ
also called sequence graph
mixture of control and data flow graph
hierarchy of sequential elements
ƒ units model data flow
ƒ hierarchy models control flow
special nodes (for control operations)
ƒ start/end node: NOP (no operation) – all inputs needed (AND), all outputs
needed (AND)
ƒ branch node (BR) – one out of many outputs selected (OR)
ƒ iteration (LOOP) – one out of two outputs selected (OR)
ƒ procedure call (CALL) – lower hierarchy is executed exactly once
attributes
ƒ nodes: execution time, cost, ...
ƒ arcs: conditions for branches and loops
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
41
CDFG – Entity
Legend:
data dependencies
control dependencies
Notes: AND dependencies at NOPs (NO Operation), OR dependencies at
BRanches and LOOPs
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
42
CDFG – Branch
Notes:
• data dependencies are not fully specified
• x = a – b may execute in parallel to IF statement
• computation of p and q within IF statement may execute in parallel
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
43
CDFG – Loop
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
44
CDFG – Call
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
45
Review of Models, Concepts and Languages
Basic
BasicConcepts
Concepts
ƒ concurrency
ƒ concurrency
ƒ hierarchy
ƒ hierarchy
ƒ communication
ƒ communication
ƒ synchronisation
ƒ synchronisation
ƒ exception handling
ƒ exception handling
ƒ non-determinism
ƒ non-determinism
ƒ timing
ƒ timing
Behavioral
BehavioralModels
Models
ƒ Finite State Machine (FSM)
ƒ Finite State Machine (FSM)
ƒ NDFSM
ƒ NDFSM
ƒ composed FSM
ƒ composed FSM
ƒ Petri Net (PN)
ƒ Petri Net (PN)
ƒ Data Flow Graph (DFG)
ƒ Data Flow Graph (DFG)
ƒ Control Flow Graph (CFG)
ƒ Control Flow Graph (CFG)
ƒ Control/Data Flow Graph
ƒ Control/Data Flow Graph
(CDFG)
(CDFG)
Integrated HW/SW-Systems
Specification
SpecificationLanguages
Languages
ƒ StateCharts
ƒ StateCharts
ƒ SDL
ƒ SDL
ƒ VHDL
ƒ VHDL
ƒ SystemC
ƒ SystemC
ƒ ...
ƒ ...
Andreas Mitschele-Thiel
6-Apr-06
46
Summary of Basic Concepts of Models and Languages
State transitions
ƒ
events triggering a state transition
(simple input, complex conditions)
ƒ
computation associated with
transition
Concurrency
ƒ
decomposition of behavior in
concurrent entities
ƒ
different levels of concurrency (job,
task-, statement-, operation-level)
ƒ
data-driven (data dependencies) vs
control-driven concurrency (control
dependencies)
ƒ
reduction of states
Hierarchy
ƒ
structural hierarchy (system, block,
process, procedure)
ƒ
behavioral hierarchy (hierarchical
transitions, fork-join)
Integrated HW/SW-Systems
Programming constructs
ƒ
specify sequential algorithm
Communication
ƒ
shared variables (broadcast)
ƒ
message passing
ƒ
synchronous vs. asynchronous
Synchronization
ƒ
control-dependent (fork-join)
ƒ
data-dependent (data, event,
message)
Exception handling
ƒ
immediate termination of current
behaviror
Non-determinism
ƒ
choice between multiple transitions
ƒ
non-deterministic ordering
Timing
ƒ
timeouts
ƒ
time constraints (e.g. exec. time)
Andreas Mitschele-Thiel
6-Apr-06
47
References
ƒ
ƒ
ƒ
D. Gajski, F. Vahid, S. Narayan, J. Gong: Specification and Design of
Embedded Systems. Prentice Hall, 1994. (chapters 2 and 3)
J. Teich: Digitale Hardware/Software Systeme. Springer, 1997.
University of Berkeley: Overview on papers on behavioral modelling
http://www-cad.eecs.berkeley.edu/~polis/class/index.html
Integrated HW/SW-Systems
Andreas Mitschele-Thiel
6-Apr-06
48