First, A Reality Check
You don't need to install anything to learn Verilog. Every interactive editor in these docs runs real Verilog through Icarus Verilog in a sandbox, including the waveform viewer. If you're here to learn the language, skip this page and come back when you want to work on a longer project locally.
Still want a local install? Read on.
What "Installing Verilog" Actually Means
Verilog is a language, not a program. To run it you need:
- A simulator - the tool that compiles your
.vfiles and runs them. For most learners that's Icarus Verilog, which gives you theiverilogcompiler and thevvpruntime. - A waveform viewer - usually GTKWave - that reads the
.vcdfiles your testbench produces. - A text editor - VS Code with a Verilog extension is the common pick, but anything works.
Vendor toolchains (Xilinx Vivado, Intel Quartus, Synopsys VCS, Cadence Xcelium) exist for FPGA programming and ASIC work. They're large, often licensed, and overkill for learning. Stick with Icarus.
Installing on macOS
The fastest path is Homebrew:
brew install icarus-verilog gtkwave
That installs both the compiler and the waveform viewer. Verify:
iverilog -V
gtkwave --version
You should see version numbers from both. iverilog puts itself on your PATH automatically. GTKWave installs an app bundle under /Applications and a gtkwave command line you can launch from the terminal.
If Homebrew isn't installed, follow the instructions at brew.sh first - it's one curl command - then come back.
Installing on Linux
On Debian-based distributions (Ubuntu, Mint, Pop!_OS):
sudo apt update
sudo apt install iverilog gtkwave
On Fedora / RHEL-style systems:
sudo dnf install iverilog gtkwave
On Arch:
sudo pacman -S iverilog gtkwave
Then verify the same way:
iverilog -V
gtkwave --version
The packaged version sometimes lags upstream by a release. For most learning that's fine. If you need a newer release, build from source - the project's GitHub repo has instructions, and it's a ./configure && make && sudo make install away.
Installing on Windows
The easiest route is the prebuilt installer maintained by the iverilog community at bleyer.org (search for "iverilog Windows"). It bundles Icarus Verilog, GTKWave, and the GCC toolchain Icarus needs internally.
- Download the latest installer (typically
iverilog-vXX-setup.exe). - Run it. Accept the defaults unless you have a reason not to.
- When the installer asks, leave "Add to PATH" checked.
- Open a new PowerShell or Command Prompt window and verify:
iverilog -V
gtkwave --version
If you forgot to add to PATH, the binary lives at something like C:\iverilog\bin\iverilog.exe. Either add C:\iverilog\bin to your user PATH from System Properties, or re-run the installer and tick the box.
WSL2 is also a fine option on Windows - install Ubuntu from the Microsoft Store and follow the Linux instructions inside it. You'll have a more familiar Unix-y workflow.
Compiling and Running Your First File
Once installed, the workflow looks like this. Save a file as hello.v:
module hello;
initial begin
$display("hello from verilog");
$finish;
end
endmodule
Compile it into a simulation binary:
iverilog -o hello hello.v
iverilog is the compiler. -o hello names the output. hello.v is your source.
Run the simulation:
vvp hello
You should see:
hello from verilog
That's the entire local loop. From here you can split your design across multiple files (iverilog -o sim *.v), use the -g2012 flag to enable SystemVerilog-2012 features, or pipe the output to your own scripts.
Producing and Viewing a Waveform
Add $dumpfile and $dumpvars to your testbench, run it, and open the resulting VCD in GTKWave:
initial begin
$dumpfile("dump.vcd");
$dumpvars(0, test);
// ...
end
After vvp sim finishes, you'll have a dump.vcd next to your source. Open it:
gtkwave dump.vcd
GTKWave loads the file and presents the signal tree on the left. Drag the signals you care about into the wave area on the right. We cover this in detail in Dumpfile and VCD.
Common Errors
iverilog: command not found - the binary isn't on your PATH. On Windows that usually means the installer wasn't run with PATH update enabled. On macOS/Linux it usually means Homebrew/apt didn't finish, or you're in a shell that hasn't reloaded its PATH (close and reopen the terminal).
syntax error on a line that looks correct - check that you're not using a SystemVerilog feature in plain Verilog mode. Pass -g2012 to iverilog to enable SystemVerilog-2012:
iverilog -g2012 -o sim main.v
Unknown module during compile - either the module's source file wasn't passed to iverilog, or the module name in the instantiation doesn't match the module declaration exactly. Verilog is case-sensitive.
Empty waveform in GTKWave - your testbench didn't call $dumpfile and $dumpvars, or the simulation hit $finish before any signals changed. Add at least one $dumpvars(0, top) and let the simulation run long enough for transitions.
What Comes Next
Whether you installed locally or stuck with the browser, the next doc walks through writing your first complete module from scratch - module declaration, ports, a tiny piece of combinational logic, and a testbench around it.
Frequently Asked Questions
How do I install Verilog?
There is no single 'Verilog' program - it's a language, and you install a compiler/simulator. For learning, the standard choice is Icarus Verilog (the iverilog and vvp commands), paired with GTKWave for viewing waveforms. On macOS use brew install icarus-verilog gtkwave; on Debian/Ubuntu use apt install iverilog gtkwave; on Windows download the prebuilt installer from the Bleyer site.
Do I have to install anything to learn Verilog?
No. The editor on this page runs your code under iverilog and vvp in the cloud and renders the VCD waveform inline. You can complete every doc in these tutorials without installing a thing. Installing locally is useful once you want to save files, version-control a project, or work on a design too large for the browser editor.
What is the difference between iverilog and vvp?
iverilog is the compiler - it turns your .v source files into a simulation binary. vvp is the runtime that executes that binary. The typical command sequence is iverilog -o sim main.v test.v followed by vvp sim. Most workflow scripts wrap both.
Is Icarus Verilog free?
Yes. Icarus Verilog is open source under GPL/LGPL. There's no license server, no trial period, and it works for both learning and commercial use. The commercial alternatives (ModelSim, VCS, Xcelium) are paid; for everything covered in these docs, Icarus is enough.
How do I check my iverilog version?
Open a terminal and run iverilog -V. You should see a version number like Icarus Verilog version 12.0. If you get 'command not found', the binary isn't on your PATH - re-run the installer or add the bin directory to your shell config.