Merry Christmas!
For several years now I have been working with vivado from Xilinx. I don't use the simulation facility in vivado. Telling it to "run synthesis" is very slow and I began wondering if a tool like "iverilog" or "verilator" might be a way to spot check my verilog syntax and even do some simple testing. It turns out that it definitely is useful as a first step and time saver before going on to vivado.
dnf install iverilogThis gives me both "iverilog" and "vvp" and I am good to go.
Using it for simulation looks promising and will give me even more practice with verilog writing test bench code.
vvp a.out Hello, World hello.v:5: $finish called at 0 (1s)
Suppose you have multiple files such as counter.v and tb_counter.v where "tb" is a test bench. You can "compile" them together and run them via:
iverilog -o design tb_counter.v counter.v vvp design
If you have a big design and lots of files, you can put all the filenames, one per line into a file list "file_list" then use:
iverilog -o design -c file file_list vvp designAt this point I will almost certainly start using a Makefile.
The iverilog system will choose as a "root" module, some module that is not instantiated by any other module. If there is no such module or this is otherwise ambiguous, you can use the "-s" switch to indicate a root module:
iverilog -s main -o design -c file file_list
Installing: gtkwave x86_64 3.3.121-1.fc41 Installing dependencies: Judy x86_64 1.0.5-37.fc41 amtk x86_64 5.6.1-7.fc41 libgedit-gtksourceview x86_64 299.0.5-2.fc41 libpeas1-loader-python3 x86_64 1.36.0-7.fc41 tepl x86_64 6.8.0-3.fc41 Installing weak dependencies: gedit x86_64 2:46.2-5.fc41They say to add this to your test bench, where "tester" is the name of your test bench module
initial begin $dumpfile("test.vcd"); $dumpvars(0,tester); endThen run your simulation via:
vvp foo.vvp -fstThe -fst option is not necessary, but is faster than the default -vcd.gtkwave dump.fst
There is a 159 page manual. Holy Cow, I hope it isn't that complex.
See my notes below:
Tom's Computer Info / tom@mmto.org