2022-08-11 02:09:55 +08:00
|
|
|
#!/usr/bin/env bash
|
2020-12-25 01:41:01 +08:00
|
|
|
##===- utils/get-verilator.sh - Install Verilator ------------*- Script -*-===##
|
|
|
|
#
|
|
|
|
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
# See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
#
|
|
|
|
##===----------------------------------------------------------------------===##
|
|
|
|
#
|
2020-10-31 04:12:15 +08:00
|
|
|
# Downloads, compiles, and installs Verilator into $/ext
|
2020-12-25 01:41:01 +08:00
|
|
|
# Verilator can be used to check SystemVerilog code.
|
|
|
|
#
|
|
|
|
##===----------------------------------------------------------------------===##
|
2020-10-31 04:12:15 +08:00
|
|
|
|
2021-04-01 09:51:58 +08:00
|
|
|
mkdir -p "$(dirname "$BASH_SOURCE[0]")/../ext"
|
2020-10-31 04:12:15 +08:00
|
|
|
EXT_DIR=$(cd "$(dirname "$BASH_SOURCE[0]")/../ext" && pwd)
|
2021-03-07 13:52:34 +08:00
|
|
|
VERILATOR_VER=4.110
|
2020-10-31 04:12:15 +08:00
|
|
|
|
|
|
|
echo $EXT_DIR
|
|
|
|
cd $EXT_DIR
|
|
|
|
|
|
|
|
wget https://github.com/verilator/verilator/archive/v$VERILATOR_VER.tar.gz
|
|
|
|
tar -zxf v$VERILATOR_VER.tar.gz
|
|
|
|
cd verilator-$VERILATOR_VER
|
|
|
|
autoconf
|
2020-11-04 08:46:17 +08:00
|
|
|
./configure --prefix=$EXT_DIR
|
2020-10-31 04:12:15 +08:00
|
|
|
make -j$(nproc)
|
|
|
|
make install
|
|
|
|
cd ..
|
|
|
|
rm -r verilator-$VERILATOR_VER v$VERILATOR_VER.tar.gz
|