Professional Documents
Culture Documents
Digital Systems Design
Digital Systems Design
UNIVERSITÄT
ILMENAU
Andreas Mitschele-Thiel
Dieter Wuttke
Digital Systems Design
Part I
IQtroduction
2
Digital Systems Design
Motivation for the Course – Why is this important?
What are „Integrated HW/SW-Systems“?
Any computer system consists of hardware and software!
But: HW is often hidden and not considered important by SW developers
3
Digital Systems Design
Motivation for the Course – Why is this important?
Image “borrowed” from an Iomega advertisement for Y2K software and disk drives,
Scientific American, September 1999.
4
Digital Systems Design
Motivation for the Course – Why is this important?
Information Technology Scenario
5
Digital Systems Design
Objectives
Let’s assume you are employed as a system architect with some company and
faced with the following task:
The goal of the course is to provide the knowledge to make these kind of
decisions.
6
Digital Systems Design
Content IHS 2
Motivation and overview
Development process and tasks
System requirements
Behavioral models overview
FSM, NDFSM, FSM composition
PN, DFG, CFG, CDFG
Specification languages details
Statecharts
SDL
VHDL
SystemC
Functional validation
Performance/temporal validation
Optimization
7
Digital Systems Design
Organisational Stuff
Course prerequisites:
Basics of digital systems
Basics of computer architecture and computer design
Instructor contact:
Andreas Mitschele-Thiel Dr. Dieter Wuttke
Office: Zusebau, Room 1032 Office: Zusebau, Room 1067
Email: mitsch@tu-ilmenau.de Email: dieter.wuttke@tu-ilmenau.de
Phone: 03677-69-2819 Phone: 03677-69-2820
10
Digital Systems Design
Introduction
11
Digital Systems Design
Some Examples of Systems with Tight HW/SW Interaction
Communication systems
GSM/UMTS network elements
IP router (QoS support)
ATM switch
GSM/UMTS mobile
Safety-critical systems
fly-by-wire system
ABS, ASR, ESP, etc.
train control
control of physical and chemical processes
UTRAN CN
RNS
CS Domain
User Node B
Equipment
(UE)
MSC/VLR GMSC
RNC
RNS HLR/AuC/EIR
Node B
SGSN Gn GGSN
RNC
PS Domain
UE Iub
Node B
Uu Iu
13
Digital Systems Design
Example: Digital Wireless Platform
Java
phone
Keypad,
(bit level)
Control ARQ
A
Timing
D recovery
Equalizers MUD
Analog RF Adaptive
Filters Antenna
Algorithm
analog digital
DSP core
15
Digital Systems Design
Example: Modern Vehicles, an Electronic System
Cellular Body
Phone Control
Cellular
Phone Vehicle Web Site
Technology
Navigation Info/Comms/ Stereo/CD
AV Bus
GPS Display Comms
SW Shell
GSM/GPRS
Windows CE,
UMTS, Paging
NT, MAC, BIOS
Compression
User I/F
Output & I/F SW Apps
Voice Synthesis
Serial, Ethernet Browser,
Challenges Diagnostics
Voice Control
Comms, User Apps
Stylus, ETC
• Minimum Technology to
Satisfy User Requirements
• Usability Display
Processor
Heads Up,
• Integrate with Other Vehicle RISC, PowerPC
Flat Panel
Systems X86, Hitachi RISC
Graphics
• Add Functions Without
Adding the Cost
17
Digital Systems Design
Example: Smart Buildings
Stereo
Web-TV
Voice Video STB TV
Phone Phone
Entertainment
DVD Based Cam
PDA Telecom Player Corder
Based
PC-1
PC-2 laptop VCR
Still
Camera
Intercom Video
PC/Data Game
Door Sprinklers
Motion Sensors
Detectors Window Utility Toasters
Sensors Customization
Appliance
Security Based
Based
Video
surveillance
Light
Control Ovens
Climate
Control
Smoke Audio
Detectors Alarms
Clocks
19
Digital Systems Design
Example: Smart Dust Components
Laser diode
III-V process
Solar cell
CMOS or III-V
20 1-2 mm
Digital Systems Design
Example: Airborne Dust
Controlled auto-rotator
Rocket dust MEMS/Hexsil/SOI
MEMS/Hexsil/SOI
21
Digital Systems Design
Example: Synthetic Insects
Typical characteristics:
perform a small set of highly specific functions (not "general purpose”)
increasingly high-performance & real-time constrained
power, cost and reliability are often important issues
23
Digital Systems Design
What is a System Anyway?
environment
sensor
sensor
sensor
sensor actor
sensor
processing
Environment to environment
Sensors + Information Processing + Actuators
Computer is a system
Microprocessor (ASCI, memory) is not
24
Digital Systems Design
Design Process: Behavior vs. Structure
Performance models:
Models of emb. SW, comm. and
computation comp. resources
Requirements
System System
Validation Behavior Architecture
HW/SW
Behavior partitioning,
Mapping
Simulation scheduling
Performance
Simulation
SW
Synthesi Communication estimation
s Refinement
Flow To Implementation
25
Digital Systems Design
Will the system solution match the original system spec?
Software
? Hardware
• HW or IP Selection
• Design
• Verification
• System Test
Clock
VCXO
Select
Tx Synth/ STM
Optics MUX I/F
Line STS
OHP Cell/
Rx CDR/ I/F STS XC SPE Data Packet
Optics DeMUX PP Map Framer
I/F
mP
26
Digital Systems Design
Important Lessons
Communication is everywhere
27
Digital Systems Design
Digital Systems Design
Part II
Development Process
2
Digital Systems Design
System Development – Poor Process
Good planning.
Good common infrastructure.
Specialization of functions.
Good resource management.
4
Digital Systems Design
General Development Tasks
Analysis
of the requirements of the environment to the system
Modelling
the system to be designed and experimenting with algorithms involved
HW/SW partitioning
allocating elements in the refined model to either HW units or SW running on
custom hardware or general microprocessors
Scheduling
the times at which the functions are executed (this is important when several
modules in the partition share a single hardware unit)
5
Digital Systems Design
System Development Process – The Theory
Waterfall model
Analysis
Design
Implementation
Analysis
Problem
analysis
Feasibility
study
Requirements
analysis
Feasibility
study
Requirements
analysis
8
Digital Systems Design
Feasibility Study
Check the feasibility of the product development and the product
technical feasibility (availability of efficient algorithms, ...)
economic feasibility (time-to-market,
market window, investment, pay-off) Analysis
Problem
analysis
Feasibility
Focus of the feasibility study are study
Requirements
critical issues of the system analysis
in order to
improve confidence in the successful
completion of the project
Feasibility
study
Requirements
analysis
• Performance requirements
10
Digital Systems Design
Requirements Definition: Contents
Identification of the system (interfaces to the environment)
Functional requirements (functionality provided at the interfaces)
Temporal and performance requirements (throughput, response time, delay,
jitter)
Fault-tolerance and reliability
Quality (absence of errors)
Safety
Operating platform (OS, general HW)
Power consumption
Heat disipation
Operating environment (operating temperature, shock-, dust-resistance, etc.)
Size
Mechanical construction
EMC (Tx/Rx) We will see methods to ensure that
Maintainability
the requirements are met in the
Extendability
Support design section
Documentation
Cost (development, deployment and operation)
Date of completion
11 ...
Digital Systems Design
Design and Subphases
Design
Architectural
design
Detailed
design
Implementation
design
Purpose:
decide how the system meets the requirements -> inside view
focus on the solution
12
Digital Systems Design
Design and Subphases
13
Digital Systems Design
The Design Space: A Complex Optimization Problem
structural
view
msc data_transfer
application transport network medium network transport application
data-oriented functional
system
view view
behavioral
view
15
Digital Systems Design
Behavioral Models
Behavioral models describe the behavior of the system or parts hereof
END_TIMER_10 or
BELT_ON or
ALARM
KEY_OFF => ALARM_OFF
Send msg
Process 1 Process 2
Send Ack
Receive Ack
16
Digital Systems Design
Structural Models
Structural models focus on the structure of the system, i.e. its components,
modules, etc., rather than its behavior
&
&
&
17
Digital Systems Design
Behavior and Structure
System System
Validation Behavior Architecture
HW/SW
Behavior partitioning
Mapping
Simulation ,
scheduling
Performance
Simulation
Communication
Refinement
Synthesis
Flow To Implementation
18
Digital Systems Design
Behavior meets Structure: The Optimization Problem
There are numerous solutions to define
Behavioral Space the behavior consistent with the given
requirements (algorithms, data structures)
There are numerous ways to model the
defined behavior of the system
19 Structural Space
Digital Systems Design
Design: Behavior vs. Structure
Behavioral specifications describe the functionality of the system using some
modeling or programming language
behavior specifications may be
abstract models (state charts, UML, SDL) or
Tasks:
coding of functions, algorithms, etc. in the selected implementation language
test of the modules and components in isolation emulating the environment of
the modules/components
Notes:
provided the design is complete and correct this is straight-forward
the implementation phase represents a small part of the development process
(appr. 20% for pure SW projects)
21
Digital Systems Design
Validation Methods
By construction
Property is inherent.
By verification
Property is provable.
By testing
Check behavior of (all) inputs.
By simulation
Check behavior in the model world.
By intuition
Property is true. I just know it is.
By assertion
Property is true. Wanna make something of it?
By intimidation
Don’t even try to doubt whether it is true.
Tasks:
System integration: subsequent addition of HW components and SW
modules to the system until the final system is established
Integration testing: stepwise testing of system (requires knowledge of the
system as a whole)
System testing: test after all parts have been integrated
Notes:
Testing may be applied to almost all requirements or properties of systems,
system components or modules (functionality, performance, reliability, termal
resistance, shock resistance, ergonomics, man-machine interface,
documentation, ...)
Testing is the most popular validation method in practice
23
Digital Systems Design
Maintenance
involved during the whole lifetime of a system, from delivery till removal from
service
changing functional or
performance requirements
removal of errors
Note: often the maintenance cost are much greater than the development cost
24
Digital Systems Design
Process Models – Overview
Waterfall model (top-down)
engineering approach to building a house, bridge, etc.
no feedback assumed
Iterative waterfall model
validation and feedback to earlier stages
Evolutionary model
system development process is considered an evolution of prototypes
requirements are subsequently added to the system
Spiral model
generalisation of various process models (meta model)
multiple development cycles including validation
V model
continuous validation with real world/environment
Component-based (bottom-up)
compose the system of a set of predefined components (object-based)
25
Digital Systems Design
Classic Waterfall Model & Iterative Waterfall Model
Design
Implementation
Integration
Maintenance
26
Digital Systems Design
Evolutionary Model
Limits of the waterfall model
often the requirements are
incomplete in the beginning
waterfall model is not
appropriate where requirements analysis
are not well understood or not
well defined design
with the waterfall model,
there are no intermediate implementation
product releases modification of
product definition
test
Idea of the evolutionary model:
provide intermediate product new prototype
releases needed y
refine and extend n
requirements during the
development process
27
Digital Systems Design
Spiral Model
Meta model supporting the flexible combination of the above approaches
28
Digital Systems Design
V Model
Extension of the waterfall model to integrate quality assurance (verification and
validation)
validation
requirements application scenarios acceptance
definition test
verification
detailed test cases integration
design test
test
module cases module
implementation test
Validation: ensure the system conforms with the needs of the environment (are we
building the right system? – product quality)
Verification: ensures that the outcome of a development phase exactly conforms to
29the specification provided as input (is the system built right? – process quality)
Digital Systems Design
Traditional (Early Partitioning) vs. Codesign Approach
Early Partitioning (Structure First) HW/SW Codesign (Behavior First)
prototyp/product prototyp/product
System System
Behavior Architecture
1 2
System System
Behavior Architecture Mapping
3
Behavior on
System System
Architecture
Implementation Performance
Refine
4 Implementation
of System
31
Digital Systems Design
References
System Focus
D. Gajski, F. Vahid, S. Narayan, J. Gong: Specification and Design of
Embedded Systems. Prentice Hall, 1994.
A. Mitschele-Thiel: Systems Engineering with SDL – Developing Performance-
Critical Communication Systems. Wiley, 2001. (section 2.1.2)
J. Teich: Digitale Hardware/Software Systeme. Springer, 1997.
Software Focus
H. Balzert: Lehrbuch der Software-Technik – Band 1: Softwareentwicklung.
Spektrum-Verlag, 2001.
R. S. Pressman: Software Engineering – A Practicioner´s Approach. Fourth
Edition, McGraw Hill, 1997.
32
Digital Systems Design
Digital Systems Design
Part III
Requirements
2
Digital Systems Design
Requirements
Analysis process
Functional requirements
Performance requirements
Real-time requirements
Safety and reliability
Principles and elements of requirements analysis
3
Digital Systems Design
The Importance of Requirements
Analysis
Problem
analysis
Feasibility
study
Requirements
analysis
Design
The requirements analysis is a detailed study of the
requirements of the system as seen from its environment.
Major tasks are to
identify,
analyze and
classify
the requirements of the product to be built
5
Digital Systems Design
Requirements Definition: Contents
Identification of the system (interfaces to the environment)
Functional requirements (functionality provided at the interfaces)
Temporal and performance requirements (throughput, response time, delay,
jitter)
Fault-tolerance and reliability
Quality (absence of errors)
Safety
Operating platform (OS, general HW)
Power consumption
Heat disipation
Operating environment (operating temperature, shock-, dust-resistance, etc.)
Size
Mechanical construction
EMC (Tx/Rx)
Maintainability
Extendability
Support
Documentation
Cost (development, deployment and operation)
Date of completion => let‘s take a look at
6 ... some details
Digital Systems Design
Functional Requirements
Definition of the exact behavior of the system as seen at its interfaces
c1 * i(n)
OFF
KEY_OFF or END_TIMER_5 => S
BELT _ON => ALARM_ON
* c2 + o(n)
END_TIMER_10 or i(n-1) c2 * i(n-1)
BELT_ON or
ALARM
KEY_OFF => ALARM_OFF
7
Digital Systems Design
Performance Requirements
Important performance requirements
Capacity
response time
Response time
Jitter
deadline time
Definitions:
If the result is useful even after the deadline, we call the deadline soft.
If the result is of no use after the deadline has passed, the deadline is called firm.
If a catastrophe could result if a strict deadline is missed, the deadline is called
hard.
A real-time computer system that has to meet at least one hard deadline is called
a hard real-time system.
System design for hard- and soft real-time systems is fundamentally different.
9
Digital Systems Design
Real-time (Temporal) Requirements
Examples:
soft deadlines
public transportation system
firm deadlines
audio processing
video processing
hard deadlines
control of nuclear or chemical processes (chain reaction)
10
Digital Systems Design
Real-time Systems – Classification
11
Digital Systems Design
Time Triggered (TT) vs. Event Triggered (ET) Systems
A system is Time Triggered (TT) if the control signals, such as
sending and receiving of messages
recognition of an external state change
are derived solely from the progression of a (global) notion of time.
A system is Event Triggered (ET) if the control signals are derived solely from
the occurrence of events, e.g.,
termination of a task
reception of a message
an external interrupt.
Note that the triggering method is often an attribute of the implementation and
not necessarily a requirement.
12
Digital Systems Design
Safety Requirements: Fail-Safe vs. Fail-Operational
Safety requirements define the action taken in the case of a failure.
13
Digital Systems Design
Reliability Requirements
Reliability denotes the probability for a failure or absence from failure of a
system
The reliability of the system can be estimated/calculated (in theory) from the
reliability of its components
A system that ensures that it still functions correctly even in the case of failure of
some components is called a fault tolerant system (i.e. it is able to tolerate faults
of single components of the system)
14
Digital Systems Design
Predictability in Rare Event Situations
A rare event is an important event that occurs very infrequently during the
lifetime of a system, e.g. the rupture of a pipe in a nuclear reactor.
A rare event can give rise to many correlated service requests (e.g. an alarm
shower).
In most cases, typical workload testing will not cover the rare event scenario.
15
Digital Systems Design
Principles and Elements of the Analysis Model
Guidelines for the analysis:
understand the problem first! (before you begin to create the analysis model)
record origin and reason for every requirement
use multiple views of requirements (data model, functional model, behavioral
models)
priorize requirements
eliminate ambiquities
Specific methods and tools for various application areas have been proposed,
e.g. real-time systems, transformational systems, control systems,
communication systems, etc.
16
Digital Systems Design
References
H. Balzert: Lehrbuch der Software-Technik – Band 1: Softwareentwicklung.
Spektrum-Verlag, 2001.
R. S. Pressman: Software Engineering – A Practicioner´s Approach. Fourth
Edition, 1997. (Chapter 12: Analysis Modeling)
A. Mitschele-Thiel: Systems Engineering with SDL – Developing Performance-
Critical Communication Systems. Wiley, 2001.
B. Thomé (Editor): Systems Engineering – Principles and Practice of
Computer-based Systems Engineering, Wiley, 1993.
17
Digital Systems Design
Digital Systems Design
Part IV
Behavioral Models and
Specification Languages
1
Digital Systems Design
Behavioral Models and Specification Languages
Basic Concepts
concurrency
hierarchy
communication
synchronisation
Behavioral Models exception handling
Finite State Machine non-determinism
(FSM) timing
NDFSM
composed FSM
Petri Net (PN)
Data Flow Graph (DFG)
Control Flow Graph (CFG)
Control/Data Flow Graph Specification Languages
(CDFG) StateCharts
SDL
VHDL
SystemC
...
3
Digital Systems Design
Finite State Machines (FSM)
Typical applications:
reactive (control) systems
4
Digital Systems Design
Finite State Machines – Control Algorithms
5
Digital Systems Design
Finite State Machines – Discussion
6
Digital Systems Design
Moore vs. Mealy Automata
Theoretically, same computational power
In practice, different characteristics
Moore machines:
non-reactive
(response delayed by 1 cycle – δ n
τ a
µ
X Z Z Y
clocked change of output only)
easy to design
(always well-defined)
good for SW implementation
software is always “slow”
Mealy machines:
a
reactive (immediate response Z
to changes of input) δ τ λ
n
hard to compose X Z Y
problematic SW implementation
due to immediate response to changes of input (interrupts/polling)
software must be “fast enough”
may be needed in hardware, for speed
7
Digital Systems Design
Finite State Machines – Discussion
8
Digital Systems Design
Finite State Machines – Example: state diagram (informal)
9
Digital Systems Design
Finite State Machines – Discussion
Advantages:
Easy to use (graphical languages)
verification
Disadvantages:
Sometimes over-specify implementation
10
Digital Systems Design
Finite State Machines - Extensions
⇒ Nondeterminism
⇒ Parallel automata
⇒ Processes
⇒ Communication
⇒ Hierarchy
⇒ Graphical support
11
Digital Systems Design
NDFSM: Time Range
12
Digital Systems Design
NDFSMs and FSMs
Fundamental hypothesis:
all the FSMs change state together (synchronicity)
System state = Cartesian product of component states
(state explosion may be a problem...)
14
Digital Systems Design
FSM Composition – Example
Example: seat belt control || timer
KEY_ON => START_TIMER WAIT
Belt control:
• 5 sec after the car key is switched on, an alarm signal should be on as long as
the belt is not locked.
• After 10 sec the alarm should be switched off
15
Digital Systems Design
FSM Composition – Example
Example: seat belt control || timer
KEY_ON => START_TIMER WAIT
SEC =>
SEC => SEC => SEC => SEC =>
0 END_TIMER_10
9 8 7 6 5
16
Digital Systems Design
FSM Composition – Example
Cartesian product
SEC and
OFF, 1
(KEY_OFF or BELT_ON) =>
OFF, 2
17
Digital Systems Design
Finite State Machines - Extensions: parallel automata
18
Digital Systems Design
FSM Extensions – Example: user interaction > Processes
19
Digital Systems Design
FSM Extensions - Communication (MSC)
20
Digital Systems Design
Hierarchical FSM models – StateCharts
21
Digital Systems Design
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)
22
Digital Systems Design
StateCharts – OR Decomposition
State U is an abstraction of states S and T
e
U
f
S
S
e f
V V
g g
T f
T
h
h
23
Digital Systems Design
Digital Systems Design
Part V
High-level Synthesis
1
Digital Systems Design
High-level Synthesis
3
Digital Systems Design
Motivation for High-level Synthesis
Complexity problem: millions of transistors on a single chip
=> handcrafting of each single transistor is not possible
=> handcrafting of single gates is not possible
=> cost and time of the process require to do it right the first time
=> need design automation on more abstract levels
=> high-level synthesis
algorithm synthesis
HW/SW (system)
synthesis
4
Digital Systems Design
Domains of HW Design
Y chart: design domains and abstraction levels
t = 5 ns
processors,
memories, buses CFG, algorithms
registers, ALUs, MUXs register transfers
gates, flip-flops Boolean expressions
transistors transistor functions
transistor layout
cells
chips
boards
processors,
memories, buses CFG, algorithms
registers, ALUs, MUXs register transfers
gates, flip-flops Boolean expressions
transistors transistor functions
transistor layout
cells
chips
boards
behavioral domain
structural domain
processors,
memories, buses CFG, algorithms
registers, ALUs, MUXs register transfers
gates, flip-flops Boolean expressions
transistors transistor functions
transistor layout
cells
chips
boards
behavioral domain
structural domain
processors,
memories, buses CFG, algorithms
registers, ALUs, MUXs register transfers
gates, flip-flops Boolean expressions
transistors transistor functions
transistor layout
cells
chips
boards
transistor layout
cells
chips
boards
processors,
memories, buses CFG, algorithms
registers, ALUs, MUXs register transfers
gates, flip-flops Boolean expressions
transistors transistor functions
transistor layout
cells
chips
boards
12
Digital Systems Design
High-level Synthesis – Central Tasks
High-level synthesis deals with
the algorithmic level (behavioral viewpoint)
the system level (structural viewpoint)
16
Digital Systems Design
Control/Data Flow Graph (CDFG)
also called sequence graph
mixture of control and data flow graph
hierarchy of sequential elements
units model data flow
attributes
nodes: execution time, cost, ...
17
Digital Systems Design
DFG – Example
21
Digital Systems Design
CDFG – Loop
22
Digital Systems Design
Review of Models, Concepts and Languages
Basic Concepts
concurrency
hierarchy
communication
synchronisation
Behavioral Models
exception handling
Finite State Machine (FSM)
non-determinism
NDFSM
timing
composed FSM
SDL
VHDL
SystemC
...
23
Digital Systems Design
Data Flow Graph (DFG)
Powerful formalism for data-dominated applications
Languages:
graphical: Ptolemy (UCB), GRAPE (U. Leuven), SPW (Cadence), COSSAP
(Synopsys)
textual: Silage (UCB, Mentor), Haskell, Lucid
24
Digital Systems Design
High-level Synthesis: Example
Behavioral model:
* * * * +
1 2 6 8 10
* * + <
3 7 9 11
Resource model:
- * multiplier *
4 1 2
data * *
3 6
dependency
- * *
5 7 8
t0
* 1 * 2 * * 8
+ 10
6
t1
* 3 * + 9
< 11
7
t2
- 4
t3
- 5
t4
26
Digital Systems Design
High-level Synthesis: Example
Mapping and scheduling with limited resources:
4 multipliers
2 ALUs
=> latency 4 T t
0
* 1 * 2 * * 8
+ 10
6
t1
* 3 * + 9
< 11
7
t2
- 4
t3
- 5
t4
27
Digital Systems Design
High-level Synthesis: Example
Mapping and scheduling with
t0
limited resources:
* 1
+ 10
1 multiplier
t1
1 ALU
* <
=> latency 7 T 2 11
t2
* 3
t3
* - 4
6
t4
* 7
t5
* 8
- 5
t6
+ 9
t7
28
Digital Systems Design
ASAP Scheduling without Resource Constraints
ASAP (as soon as possible) scheduling without resource constraints:
algorithm: for each time slot select node which has all predecessors assigned
problem is solvable in polynomial time
t0
assign all nodes
without predecessors * * * * +
1 2 6 8 10
t1
assign nodes with
scheduled predecessors * 3 * + 9
< 11
7
t2
dito - 4
t3
dito
- 5
t4
29
Digital Systems Design
ALAP Scheduling without Resource Constraints
ALAP (as late as possible) scheduling without resource constraints:
algorithm: complementary to ASAP; start with nodes without successors
problem is solvable in polynomial time
t0
dito
* 1 * 2
t1
dito * *
3 6
t2
assign nodes with
scheduled successor - 4 * * +
7 8 10
t3
assign all nodes
without sucessor - + 9
< 11
5
t4
30
Digital Systems Design
Scheduling with Resource Constraints: ASAP Extension
Extensions to ASAP and ALAP, respectively
compute schedule using ASAP (or ALAP)
if a resource constraint is violated, move respective nodes
Example: extended ASAP (2 multiplier, 2 ALUs)
t0
* 1 * 2 * * 8
+ 10
7
t1
* * + < 11
3 76 9
t2
- 4 * *
6 8
t3
- 5 + 9
t4
31
Digital Systems Design
Scheduling with Resource Constraints: List Scheduling
Apply global criteria to optimize the schedule t0
derive priority for each node based on
* 1
+ 10
length of path to sink/source or
t1
laxity of node (i.e. the difference
between start according to ASAP and * 2
< 11
ALAP) or t2
number of successor nodes (fanout)
* 3
Example: 1 multiplier, 1 ALU
t3
Priority assignment (according to length to sink):
* - 4
6
4 * 1
4 * 2
3 * 2 * 8
2 + 10 t4
6
* 7
3 * 3
2 * 1 + 9
1 < 11 t5
7
* 8
- 5
2 - 4
t6
+ 9
t7
32 - 5 1
Digital Systems Design
Scheduling with Resource Constraints: List Scheduling
t0
Example:
2 combined multiplier/ALU units t1 * *
1 2
2 time units for multiplication
t3 * 6 * 3
Priority assignment (length to sink):
t4
6 * 1
6 * 2
5 * 3 * 8
2 + 10
6
t5 * 7 * 8
4 * 3
3 * 1 + 9
1 < 11
7
t6
- 4
+ 10
2 - 4 t7
- 5
+ 9
t8
1 - 5 <
11
33 t9
Digital Systems Design
Advanced Topics of High-level Synthesis
Considered so far:
mapping and scheduling without resources constraints
mapping and scheduling with given number (and type) of resources
Advanced topics:
mapping and scheduling with time constraints and open number of resources
mapping and scheduling of periodic tasks
mapping and scheduling in the presence of multiple resources with identical
functionality but different area-latency relations
...
The general mapping and scheduling problem is NP hard (optimal solution is not
computable in polynomial time)
Numerous heuristic optimization algorithms have been applied to the problem
34
Digital Systems Design
References
D. Gajski, N. Dutt, A. Wu, S. Lin: High-level Synthesis – Introduction to Chip
and System Design. Kluwer Academic Publishers, 1992.
Bleck, Goedecke, Huss, Waldschmidt: Praktikum des modernen VLSI-
Entwurfs. B.G. Teubner, 1996
J. Teich: Digitale Hardware/Software Systeme. Springer, 1997.
35
Digital Systems Design
Models, Concepts and Languages
Basic Concepts
concurrency
hierarchy
communication
synchronisation
Behavioral Models
exception handling
Finite State Machine (FSM)
non-determinism
NDFSM
timing
composed FSM
SDL
VHDL
SystemC
...
1
Digital Systems Design
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
7
Digital Systems Design
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 (problem in reality!!!)
8
Digital Systems Design
StateCharts – Hierarchy
State decomposition:
Initialization:
9
Digital Systems Design
StateCharts – OR Decomposition
State U is an abstraction of states S and T
e
U
f
S
S
e f
V V
g g
T f
T
h
h
10
Digital Systems Design
StateCharts – Top Down Design
State V is an abstraction of states S and U
11
Digital Systems Design
StateCharts – Default State
12
Digital Systems Design
StateCharts – Default State
13
Digital Systems Design
StateCharts – Exit on Sub-States
14
Digital Systems Design
StateCharts – Default State and History
15
Digital Systems Design
StateCharts – AND State
16
Digital Systems Design
StateCharts – AND State
Entry of top state (e.g. caused by event “n”) activates all parallel automata
18 Leaving of sub-state (e.g. caused by “h (inS)”) deactivates the top state A
Digital Systems Design
StateCharts – external transition variants to AND States
Entry of top state (e.g. caused by event “n”) activates all parallel automata
19 Leaving of sub-state (e.g. caused by “h (inS)”) deactivates the top state A
Digital Systems Design
StateCharts – Action on Entry and/or Exit
20
Digital Systems Design
StateCharts – Synchrony Hypothesis
21
Digital Systems Design
StateCharts – Synchrony Problem
22
Digital Systems Design
StateCharts – Microsteps
23
Digital Systems Design
StateCharts – Example
24
Digital Systems Design
StateCharts – AND Decomposition <> Composition
k X,W
Q
Q R
R
25
Digital Systems Design
StateCharts – Summary
26
Digital Systems Design
Asynchronous Communication
Languages
blocking write/blocking read (CSP, CCS)
non-blocking write/blocking read (FIFO, CFSMs, SDL)
non-blocking write/non-blocking read (shared variables)
27
Digital Systems Design
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
28
Digital Systems Design
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)
29
Digital Systems Design
Communication Models
writer is blocked (e.g.
if buffer is full)
30
Digital Systems Design
Petri Nets (PNs)
conflict/non-deterministic choice
concurrency
31
Digital Systems Design
Petri Net
t3
p3
32
Digital Systems Design
Concurrency, causality, choice
t1
Concurrency
t2
t5
Causality, sequencing
Choice,
conflict
t3 t4
t6
33
Digital Systems Design
Communication Protocol
Send msg
Process 1 Process 2
Send Ack
Receive Ack
34
Digital Systems Design
Producer-Consumer Problem
Produce
Buffer
Consume
35
Digital Systems Design
Summary: Control Flow Description
⇒ Nondeterminism ⇒ NDFSM
⇒ Processes ⇒ SDL
⇒ Communication ⇒ MSC
37
Digital Systems Design
Control vs. Data Flow Applications
Rough classification: Specification, synthesis and validation
control: methods emphasize:
don’t know when data arrive for control:
38
Digital Systems Design
Data Flow Graph (DFG)
Powerful formalism for data-dominated applications
Languages:
graphical: Ptolemy (UCB), GRAPE (U. Leuven), SPW (Cadence), COSSAP
(Synopsys)
textual: Silage (UCB, Mentor), Haskell, Lucid
39
Digital Systems Design
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
i * c2
* c1 i(-1)
+ o
40
Digital Systems Design
DFG – Example
41
Digital Systems Design
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)
42
Digital Systems Design
CFG – Example (detailed level)
43
Digital Systems Design
Control/Data Flow Graph (CDFG)
also called sequence graph
mixture of control and data flow graph
hierarchy of sequential elements
units model data flow
attributes
nodes: execution time, cost, ...
44
Digital Systems Design
CDFG – Entity
Legend:
data dependencies
control dependencies
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
46
Digital Systems Design
CDFG – Loop
47
Digital Systems Design
CDFG – Call
48
Digital Systems Design
Review of Models, Concepts and Languages
Basic Concepts
concurrency
hierarchy
communication
synchronisation
Behavioral Models
exception handling
Finite State Machine (FSM)
non-determinism
NDFSM
timing
composed FSM
SDL
VHDL
SystemC
...
49
Digital Systems Design
Summary of Basic Concepts of Models and Languages
State transitions Programming constructs
events triggering a state transition specify sequential algorithm
(simple input, complex conditions) Communication
computation associated with shared variables (broadcast)
transition
message passing
Concurrency
synchronous vs. asynchronous
decomposition of behavior in
concurrent entities Synchronization
different levels of concurrency (job, control-dependent (fork-join)
task-, statement-, operation-level) data-dependent (data, event,
data-driven (data dependencies) vs message)
control-driven concurrency (control Exception handling
dependencies) immediate termination of current
reduction of states behaviror
Hierarchy Non-determinism
structural hierarchy (system, block, choice between multiple transitions
process, procedure) non-deterministic ordering
behavioral hierarchy (hierarchical Timing
transitions, fork-join)
timeouts
50 time constraints (e.g. exec. time)
Digital Systems Design
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.
http://www.sei.cmu.edu/publications/documents/02.reports/02tn001.html
51
Digital Systems Design
Models, Concepts and Languages
Basic Concepts
concurrency
hierarchy
communication
synchronisation
Behavioral Models
exception handling
Finite State Machine (FSM)
non-determinism
NDFSM
timing
composed FSM
SDL
VHDL
SystemC
...
1
Digital Systems Design
Parallel Finite State Machines - Result of Decomposition
2
Digital Systems Design
Parallel Finite State Machines Example
3
Digital Systems Design
Single FSM
4
Digital Systems Design
FSM- Decomposition / Composition
5
Digital Systems Design
Parallel Finite State Machines - Properties
Concurrency
Delay
Synchronization
Rendezvous
Mutual exclusion
Blocking
Priorization
6
Digital Systems Design
Finite State Machines - Stability
Stable {X2,X1,X0}
{X0}
{X3}
{X1}
In = X1= Out
7
Digital Systems Design
Finite State Machines - Stability
Instable {X2}
{X0} {X1,X0}
{X1} {X3}
In = X1= Out
8
Digital Systems Design
Finite State Machines - Stability
Conditionally stable
stable for X0
In = X0 Out ={X0,X2,X3}
In = X1 Out = X1
(instable for X1 )
9
Digital Systems Design
Finite State Machines - Stability
Example
10
Digital Systems Design
Finite State Machines - Stability
Example
11
Digital Systems Design
Finite State Machines - Stability
Example
12
Digital Systems Design
Finite State Machines - Stability
Example
13
Digital Systems Design
Finite State Machines - Stability
Instable States
14
Digital Systems Design
Finite State Machines - Stability
Stable States (abstraction)
15
Digital Systems Design
Petri Nets (PNs)
conflict/non-deterministic choice
concurrency
22
Digital Systems Design
Summary of Basic Concepts of Models and Languages
State transitions Programming constructs
events triggering a state transition specify sequential algorithm
(simple input, complex conditions) Communication
computation associated with shared variables (broadcast)
transition
message passing
Concurrency
synchronous vs. asynchronous
decomposition of behavior in
concurrent entities Synchronization
different levels of concurrency (job, control-dependent (fork-join)
task-, statement-, operation-level) data-dependent (data, event,
data-driven (data dependencies) vs message)
control-driven concurrency (control Exception handling
dependencies) immediate termination of current
reduction of states behavior
Hierarchy Non-determinism
structural hierarchy (system, block, choice between multiple transitions
process, procedure) non-deterministic ordering
behavioral hierarchy (hierarchical Timing
transitions, fork-join)
timeouts
43 time constraints (e.g. exec. time)
Digital Systems Design
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.
http://www.sei.cmu.edu/publications/documents/02.reports/02tn001.html
44
Digital Systems Design
TECHNISCHE
UNIVERSITÄT
ILMENAU
Systems Design
Part 9,
Time and Performance Evaluation
1
Digital Systems Design
Evaluation of Temporal and Performance Aspects
3
Digital Systems Design
Example: IP Office Firewall
Analysis
Typical performance-related
Design questions in design phase:
identify
performance System architecture?
requirements Implementation HW architecture, need for
identify traffic evaluate design special HW?
Integration
model alternatives Which chip sets/processor?
identify costly or identify performance Which peripherals?
contradicting critical components Programming approach,
requirements measurement-based
adapt design to meet language?
replace costly evaluation
performance Which operating system?
4
functions by requirements
cheaper functions
Digital Systems Design …?
Accuracy and Effort
look at worst case (maximum load) or average (be aware of nonlinear
behavior)
watch level of detail!
different kinds of performance requirements
throughput/utilization of resources -> cheap and accurate performance
evaluation
response time -> less accurate and highly expensive evaluation
there is a
optimistic pessimistic
problem! estimate estimate
5
Digital Systems Design
Tasks of Performance Evaluation - Summary
(5) Derive quantitative data (as input) for the performance model
Some advice:
do simple things first!
abstract, abstract, abstract!
(back-of-the-envelope analysis is preferable over complex behavioral model)
don´t skip or defer performance evaluation!
6
Digital Systems Design
Tasks (1): Identify the Goals of the Performance Evaluation
7
Digital Systems Design
Tasks (2-5): Performance Modelling
(2) Study the details of the object under investigation
Workload:
identification of the service requests issued to the system
Available resources:
analysis of the execution environment
System:
analysis of the static structure as well as dynamic aspects of the system
Mapping:
identification of the resources used by specific service requests
(3) Decide on the modeling approach
select appropriate performance evaluation technique (CFG, DFG, FSM,
sequence diagrams, queuing model, ...)
(4) Build the performance model
carefully select the level of abstraction
(5) Derive quantitative data for the performance model
derive execution times, available resources, traffic model, ...
8 measurement, emulation, code analysis, empirical estimation
Digital Systems Design
Tasks (6-8): Performance Evaluation
(6) Transform the performance model to an executable or assessable model
take into account the limits of the selected performance evaluation
technique
9
Digital Systems Design
Performance Model – The Incredients
Application
information about the application
Resources
typically some structural model attributed with capacity information of
resources (MIPS, FLOPS, ...)
Mapping (spatial assignment)
information describing how the entities of the application are assigned to the
resources (which function is assigned to which processor or other HW entity)
Runtime system (temporal assignment)
information on dynamic aspects, e.g. scheduling algorithms
System stimuli (traffic model)
the characteristics of the input to the system that triggers an execution
types and temporal characteristics of the input events
10
Digital Systems Design
Example
2 P1
Mapping
4 5 (spatial assignment)
3
P2
6
Stimuli:
number of arrivals (stimuli) for task 1 (source node) per second
(deterministic or probabilistic)
11
Digital Systems Design
Performance Evaluation – Summary of Methods
Methods
process graph analysis (structural model)
task graph analysis (behavioral model)
schedulability analysis (real-time analysis)
Markov chain analysis
queuing network analysis
operational analysis
discrete-event simulation
12
Digital Systems Design
Process Graph Analysis
Process graph
structural model of the application
nodes represent functional entities (module, function, procedure, operation, etc)
edges represent communication relations
precedence relations are neglected
Process graph analysis
limited to the analysis of the load imposed on the resources of the system
assumption that contention on resources does not have a negative impact on the
load of the system
resources may be physical (e.g. processor, HW entity, communication link) or
logical (e.g. critical sections)
Example of simple analysis:
load(r) = ∑ p∈Ar load(p,r)
where
p denotes some process
Ar specifies the set of processes assigned to resource r and
load(p,r) denotes the exact resource demand resulting from the assignment of process
p on resource r
Note: the formula may be equally applied to compute the load of a communication link
13
Digital Systems Design
Process Graph Analysis
Example: HW/SW partitioning
SW HW
assign the tasks to the SW and the HW entity
such that 1
1 4
the maximum of the processing time of SW 5/3 10/1
and HW is a minimum and 10 8
the communication cost are minimal
Discussion:
simple, fast and efficient
application to best-case analysis
=> load/capacity is a central constraint that has to be met by the system,
otherwise detailed studies are useless!
15
Digital Systems Design
Task Graph Analysis
Task graph
simple behavior model of the application
nodes represent functional entities (module, function, procedure, operation, etc)
arcs represent precedence constraints
Discussion:
simple and efficient for deterministic (constant) execution times
(complex for other distributions)
application to best-case analysis
(neglect contention on resources – scheduling)
wide application to optimization techniques
16
Digital Systems Design
Task Graph Analysis – Examples
Analysis:
find the longest (critical) path and compute its length
prozessor
1 2 MI 20 ms
2 100 MIps
2
1
4 5 medium phy network
33 ms
3 4 1 Mb 30 Mbps
3 4
prot. stack
6 prozessor
1 2,8 MI 23 ms
120 MIps
Model:
fixed set of processes
single processor/resource
Schedulability analysis:
check if the deadlines can be met under all circumstances
18
Digital Systems Design
Rate Monotonic Priority Assignment
Idea: assign priorities to processes according to their period T (and deadline D)
(process with shortest period is assigned the highest priority (5))
19
Digital Systems Design
Schedulability Analysis – Utilization-based
Idea: derive sufficient condition for schedulability based on the analysis of the
resource utilization
Assumption: RM scheduling
Utilization bounds (U): N=1 => U=1; N=2 => U=0.828; N=10 => U=0.718;
for infinite number of N: U->0.69
Discussion:
20 simple test for simple models (deadline Di = Ti, etc.)
Digital Systems Design
Schedulability Analysis – Example
2 6 2 1
1/N
U = ∑i=1...N (Ui) = ∑i=1...N (Ci/Ti) < N(2 – 1)
21
Digital Systems Design
Schedulability Analysis – Response-time Analysis
Idea:
predict the worst-case response time of each process and compare with the
deadline to determine the feasibility of the schedule
Outline of approach:
response time Ri of process i is Ri = Ci + Ii where Ii is the maximum
interference of process i from higher-priority processes
the interference depends on the number of releases of the interfering processes
and their computation time, i.e. the interference Ii,j of the higher priority
process j on process i is
Ii,j = Ri/Tj * Cj
application of fixed-point iteration method to solve the equations
(start with Ri,0 = Ci; terminate when Ri,n+1 = Ri,n)
Ri,n+1 = Ci + ∑j<i Ri,n/Tj * Cj
Response-time analysis:
Response time R0 of Process P0:
R0 = C0 + I0 = C0 + 0 = 1 ms
Response time R1 of process P1 (recursive):
R1 = C1 = 1 ms (without interrupt)
R1 = C1 + I1 = C1 + I1,0 = C1 + R‘1/T0 * C0 = 1 + 1/3 * 1 = 2 ms
R1 = C1 + I1 = C1 + I1,0 = C1 + R‘1/T0 * C0 = 1 + 2/3 * 1 = 2 ms
Response time R2 of process P2 (recursive):
R2 = C2 = 2 ms
R2 = C2 + I2 = C2 + I2,0 + I2,1 = C2 + R‘2/T0 * C0 + R‘2/T1 * C1 = 2 + 2/3 * 1 + 2/4 * 1 = 4 ms
R2 = C2 + I2 = C2 + I2,0 + I2,1 = C2 + R‘2/T0 * C0 + R‘2/T1 * C1 = 2 + 4/3 * 1 + 4/4 * 1 = 5 ms
R2 = C2 + I2 = C2 + I2,0 + I2,1 = C2 + R‘2/T0 * C0 + R‘2/T1 * C1 = 2 + 5/3 * 1 + 5/4 * 1 = 6 ms
Assumption:
stations are separable (product-form queuing networks)
each station can be analysed in separation (exponential input results in
exponential output)
Restrictions:
limited distributions (exponential and derivatives)
no synchronizations
no blocking (infinite queues)
Results:
mean values for delays, utilization, queue length and population
Discussion:
efficient solution techniques available for a considerable set of queuing
networks
26
See R. Jain for details
Digital Systems Design
Queuing Network Analysis - Example
Example: communication system (unbounded queues)
µ = 30 1/s
medium phy network
1 Mb 30 Mbps
prot. stack
µ = 43 1/s
prozessor
2,8 MI 120 MIps
Assumptions:
job flow balance
no assumptions on service and arrival time distributions
Analysis of arrival rates, throughput, utilization and mean service times of the
different stations in the system
Discussion:
simple (unsuitable to parallel execution)
fast
answers „what if“ questions
derivation of response time figures only if population is given (i.e. application of
Little´s law (answer response time questions only if the population of jobs in the
system is known ) – no assumptions about distributions)
1
2/1 P1 1 5 3 6
P2 4 2
2
1/2 0 2 4 6 8 10
4 5
3/3 4/4
3 4/5
Discussion
6 no assumptions
1/6
Gain important insight in the system execution for performance debugging and
development of future systems
30
Digital Systems Design
Comparision of Methods
Analysis Analysis of Verification Modelling of
multiprocessor of Real parallel
best worst average systems Time processing (prec.
case case requests constraints)
Process graph no
Schedulability
Utiliz.-based no no
Resp.-based no no
Markov chains no
Queuing no no
networks
Operational no no
analysis
Simulation no
Measurements no
31
Digital Systems Design
Problems and Limits of Performance Evaluations
missing data
uncertainty of available execution data
data dependencies (if, case, while, ...)
context dependencies: caching, scheduling, synchronization, blocking
=> worst case execution time (based on code rather than measurements)
uncertainty of traffic model, i.e. the distributions of the stimuli of the system
32
Digital Systems Design
References
Overview and simple techniques:
A. Mitschele-Thiel: Systems Engineering with SDL – Developing Performance-Critical
Communication Systems. Wiley, 2001. (section 2.3 & 2.4)
H.U. Heiss: Prozessorzuteilung in Parallelrechnern. BI-Wissenschaftsverlag, Reihe
Informatik, Band 98, 1994.
R. Jain: The Art of Computer Systems Performance Analysis – Techniques for
Experimental Design, Measurements, Simulation, and Modeling. Wiley, 1991.
1
Digital Systems Design
Heuristic Search
Most heuristics are based on an iterative search comprising the following
elements:
selection of an initial (intermediate) solution (e.g. a sequence)
evaluate quality
y accept solution as
acceptance criteria satisfied
„best solution so far“
n
termination criteria satisfied
10 y
Digital Systems Design
Hill-Climbing – Discussion
simple
local optimizations only: algorithm is not able to pass a valley to finally reach
a higher peak
idea is only applicable to small parts of optimization algorithms but needs to
be complemented with other strategies to overcome local optimas
11
Digital Systems Design
Random Search
also called Monte Carlo algorithm
Idea:
random selection of the candidates for a change of intermediate solutions or
random selection of the solutions (no use of neighborhood)
Discussion:
simple (no neighborhood relation is needed)
not time efficient, especially where the time to evaluate solutions is high
sometimes used as a reference algorithm to evaluate and compare the
quality of heuristic optimization algorithms
idea of randomization is applied to other techniques, e.g. genetic algorithms
and simulated annealing
12
Digital Systems Design
Simulated Annealing
Idea:
simulate the annealing process of material: the slow cooling of material leads to
a state with minimal energy, i.e. the global optimum
Classification:
Search strategy
random local search
Acceptance criteria
unconditional acceptance of the selected solution if it represents an
improvement over previous solutions
otherwise probabilistic acceptance
Termination criteria
static bound on the number of iterations (cooling process)
13
Digital Systems Design
Simulated Annealing – Discussion and Variants
Discussion:
parameter settings for cooling process is essential (but complicated)
slow decrease results in long run times
straightforward to implement
Variants:
deterministic acceptance
nonlinear cooling (slow cooling in the middle of the process)
adaptive cooling based on accepted solutions at a temperature
reheating
14
Digital Systems Design
Genetic Algorithms – Basic Operations
1 1 0 0 1 0 1 0 1 1 0 1 0 1 0 0 1 0 0 1
crossover
1 1 0 0 0 0 1 0 0 1
mutation
1 1 0 0 0 1 1 0 0 1
15
Digital Systems Design
Genetic Algorithms – Basic Algorithm
17small
population results in inbreeding
larger population works well with small mutation rate tradeoff between size of population and number of iterations
Digital Systems Design
Genetic Algorithms –Basic Operations
Mutation
=> crating a new member of the population by changing one member
18
Digital Systems Design
Genetic Algorithms –Basic Operations
Crossover
=> crating a new member of the population from two members
19
Digital Systems Design
Genetische Algorithmen – Traveling Salesman Problem
20minimal
impact of mutation rate with small population
negativ impact of high mutation rate with larger population (increased randomness) – impact not quite clear
Digital Systems Design
Genetic Algorithms – Discussion
finding an appropriate coding for the binary vectors for the specific
application at hand is not intuitive
problems are
redundant codings,
21
Digital Systems Design
Tabu Search
Idea:
extension of hill-climbing to avoid being trapped in local optima
allow intermediate solutions with lower quality
maintain history to avoid running in cycles
Classification:
Search strategy
deterministic local search
Acceptance criteria
acceptance of best solution in neighborhood which is not tabu
Termination criteria
static bound on number of iterations or
dynamic, e.g. based on quality improvements of solutions
22
Digital Systems Design
Tabu Search – Algorithm
y
set is empty
n
The brain of the algorithm is the
evaluate quality and tabu list that stores and maintains
select best solution from set information about the history of the
search.
update tabu list In the most simple case a number of
previous solutions are stored in the
tabu list.
n More advanced techniques maintain
termination criteria satisfied
attributes of the solutions rather than
y the solutions itself
23
Digital Systems Design
Tabu Search – Organisation of the History
The history is maintained by the tabu list
Attributes of solutions are a very flexible mean to control the search
25
Digital Systems Design
Heuristic Search Methods – Classification
Search strategy
search area
global search (potentially all solutions considered)
local search (direct neighbors only – stepwise optimization)
selection strategy
deterministic selection, i.e. according to some deterministic rules
random selection from the set of possible solutions
probabilistic selection, i.e. based on some probabilistic function
history dependence, i.e. the degree to which the selection of the new
candidate solution depends on the history of the search
no dependence
one-step dependence
multi-step dependence
Acceptance criteria
deterministic acceptance, i.e. based on some deterministic function
probabilistic acceptance, i.e. influenced by some random factor
Termination criteria
static, i.e. independent of the actual solutions visited during the search
dynamic, i.e. dependent on the search history
26
Digital Systems Design
Heuristic Search Methods – Classification
local global det. prob. random none one- multi- det. prob. stat. dyn.
step step
hill- x x x x x
climbing
tabu x x x x x x
search
simulated x x x x x
annealing
genetic x x x x x x x
algorithms
random x x x x x
search
27
Digital Systems Design
Single Pass Approaches
The techniques covered so far search through a high number of solutions.
Discussion:
single-pass algorithms are very quick
quality of solutions is often small
not applicable where lots of constraints are present (which require some kind
of backtracking)
decide subproblem
based on guidelines
possibly recompute or
adapt guidelines
n
final solution constructed
y
29
Digital Systems Design
List Scheduling – Example (1)
Problem:
2 processors
6 tasks with precedence constraints 1 2 /8
find schedule with minimal execution time
2 1 /6
HLFET (highest level first with estimated times)
4 3 /4 5 4 /5
length of the longest (critical) path to the sink
node (node 6) 3 4 /5
Assignment strategy
first fit 6 1 /1
Resulting schedule:
Legend:
P1 1 2 3 6 green: estimated times
P2 5 4 red: levels (priorities)
0 2 4 6 8 10
31
Digital Systems Design
List Scheduling – Example (2)
Problem (unchanged):
2 processors
6 tasks with precedence constraints 1 2 /2
find schedule with minimal execution time
Resulting schedule:
Legend:
P1 1 2 5 6 green: estimated times
P2 4 3 blue: co-levels (priorities)
0 2 4 6 8 10
32
Digital Systems Design
Clustering - Basics
34
Digital Systems Design
Clustering
probabilistic deterministic
hierarchical partitioning
35
Digital Systems Design
Hierarchical Clustering
Dendrogram
n
Number of iterations reached
y
14
Digital Systems Design
Clustering – Application to Load Balancing
10
7 5 12 12 12
5 4 5 4 5 4 5 4
4 4 4 4
6 7 6 7 6 7 6
3 8 3 8 3 8 3 16
1 1 1 1
2 9 2 9 2 9 2
12
18 18 20
5 4 8 8
4 9
6
3 16 3 16 3 16 16
1 1 1
2 2 2
16
Digital Systems Design
Clustering – Hierarchical Algorithms
Centroid-based
Algorithms implement
different methods to
compute the distance
between two clusters
17
Digital Systems Design
Clustering – Single Linkage
10
9 P1 P7 Distance between groups is estimated as
8 the smallest distance between entities
P5
7
6 Example:
d ( 2, 4 )5 = min[d 25 , d 45 ] = d 45 = 4.1
5 P3
P4
4
3
P2 P6
2
1
0
0 2 4 6 8 10
Cluster # P1 P2 P3 P4 P5 P6 P7
P5 - - - - 0 5.1 1.4
P6 - - - - - 0 6
P7 - - - - - - 0
18
Digital Systems Design
Clustering – Single Linkage
Cluster # P1 P2 P3 P4 P5 P6
C243 P7 - 0 2.8 2.2
P2 - 0 3 1.4 5.4 P6
3 6.7 - - - 0
P5 - - - - 0 5.1 1.4
P6 - - - - - 0 6
P7 - - - - - - 0
19
Digital Systems Design
Clustering – Group Average
10
9 P7
Distance between groups is defined
P1
8 as the average distance between
P5
7 all pairs of entities
6
5 P3 Example:
P4
4
3
2 P2 P6 d ( 2, 4 )5 =
1
(d 25 + d 45 ) = 4.8
1
2
0
0 2 4 6 8 10
Cluster # P1 P2 P3 P4 P5 P6 P7
P5 - - - - 0 5.1 1.4
P6 - - - - - 0 6
P7 - - - - - - 0
20
Digital Systems Design
Clustering – Group Average
P2 - 0 3 1.4 5.4 3
P6 6.7 - - - 0
P5 - - - - 0 5.1 1.4
P6 - - - - - 0 6
P7 - - - - - - 0
21
Digital Systems Design
Clustering – Centroid-based
10
9 xP1 P7
Determine distances between centroids (k,l)
x
8 Merge centroids with the least distance
P5
((C ))
7
6
5 P3
x
d (k , l ) = xk − C xl ) + (C
2
yk − C yl
2
P4
4
3 x
P6
2 P2
1
0
0 2 4 6 8 10
Cluster # P1 P2 P3 P4 P5 P6 P7
P5 - - - - 0 5.1 1.4
P6 - - - - - 0 6
P7 - - - - - - 0
22
Digital Systems Design
Clustering – Centroid-based
10
Cluster # C1 C24 C3 C57 C6
9 xP1 P7
x
8 C1 0 7.1 5 6.5 9.2
P5
7
C24 - 0 2.5 5.4 2.5
6
5 P3 C3 - - 0 3.5 4.3
x P4
4
C57 - - - 0 5.5
3 x
P2 P6
2 C6 - - - - 0
1
0
0 2 4 6 8 10
Cluster # P1 P2 P3 P4 P5 P6 P7
P5 - - - - 0 5.1 1.4
P6 - - - - - 0 6
P7 - - - - - - 0
23
Digital Systems Design
Differences between Clustering Algorithms
4 4
x 10 x 10
2.5 2.5
4
2
x 10 2
2.5
Single Linkage K-means
1.5 1.5
1
2
Single
WardLinkage
K-means
Centroid
CompleteLinkage
Linkage 1
0.5 0.5
Y (m)
Y (m)
0 0
1.5
4
-0.5 x 10 -0.5
2.5
-1
2 1 -1
-2.5 -2.5
-3 -2 -1 0 1 2 3
YY (m)(m)
0.5 -3 -2 -1 0 1 2 3
X (m) 4 X (m) 4
0 0 x 10 x 10
4
x 10
-0.5 2.5
-0.5
-1 2
-1.5 x 10
4
1.5
Ward
2.5
-2
-1 1
2
-2.5 Centroid Linkage 0.5
-3 1.5 -2 -1 0 1 2 3
-1.5
Y (m)
X (m) 4
x 10 0
1
-0.5
0.5
-2
Y (m)
-1
0
-1.5
-0.5
-2.5 -2
-3-1 -2 -1 0 1 2 3
-2.5
-1.5 X (m) -3 -2 -1 0 4 1 2 3
X (m) x 10 4
x 10
-2
24
Digital Systems Design
-2.5
-3 -2 -1 0 1 2 3
X (m) 4
x 10
Clustering – Variants
Clustering methods
Partitioning methods Hierarchical methods
k-means Agglomeration Division
Fuzzy-c-means (bottom up) (top down)
SOM Single linkage Wards
Clique Complete linkage Tree Structural Vector
One Pass Average group Quantification
Gustafson-Kessel algorithm Centroid Macnaughton-Smith
MST algorithm
ROCK
1 1 1 -> A 2 1 -> B
5
2 5 f(1)=17 f(2)=17
29
Digital Systems Design
Branch and Bound with Underestimates
Application of the A* algorithm to the scheduling problem
2 8 3 9
3 2 -> A 4 2 -> B 5 3 -> A 6 3 -> B
6 1 f(3)=22 f(4)=18 f(5)=18 f(6)=22
4 f(x) = g(x) + h(x)
3
g(x) exact 7 2 -> A 8 2 -> B
h(x) underestimate rest f(7)=25 f(8)=18
A 1 3
B 12 2 4 9 4 -> A 10 4 -> B
f(9)=24 f(10)=18
0 4 8 12 16 20 24
30Search is terminated when min {f(x)} is a terminal node (in the search tree)
Digital Systems Design
References
A. Mitschele-Thiel: Systems Engineering with SDL – Developing Performance-
Critical Communication Systems. Wiley, 2001. (section 2.5)
C.R. Reeves (ed.): Modern Heuristic Techniques for Combinatorial Problems.
Blackwell Scientific Publications, 1993.
H.U. Heiss: Prozessorzuteilung in Parallelrechnern. BI-Wissenschaftsverlag,
Reihe Informatik, Band 98, 1994.
M. Garey, D. Johnson: Computer and Intractability. W.H. Freeman, New
York, 1979.
31
Digital Systems Design