General Lab Instructions
General Lab Instructions
1. Once installed make sure that iverilog is properly added to the path.
2. You can add it on your own if not done automatically during installation.
3. In Control panel -> Advanced System Settings -> Environment Variables
4. Here in the System Variables choose path and edit it.
5. Click New and add two paths C:\iverilog\bin\ for iverilog
6. Click New and add two paths C:\iverilog\gtkwave\bin\ for gtkwave
7. Save the changes. Sometimes you may have to restart the system.
8. Check if iverilog is properly added to the path using the following process.
~1~
My First Verilog Program
You can run the conventional “Hello World!” program to familiarize yourself with
the process of executing program using iverilog.
module hello;
initial
begin
$display("Hello World");
$finish ;
end
endmodule
The results of this compile are placed into the file "hello", because the "-o" flag tells the
compiler where to place the compiled result. If there are syntax errors, you will find
them after compilation. In case of no errors, proceed to see the output using
vvp filename.vvp
The "iverilog" and "vvp" commands are the most important commands available to users
of Icarus Verilog. The "iverilog" command is the compiler, and the "vvp" command is the
simulation runtime engine. What sort of output the compiler actually creates is
controlled by command line switches, but normally it produces output in the default
vvp format, which is in turn executed by the vvp program.
~2~
will improve your analytical and design capabilities. The pleasure of applying the
concepts learnt in your favorite course digital design will give you immense
pleasure.
1. While using icarus Verilog, make sure that the following lines of code are added
in every test bench. The .vcd file generated goes as an input to a wave form viewer
initial
begin
$dumpfile("filename.vcd");
$dumpvars;
end
2. If you want to instantiate any module in any other module then the first line in
the new module should have `include “modulename.v” ex. the full_adder.v which
calls half_adder module which is in file half_adder.v then the full_adder.v should
have the line `include “half_adder.v” in it. This is exclusive to icarus verilog only.
in the `include, the prefix is backtick (where tilde is located) and not ' (apostrophe).
***The End***
~3~