Skip to content

Verilator Fedora Installation Procedure:

muneebullashariff edited this page Feb 12, 2024 · 1 revision

Steps to install Verilator

  • Ctrl+Alt+T to open a Terminal

  • Copy paste the below text into the terminal

sudo dnf install git help2man perl python3 make autoconf g++ flex bison ccache numactl perl-doc

(In the below image, the packages were already installed. When prompted for password, enter password and when prompted to install, y/n, type y) image

  • Create a clone of verilator
git clone https://github.com/verilator/verilator

image

  • If your terminal uses bash, run
unset VERILATOR_ROOT    # For bash
  • However, if your terminal uses csh, run
unsetenv VERILATOR_ROOT  # For csh
  • Enter verilator directory
cd verilator
  • Autoconf will create the configuration tool for verilator
autoconf
  • Run the configuration tool
./configure
  • Build verilator
make
  • Install the verilator binary
sudo make install
  • Install gtkwave
sudo dnf install gtkwave

How to use verilator

Verilate:- The process of compiling a SystemVerilog/Verilog file into a binary/C++ file.

In order to observer the output of an sv/v code, we must first verilate it. This can be done using the following command:

verilator --binary <filename>.sv

To include waveform generation:

verilator --binary --trace <filename>.sv

(Note: Please include the below block in your testbench file if you want waveform generation)

initial begin
  $dumpfile(“dump.vcd”); 
  $dumpvars;
end

(Please refer to https://verilator.org/guide/latest/exe_verilator.html for more arguments like --binary and --trace)

  • Once the target file has been verilated, an object will be generated in obj_dir/.
  • Run the object:
./obj_dir/V<filename>
  • To run waveforms:
gtkwave dump.vcd