Beruflich Dokumente
Kultur Dokumente
Introduction to VHDL
Tech. Simulation
Synthèse
Lib.
Gate
Level
Lay-out
Simulation
Placement/routage
Simui.
FPGA ASIC Lib.
• C’est quoit VHDL?
VHSIC
Hardware
Description
Language
VHSIC – Very High Speed Integrated Circuit
Fonctions Fonctions
concurrents séquentielles
vhdl
Description Modélisation
hiérarchique de temps
VHDL: concepts de base
• Structure générale
Votre fichier texte de
description: xxx.vhd
6
VHDL: Les en-têtes de fichier
Library IEEE ;
Use IEEE.std_logic_1164.all;
Use IEEE.std_logic_arith.all;
….
…
Il faut pas utiliser Numeric_std et std_logic_arith en même temps pour ne pas avoir
conflit
VHDL: L’entité
entity sequencement is
Port (
clock : in std_logic;
reset : in std_logic;
Q : out std_logic_vector (1 down to 0)
);
End sequencement ;
Clock
Q(1:0)
sequencement
reset
VHDL: Déclaration de l'architecture
Référence à
une entité
Nom de
l’architecture
Introduction to VHDL
d0
f
d1
ENTITY mux2to1 IS
PORT( d0, d1, s :IN STD_LOGIC;
f :OUT STD_LOGIC);
END mux2to1;
Introduction to VHDL
d0
f
d1
• Description compartmental …
If s=0, d0 passes sur la sortie f : f=d0
If s=1, d1 passes sur la sortie f=d1
Introduction to VHDL
d0
f
d1
d0
f
d1
Description structural…
d0
f
d1
s
Introduction to VHDL
d0
d0
f
f
d1
d1
s s
Hierarchie
Un bon exemple est la construction d'un multiplexeur
(4-pour-1) à partir de 2 (Muxes 2-pour-1 ) qui seront
utilisé comme composants
d0
d1
d2
d3
s1 s0
Introduction to VHDL
d3
s1 s0
ENTITY mux4to1 IS
PORT( d0, d1, d2, d3, s0, s1 : IN STD_LOGIC;
f : OUT STD_LOGIC);
END mux4to1;
Introduction to VHDL
d0
d1
f
d2
d3
s1 s0
ENTITY mux4to1 IS
PORT(w0, w1, w2, w3, sel0, sel1 :IN STD_LOGIC;
f :OUT STD_LOGIC);
END mux4to1;
Processes
• Un processus est une région de code VHDL qui
exécute séquentiellement
Processes
ENTITY orgate IS
PORT (a,b : in bit;
z : out bit);
END orgate;
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY ieee;
ENTITY mux2to1 IS
USE ieee.std_logic_1164.all;
PORT (d0, d1, s :IN STD_LOGIC;
USE work.mux2to1_package.all;
f :OUT STD_LOGIC);
END mux2to1;
ENTITY mux4to1 IS
PORT(w0, w1, w2, w3, sel0, sel1 :IN STD_LOGIC;
ARCHITECTURE LogicFunc OF mux2to1 IS
f :OUT STD_LOGIC);
BEGIN
END mux4to1;
f <= (d0 AND (NOT s)) OR (d1 AND s);
END LogicFunc;
ARCHITECTURE structure OF mux4to1 IS
SIGNAL I1, I2 :STD_LOGIC;
LIBRARY ieee;
BEGIN
USE ieee.std_logic_1164.all;
u1:mux2to1 PORT MAP(w0, w1, sel0, I1);
u2:mux2to1 PORT MAP(w2, w3, sel0, I2);
PACKAGE mux2to1_package IS
u3:mux2to1 PORT MAP(I1, I2, sel1, f);
COMPONENT mux2to1
END structure;
PORT (d0, d1, s :IN STD_LOGIC;
f :OUT STD_LOGIC);
END COMPONENT;
END mux2to1_package;
Introduction to VHDL
Types
ENTITY fulladd IS
PORT (a,b,Cin : IN bit;
sum, Carry : OUT bit);
END fulladd;
Types
Types prédéfinis
PACKAGE standard IS
TYPE boolean IS (true, false);
TYPE bit IS (‘0’, ‘1’)
TYPE character IS (-- ascii set)
TYPE integer IS range implementation_defined;
TYPE real IS range implementation_defined;
-- bit_vector, string, time
END standard;
Introduction to VHDL
Types predefinés
Introduction to VHDL
Arrays
Introduction to VHDL
Assignment de matrix
Introduction to VHDL
matrices et Concatenation
Introduction to VHDL
Arrays et Aggregates
Introduction to VHDL
VHDL Operators
• Processes
• If-then-else
• Case
Introduction to VHDL
The IF Statement
Introduction to VHDL
Déclaration IF-ELSIF
Introduction to VHDL
Configurations
Configurations
Introduction to VHDL
Configurations
ENTITY mux2to1 IS
PORT( d0, d1, s :IN STD_LOGIC;
f :OUT STD_LOGIC);
END mux2to1;
Each of these entities and architectures will reference standards and types
from within a stated library
Introduction to VHDL
The link between each level of hierarchy, and the specification as to which
architecture will be used is provided by the configuration
Introduction to VHDL
Packages
• A package contains a collection of definitions that
may be referenced by many designs at the same time