Block Diagrams for Modeling and Design Edward A. Lee...
Transcript of Block Diagrams for Modeling and Design Edward A. Lee...
UNIVERSITY OF CALIFORNIA AT BERKELEY
iagrams.fmCopyright © 1998, The Regents of the University of CaliforniaAll rights reserved.
Design
Lee
eyCS
blockd
Block Diagrams for Modeling and
Edward A.Professor
UC BerkelDept. of EE
© 1998, p. 2 of 39
Abstract
trong human appeal,out a design. A fewpecify systems havediagrams can capturestems. Others have
a havior of software.n garnering support,
n achines, and objectgnizable as "block dia-re are many possible
ial if these diagramsexplores some of thend weaknesses make
h le model is likely toe recent innovations
equential control. So-s.
b
VmasafRimgcaptewc
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
isual depictions of electronic systems have always held a saking them extremely effective in conveying information abttempts to use such depictions to completely and formally succeeded, most notably in circuit design, where schematic ll of the essential information needed to implement some syiled dramatically, for example flowcharts for capturing the beecently, a number of innovative visual formalisms have beecluding visual dataflow, hierarchical concurrent finite state models. This talk focuses on the subset of these that are recorams." Such diagrams represent concurrent systems, but theoncurrency semantics. Formalizing the semantics is essentre to be used for system specification and design. This talk ossible concurrency semantics, arguing that their strengths aem complementary rather than competitive, so that no singmerge as a universally useful model. I will also describe somhere concurrency models are combined with automata for salled hybrid systems are a special case of such combination
© 1998, p. 3 of 39
Domains where Block Diagrams are Common
ite different.
TER
REGISTER
MULTIPLIER
MUX
SHIFTER
MUX
LATOR
ER
b
•
•
•
•
•
•
B
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
Circuit schematics
Computer architecture
Dynamical systems
Control theory
Signal processing
Communications
ut the meaning of these diagrams can be qu
REGIS
ACCUMU
ALU
SHIFT
SHIFTER
z-1 z-1 z-1 z-1
© 1998, p. 4 of 39
Properties of Block Diagrams
uted
mputation”
s.
b
•
•
•
•
•
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
Modular• Large designs are composed of smaller designs
• Modules encapsulate specialized expertise
Hierarchical• Composite designs themselves become modules
• Modules may be very complicated
Concurrent• Modules logically operate simultaneously
• Implementations may be sequential or parallel or distrib
Abstract• The interaction of modules occurs within a “model of co
• Many interesting and useful MoCs have emerged
Domain Specific• Expertise encapsulated in MoCs and libraries of module
© 1998, p. 5 of 39
Blocks and Signals
b
•
•
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
Blocks represent activities• May have inputs and outputs, or not
• May be implemented concurrently, or not
• Are conceptually concurrent
Signals represent shared information• Shared variables
• Functions of time
• Sequences of tokens
• Events in time
block
signal
A
B
C
D
© 1998, p. 6 of 39
Specifying Blocks
ignals)
other signals
b
•
•
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
Denotationally:• A relation between signals (constraints on acceptable s
• A function mapping input signals to output signals
e.g.
Operationally:• Given observations of some signals, how do we change
e.g.
uH
y
Y z( ) H z( )U z( )=
x n 1+( ) Ax n( ) bu n( )+=
y n( ) cT
x n( ) du n( )+=
© 1998, p. 7 of 39
Semantics
s (asystem)
have in a partic-
particular
b
•
•
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
The meaning of an interconnection of block
Denotational semantics:
The set of properties that signals mustular interconnection
Operational semantics:
How to compute the signal values for ainterconnection
block
signal
A
B
C
D
© 1998, p. 8 of 39
Determinacy
s that obeys the
, there is at
t least one
e determinate.
mily of behav-o
means that
behaviors.
b•
•
•
•
Ni
Hb
N
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
A behaviorof a system is a set of signal valuesemantics.
A system isdeterminate if knowing the inputsmost one behavior.
A system isreceptive if for all inputs there is abehavior.
A semantics is determinate if all systems ar
ondeterminacy can be useful inmodeling: a fars is described and analyzed compactly.
owever, nondeterminism is risky indesign if itehavior is underspecified.
ondeterminacy can be viewed as a family of
© 1998, p. 9 of 39
Some Candidate Semantics
s its place.
b
1234567
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
. Analog computers (differential equations)
. Discrete time (difference equations)
. Discrete-event systems
. Synchronous-reactive systems
. Process networks
. Dataflow
. Sequential processes that rendezvous
Basic claim of this talk: each of these ha
© 1998, p. 10 of 39
Essential Differences — Models of Time
chronous/reactive
⊥
⊥ ⊥ ⊥ ⊥⊥⊥
⊥ ⊥
m
ce of Memory , 1931
b
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
syn
continuous time
discrete time
ultirate discrete time
F1 F2 F3 F4
E1 E2 E3 E4
G1 G2 G3 G4
totally-ordered
partially-ordered discrete events
Salvador Dali, The Persisten
discrete events
© 1998, p. 11 of 39
Key Semantic Issues
ior? More than
point off.
behavior? All some property?d to know whethercs (full abstraction).
ntics as a block?.
b
•
•
•
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
Does a composition of blocks have a behavone behavior?• Typical hard case:
Denotationally, the behavior here is a signal that is fixed
Can a simulation or analysis strategy find abehaviors? A subset of behaviors satisfying• The “strategy” is an operational semantics, and we nee
this semantics is the same as the denotational semanti
Does a block diagram have the same sema• This is sometimes called the “compositionality” property
f
© 1998, p. 12 of 39
Key Practical Issues
b
•
•
•
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
Can it be simulated?• Bounded memory
• Bounded time for at least a partial solution
• Simulation speed
Can it be implemented?• Bounded memory
• Bounded time for at least a partial solution
• Synthesis algorithms
How many ways can it be implemented?• Software vs. hardware
• Parallel vs. sequential
• Scheduling algorithms
• Avoiding overspeficiation
© 1998, p. 13 of 39
1. Analog Computers
t
rm
0.9x 0.9+
b
E
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
xample: First-order differential equation:
componen
real-valued function
wavefo
A
B
C
of a continuum
1
+
constant
∫integral
gain
sum
0.9
xx =
© 1998, p. 14 of 39
Properties
elations
feedback loops)
iques
b
S
S
W
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
emantics:• blocks are relations between functions of time
• fixed point is a set of functions of time satisfying these r
trengths:• Accurate model for many physical systems
• Determinate under simple conditions (strict causality in
• Established and mature (approximate) simulation techn
eaknesses:• Covers a narrow application domain
• Tightly bound to an implementation
• Relatively expensive to simulate
• Difficult to implement in software
© 1998, p. 15 of 39
2. Discrete Time Processing
t
a5x n 4–( )+
b
E
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
xample: Difference equation:
componenA
B
C
discrete time signal
z-1 z-1 z-1 z-1x n( )
y n( )a1 a2 a3 a4 a5
y n( ) a1x n( ) a2x n 1–( ) a3x n 2–( ) a4x n 3–( )+ + +=
© 1998, p. 16 of 39
Properties
g these relations
stems
feedback loops)
b
S
S
W
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
emantics:• blocks are relations between functions of discrete time
• fixed point is a set of functions of discrete time satisfyin
trengths:• Useful model for many embedded signal processing sy
• Determinate under simple conditions (strict causality in
• Easy simulation (cycle-based)
• Easy implementation (synchronous circuits or software)
eaknesses:• Covers a narrow application domain
• Global synchrony may overspecify some systems
© 1998, p. 17 of 39
3. Discrete-Event Models
discrete pointsat is usually antities react tological order.
b
E•
•
•
•
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
xample application areas: Communication networks
Queueing systems
Manufacturing systems
Hardware architecture
entities
signal
[z1, z2, ...]
events
Events occur at on a time line thcontinuum. The eevents in chrono
[x1, x2, ...]
[y1, y2, ...]
A
B
C
© 1998, p. 18 of 39
Example: Hardware Architecture
controllerprocess
user interfaceprocess
nnect
CODEC
audio/video
b
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
control panel
ASIC microcontroller
real-timeoperatingsystem
system interco
DSPassembly
code
programmableDSP
host port
memory interface
microwave,
network
microfluidic,FPGA
MEMS
© 1998, p. 19 of 39
Properties
e)
feedback loops)
feedback loops)
e)
b
S
S
W
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
emantics:• Signals are sets of events placed in time (finite or infinit
• Blocks are relations between signals
• Fixed point is a set of signals
trengths:• Natural description of asynchronous digital hardware
• Global synchronization
• Determinate under simple conditions (strict causality in
• Simulatable under simple conditions (delta causality in
eaknesses:• Expensive to implement in software
• May over-specify and/or over-model systems (global tim
© 1998, p. 20 of 39
Machinery for Studying Semantics of 1,2, and 3
differ.
r the existence
s programsn find it.
2
b
•
•
Ew
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
The Cantor metric:
,
where is the glb of the times where and
Metric space theorems provide conditions foand uniqueness of fixed points.
xample result: VHDL (a DE language) permithere a fixed point exists but no simulator ca
d s1 s2,( ) 1
2τ-----=
τ s1 s
© 1998, p. 21 of 39
4. Synchronous/Reactive Models
f timequence of
e signals arepoint equation:
t, 1( )
t, z( )
t x y,( )
b
A•
•
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
pplication areas: Anything with elaborate control logic
User interfaces
module
signal
x
y
z
event
A discrete model oprogresses as a se“ticks.” At a tick, thdefined by a fixed
x
y
z
f A
f B
f C,
=
A
B
C
© 1998, p. 22 of 39
Properties
)
xed points)
b
S
S
W
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
emantics:• Each tick represents a new fixed point computation
• Convergence to fixed points (when possible) is finite
trengths:• Good match for control-intensive systems
• Tightly synchronized
• Determinate in most cases (use constructive semantics
• Maps well to hardware and software
eaknesses:• Computation-intensive systems are overspecified
• Modularity is compromised
• Causality loops are possible (no fixed point or multiple fi
• Causality loops are hard to detect
© 1998, p. 23 of 39
5. Process Networks
r threads)
s
(to my knowl-t implementa-
i ise (IMO).
l
b
P•
•
Pet
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
ossible application areas: User interfaces (determinate replacement fo
Asynchronous, multitasking, reactive system
rocess networks,per se, are not actually useddge) today. But the understanding of efficienons is very recent, and they hold much prom
A
B
C
process
stream of tokens
channe
© 1998, p. 24 of 39
Properties
es
n
sses)
cesses)
ndecidable)
b
S
S
W
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
emantics:• Blocks are relations between (possibly infinite) sequenc
• Operationally: sequences are constructed token by toke
• Any finite execution produces a prefix of the denotation
trengths:• Loose synchronization (distributable)
• Determinate under simple conditions (monotonic proce
• Implementable under simple conditions (continuous pro
• Maps easily to threads, but much easier to use
• Turing complete (expressive)
eaknesses:• Control-intensive systems are hard to specify
• Turing complete (deadlock and bounded memory are u
© 1998, p. 25 of 39
6. Dataflow
ocess is made upations).
scheduling)
bAo
A•
•
•
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
special case of process networks where a prf a sequence of firings (finite, atomic comput
pplication areas: Signal processing
Computer architecture (dynamic instruction
Compilers (an analysis technique)
actor
stream of tokens
tokens
A
B
C
© 1998, p. 26 of 39
Dataflow for Signal Processing
Author: UweTrautwein,TechnicalUniversity ofIlmenau,Germany
b
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
© 1998, p. 27 of 39
Properties
ons to get processes
ftware
b
S
S
W
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
emantics:• Firing functions are composed using higher-order functi
• Decidable special case: “synchronous dataflow”
trengths:• Good match for signal processing
• Loose synchronization (distributable)
• Determinate under simple conditions
• Special cases map well to hardware and embedded so
eaknesses:• Control-intensive systems are hard to specify
© 1998, p. 28 of 39
7. Rendezvous Models
t rendezvous ofeceiver. Com-buffered andxamples CCS.
b
A•
•
•
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
pplication areas: Client/server systems
Object-request brokers
Resource sharing
entities
signal
[z1, z2, ...]
events
Events represena sender and a rmunication is uninstantaneous. Einclude CSP and
[x1, x2, ...]
[y1, y2, ...]
A
B
C
© 1998, p. 29 of 39
Properties
b
S
S
W
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
emantics:• Rendezvous is atomic (indivisible)
• Traces (interleavings of rendezvous events)
trengths:• Models resource sharing well
• Partial-order synchronization (distributable)
• Supports naturally nondeterminate interactions
eaknesses:• Oversynchronizes some systems
• Difficult to make determinate (and useful)
© 1998, p. 30 of 39
A Key Property of Block Diagrams
in applicatione:
ically
b
Aa•
•
•
•
•
•
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
They are Static!
consequence is that they are typically usedreas where fixed algorithms prevail for all tim Circuits
Computer architecture
Dynamical systems
Control theory
Signal processing
Communications
We can generalize them by hierarchcombining with automata.
© 1998, p. 31 of 39
Sequential Example — Finite State Machines
hen a transi-e from one and actionsvariants specify a state is
b
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
A/i
C/j
B/k
Strengths:• Natural description of sequential control
• Behavior is decidable
• Can be made determinate (often is not, however)
• Easy to implement in hardware or software
Weaknesses:• Awkward to specify numeric computation
• Size of the state space can get large
states
transitions
z/r
guard/action
Guards specify wtion may be madstate to another,assert events. Inwhen remainingallowed.
x/p
y/q
name/invariant
© 1998, p. 32 of 39
Mixing Control and Concurrency — *Charts
mantics
b
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
Choice of domain here determines concurrent se
FSM
FSM
© 1998, p. 33 of 39
Hybrid Systems
g system
puters
er):
e a concur-e re.
b
•
•
T
Hr
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
A discrete program combined with an analo
A combination of automata and analog com
raditional syntax (example: leaking gas burn
ere, the differential equations hardly look likncy model, but in fact, in a trivial way, they a
x 1=y 1=
x 1≤z 1=
x 1=y 1=z 1=
x:=0
x 30≥x:=0
leaking not leaking
© 1998, p. 34 of 39
Alternative View of Hybrid Systems
ncy model and.
z
b
*a
F
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
charts with analog computers as the concurre particular style of nondeterminate automata
or example (leaking gas burner):
1 ∫y y
x 1≤x:=0
x 30≥x:=0leaking not leaking ∫
z
x
1 ∫x x
1z
1 ∫x x
0z
© 1998, p. 35 of 39
In general
are internally
defined in a
in theton.
of the
tem.
ted (as inhe same theomaton.
b
•
•
•
•
•
•
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
A concurrent system contains modules thatautomata.
States of an automaton contain subsystemsconcurrent semantics.
Transitions and guards depend on variablessubsystems as well as inputs to the automa
Transitions have actions on the subsystemsdestination state.
Multiple states may share the same subsys
If multiple concurrent semantics can be nesPtolemy), then subsystems need not have tsemantics as the system containing the aut
© 1998, p. 36 of 39
Example: DE, Dataflow, and FSMs
b
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
Implemented byBilung Lee
© 1998, p. 37 of 39
Heterogeneous System-Level Specification & Modeling
tion)
hnologies)
ynthesis, &
b
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
problem level (heterogeneous models of computa
implementation level (heterogeneous implementation tec
mapping, smodeling
© 1998, p. 38 of 39
Metamodeling
l
work
model
b
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
metamodeling framework
metamodel
semantic framework
modelcomponent
metamode
semantic frame
component
© 1998, p. 39 of 39
More Information
detail and lots
cy)
)
b
To
h
•
•
•
•
UNIVERSITY OF CALIFORNIA AT BERKELEY
lockdiagrams.fm
he following papers by the speaker give moref references:
ttp://ptolemy.eecs.berkeley.edu/papers/...
97/preliminaryStarcharts/
(on automata combined with concurren 97/denotational/
(on comparing concurrency semantics 97/dataflow/
(on the semantics of dataflow) 98/realtime/
(on the semantics of discrete events)