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

  1. Run the following command in Terminal:

    sudo apt update
    sudo apt install iverilog
    
  2. 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

  1. Clone the Icarus Verilog repository:

    git clone https://github.com/steveicarus/iverilog.git
    cd iverilog
    
  2. Build and install:

    sh autoconf.sh
    ./configure
    make
    sudo make install
    
  3. 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

  1. Run the following command in Terminal:

    sudo apt install gtkwave
    
  2. Verify the installation:

    gtkwave --version
    

    You should see the version information for GTKWave. It should be 3.3.116.

Method 2: Build from Source

  1. Download the source code:

    git clone https://github.com/gtkwave/gtkwave.git
    cd gtkwave
    
  2. Build and install:

    ./configure
    make
    sudo make install
    
  3. Verify the installation:

    gtkwave --version
    

Testing the Installation

Running a Verilog Simulation

  1. Create a simple Verilog file (e.g., test.v):

  2. 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

  1. Create two Verilog files.

    • counter.v
    • tb_counter.v
  2. Compile and run:

    iverilog counter.v tb_counter.v -o counter
    vvp counter
    

    This will generate the counter_dump.vcd file.

  3. 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.