Verilog Guide
Verilog Guide
SETUP:
1. Download Verilog: iverilog-v12-20220611-x64_setup
3. Advance system settings >> Environment Variables >> path >> paste C:\iverilog\bin
NOTE:
Add copied path to
both “user variables”
and “System variables.”
Open command prompt in “bin” and run command iverilog
Using VScode:
1. iverilog -o Object_file file_name.v File_name_tb.v
2. vvp object_file
3. gtkwave object_file.vcd
Verilog Keywords:
module Represents block of Verilog code that implements certain behavioural
characteristics.
test.v Top level module that contains the design code.
test_tb.v Top level module (testbench code) that contains stimulus to check
functionality of design.
initial Procedural block used to initialize variables and drive design ports with specific
values.
always Procedural block that executes statements sequentially based on some
events.
always@(*) Always executes statements independent of condition.
$dumpfile Dump the changes in the values of wires and registers in file inside its argument
i.e., $dumpfile(“test.vcd”);
$dumpvars Specifies which variables are to be dumped mentioned in dumpfile.
$finish Terminates the current simulation.
NOTE: $dumpvars(0, testbench_file) signifies that when level is set to 0, it dumps all the
variables of that module and all the variables in lower level modules instantiated by this top
module.