Verilog Using Synapticad
Verilog Using Synapticad
Verilog HDL
Lecture 02
Chapter 02
Course Overview
!
!
!
!
!
!
!
!
!
8/30/15
Introduction
Language Elements
Language Expressions
Gate-Level Modeling
User-Defined Primitives
Dataflow Modeling
Behavioral Modeling
Structural modeling
Task and Functions
Chapter Overview
!
!
!
Design Methodologies
Verilog Modules and Ports
Styles of Verilog Modeling
!
!
!
!
8/30/15
Dataflow Modeling
Behavioral Modeling
Structural Modeling
Mixed-Design Modeling
INCREASING ABSTRACTION
LEVEL
8/30/15
CHIP
STRUCTURAL
BEHAVIORAL
PERFORMANCE
I/O RESPONSE
ALGORITHMS
OPERATIONS
PARALLEL PORT
REGISTERS, ALUs
REGISTER
COUNTERS, MUXES
TRUTH TABLES
STATE TABLES
OPERATIONS
GATE
GATES, FLIP-FLOPS
BOOLEAN EQUATIONS
CIRCUIT
TRANSISTORS, RLC
DIFFERENTIAL EQUATIONS
SILICON
GEOMETRICAL
OBJECTS
INCREASING DETAIL
---
8/30/15
Schematic Design
Schematics display the structure of a design.
Main focus on structural details of the design.
Efficient at small design level.
C_out_bar
C_out
Sum
Add_half
b
C_out
sum = a b
a
b
sum
c_out = a b
8/30/15
rst
data_in
clk
Procedural statement
Design Methodologies
!
8/30/15
Top-Down Design
Bottom-Up Design
Bottom-Level
Block: Leaf
8/30/15
Bottom-Level
Block: Leaf
Bottom-Level
Block: Leaf
Bottom-Level
Block: Leaf
Bottom-Level
Block: Leaf
Bottom-Level
Block: Leaf
Bottom-Level
Block: Leaf
8/30/15
Bottom-Level
Block: Leaf
Bottom-Level Bottom-Level
Block: Leaf
Block: Leaf
Bottom-Level Bottom-Level
Block: Leaf
Block: Leaf
10
11
8/30/15
12
8/30/15
13
Logical Equations:
Dy3 = y3y2 + y3y1 + y3y0
+ y3y2y1y0
Dy2 = y2y1 + y2y0 + y2y1y0
Dy1 = y1y0 + y1y0
Dy0 = y0
8/30/15
14
Cout = ab + (a b)cin
8/30/15
15
Description of internal
structure/function
!
Communicate with
outside through ports
!
!
Achieve hardware
encapsulation
a
b
sum
c_out_bar
c_out
8/30/15
16
8/30/15
//declarations
// other statements
17
Module Instantiation
!
Accomplished by entering:
!
!
!
!
8/30/15
18
8/30/15
19
8/30/15
20
Smart Primitives
module nand3 (O, A1, A2, A3);
input
A1, A2, A3;
output
O;
nand (O, A1, A2, A3);
endmodule
Smart Primitives: Same primitive can be used to
describe for any number of inputs
8/30/15
21
Symmetrical Delays
! All the delays are uniform
! Default Delay = 0
Asymmetrical Delays
! Min Delay
! Typical Delay
! Max Delay
Times
!
!
8/30/15
22
x1
x2
x3
x4
y1
y
y2
23
Min delay
Typical delay
Max delay
Falling time
Rising time
24
Construct Definitions
!
Continuous Assignment:
To describe combinational logic where the output of the circuit is
evaluated whenever an input changes:
8/30/15
25
8/30/15
26
Example: TB
for 2-input
and Gate
(Cont)
8/30/15
27
8/30/15
28
!
!
Behavioral Modeling:
!
1.
2.
8/30/15
29
!
!
Mixed-Design Modeling:
!
!
8/30/15
30
+X1
+X2
+Z1
assign z1 = x1 ^ x2;
endmodule
8/30/15
31
8/30/15
32
8/30/15
33
Time Units
!
8/30/15
34
//dataflow modeling
timescale 10ns/1ns
module four_and_delay (z1, x1, x2);
input x1, x2; output
z 1;
wire x1, x2; wire [3:0] z1;
assign #2
assign #2
assign #2
assign #2
endmodule
8/30/15
-X1
-X2
+Z1[0]
-X1
+X2
+Z1[1]
+X1
-X2
+Z1[2]
+X1
+X2
+Z1[3]
When input x1 or x2
changes value, the value
of right-hand statement is
assigned to the left-hand
after a delay of 20ns.
35
#5
x1 = 1b 0;
x2 = 1b 1;
#5 x1 = 1b 0;
x2 = 1b 1;
#5 x1 = 1b 0;
x2 = 1b 0;
#5 $stop;
end
four_and_delay Inst1 (
. x1 (x1), . x2 (x2), . z1 (z1), );
endmodule
36
8/30/15
37
Summary
!
!
!
!
!
8/30/15
Top-down
Bottom-up
38
Questions?
8/30/15
39