Академический Документы
Профессиональный Документы
Культура Документы
Main topics:
■ Circuit design based on VHDL
■ VHDL basics
■ Advanced VHDL language structures
■ Circuit examples
Introduction to VHDL
Shortly About the VHDL
Introduction to VHDL
HDL Requirements
■ Abstraction
■ Modularity
■ Concurrency
■ Hierarchy
Introduction to VHDL
Abstraction
VHDL supports description of components as well as systems at various levels of abstraction
■ Gate and component delays
■ Clock cycles
■ Abstract behavior without any notion of delays
Introduction to VHDL
Modularity
Introduction to VHDL
constructs
Introduction to VHDL
Gajski’s Y-chart
Structural Behavior
A Series of
Test
Refined
Vectors
Models
Final Chip
Model
VHDL for Simulation & Synthesis
Introduction to VHDL
Standardization 1
■ IEEE standard specification language (IEEE 1076-1993)
for describing digital hardware used by industry worldwide
■ VHDL enables hardware modeling from the gate level to
the system level
Introduction to VHDL
Standardization 3
■ It was the American Department of Defense which initiated
the development of VHDL in the early 1980s because the US
military needed a standardized method of describing electronic
systems
■ VHDL was standardized in 1987 by the IEEE
– IEEE Std-1076-1987
■ ANSI Standard in 1988
■ Added Support for RTL Design
– VITAL: VHDL Initiative Towards ASIC Library
■ Revised version in 1993
– IEEE Std-1076-1993
Introduction to VHDL
Standardization 4
■ 1995:
– numeric_std/bit: IEEE-1076.3
– VITAL: IEEE-1076.4
■ 1999: IEEE-1076.1 (VHDL-AMS )
■ 2000:
– IEEE-1076-2000
– IEEE-1076.1-2000 (VITAL-2000, SDF 4.0)
■ Added mixed-signal support to VHDL in 2001 ->
– VHDL-AMS
» IEEE Std-1076.1-2001
■ 2002: IEEE-1076-2002
Introduction to VHDL
Tools
■ High-tech companies
– Texas Instruments, Intel use VHDL
– most European companies use VHDL
■ Universities
■ VHDL groups to support new users
IEEE
■ IEEE is the Institute of Electrical and Electronics Engineers
■ The reference manual is called IEEE VHDL Language
Reference Manual Draft Standard version 1076/B
■ It was ratified in December 1987 as IEEE 1076-1987
■ Important:
– the VHDL is standardized for system specification
– but not for design
Technology independence
■ The design of VHDL components can be technology-independent
or more-or-less technology independent for a technical family
■ The components can be stored in a library for reuse in several
different designs
■ VHDL models of commercial IC standard components can now
be bought, which is a great advantage when it comes to verifying
entire circuit boards
Analog world
■ VHDL has not yet been standardized for analog electronics
■ Standardization is in progress on VHDL with an analog
extension (AHDL) to allow analog systems to be described
as well
■ This new standard will be based wholly on the VHDL
standard and will have a number of additions for describing
analog functions
CAPABILITIES OF VHDL
■ Used as exchange medium b/w chip vendors & cad tool users
* different chip vendors can provide vhdl descriptions of their components to
system designers
* CAD Tool users can use it to capture the behavior of the design at high level
of abstraction for functional simulation.
Introduction to VHDL
■
Supports both synchronous & asynchronous timing models.
■ Modeling techniques such as FSM Descriptions,algorithmic
Descriptions,boolean equations possible
■ Publicly available,human readable ,machine readable not proprietary\
■ IEEE & ANSI standard
■ Supports three basic descriptions styles ie structural,behavioral,dataflow or
combination of these
■ Supports wide range of abstraction levels ranging from abstract behavioral
descriptions to very precise gate level descriptions
■ Design can be captured @ mixed level using single coherent language
■ Arbitrarily large designs can be modeled -- no limitations on the size of the
design
■ Language elements make large scale design modeling easier eg components
,functions ,procedures and packages
■ Test bench can be written using the same language to test vhdl models
■ to VHDL
Introduction
■ Nominal ppn delay,min-max delays,set up,hold timing,
timing constraints & spike detection can be described
■ Use of generics & attributes facilitate back
annotation,parameterized designs
■ Model can contain info about the design itself in terms of
user defined attributes such as total area & speed
■ Used to describe library components from different
vendors.
■ Model can be verified by simulation
■ Synthesis description styles are capable of being
synthesized to gate level descriptions
■ Defines new data types
Introduction to VHDL
VHDL-Related Newsgroups
■ comp.arch.fpga
■ comp.lang.vhdl
■ comp.cad.synthesis
Introduction to VHDL
Other HDL languages
■ There are several other language extensions built to either aid in RTL construction
or assist in modeling:
– ParaCore - http://www.dilloneng.com/paracore.shtml
– RubyHDL - http://www.aracnet.com/~ptkwt/ruby_stuff/RHDL/index.shtml
– MyHDL - http://jandecaluwe.com/Tools/MyHDL/Overview.shtml
– JHDL - http://www.jhdl.org/
– Lava - http://www.xilinx.com/labs/lava/
– HDLmaker - http://www.polybus.com/hdlmaker/users_guide/
– SystemC
– AHDL – http://www.altera.com
» It is good for Altera-made chips only, which limits its usefulness
» But it is easy to pick up and use successfully
■ The main purpose of a language -- programming, hdl, or otherwise -- is to ease the
expression of design
Introduction to VHDL
Verilog
■ Verifying Logic
■ Phil Moorby from Gateway Design Automation in 1984 to 1987
– Absorbed by Cadence
» Cadence's ownership of Verilog => others support VHDL
■ Verilog-XL simulator from GDA in 1986
■ Synopsis Synthesis Tool in 1988
■ In 1990 became open language
– OVI: Open Verilog International
■ IEEE Standard in 1995
– IEEE Std-1364-1995
■ Last revision in 2001
– IEEE Std-1364-2001
■ Ongoing work for adding
– Mixed-signal constructs: Verilog-AMS
– System-level constructs: SystemVerilog
Introduction to VHDL
VHDL vs. Verilog
VHDL Verilog
All abstraction levels All abstraction levels
Complex grammar Easy language
Describe a system (everything) Describe a digital system
Lots of data types Few data types
User-defined package & library No user-defined packages
Full design parameterization Simple parameterization
Easier to handle large designs
Very consistent language. Code written and Less consistent language. If you don't follow
simulated in one simulator will behave exactly some adhoc methodology for coding styles,
the same in another simulator. E.g. strong you will not get it right.
typing rules.
Introduction to VHDL
VHDL vs. Verilog (Cont.)
■ It does seem that Verilog is easier for designing at the
gate-level, but that people who do higher level simulations express a
preference for VHDL
■ VHDL places constraints on evaluation order that limit the
optimizations that can be performed
– Verilog allows the simulator greater freedom
– For example, multiple levels of zero-delay gates can be collapsed into a single
super-gate evaluation in Verilog
– VHDL requires preserving the original number of delta cycles of delay
in propagating through those levels
VHDL Verilog
In Europe the VHDL is the most popular
language
Based on Pascal language Based on C language
Most FPGA design in VHDL Most ASIC design in Verilog
Introduction to VHDL
VHDL vs. Verilog: Process block
■ VHDL:
process (siga, sigb)
begin
…...
end;
■ Verilog:
always @ (siga or sigb)
begin
….
end
Introduction to VHDL
VHDL vs. Verilog:
Concurrent Signal Assignment
■ VHDL:
c <= a and b;
■ Verilog:
assign c = a & b ;
Introduction to VHDL
VHDL vs. Verilog: Signal Delays
■ VHDL:
a <= transport b after 1 ns;
■ Verilog:
#1 assign a = b;
» ‘a’ output is delayed by 1 time unit
» The ‘# ‘ operator is the delay operator
» # N will delay for N simulation units
» Delays can assigned to both inputs and outputs
#1 assign a = #1 b;
» ‘b’ is delayed by 1 unit, then assigned to ‘a’, which is then delayed by 1 time
unit
Introduction to VHDL
VHDL vs. Verilog: Clock Generator
■ VHDL:
signal clk : std_logic := ‘0’;
process
begin
clk <= not (clk) after clkperiod/2;
wait on clk;
end;
■ Verilog:
initial clk = 0;
always #(clkperiod/2) clk = ~ clk;
Introduction to VHDL
Verilog Weakness
■ Not well suited for complex, high level modeling
– No user defined type definition
– No concept of libraries, packages, configurations
– No ‘generate’ statement - can’t build parameterized structural models
– No complex types above a two-dimensional array
Introduction to VHDL
VHDL vs. Verilog:
Managing Large designs
■ VHDL:
– Configuration, generate, generic and package statements all help manage
large design structures
■ Verilog:
– There are no statements in Verilog that help manage large designs
Introduction to VHDL
VHDL vs. Verilog:
Procedures and Tasks
■ VHDL:
– allows concurrent procedure calls
■ Verilog:
– does not allow concurrent task calls
Introduction to VHDL
VHDL vs. Verilog:
Structural Replication
■ VHDL:
– The generate statement replicates a number of instances
of the same design-unit or some sub part of a design, and
connects it appropriately
■ Verilog:
– There is no equivalent to the generate statement in
Verilog.
Introduction to VHDL
Languages “under development”
■ SystemVerilog
– Extending Verilog to higher levels of abstraction for architectural and
algorithm design and advanced verification
■ VHDL 200x
– Goal of VHDL Analysis and Standards Group (VASG):
» Enhance/update VHDL for to improve performance, modeling capability,
ease of use, simulation control, and the type system
■ e.g.: Data types and abstractions:
– variant records
– interfaces
Introduction to VHDL
VHDL Example
■ And gate
a
AND c
b
Introduction to VHDL
VHDL Description: AND gate
entity AND2 is
port (a, b: in bit ;
c : out bit);
end AND2;
Introduction to VHDL
Concurrency in VHDL Descriptions
signals signals
Introduction to VHDL
Concurrent and Sequential Computations
■ Processes are concurrent
■ Sequential activity within each process
Introduction to VHDL
Hierarchy in VHDL
C 0
C 1 C 2 C 3
C 4 C 5 C 6 C 7 S 1 1
S 1 2
S 1 S 3 S 6 S 7
S 2 S 4 S 8
S 9
S 1 3
S 1 0
S 1 4
S 5
Introduction to VHDL
Modeling Styles in VHDL
Introduction to VHDL
Modeling Styles
■ Semantic model of VHDL
■ Structural description
■ Algorithmic description
■ RTL description
Introduction to VHDL
Modeling Choices in VHDL
■ Behavioral and Structural Domains
– Several Levels of Abstraction
■ Multiple Styles of Behavioral Description:
– Data Flow Style (concurrent)
– Procedural Style (sequential)
■ Combinations, variations and special cases of these, e.g.,
– special case of data flow style - FSM described using guarded blocks
– special case of procedural style - FSM described using case statement in a
process
Introduction to VHDL
Structural Description
Introduction to VHDL
Behavioral Description
■ Procedural ■ Non-procedural
(textual order => execution order) (textual order NOT => execution order)
■ Sequential statements ■ Concurrent statements
■ Control constructs alter normal sequential ■ Data flow (or rather data dependency
flow restricts concurrency)
Introduction to VHDL
Concurrent Statements in VHDL
Introduction to VHDL
Example: 1-bit Full Adder
entity FullAdder is
port (X, Y, Cin: in bit; -- Inputs
Cout, Sum: out bit); -- Outputs
end FullAdder;
X Sum
Y FullAdder
Cin Cout
Introduction to VHDL
Example: 1-bit Full Adder (contd.)
Introduction to VHDL
Example: 4-bit Adder
entity Adder4 is
port (A, B: in bit_vector(3 downto 0);
Ci: in bit; -- Inputs
S: out bit_vector(3 downto 0);
Co: out bit); -- Outputs
end Adder4;
Introduction to VHDL
Example: 4-bit Adder (contd.)
Introduction to VHDL
Example: 4-bit Comparator
entity nibble_comparator is
port (a, b: in bit_vector (3 downto 0);
gt,eq,lt : in bit;
a_gt_b, a_eq_b, a_lt_b : out bit);
end nibble_comparator;
Introduction to VHDL
Structural Description (contd.)
architecture iterative of nibble_comparator is
component comp1
port (a, b, gt,eq,lt : in bit; a_gt_b, a_eq_b, a_lt_b : out bit);
end component;
for all : comp1 use entity work.bit_comparator(gate_level);
signal im: bit_vector (0 to 8);
begin
c0:comp1 port map(a(0),b(0), gt, eq, lt, im(0), im(1), im(2));
c1toc2: for i in 1 to 2 generate
c:comp1 port map(a(i),b(i),im(i*3-3),im(i*3-2),im(i*3-1),
im(i*3+0),im(i*3+1),im(i*3+2));
end generate;
c3: comp1 port map(a(3),b(3),im(6),im(7),im(8),
a_gt_b, a_eq_b, a_lt_b);
end nibble_comparator;
Introduction to VHDL
Example: 1-bit Comparator
(data flow)
entity comp1 is
port (a, b, gt,eq,lt : in bit; a_gt_b, a_eq_b, a_lt_b : out bit);
end comp1;
architecture dataflow of comp1 is
signal s : bit;
begin
s <= (a and b) or (not a and not b);
a_gt_b <= (gt and s) or (a and not b);
a_lt_b <= (lt and s) or (not a and b);
a_eq_b <= eq and s;
end dataflow;
Introduction to VHDL
■ Behavioral Description in VHDL
Introduction to VHDL
Modeling Styles
■ Semantic model of VHDL
■ Structural description
■ Algorithmic description
■ RTL description
Introduction to VHDL
Concurrent Statements in VHDL
Introduction to VHDL
Example: D Flip-Flop
entity DFF is
port (D, CLK: in bit;
Q: out bit; QN: out bit := ‘1’) ;
end DFF;
D Q
DFF
CLK QN
Introduction to VHDL
Example: DFF (contd.)
Architecture Beh of DFF is
begin process (CLK)
begin if (CLK = ‘1’ then
Q <= D after 10 ns;
QN <= not D after 10 ns;
endif;
endprocess;
end Beh;
Introduction to VHDL
Concurrent Conditional Assignment:
4 to 1 Multiplexer
y <= x0 when sel = 0
else x1 when sel = 1
else x2 when sel = 2
else x3 when sel = 3
x0
x1 y
x2
x3
sel
Introduction to VHDL
CASE Statement:
4 to 1 Multiplexer
Case sel is
when 0 => y <= x0
when 1 => y <= x1 x0
when 2 => y <= x2 x1 y
x2
when 3 => y <= x3 x3
end case
Introduction to VHDL
VHDL Processes
General form of Process
process(sensitivity-list)
begin
sequential-statements
end process;
Process example
process (B, C, D)
begin
A <= B; -- statement 1
B <= C; -- statement 2
C <= D; -- statement 3
end process;
Introduction to VHDL
Introduction to VHDL