Professional Documents
Culture Documents
1
Digital Systems Design
• HDL is for writing models of a system
• Reasons for modeling
– requirements specification
– documentation
– testing using simulation
– formal verification
– synthesis
• Goal
– most reliable design process, with minimum cost and
time
– avoid design errors!
2
Modeling Digital Systems
• HDL is for writing models of a system
• Reasons for modeling
– requirements specification
– documentation
– testing using simulation
– formal verification
– synthesis
• Goal
– most reliable design process, with minimum cost and
time
– avoid design errors!
3
Generation of ICs
4
IC Design Flow
5
Hardware Description Languages
• HDL can be used to describe any digital
system:
• For example, a computer or a component.
• A digital system can be described at several
levels:
• Switch level: wires, resistors and transistors
• Gate level: logic gates and flip flops
• Register Transfer Level (RTL): registers and
the transfers of information between registers.
Introduction to Verilog
• Verilog is Hardware description language(HDL).
• It describes digital system like MP, FF, Registers, Memory etc.
• HDL descriptions provide technology-independent documentation of
a design and its functionality.
• Design style :
→ Bottom-up -- Each design is performed at gate level
→ Top Down -- Desired style of all designers- early testing is done.
Basic Limitation of HDL
Description of digital systems only
Application Areas of HDL
System Specification
Suitable for all levels
Behavioral level
Not suitable
HW/SW
Partition
Hardware Softwre
Spec Spec
ASIC
FPGA Boards
Software
&
PLD Systems
Std Parts
Abstraction Levels in HDLs
Behavioral
Gate
Layout (VLSI)
Why use HDL? 1
• When HDL was first developed:
▪Most logic simulators operated on
netlists
• Netlist:
▪List of gates and how they’re
connected
▪A natural representation of a digital
logic circuit
• Not a very convenient way to
express designs, simulate, debug… 11
Why use HDL? 2
• Text-based
• Allows simulation before building
circuit
• Can be compiled (synthesized)
into logic circuit
• Much easier to write test
benches
12
Why use HDL? 3
• More abstract models of circuits
▪Easier to write
▪Simulates faster
• More flexible
• Provides sequencing
• A major par of Verilog’s success:
▪It allowed both the model and the
testbench to be described together
13
Two Major HDLs
• VHDL
• Verilog HDL
• Virtually every chip (FPGA, ASIC,
etc.):
▪ Designed in part using one of these
two languages
• Combines structural and behavioral
modeling styles. 14
VHDL
• “V” is short for Very High Speed
Integrated Circuits.
• Designed for and sponsored by US
Department of Defense.
• Designed by a committee (1981-1985).
• Syntax based on Ada programming
language.
• Was made an IEEE Standard in 1987.
15
Verilog HDL
• Introduced in 1985 by Gateway
Design System Corporation:
▪ Now a part of Cadence Design
Systems, Inc.
• Became an IEEE Standard in 1995
• Syntax based on C programming
language.
16
Verilog Compared to VHDL
• VHDL
▪ Provides some high-level constructs
not available in Verilog:
• E.g. user defined types, configurations
• Verilog
▪ Provides comprehensive support for
low-level digital design.
▪ Not available in native VHDL
• E.g. Range of type definitions and
supporting functions (called packages). 17
Verilog Compared to VHDL
• Verilog and VHDL are comparable languages
• VHDL has a slightly wider scope
▪ System-level modeling
▪ Fewer sources of nondeterminism (e.g., no
shared variables)
• VHDL is harder to simulate quickly
• VHDL has fewer built-in facilities for
hardware modelling
• VHDL is a much more verbose language
▪ Most examples don’t fit on slides
18
Design Methodology
19
Two Main Components of
Verilog
• Behavior
▪Concurrent, event-triggered
processes
• Structure:
▪Wires, interconnection, etc.
20
Structural vs. Behaviorial
Verilog
• Structural verilog:
▪ Module instances and their
interconnections (by wires) only.
• Behavioral verilog:
▪ The use of regs, explicit time
delays, arithmetic expressions,
procedural assignments, and other
verilog control flow structures.
Concept of Verilog “Module”
• In Verilog, the basic unit of hardware
is called a module.
▪ Modules cannot contain definitions of
other modules.
▪ A module can, however, instantiate
another module.
▪ Allows the creation of a hierarchy in a
Verilog description.
22
Basic Syntax of Module
Definition
module module_name (list_of_ports);
input/output declarations
local net declarations
Parallel statements
endmodule
23
Example 1 :: Simple AND
gate
24
Concept of Verilog “Module”
input/output declarations;
parallel statements;
endmodule
Example 1 :: simple AND gate
• Arithmetic operators
*, /, +, -, %
• Logical operators
! logical negation
&& logical AND
|| logical OR
• Relational operators
>, <, >=, <=, ==, !=
• Bitwise operators
~, &, |, ^, ~^
• Shift operators
>>, <<
• Conditional
<condition> ? <expression1> : <expression2>
Description Styles in Verilog
• Examples
module generate_sum (a, b, c);
input a, b;
output c;
xor (c, a, b);
endmodule
Data-flow Modeling