eecs270.org

Local Simulation Tool Installation Guide

In the past, we have recommended using ModelSim through CAEN VNC for testing Verilog. While this is still a valid option, we recommend and provide support for local simulation through an open source toolchain.

Installation

Windows

For Windows, we recommend using WSL to install the tools. Install WSL as described by the eecs280 setup guide. While you can run these tools natively on Windows, the setup is more complex. Additionally, having WSL Linux gives you a lot more flexibility for running other tools and scripts in the future.

In your WSL Ubuntu shell:

sudo apt update
sudo apt install iverilog gtkwave

GTKWave on WSL needs WSLg for GUI support. WSLg is enabled by default on Windows 11 and on recent Windows 10 builds. If gtkwave does not open a window, run wsl --update in PowerShell.

macOS

Install Homebrew if you do not already have it, then:

brew install icarus-verilog
brew install --cask gtkwave

If macOS Gatekeeper blocks GTKWave on first launch, right-click the app and choose Open.

VaporView (requires VS Code)

  1. Open VS Code.
  2. Go to the Extensions panel.
  3. Search for VaporView and click Install.

Basic Usage

The examples below use Project 0 (Majority), but the same pattern works for every project.

1. Dump waveforms from your testbench

Add the following to the initial block of your testbench so that simulation produces a .vcd file:

initial begin
    $dumpfile("wave.vcd");
    $dumpvars(0, TestBench0);   // 0 = all nested levels; TestBench0 = top module
    // ...your test stimulus...
end

2. Compile and simulate with iverilog

From the directory containing your Verilog sources:

iverilog -o sim TestBench0.v Majority.v   # compile testbench + design into 'sim'
vvp sim                                   # run sim, producing wave.vcd

3a. View waveforms in GTKWave

gtkwave wave.vcd

3b. View waveforms in VaporView

Example: Project 0 Workflow

# Compile testbench + design
iverilog -o sim TestBench0.v Majority.v

# Run simulation (produces wave.vcd)
vvp sim

# Inspect waveforms
gtkwave wave.vcd      # standalone GUI
# or
code wave.vcd         # VaporView in VS Code

Iterate: edit your Verilog, re-run the three commands, refresh the waveform viewer.

Further Resources

Notes