Vorlesung Hardware-Beschreibungssprachen · † Ubliche HDLs: VHDL, ABEL, Verilog, Altera-HDL, ......
Transcript of Vorlesung Hardware-Beschreibungssprachen · † Ubliche HDLs: VHDL, ABEL, Verilog, Altera-HDL, ......
Vorlesung
Hardware-Beschreibungssprachen
Dr.-Ing. S. Arlt
Fakultat EI
Fachbereich Elektronische Schaltungen und Systeme
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 0-1
1
Vorlesung
Hardware-Beschreibungssprachen
Kapitel 1 : Einfuhrung
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 1-1
1
'
&
$
%
'
&
$
%
Motivation
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 1-2
• Lucke zwischen Integrationsdichte und Design
• Steigende Komplexitat
– 1970 Intel CPU 4004
4 Bit, 10µm, 600mm2, 0, 74MHz, 2, 25k Transistoren
– 1997 Intel CPU Pentium 2
32 Bit, 0, 35µm, 203mm2, 300MHz, 7.500k Transistoren
– 2005 Intel CPU Pentium 4 6xx
64 Bit, 0, 09µm, 135mm2, 3587, 8MHz, 169.000k Transistoren
• Abstraktion, Generik
• Time to Market
• Intellectual Properties (IP) & Reuse
2
'
&
$
%
'
&
$
%
Was ist eine HDL?
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 1-3
• Modellierungssprachen fur die Simulation und Implementierung elektro-
nischer Schaltungen
• Dokumentationsmittel speziell auf hoherem Abstraktionsniveau
• Ubliche HDLs: VHDL, ABEL, Verilog, Altera-HDL, UDL/I
• Unterschiede zu Hochsprachen wie C, C++, Pascal:
– Beschreibung von Parallelitat
– strukturelle Beschreibung (Entwurf des Steuer- und Datenflusses)
– Existenz entsprechender Datentypen fur die Modellierung von Si-
gnalvektoren und Signalpegeln
3
'
&
$
%
'
&
$
%
Anwendungen
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 1-4
• Spezifikation
• Verifikation, Modellierung ⇒ Simulation
• Synthese
• Dokumentation
4
'
&
$
%
'
&
$
%
Historie VHDL
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 1-5
VHSIC Very High Speed Integrated Circuits - Programm des DoD
VHDL- Hardware Description Language
• 1981 erste Anforderungen
• 1983-1985 VHDL-Entwicklung von Intermetrics, IBM, TI
• 1987 IEEE Standard 1076-1987 VHDL-87
• 1991 IEEE Standard 1164 (neunwertige Logik)
• 1993 IEEE Standard 1076-1993 VHDL-93
• 1995 IEEE Standards 1076.3 1076.4
5
'
&
$
%
'
&
$
%
Historie Verilog
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 1-6
• 1985 Verilog- Spache und Simulator von Gateway Automation entwickelt
• 1985-1989 wachsende Zunahme der Verwendung von Verilog bei ASIC-
Herstellern
• 1989 Verilog wird von Cadence ubernommen
• 1990 Formulierung von Open Verilog International (OVI)
• 1995 IEEE Standard 1364
6
'
&
$
%
'
&
$
%
Kurzvergleich
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 1-7
• VHDL bietet mehr lexikalische Elemente (erweiterte Typdefinitionen,
Variablen)
• Vorteile von Verilog liegen bei der Simulation von Netzlisten mit Ti-
mingmodellen, ist an C angeleht, keine strenge Typprufung
• Die Favorisierung einer Sprache ist bei den heute verfugbaren Simulations-
und Synthesewerkzeugen nicht mehr notwendig
• Europa: ca. 90% Nutzung von VHDL
• USA: ca.50% Nutzung von VHDL
• Verilog oft effizienter als VHDL
7
Vorlesung
Hardware-Beschreibungssprachen
Kapitel 2 : Entwurfsmethodik
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 2-1
1
'
&
$
%
'
&
$
%
Systematisierung des Entwurfs
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 2-2
Verhalten Struktur
Geometrie
funktionale Ebene
Logikebene
elektr. Ebene
Systemebene
algorithmische Ebene
Systemspezifikationen
Algorithmen
Register-Transfer (RT)
Boole`sche Gleichungen
Differentialgleichungen
Prozessoren, Speicher
Subsysteme
Module (ALUs, MUXs, Register)
Gatter, Flipflops
Transistoren
Polygone
Subzellen
Floorplan
Cluster
Partitionierung in ICs
Synthese
Analyse
Extraktion
Generierung
Abstraktion
Struktur
Geometrie
Detaillierung
Y-Diagramm nach Gajski-Kuhn
2
'
&
$
%
'
&
$
%
Entwurfsablauf
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 2-3
FPGA
libraries
testbench
ASIC
waveformtext graphic
VHDL−Entry
netlist
synthesis
VHDL
place & route
netlist timingannotation
simulation
functionalsimulation
program data
fabricationprocess
netlist
detailedtiming
simulation
VHDL Design Flow
3
Vorlesung
Hardware-Beschreibungssprachen
Kapitel 3 : Aufbau eines VHDL Modells
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 3-1
1
'
&
$
%
'
&
$
%
Grundstruktur eines VHDL Modells
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 3-2
Desing Entity
Entity Declaration
Architecture Body
Design
2
'
&
$
%
'
&
$
%
Syntax
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 3-3
library <library name>[, <library name n>] ;
use<library name > [. < package name>]. > all/element name>;
entity <entity name> is
[generic( < parameter declaration > ); ]
port( < input/output declaration > );
[<entity declaration>; ]
end[entity] < entity name>;
architecture <architecture name> of <entity name> is
[<architecture declaration>; ]
begin
<V HDL statements>;
end[architecture] < architecture name>;
configuration <configuration name> of <identifier name> is
<configuration statements>
end[configuration][<configuration name>];
3
Vorlesung
Hardware-Beschreibungssprachen
Kapitel 4 : VHDL Sprachelemente
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 4-1
1
'
&
$
%
'
&
$
%
VHDL Sprachaufbau
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 4-2
Grundzeichenvorrat
VHDL−Modell
lexikalische Elemente
Sprachkonstrukte
Design−Einheiten
VHDL-87 7-Bit Zeichensatz
VHDL-93 8-Bit ASCII Zeichensatz
2
'
&
$
%
'
&
$
%
Lexikalische Elemente
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 4-3
= Worter, lat. Lexeme
• Kommentare
• Bezeichner (identifier)
• Literale
• Reservierte Worter
3
'
&
$
%
'
&
$
%
Literale
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 4-4
Literal= (lat. litera) = Buchstabe
Literale sind von einer Programmiersprache definierte Zeichenfolgen zur Dar-
stellung der Werten von Basistypen
• Abstract
– Decimal (-Mantisse-Exponent)
– Based (Basis-Mantisse-Exponent)
∗ Integer/Real
• Character
• String
• Bit String
4
'
&
$
%
'
&
$
%
Beispiel - Bussysteme
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 4-5
+V
R
CC
Open−Collector−TreiberTri−State−Treiber CMOS−Realisierung
H, 0
Logik
1, 0, Z, X
1, 0, Z, X
5
'
&
$
%
'
&
$
%
std ulogic
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 4-6
type std ulogic is (
’U’ -- uninitialized
’X’ -- forcing unknown, starker unbekannter Wert
’0’ -- forcing 0
’1’ -- forcing 1
’Z’ -- high impedanz
’W’ -- weak unknown
’L’ -- weak 0
’H’ -- weak 1
’-’); -- don’t care
6
'
&
$
%
'
&
$
%
Resolution Function
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 4-7
U X 0 1 Z W L H -
U ’U’ ’U’ ’0’ ’U’ ’U’ ’U’ ’0’ ’U’ ’U’
X ’U’ ’X’ ’0’ ’X’ ’X’ ’X’ ’0’ ’X’ ’X’
0 ’0’ ’0’ ’0’ ’0’ ’0’ ’0’ ’0’ ’0’ ’0’
1 ’U’ ’X’ ’0’ ’1’ ’X’ ’X’ ’0’ ’1’ ’X’
Z ’U’ ’X’ ’0’ ’X’ ’X’ ’X’ ’0’ ’X’ ’X’
W ’U’ ’X’ ’0’ ’X’ ’X’ ’X’ ’0’ ’X’ ’X’
L ’0’ ’0’ ’0’ ’0’ ’0’ ’0’ ’0’ ’0’ ’0’
H ’U’ ’X’ ’0’ ’1’ ’X’ ’X’ ’0’ ’1’ ’X’
- ’U’ ’X’ ’0’ ’X’ ’X’ ’X’ ’0’ ’X’ ’X’
7
'
&
$
%
'
&
$
%
Synthese mit std logic und std ulogic
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 4-8
Fehler !!
port(en1, en2, data1, data2 : in std_logic;
architecture rtl of stdlog isbegin data_bus <= data1 when en1 = ’1’ else ’Z’; data_bus <= data2 when en2 = ’1’ else ’Z’;end rtl;
entity stdlog is
data_bus : out std_logic);end stdlog;
begin data_bus <= data1 when en1 = ’1’ else ’Z’; data_bus <= data2 when en2 = ’1’ else ’Z’;
entity stdulog is port(en1, en2, data1, data2 : in std_ulogic;
architecture rtl of stdulog isend stdulog; data_bus : out std_ulogic);
end rtl;
data2
data1
en1
en2
data_bus
en2 = ’0’;en1 = ’1’; data1 = ’0’;
Beispiel:
’0’
’Z’data_bus = ’0’
library ieee;use ieee.std_logic_1164.all; use ieee.std_logic_1164.all;
library ieee;
8
'
&
$
%
'
&
$
%
Slice Names
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 4-9
3 2 1 0 7 6 5 4 3 2 1 0vec4 vec8
vec4 <= vec8(5 downto 2);
9
'
&
$
%
'
&
$
%
Nachbildung einer Shift Operation
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 4-11
0 0
256 4 3 1 0
X
Y
7
7 6 5 4 3 2 1 0
11
'
&
$
%
'
&
$
%
Bedingte Signalzuweisung
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 4-12
Resultierender Multiplexer:
00011011
a
b
c q
2 addr
12
'
&
$
%
'
&
$
%
Verzogerungsmodelle
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 4-13
100 20 30 40 50
b
a
c
d
80 [ns]60 70
12 ns
13
'
&
$
%
'
&
$
%
Simulationsergebnis
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 4-14
0
0
0
2 4 5
2 6
2 3 4 5
3 5
1
0
2
3
3
4
4
5
vec_q1
vec_q0
sum
num
clk
6
t
0
0
2 4 51
0
3
vec_q1
vec_q0
sum
num
clk
t
4321
4320 1
54321
14
Vorlesung
Hardware-Beschreibungssprachen
Kapitel 5 : Entwurfsbeispiele
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 5-1
1
'
&
$
%
'
&
$
%
Johnson Zahler
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 5-2
D Q D Q D Q D Q
Q 1Q 0 Q 2 Q 3
CLK
2
'
&
$
%
'
&
$
%
Schieberegister
'
&
$
%
'
&
$
%
S. Arlt TUI/EI/ESS HBS 5-4
D QD Q D Q D Q D Q’0’
ld_shiftclk
ld_val(4:0)
ser_out
0 1 432
4