Metodologie di Progettazione Hardware/Software Introduzione

Transcript

Metodologie di Progettazione Hardware/Software Introduzione
Metodologie di Progettazione
Hardware/Software
Introduzione
1
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Embedded systems overview
• Computing systems are everywhere
• Most of us think of “desktop” computers
–
–
–
–
PC’s
Laptops
Mainframes
Servers
• But there’s another type of computing system
– Far more common...
2
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
1
Embedded systems overview
• Embedded computing systems
– Computing systems embedded
within electronic devices
– Hard to define. Nearly any
computing system other than a
desktop computer
– Billions of units produced yearly,
versus millions of desktop units
– Perhaps 50 per automobile
3
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Embedded Systems
• Embedded Systems (ES) = sistemi di elaborazione delle
informazioni dedicati contenuti all’interno di un prodotto
più grande
4
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
2
Application areas (1)
• Automotive electronics
• Aircraft electronics
• Trains
• Telecommunication
• Military applications
5
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Application areas (2)
• Consumer
electronics
6
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
3
A “short list” of embedded systems
Anti-lock brakes
Auto-focus cameras
Automatic teller machines
Automatic toll systems
Automatic transmission
Avionic systems
Battery chargers
Camcorders
Cell phones
Cell-phone base stations
Cordless phones
Cruise control
Curbside check-in systems
Digital cameras
Disk drives
Electronic card readers
Electronic instruments
Electronic toys/games
Factory control
Fax machines
Fingerprint identifiers
Home security systems
Life-support systems
Medical testing systems
Modems
MPEG decoders
Network cards
Network switches/routers
On-board navigation
Pagers
Photocopiers
Point-of-sale systems
Portable video games
Printers
Satellite phones
Scanners
Smart ovens/dishwashers
Speech recognizers
Stereo systems
Teleconferencing systems
Televisions
Temperature controllers
Theft tracking systems
TV set-top boxes
VCR’s, DVD players
Video game consoles
Video phones
Washers and dryers
7
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Cars
Multiple processors
Up to 100
Networked together
Multiple networks
–Functions:
•
•
•
•
•
ABS: Anti-lock braking systems
ESP: Electronic stability control
Airbags
Efficient automatic gearboxes
Theft prevention with smart
keys
• Blind-angle alert systems
• ... etc ...
8
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
4
Cars
– Large diversity in processor types:
• 8-bit – door locks, lights, etc.
• 16-bit – most functions
• 32-bit – engine control, airbags
– Form follows function
• Processing where the action is
• Sensors and actuators distributed all over the
vehicle
9
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Cars
BMW 7 series
Up to 70 Electronic Modules
Electronic Cost : 25% total Car cost
Semiconductor Content > 1000 $
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
5
Digital camera
Digital camera chip
CCD
CCD preprocessor
Pixel coprocessor
D2A
A2D
lens
JPEG codec
Microcontroller
Multiplier/Accum
DMA controller
Memory controller
•
•
•
Display ctrl
ISA bus interface
UART
LCD ctrl
Single-functioned -- always a digital camera
Tightly-constrained -- Low cost, low power, small, fast
Reactive and real-time
11
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Caratteristiche dei sistemi embedded
• Specializzazione
– Eseguono un solo programma, ripetutamente
• Inclusione di elettronica ed altri dispositivi dedicati per:
– Interagire con il mondo esterno
– Svolgere alcune funzioni elaborative
• Sistemi reattivi e real-time
– Devono continuamente reagire ai cambiamenti dell’ambiente in
cui opera il sistema
– Deve produrre certi risultati in real-time senza ritardo
• Con molti vincoli (spesso assai stringenti)
– Basso costo, ridotto consumo di potenza, piccolo, veloce, ecc.
12
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
6
Caratteristiche dei sistemi embedded
Un sistema embedded è progettato per eseguire una
sola o comunque poche specifiche applicazioni:
– Le applicazioni da svolgere sono note a priori, prima che il
processo di progettazione inizi
– Spesso è opportuno garantire al sistema la flessibilità necessaria
per i futuri aggiornamenti o per un eventuale riutilizzo del
componente. Normalmente si raggiunge questo scopo rendendo il
sistema riprogrammabile
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Caratteristiche dei sistemi embedded
• Dovendo interagire con il mondo esterno i S.E. includono
dispositivi quali
– Sensori
– Attuatori
• I sistemi embedded sono sistemi ibridi (digitale +
analogico)
– Sono presenti convertitori A/D e D/A
• L’interazione con l’utente avviene con mezzi spesso
semplificati:
– Display
di dimensione ridotta
– Dispositivi di input limitati
– Dispositivi di I/O specializzati rispetto alle competenze o al modo
di operare dell’utente
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
7
Caratteristiche dei sistemi embedded
• Alcune funzioni possono essere svolte in maniera
più efficiente facendo ricorso a dispositivi
hardware dedicati quali DSP, celle IP, ecc.
• Applicazioni DSP tipiche:
– segnali generici: filtraggio, DFT, FFT, ecc.
– voce: encoding, decoding, equalizzazione, ecc.
– modem: modulazione, demodulazione
• Altro hardware dedicato:
– Compressione video, crittografia, …
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Caratteristiche dei sistemi embedded
• Molti ES devono rispettare vincoli real-time
• Un sistema real-time system deve reagire agli stimoli
provenienti dall’oggetto controllato entro un intervallo di
tempo che dipende dall’ambiente.
• Per i sistemi real-time, risposte giuste arrivate tardi sono
errate.
• „Un vincolo real-time constraint è detto hard, se il non
rispetto del vincolo potrebbe avere conseguenze
catastrofiche “ [Kopetz, 1997].
• Tutti gli altri time-constraints sono detti soft.
16
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
8
Caratteristiche dei sistemi embedded
Tipicamente sono reactive systems:
“A reactive system is one which is in continual
interaction with is environment and executes at a pace
determined by that environment“ [Bergé, 1995]
Il comportamento dipende dagli ingressi e dallo
stato corrente.
la macchina a stati è il modello più appropriato.
17
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Principali requisiti dei sistemi embedded
• I requisiti di progetto imposti ad un Sistema
Embedded possono essere:
–
–
–
–
–
–
Requisiti funzionali
Requisiti temporali
Requisiti di affidabilità
Consumo
Prestazioni
Costo
• Spesso i requisiti risultano essere in contrasto tra
loro
18
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
9
Challenges for implementation in hardware
Lack of flexibility (changing standards).
Mask cost for specialized HW becomes very expensive
Trend towards
implementation
in Software
19
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Importance of Embedded Software
and Embedded Processors
“... the New York Times has estimated that the average
American comes into contact with about 60 micro-processors
every day....” [Camposano, 1996]
Latest top-level BMWs contain over 100 micro-processors
[Personal communication]
Most of the functionality will be implemented in software
20
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
10
Challenges for implementation in software
If embedded systems will be implemented mostly in
software, then why don‘t we just use what software
engineers have come up with?
Exponential increase in software complexity
In some areas code size is doubling every 9
months [ST Microelectronics, Medea Workshop,
Fall 2003]
... > 70% of the development cost for
complex systems such as automotive
electronics and communication systems are
due to software development
21
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Challenges for Embedded Software
– Come catturare il comportamento richiesto di sistemi
complessi?
– Come tradurre in modo efficiente le specifiche in una
implementazione?
– Deve essere presa in considerazione dagli ingegneri del
software la potenza dissipata?
– Come verificare che i vincoli real-time sono rispettati?
– Quale linguaggio di programmazione fornisce caratteristiche
real-time?
22
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
11
Challenges for Embedded Software
It is not sufficient to consider ES
just as a special case of software engineering
EE knowledge must be available, Walls between EE
and CS must be torn down
23
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Design metrics
24
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
12
Progettazione – ottimizzazione di diverse
design metrics
• Obiettivo di progetto:
– Realizzare una implementazione con la funzionalità richiesta
• Sfide nella progettazione:
– Ottimizzare contemporaneamente diverse design metrics
• Design metric
– Una caratteristica misurabile dell’implementazione del sistema
Implementazione: un microprocessore con relativo programma,
una connesione di gates o una loro combinazione
25
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Progettazione – ottimizzazione delle design
metrics
• Metriche comuni
– NRE cost (Non-Recurring Engineering cost): il costo di
progettazione del sistema, da conteggiare una sola volta
– Unit cost: il costo economico per la produzione di ogni
copia del sistema, escluso il costo NRE
– Size: lo spazio fisico richiesto dal sistema
– Performance: il tempo di esecuzione o il throughput del
sistema
– Power: la potenza consumata dal sistema
– Flexibility: la capacità di modificare la funzionalità del
sistema senza richiedere un elevato valore di NRE cost
26
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
13
Progettazione – ottimizzazione delle design
metrics
• Metriche comuni (continua)
– Time-to-prototype: il tempo per realizzare una versione prototipale
funzionante del sistema
– Time-to-market: il tempo richiesto per lo sviluppo e la vendita ai
clienti del sistema
– Reliability R(t) = probabilità che il sistema stia lavorando
correttamente all’istante t assunto che stava lavorando all’istante
t=0
– Maintainability M(d) = probabilità che il sistema continui a lavorare
correttamente d unità di tempo dopo un errore.
– Availability A(t): probabilità che il sistema stia lavorando al tempo t
– Safety: nessun danno deve essere provocato
– Security: comunicazione confidenziale e autenticata
27
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Competizione tra metriche – migliorare una
metrica può peggiorare le altre
• Esperienza sia con il software sia con
hardware è necessaria per ottimizzare
le metriche di progetto
Power
Performance
Size
– Non solo esperto di hardware o esperto
di software, come di norma avviene
– Un designer deve avere confidenza con
diverse tecnologie per potere scegliere
quella migliore per una data
applicazione e certi vincoli di progetto
NRE cost
CCD
Digital camera chip
A2D
CCD preprocessor
Pixel coprocessor
D2A
lens
JPEG codec
Microcontroller
Multiplier/Accum
DMA controller
Memory controller
Display ctrl
ISA bus interface
UART
LCD ctrl
Hardware
Software
28
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
14
Time-to-market
• Il tempo richiesto per lo sviluppo
e la commercializzazione di un
prodotto
• Market window
– Periodo in cui potrebbe avere le
vendite maggiori
• Il time-to-market medio
richiesto è di circa 7-8 mesi
• I ritardi possono essere molto
costosi
Reve
nues
($)
Time (months)
29
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Perdite dovute a un ingresso ritardato nel
mercato
• Modello semplificato del reddito
Revenues ($)
Peak revenue
Peak revenue from
delayed entry
On-time
Market fall
Market rise
Delayed
D
On-time
entry
Delayed
entry
2W
W
Time
– Tempo di vita di un prodotto =
2W, picco a W
– L’ingresso nel mercato
definisce un triangolo che
rappresenta la penetrazione
del mercato
– L’area del triangolo
rappresenta il reddito
• Perdità
– La differenza tra le le aree dei
due triangoli, quello
dell’immissione in tempo e
quello dell’immssione ritardata
30
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
15
Perdite dovute a un ingresso ritardato nel
mercato
• Area = 1/2 * base * altezza
– In tempo = 1/2 * 2W * W
– Ritardato = 1/2 * (W-D+W)*(W-D)
Revenues ($)
Peak revenue
Peak revenue from
delayed entry
On-time
• Percentuale di reddito perso =
(D(3W-D)/2W 2)*100%
Market fall
Market rise
Delayed
D
On-time
entry
W
Delayed
entry
2W
Time
– Tempo di vita= 2W=52 settimane,
ritardo D=4 settimane
– (4*(3*26 –4)/2*26^2) = 22%
– Tempo di vita 2W=52 settimane,
ritardo D=10 settimane
– (10*(3*26 –10)/2*26^2) = 50%
31
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
NRE e unit cost
• Costi:
– Unit cost: il costo economico per la produzione di ogni copia del
sistema, escluso NRE cost
– NRE cost (Non-Recurring Engineering cost): il costo di progettazione
del sistema, da conteggiare una sola volta
– Costo totale = NRE cost + unit cost * numero di unità
– Costo per prodotto = costo totale / numero di unità
= (NRE cost / numero di unità) + unit cost
• Esempio
– NRE=$2000, unit cost=$100
– Per 10 unità
– Costo totale = $2000 + 10*$100 = $3000
– Costo per prodotto = $2000/10 + $100 = $300
Ammortizzare l’ NRE cost sulle unità comporta
un costo aggiuntivo per unità di $200
32
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
16
NRE e unit cost
• Confronto delle tecnologie sulla base dei costi – la migliore dipende
dalle quantità prodotte
– Tecnologia A: NRE=$2,000, unit=$100
– Tecnologia B: NRE=$30,000, unit=$30
– Tecnologia C: NRE=$100,000, unit=$2
100000
1000000
A
100000
B
C
10000
Costo per unità ($)
Costo Totale ($)
10000000
10000
A
1000
B
100
C
10
1
1000
10
50
250
1250
6250 31250
10
50
250
1250
6250
31250
Numero di unità
Num ero di unità
• Ma bisogna anche considerare il time-to-market
33
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Le performance
• Misure del sistema abbondantemente utilizzate
– Clock frequency, instructions per second – non sono delle buone
misure
– Esempio: Digital camera – un utente vuole conoscere quanto
velocemente un immagine viene processata, e non la frequenza
del clock o il numero di istruzioni al secondo
• Latenza (response time)
– Il tempo tra l’inizio e la fine di un task
– Esempio: la digital camera processa un immagine in 0,25 secondi
• Throughput
– Tasks per second. Esempio. La digital camera processa 4
immagini al secondo
34
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
17
Design
technologies
35
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Tre tecnologie chiave nei sistemi embedded
• Tecnologia
– Un modo di realizzare un task, usando processi,
metodi o conoscenza
• Tecnologie per I sistemi embedded
– Processor technology
– IC technology
– Design technology
36
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
18
Processor technology
• L’architettura dell’unità di computazione utilizzata per implementare la
funzionalità richiesta al sistema
• I processori non devono essere necessariamente programmabili
– “Processore” non vuol dire “general-purpose processor”
Controller
Datapath
Controller
Datapath
Controller
Datapath
Control
logic and
State register
Register
file
Control logic
and State
register
Registers
Control
logic
index
Custom
ALU
State
register
IR
PC
General
ALU
IR
total
+
PC
Data
memory
Program
memory
Assembly code
for:
Data
memory
Data
memory
Program memory
Assembly code
for:
total = 0
for i =1 to …
General-purpose (“software”)
total = 0
for i =1 to …
Application-specific
Single-purpose (“hardware”)
37
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Processor technology
• I processori variano in funzione del problema
total = 0;
for (i = 0; i< N; i++)
total += M[i];
Desired
functionality
General-purpose
processor
Application-specific
processor
Single-purpose
processor
38
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
19
General-purpose processors
• Dispositivi programmabili usati per un
ampio spettro di applicazioni
– Noti come “microprocessori”
• Caratteristiche
– Program memory
– General Datapath con ampio register file
e ALU di tipo generale
Controller
Datapath
Control
logic and
State
register
Register
file
IR
• Vantaggi
General
ALU
PC
Program
memory
– Basso time-to-market e NRE costs
– Alta flessibilità
Data
memory
Assembly code
for:
• Svantaggi
total = 0
for i =1 to …
– Alti costi per unità per grandi volumi
– Le prestazioni potrebbero essere ridotte
39
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
General-purpose processors
il DLX sequenziale
PCWriteCond
PCSource
PCWrite
TargetWrite
IorD
ALUop
Unità
di
MemRead
ALUSelA
MemWrite
ALUSelB
Controllo
IRWrite
RegWrite
Mem2Reg
RegDest
P
C
M
U
X
Lettura
Ind
Dati
Lettura
MEM
Scrittura
Dati
R
E
G
I
S
T
R
M
U
X
Mem
Data
M
U
X
Reg.
R Let.
Let. 1 E Dati1
Reg.
G
Let. 2
F Let.
Reg.
Dati2
Scrittura I
L
Scrittura
E
Dati
Est.
Segno
A
B
4
Shift
S.2 bit
M
U
X
M
U
X
Shift
S.2 bit
A Zero
L Ris.
U
T
A
R
G
E
T
M
U
X
AluOutput
40
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
20
General-purpose processors
addi r1, r0, 0
addi r3, r0, 0
Loop: lw r4,M(r1)
addi r1,r1,4
slti r2, r1, 40
add r3,r3,r4
bnez r2, loop
total = 0;
for (i = 0; i< N; i++)
total += M[i];
41
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Pipelining: Increasing Instruction Throughput
T0
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
IFetch 0 IDec 0 IExe 0 IMem 0 IWrB 0 IFetch 1 IDec 1 IExe 1 IMem 1 IWrB 1 IFetch 2 IDec 3
T0
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
IFetch 0 IDec 0 IExe 0 IMem 0 IWrB 0
IFetch 1 IDec 1 IExe 1 IMem 1 IWrB 1
IFetch 2 IDec 2 IExe 2 IMem 2 IWrB 2
IFetch 3 IDec 3 IExe 3 IMem 3 IWrB 3
IFetch 4 IDec 4 IExe 4 IMem 4 IWrB 4
IFetch 5 IDec 5 IExe 5 IMem 5 IWrB 5
IFetch 6 IDec 6 IExe 6 IMem 6 IWrB 6
IFetch 7 IDec 7 IExe 7 IMem 7 IWrB 7
42
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
21
General-purpose processors
il DLX pipeline
PCSrc
ID/EX
0
M
u
x
1
WB
Control
IF/ID
EX/MEM
M
WB
EX
M
MEM/WB
WB
Add
Add
Add result
Instruction
memory
ALUSrc
Read
register 1
Read
data 1
Read
register 2
Registers Read
Write
data 2
register
Write
data
Zero
ALU ALU
result
0
M
u
x
1
MemtoReg
Address
Instruction
PC
Branch
Shift
left 2
MemWrite
RegWrite
4
Address
Data
memory
Read
data
Write
data
Instruction 16
[15– 0]
Instruction
[20– 16]
Instruction
[15– 11]
Sign
extend
32
6
ALU
control
0
M
u
x
1
1
M
u
x
0
MemRead
ALUOp
RegDst
43
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Superscalar and VLIW Architectures
• Performance can be improved by:
– Faster clock (but there’s a limit)
– Pipelining: slice up instruction into stages, overlap stages
– Multiple ALUs to support more than one instruction
stream
• Superscalar
– Scalar: non-vector operations
– Fetches instructions in batches, executes as many as possible
• May require extensive hardware to detect independent
instructions
• VLIW: each word in memory has multiple independent
instructions
• Relies on the compiler to detect and schedule instructions
• Currently growing in popularity
44
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
22
Single-purpose processors
• Sistema digitale progettato per
eseguire un solo programma
Controller
Datapath
Control
logic
index
– Es. coprocessori, acceleratori o periferiche
total
• Caratteristiche
State
register
– Contengono i soli componenti che servono
per eseguire un solo programma
– Non hanno la program memory
+
Data
memory
• Vantaggi
– Veloce, Low power, Piccola dimensione
• Svantaggi
– Assenza di flessibilità, alto time-to-market,
alto costo NRE
45
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Single-purpose processors
Cond
Compare
N
Rst_Index
Unità di
controllo
Index
Clk_Index
+
4
Rst_Total
Clk_Total
Memory
Total
+
Datapath
46
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
23
Application-specific processors
• Processori programmabili ottimizzati per
una particolare classe di applicazioni
– Compromesso tra general-purpose e singlepurpose processors
• Caratteristiche
– Program memory, Datapath ottimizzato,
Unità funzionali speciali
• Vantaggi
– Buona flessibilità, buone performance, size e
power
• Svantaggi
– Alto costo NRE (processore e compilatore)
Controller
Datapath
Control
logic and
State
register
Registers
IR
Custom
ALU
PC
Program
memory
Data
memory
Assembly code
for:
total = 0;
for(i =0;i<N;i++)
total+=M[i];
Esempi: Microcontrollori, DSP
47
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
A Common ASIP: Microcontroller
• For embedded control applications
– Reading sensors, setting actuators
– Mostly dealing with events (bits): data is present, but not in huge
amounts
– e.g., VCR, disk drive, digital camera (assuming SPP for image
compression), washing machine, microwave oven
• Microcontroller features
– On-chip peripherals
• Timers, analog-digital converters, serial communication, etc.
• Tightly integrated for programmer, typically part of register space
– On-chip program and data memory
– Direct programmer access to many of the chip’s pins
– Specialized instructions for bit-manipulation and other low-level
48
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
24
Digital Signal Processors (DSP)
• For signal processing applications
– Large amounts of digitized data, often streaming
– Data transformations must be applied fast
– e.g., cell-phone voice filter, digital TV, music synthesizer
• DSP features
– Several instruction execution units
– Multiple-accumulate single-cycle instruction, other instrs.
– Efficient vector operations – e.g., add two arrays
• Vector ALUs, loop buffers, etc.
49
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Microcontrollore: Famiglia ST6
• Microcontrollore a 8 bit
– Interrupts
4 interrupt vectors plus NMI and RESET
Software programmable for each I/O
– Memories
Up to 4 Kbytes of program memory
OTP/ROM
Up to 64 bytes of RAM
– I/O Ports
Up to 20 I/O lines
Multifunctional, bi-directional I/O pins
Up to 4 high current capability I/O line
– Clock, Reset and Power Supply
Power supply operating range: 3.0V to
6V
Maximum external frequency: 8 MHz
Oscillator Safeguard (OSG) and
Backup oscillator (LFAO)
Low Voltage Detector (LVD)
2 power saving modes: WAIT and
STOP
I/O Ports
Up to 20 I/O lines
Multifunctional, bi-directional I/O pins
Up to 4 high current capability I/O line
Peripherals
Watchdog timer
8-bit timer
ADC
Instruction Set
8-bit accumulator-based architecture
40 instructions
9 addressing modes
50
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
25
Microcontrollore: STR7(ARM7TDMI® core)
• STR710F Flash Microcontrollers from STMicroelectronics
combine the industry standard ARM7TDMI® RISC
microprocessor with embedded Flash and powerful
peripheral functions including, USB and CAN.
51
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
La famiglia ARM7
• L’ARM7 è un processore RISC a 16/32 bit, prodotto, a
partire dal 1993, dalla “Advanced Risc Machines Ltd.”
• È disponibile in una ampia gamma di versioni, dedicate
principalmente ad applicazioni di tipo “embedded”.
• Tra queste, ci sono numerosi mC prodotti da almeno 10
diversi costruttori tra i quali STM, Motorola, NEC, Atmel,
Philips, Sharp, TI.
• Si tratta quindi di un vero e proprio standard industriale.
52
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
26
Integrated circuit (IC) technology
• Il modo in cui una implementazione digitale (gate-level) è
mappata su un IC
– IC: Integrated circuit, o “chip”
– IC sono costituiti da diversi layer
• I layer più bassi formano i transistor
• Quelli intermedi formano i componenti logici
• Quelli più alti collegano i componenti con i wires
– Le tecnologie differiscono nel livello di specializzazione
rispetto a un design
IC package
IC
source
gate
oxide
channel
drain
Silicon substrate
53
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
IC technology
Porta NAND
54
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
27
IC technology
• Tre tipi di IC technologies
– Full-custom/VLSI
– Semi-custom ASIC (gate array and standard cell)
– PLD (Programmable Logic Device)
55
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Full-custom/VLSI
• Tutti i layer sono ottimizzati per una particolare
implementazione del sistema embedded
– Placing transistors
– Sizing transistors
– Routing wires
• Benefici
– Eccellenti performance, piccola dimensione, ridotta
potenza
• Svantaggi
– Elevato NRE, lungo time-to-market
56
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
28
Semi-custom
• I layer più bassi sono in tutto o in
parte realizzati
Gate array
– I designers devono occuparsi dei
livelli più alti
• Benefici
– Buone performance, buona
dimensione,minore NRE rispetto a
una implementazione full-custom
Standard Cell
• Svantaggi
– Richiede ancora settimane o mesi
per lo sviluppo
57
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
PLD (Programmable Logic Device)
• Tutti i layers già esistono
– I designers possono comprare un IC
– Le connessioni sull’ IC sono o create o distrutte per
implementare la funzionalità richiesta
– Due tipi:
• Programmable Logic Array (PLA)
• Field-Programmable Gate Array (FPGA)
• Benefici
– Basso NRE, la dispobibilità dell’IC è quasi immediata
• Svantaggi
– Più grande, più costoso, consuma molto, più lento
58
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
29
Programmable Logic Array (PLA)
59
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Xilinx FPGA
60
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
30
Indipendenza tra processore e IC
technologies
Generalpurpose
processor
General,
providing improved:
Singlepurpose
processor
ASIP
Customized,
providing improved:
Flexibility
Maintainability
NRE cost
Time- to-prototype
Time-to-market
Cost (low volume)
Power efficiency
Performance
Size
Cost (high volume)
PLD
Semi-custom
Full-custom
61
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Legge di Moore
• Il più importante trend nei embedded systems
– Predetto in 1965 dal cofondatore della Intel, Gordon Moore
La capacità dei transistor raddoppierà ogni 18 mesi per le
prossime decadi
10,000
Logic
transistor
s per chip
(in
millions)
1,000
100
10
1
0.1
Note:
logarithmic scale
0.01
0.001
20
09
20
07
20
05
20
03
20
01
19
99
19
97
19
95
19
93
19
91
19
89
19
87
19
85
19
83
19
81
62
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
31
Illustazione grafica della legge di Moore
1981
1984
1987
1990
1993
1996
1999
2002
10,000
transistors
150,000,000
transistors
Leading edge
chip in 1981
Leading edge
chip in 2002
63
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
La produttività aumenta in modo esponenziale
Productivity
(K) Trans./Staff – Mo.
100,000
10,000
1,000
100
10
1
0.1
0.01
2009
2007
2005
2003
2001
1999
1997
1995
1993
1991
1989
1987
1985
1983
1981
64
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
32
Design productivity gap
• Sebbene la capacità produttiva dei progettisti sia
aumentata in modo impressionante, non ha tenuto il
passo dell’incremento della capacità dei chip
10,000
100,000
1,000
10,000
1000
Gap
10
100
IC capacity
1
10
0.1
1
productivity
0.01
Productivi
ty
(K)
Trans./Sta
ff-Mo.
Logic
transistors
per chip
(in
millions)
100
0.1
0.001
0.01
20
09
20
07
20
05
20
03
20
01
19
99
19
97
19
95
19
93
19
91
19
89
19
87
19
85
19
83
19
81
65
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Design productivity gap
• 1981 Il chip più avanzato richiedeva 100 mesi uomo
– 10,000 transistors / 100 transistors/mese
• 2002 Il chip più avanzato richiedeva 30,000 mesi uomo
– 150,000,000 / 5000 transistors/mese
10,000
100,000
10,000
100
10
1000
100
Gap
IC capacity
1
0.1
10
1
productivity
0.01
Product
ivity
(K)
Trans./
StaffMo.
Logic
transist
ors per
chip
(in
millions
)
1,000
0.1
0.001
0.01
20
09
20
07
20
05
20
03
20
01
19
99
19
97
19
95
19
93
19
91
19
89
19
87
19
85
19
83
19
81
66
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
33
Il mese-uomo
• La situazione è peggiore di ciò che mostra il productivity gap
• In teoria l’aumento del numero di progettisti dovrebbe ridurre i tempi
di completamento di un progetto. In realtà, la produttività del singolo
progettista diminuisce a causa della complessità nella gestione e
comunicazione nel gruppo di lavoro.
• In alcune casi, un incremento di persone potrebbe allungare il tempo
di realizzazione di un progetto.
•
1M transistors, 1
designer=5000 trans/mese
Ogni designer in più riduce di
100 trans/mese
2 designer producono
4900 trans/mese ciascuno
•
•
60000
50000
40000
30000
20000
10000
16
15
Team
16
19
18
23
24
Mesi per la conclusione del lavoro
43
Individuo
0
10
20
30
Numero di designers
40
67
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Gestione della crisi della produttività
•
•
IP (Intellectual Property) Reuse
– Assemblaggio di componenti pre-progettati
– Componenti proprietari o provenienti dall’esterno
– Soft e Hard IPs
System-Level Design
– Progetto e verifica a livello di sistema anziché a livello RTL o di
gate
68
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
34
Design Technology
• E’ il modo in cui si traduce la funzionalità richiesta del sistema in una
sua implementazione
• Una procedura per progettare un sistema
• Il flusso di progettazione può essere parzialmente o totalmente
automatizzato mediante un insieme di tools.
– Software engineering tools,
– Compilers,
– Computer-Aided Design tools,
• Un’adeguata metodologia di progettazione aiuta la gestione del
processo di design e migliora la qualità, le performance e i costi del
progetto.
69
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Design Technology
Compilation/Synthesis:
Automates exploration and
insertion of implementation
details for lower level.
Libraries/IP: Incorporates
pre-designed implementation
from lower abstraction level
into higher level.
Test/Verification: Ensures
correct functionality at each
level, thus reducing costly
iterations between levels.
System
specification
Compilation/ Libraries/
Test/
Synthesis
IP
Verification
System
Hw/Sw/ Model simulat./
synthesis
OS
checkers
Behavioral
specification
Behavior
synthesis
RT
specification
RT
synthesis
Logic
specification
Logic
synthesis
Cores
Hw-Sw
cosimulators
RT
HDL simulators
components
Gates/
Cells
Gate
simulators
To final implementation
70
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
35
Il co-design
Sequential program code (e.g., C, VHDL)
• In passato:
– Hardware e software
design technologies erano
molto differenti
– La recente maturazione
della sintesi permette di
avere una visione unificata
di hardware e software
• Hardware/software
“codesign”
Behavioral synthesis
(1990's)
Compilers
(1960's,1970's)
Register transfers
Assembly instructions
RT synthesis
(1980's, 1990's)
Assemblers, linkers
(1950's, 1960's)
Logic equations / FSM's
Machine instructions
Logic synthesis
(1970's, 1980's)
Logic gates
Microprocessor plus
program bits: “software”
Implementation
VLSI, ASIC, or PLD
implementation: “hardware”
La scelta tra hardware e software per una particolare funzione è semplicemente
un tradeoff tra varie design metrics, come performance, power, size, NRE cost,
e flessibilità; non c’è una differenza sostanziale tra cosa l’hardware o il
software può implementare.
71
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
Riferimenti
– “Embedded System Design: A Unified Hardware/Software Introduction” , Frank
Vahid, Tony Givargis, John Wiley & Sons Inc., ISBN:0-471-38678-2, 2002.
– “Computers as Components: Principles of Embedded Computer Systems
Design (With CD-ROM)”, Wayne Wolf, Morgan Kaufmann Publishers, ISBN:
1-55860-541-X, 2001
-“Embedded System Design” by Peter Marwedel, Kluwer Academic Publishers,
ISBN: 1-4020-7690-8, October 2003
72
Metodologie di Progettazione Hardware/Software – LS Ing. Informatica
36