Professional Documents
Culture Documents
Dhaval S. Shukla
Teaching Assistant,L1
SVNIT,Surat
VHDL Introduction
V- VHSIC
H- Hardware
D- Description
L- Language
VHDL Benefits
1. Public Standard
2. Technology and Process Independent
Include technology via libraries
3. Supports a variety of design methodologies
1.
2.
3.
Behavioral modeling
Dataflow or RTL (Register Transfer Language)
Modeling
Structural or gate level modeling
9.
VHDL
CODE
VHDL
Synthsize
Software
Vcc1
a1
b1
a2
b2
a3
FPLD
a4
b3
b4
GND
0
Configuration Declaration
Package Declaration
Library Declaration
Package Body
-- This is a comment
-- This is an example of a comment
y <= 0; -- can occur at any point
<=
Example:
y <= 1;
Ya
Yb
c
Y2
d
-- Code Fragment A
Architecture test of example is
begin
y1 <= a and b;
y2 <= c and d;
y <= y1 or y2;
end architecture test;
-- Code Fragment B
Architecture test of example is
begin
y <= y1 or y2;
y2 <= c and d;
y1 <= a and b;
Y2
d
-- Code Fragment C
Architecture test of example is
begin
y2 <= c and d;
y <= y1 or y2;
y1 <= a and b;
Y2
d
VHDL Syntax
Entity design_name is
port(signal1,signal2,..:mode type;
signal3,signal4,..:mode type);
End entity design_name;
Begin
Concurrent
Concurrent
Concurrent
Concurrent
statement 1;
statement 2;
statement 3;
statement 4;
End architecture name;
Entity design_name is
port(signal1,signal2,..:mode type;
signal3,signal4,..:mode type);
End entity design_name;
VHDL
Test Bench
Test
Vector
VHDL
Design
Output
Vector
b
c
b
a
Inertial Delay
Transport Delay
Delays (Cont..)
Subprogram
Function
Function
Procedure
Procedure
Bus Resolution
Smoke Generator
Bus Resolution
Smoke Generator Fixed
Null Transactions
How can a driver be disconnected (i.e. not influence the output
at all)?
Use the null waveform element
Example
bus_out <= NULL AFTER 17 ns;
VHDL Packages
Packages encapsulate elements that can be globally shared
among two or more design units
A package consists of two parts
Declaration
Body
Necessary definitions
for certain objects in
package declaration,
e.g. subprogram
descriptions
Packages
Example package contents include:
Subprograms (i.e. functions and procedures)
Data and type declarations such as
User record definitions
User types and enumerated types
Constants
Files
Aliases
Attributes
Component declarations
Entities and Architectures cannot be declared or defined in a
package
To use a package, it must be made visible via the use construct
Alternately, they may also appear in a package declaration. Items declared in this
package can then be made visible within any architecture body by using the library
and use clauses.
For example, consider the entity GATING described in the basic example. A
package such as shown may be created to hold the component declarations.