因为“一生一芯”提供的安装包verilator_installer.tar.gz只能在Unbuntu20.04系统使用,但是我用的虚拟机版本是18.04,为了节约我可怜的硬盘空间,所以采用了提供的第二种方法。
https://verilator.org/guide/latest/install.html
# Prerequisites:
sudo apt-get install git perl python3 make autoconf g++ flex
bison ccache libgoogle-perftools-dev numactl perl-doc libfl2
libfl-dev zlibc zlib1g zlib1g-dev
git clone https://github.com/verilator/verilator # Only first
time
## Note the URL above is not a page you can see with a browser, it's for git only
# Every time you need to build:
unsetenv VERILATOR_ROOT # For csh; ignore error if on bash
unset VERILATOR_ROOT # For bash
cd verilator
git pull # Make sure git repository is up-to-date
git checkout v4.204
autoconf # Create ./configure script
./configure --prefix=/usr # Configure and create Makefile
make # Build Verilator itself
sudo make install
安装的过程比较慢,在安装成功安装gtkwave用来看波形
sudo apt-get install gtkwave
#gtkwave --version
但是在运行例程时候会报错:
Failed to load module "canberra-gtk-module"
这个问题其实在CSDN上可以查到,通过重新安装下面这个包来解决问题:
sudo apt-get install libcanberra-gtk-module
在安装后运行例程能够看到对应的波形图。