forked from OpenXiangShan/xs-env
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-verilator.sh
30 lines (24 loc) · 1.15 KB
/
install-verilator.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# https://verilator.org/guide/latest/install.html
sudo apt-get install git perl python3 make autoconf g++ flex bison ccache clang
sudo apt-get install libgoogle-perftools-dev numactl perl-doc
sudo apt-get install libfl2 # Ubuntu only (ignore if gives error)
sudo apt-get install libfl-dev # Ubuntu only (ignore if gives error)
sudo apt-get install zlibc zlib1g zlib1g-dev # Ubuntu only (ignore if gives error)
git clone https://github.com/verilator/verilator
# 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 tag # See what versions exist
#git checkout master # Use development branch (e.g. recent bug fixes)
#git checkout stable # Use most recent stable release
#git checkout v{version} # Switch to specified release version
# XiangShan uses Verilator v4.218
git checkout v4.218
autoconf # Create ./configure script
# Configure and create Makefile
./configure CC=clang CXX=clang++ # We use clang as default compiler
make -j8 # Build Verilator itself
sudo make install
verilator --version