Professional Documents
Culture Documents
Verilog Introduction
Verilog Introduction
Verilog Introduction
Verilog® HDL
Today program
Verilog HDL 2
History of Verilog® HDL
Beginning: 1983
“Gateway Design Automation” company
Simulation environment
Comprising various levels of abstraction
• Switch (transistors), gate, register-transfer, and higher
levels
Verilog HDL 3
History of Verilog® HDL (cont’d)
VHDL
VHSIC (Very High Speed Integrated Circuit)
Hardware Description Language
IEEE standard
Public domain
Other EDA vendors adapted VHDL
“Gateway” put Verilog in public domain
Verilog HDL 5
History of Verilog® HDL (cont’d)
Today
Market divided between Verilog & VHDL
VHDL mostly in Europe
Verilog dominant in US
VHDL
More general language
Not all constructs are synthesizable
Verilog:
Not as general as VHDL
Most constructs are synthesizable
Verilog HDL 6
Verilog® HDL
Overview of Digital Design
Using Verilog
Overview of Digital Design Using Verilog
Verilog HDL 8
Evolution of Computer-Aided Digital
Design
SSI: Small scale integration
A few gates on a chip
MSI: Medium scale integration
Hundreds of gates on a chip
LSI: Large scale integration
Thousands of gates on a chip
CAD: Computer-Aided Design
CAD vs. CAE
Logic and circuit simulators
Prototyping on bread board
Layout by hand (on paper or a computer terminal)
Verilog HDL 9
Evolution of Computer-Aided Digital
Design (cont’d)
VLSI: Very Large Scale Integration
Hundred thousands of gates
Not feasible anymore:
Bread boarding
Manual layout design
Simulator programs
Automatic place-and-route
Bottom-Up design
Design small building blocks
Combine them to develop bigger ones
More and more emphasis on logic simulation
Verilog HDL 10
Emergence of HDLs
The need to a standardized language for
hardware description
Verilog® and VHDL
Simulators emerged
Usage: functional verification
Logic synthesis technology
Late 1980s
Dramatic change in digital design
Design at Register-Transfer Level (RTL) using an HDL
Verilog HDL 11
Typical Design Flow (in 1996)
1. Design specification
2. Behavioral description
3. RTL description
4. Functional verification and testing
5. Logic synthesis
6. Gate-level netlist
7. Logical verification and testing
8. Floor planning, automatic place & route
9. Physical layout
10. Layout verification
11. Implementation
Verilog HDL 12
Typical Design Flow (cont’d)
NOTE:
CAD tools help, but the designer still has the
main role
To obtain an optimized design, the designer needs to
know about the synthesis technology
• Compare to software programming and compilation
Verilog HDL 14
Importance of HDLs
Verilog HDL 15
Popularity of Verilog HDL
Verilog HDL
General-purpose
Easy to learn, easy to use
Similar in syntax to C
Allows different levels of abstraction and mixing them
Supported by most popular logic synthesis tools
Post-logic-synthesis simulation libraries by all
fabrication vendors
PLI to customize Verilog simulators to designers’ needs
Verilog HDL 16
Trends in HDLs
Verilog HDL 17
Verilog® HDL
Hello World!
Basics of Digital Design Using HDLs
Stimulus block
Generating Checking
inputs Circuit Under Design outputs
to CUD (CUD) of CUD
4
8
Test bench
Verilog HDL 19
ModelSim® Simulation Environment
Verilog HDL 20
Verilog Basic Building Block
Module
endmodule
Verilog HDL 21
useless Verilog Example
module display_hello;
initial
$display(“Hello World!”);
endmodule
Verilog HDL 22
Verilog® HDL
Hierarchical Modeling Concepts
Design Methodologies
Verilog HDL 24
4-bit Ripple Carry Counter
Verilog HDL 25
T-flipflop and the Hierarchy
Verilog HDL 26
Modules
module <module_name>(<module_terminal_list>);
...
<module internals>
...
endmodule
Example:
module T_ff(q, clock, reset);
...
<functionality of T_flipflop>
...
endmodule
Verilog HDL 27
Modules (cont’d)
Verilog supported levels of abstraction
Behavioral (algorithmic) level
Describe the algorithm used
Very similar to C programming
Dataflow level
Describe how data flows between registers and is processed
Gate level
Interconnect logic gates
Switch level
Interconnect transistors (MOS transistors)
Register-Transfer Level (RTL)
Generally known as a combination of behavioral+dataflow that is
synthesizable by EDA tools
Verilog HDL 28
Instances
module ripple_carry_counter(q, clk, reset);
output [3:0] q;
input clk, reset;
endmodule
Verilog HDL 29
Instances (cont’d)
module TFF(q, clk, reset);
output q;
input clk, reset;
wire d;
endmodule
endmodule
Verilog HDL 30
Instances (cont’d)
Illegal instantiation example:
Nested module definition not allowed
Note the difference between module definition and module instantiation
endmodule
Verilog HDL 31
Simulation- Test Bench Styles
Verilog HDL 32
Example
Design block was shown before
ripple_carry_counter, T_FF, and D_FF modules
Stimulus block
Verilog HDL 33
Example (cont’d)
module stimulus;
reg clk; reg reset; wire[3:0] q;
Verilog HDL 35
Other Notes
Exercise 1
Install and use icarus in the lab. to simulate
Basic gates example
Chapter 2 exercises
Verilog HDL 36