Installation instructions
Here, we will install two software required for the course:
- Iverilog
- GTKwave
We recommend using Ubuntu 22.04 as your operating system. For Windows 10/11, you may use WSL (Windows Subsystem for Linux) and install Ubuntu 22.04.
Installing Icarus Verilog (iverilog)
Icarus Verilog or iverilog comprises of the compiler and simulation runtime engine.
Prerequisites
Before installing Icarus Verilog, ensure that your system has the following:
gcc
(GNU Compiler Collection)make
git
You can install these dependencies using your package manager if they are not already available:
sudo apt update
sudo apt install build-essential git
Installation Steps
Method 1: Install from Package Manager
-
Run the following command in Terminal:
sudo apt update sudo apt install iverilog
-
Verify the installation:
iverilog -V
You should see the version information for Icarus Verilog. It should be
12.0 (stable)
.
Method 2: Build from Source
-
Clone the Icarus Verilog repository:
git clone https://github.com/steveicarus/iverilog.git cd iverilog
-
Build and install:
sh autoconf.sh ./configure make sudo make install
-
Verify the installation:
iverilog -V
Installing GTKWave
GTKWave is a waveform viewer used to analyze simulation results.
Prerequisites
Ensure the following packages are installed:
tcl
tk
libx11-dev
libxft-dev
Install them using:
sudo apt update
sudo apt install tcl tk libx11-dev libxft-dev
Installation Steps
Method 1: Install from Package Manager
-
Run the following command in Terminal:
sudo apt install gtkwave
-
Verify the installation:
gtkwave --version
You should see the version information for GTKWave. It should be
3.3.116
.
Method 2: Build from Source
-
Download the source code:
git clone https://github.com/gtkwave/gtkwave.git cd gtkwave
-
Build and install:
./configure make sudo make install
-
Verify the installation:
gtkwave --version
Testing the Installation
Running a Verilog Simulation
-
Create a simple Verilog file (e.g.,
test.v
): -
Compile and run the file using Icarus Verilog:
iverilog test.v -o test vvp test
The output should display:
Hello, Icarus Verilog!
Viewing Waveforms with GTKWave
-
Create two Verilog files.
counter.v
tb_counter.v
-
Compile and run:
iverilog counter.v tb_counter.v -o counter vvp counter
This will generate the
counter_dump.vcd
file. -
Open the waveform file with GTKWave:
gtkwave counter_dump.vcd
A window will be opened with the testbench name,
tb_counter
in the SST pane. Click on it to view the signals inside the testbench.Select all the signals and click on Insert. This will insert all the testbench signals in the waveform pane. You will see the simulation output as below.