0% found this document useful (0 votes)
39 views196 pages

Verilog HDL Hardware Modeling Guide

The document provides an overview of hardware modeling using Verilog HDL, including descriptions of different levels of abstraction, language structure and concepts, modeling combinational and sequential logic, writing testbenches, and designing finite state machines.

Uploaded by

ChanYeong Na
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views196 pages

Verilog HDL Hardware Modeling Guide

The document provides an overview of hardware modeling using Verilog HDL, including descriptions of different levels of abstraction, language structure and concepts, modeling combinational and sequential logic, writing testbenches, and designing finite state machines.

Uploaded by

ChanYeong Na
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Hardware Modeling Overview

1
What is Verilog HDL?

2
Levels of Abstraction

3
Levels of Abstraction

4
Language Subsets

5
Hierarchical Design

6
Partitioning Guidelines

7
Top-Down Component

8
Device-Level Optimization

9
Inference versus Vendor Macro Instantiation

10
Modules , Ports,
Data-Flow Level Modeling

11
Half-Adder

12
Full Adder

13
Structured Half Adder

14
4-bit Binary Full Adder

15
DLatch

16
DFF

17
ISE Software Editing Resources

18
Module Description

19
Module Example

20
Driving Output Ports

21
Continuous Assignments

22
Continuous Assignments

23
Using `define for Ports

24
Using parameter for Ports

25
Port Declarations

26
Port Rules Summary

27
reg Output(s)

28
reg Output(s)

29
reg Output(s)

30
Creating Hierarchy

31
Mapping Ports

32
Internal Module Connectivity

33
Unconnected Ports

34
Using defparam

35
Using Module Instance

36
Controlled Operation Statements

37
Conditional Execution

38
Language Structure

39
if/else Statements

40
else Clause

41
if/else if Statements

42
if/else if Example

43
if/else if Rules

44
Language Structure

45
case Statement

46
Handling Multiple Statements

47
case Guidelines

48
case Guidelines

49
Full and Parallel case

50
Default Assignments

51
if/else Default Assignment Question

52
if/else Default Assignment Answer

53
case Default Assignment Question

54
case Default Assignment Answer

55
Alternate Default Approach

56
Verilog Procedural Statements

57
Behavioral Modeling

58
Behavioral and Procedural Coding

59
Simulation versus Hardware

60
Simulation

61
Testbench versus UUT

62
Procedural Statements

63
initial versus always

64
Procedural Assignments

65
Initialization

66
initial Blocks

67
always Blocks

68
Triggering and Stopping always

69
Event-Based Control

70
Modeling Combinatorial Logic

71
Event-Control Examples

72
Edge-Triggered Event

73
Modeling D-Type Flip-Flops

74
Blocking versus Non-Blocking

75
Blocking

76
Non-Blocking

77
Why Non-Blocking?

78
Effect of Non-Blocking

79
Blocking and Non-Blocking Uses

80
Blocking and Non-Blocking

81
Verilog Language Concepts

82
Syntax and Structure

83
Keywords and Identifiers

84
Comments

85
Data Values

86
Data Types

87
Verilog Net Types

88
Variable Data Types

89
Comparing reg versus wire

90
reg and Flip-Flop Confusion

91
reg and Flip-Flop Confusion

92
Numerical Representation

93
Explicitly Sized Numbers

94
Implicitly Sized Numbers

95
Integers

96
Integers

97
real

98
time

99
Bus Declaration (1)

100
Bus Declaration (2)

101
Bus Declaration (3)

102
Bus Declaration (4)

103
Memory

104
Multi-Dimensional Memory

105
Bit Select

106
Part Select

107
Verilog Operators and Expressions

108
Operators

109
Bitwise Operators

110
Bitwise Operator Examples

111
Logical Operators

112
Logical Operator Examples

113
Relational Operators

114
Relational Operator Examples

115
Equality Operators

116
Equality Operator Examples

117
Reduction Operators

118
Reduction Operator Examples

119
Conditional Operators

120
Conditional Operators

121
Conditional Operators

122
Concatenation Operators

123
Concatenation Operator Examples

124
Shift Operators

125
Shift Operator Example

126
Building Shift Registers

127
Arithmetic Operators

128
Arithmetic Operator Examples

129
Resource Sharing

130
Introduction to Testbenches

131
Design Verification

132
Testbench Concept

133
Application of a Testbench

134
Complete IEEE 1364

135
Simulation I/O Flexibility

136
Recommended Verification Stages

137
Timing Verification

138
Testbench Consistency

139
Procedural Coding

140
Verify at Each Level

141
Before the Testbench

142
Components of a Testbench

143
`timescale Directives

144
Testbench Example

145
CNTR32 Testbench

146
Creating Clock Signals

147
Other Clock Approaches

148
Modeling Input Stimulus

149
One Possible Solution

150
Gate Delays

151
Simulating Delays

152
Modeling Delays

153
Delay Specification

154
Delay Specification

155
Cumulative Delays

156
System Tasks

157
System Tasks

158
Formatting Data

159
$monitor System Tasks

160
$stop and $finish System Tasks

161
Outputting $time

162
Using $display and $monitor

163
One Possible Solution

164
Finite State Machines

165
Simple Code to Complex Logic

166
FSM Overview

167
FSM Coding

168
Mealy versus Moore

169
Moore Machine

170
Mealy Machine

171
Initialization

172
Synchronous Initialization

173
Unreachable States

174
“Safe” State Machines

175
Parameters

176
Local Parameters

177
Using Parameters

178
`define Statements

179
Using `define Statements

180
One or More Procedural Blocks

181
One Possible Approach

182
Using always

183
Modeling Next-State Logic

184
Assigning Moore Outputs

185
Assigning Mealy Outputs

186
Using assign for Outputs

187
Registered Moore Outputs

188
Registered Mealy Outputs

189
Using Single always

190
Single always Block

191
FSM Outputs

192
FSM Coding Example

193
FSM Coding Example

194
FSM Coding Example

195
FSM Coding Example

196

You might also like