329-Verilog HDL - Quick Reference Guide
329-Verilog HDL - Quick Reference Guide
Author:Susmita Nayak
Email:[email protected]
www.maven-silicon.com
VLSI Training Services
Setting standards in VLSI Design
Table of Contents
Data-types .............................................................................................................................................. 6
1.1 Nets: wire ............................................................................................................................... 6
1.1.1 wire ................................................................................................................................. 6
1.2 Registers/Variables: {reg, integer, real, time, string} ........................................................ 6
1.2.1 reg ................................................................................................................................... 6
1.2.2 integer............................................................................................................................. 7
1.2.3 real .................................................................................................................................. 7
1.2.4 time ................................................................................................................................. 8
1.2.5 string............................................................................................................................... 8
1.3 Vectors ................................................................................................................................... 8
1.4 Arrays..................................................................................................................................... 8
1.5 Parameter constants ............................................................................................................. 9
1.5.1 Parameter overriding ................................................................................................... 9
Operators ............................................................................................................................................. 10
2.1 Logical operators ................................................................................................................ 10
2.2 Bitwise operators ................................................................................................................. 10
2.3 Reduction operators............................................................................................................ 11
2.4 Shift operators ..................................................................................................................... 11
2.5 Equality operators .............................................................................................................. 12
2.6 Relational operators............................................................................................................ 12
2.7 Concatenation operators .................................................................................................... 13
2.8 Conditional operators ......................................................................................................... 13
2.9 Arithmetical operators ....................................................................................................... 13
Processes .............................................................................................................................................. 14
3.1 Continuous process ............................................................................................................. 14
3.1.1 Continuous concurrent process ................................................................................. 14
3.2 Procedural process .............................................................................................................. 14
3.2.1 initial, always ............................................................................................................... 14
3.3 Events ................................................................................................................................... 15
Data-types
1.1.1 wire
wire is continuously driven by combinational logic. The default value of a wire is “z”.
1.2.1 reg
Reg is a variable which retains value till it is updated. The default value of reg is “x”.
1.2.2 integer
Integers are signed values. The default size is 32bits. The default value of an integer is “x”.
1.2.3 real
Real numbers are expressed with a decimal point shall have atleast one digit on each side of
the decimal point. The default value of real is 0.
1.2.4 time
Time variables shall behave same as reg of atleast 64 bits. It is unsigned with default value as
“x”.
1.2.5 string
Strings are sequence of characters which are enclosed within double quotes “ “ and each
character is stored as 8 bits ASCII value. They are stored as reg type variables.
1.3 Vectors
1.4 Arrays
Operators
Processes
3.3 Events
Structured procedures
4.3 Tasks
4.4 Functions
4.5.2 Wait
4.6.4 Disable
init8x8.txt
5.3.2 $stop
5.6.2 $realtime
Compiler directives
6.1 `define
6.2 `include
6.3 `timescale
6.4 `ifdef
Verilog examples
7.6 ALU