Introduction

Icarus Verilog is an absolute masterpiece of software. It is a fully open source, standalone Verilog simulation engine written in C++ and available for all major platforms, including MacOS, Windows, and Linux.

This material will guide you through installation and usage of Icarus Verilog to do most of the designs you will find in lab this semester.

Installation

Windows

Homepage Here.

You will want the following download: Windows Setup.

  1. Double click the executable
    2025 02 20T02 24 20 905Z

  2. Accept the license agreement
    2025 02 20T02 25 44 627Z

  3. Press next through the note

  4. Keep the default installation path
    2025 02 20T02 27 20 767Z

  5. Make sure to select Full Installation
    2025 02 20T02 28 02 206Z

  6. Press next to create start menu folder

  7. Check Add executable folder(s) to the user PATH
    2025 02 20T02 29 01 114Z

  8. Then press Install and Finish

Linux

See your distro maintenance manual for more information, but will almost certainly just be:

sudo apt install iverilog gtkwave

MacOS

First, if you have not, install Homebrew: https://brew.sh/

GTK Wave is no longer officially supported: https://formulae.brew.sh/cask/gtkwave#default

Usage

Icarus Verilog is extremely simple to use. Within the directory that contains all of your Verilog files that you are working on, simply run the following commands (open a terminal in the directory with all your .v files):

iverilog *.v # This "compiles" the Verilog into the executable `a.out`
vvp a.out # This runs the simulation

All of the projects in the lab are structured such that these two commands should properly simulate everything you want to see, aside from syntax errors (which you would also get in Vivado).

The test benches are also normally set up to dump waveforms into dump.vcd which should be present in the same directory as a.out. View these by opening them in GTKWave:

gtkwave dump.vcd

This will pop up a waveform view that is nearly the same as Vivado:

2025 02 20T02 43 55 076Z

  1. The "scope" view that contains the modules you might be interested in. This is heirarchical like Vivado.

  2. The signals view. Double click on these to have them show in the Wave view.

  3. The Waveform view. Double click a signal to expand the individual bits.

  4. Zoom to fit button. Your friend.

The simulation, if it has any pass/fail critera, will show in the terminal after you run the vvp command (example from Week 6):

half_sub Test Passed: A=0, B=1 => Y=1, B_out=1
ones_compliment Test Passed: A=0111, B=0101 => Y=1100
ones_compliment Test Passed: A=1010, B=0111 => Y=0010
twos_compliment Test Passed: A=01010111 => Y=10101001
twos_compliment Test Passed: A=00000001 => Y=11111111
twos_compliment Test Passed: A=00000010 => Y=11111110
twos_compliment Test Passed: A=00001000 => Y=11111000
test.v:99: $finish called at 170000 (1ps)

You can use these simulation outputs to work on and finish your labs even if you cannot or do not wish to install Vivado on your PCs.