whitespace cleanup

This commit is contained in:
Jordan Carlin 2024-06-29 00:29:01 -07:00
parent 3d8e850505
commit 6c81fd7759
No known key found for this signature in database
4 changed files with 172 additions and 172 deletions

View File

@ -49,30 +49,30 @@ source "$os_release"
# Check for compatible distro # Check for compatible distro
if [[ "$ID" = rhel || "$ID_LIKE" = *rhel* ]]; then if [[ "$ID" = rhel || "$ID_LIKE" = *rhel* ]]; then
FAMILY=rhel FAMILY=rhel
if [ "$ID" != rhel ] && [ "$ID" != rocky ]; then if [ "$ID" != rhel ] && [ "$ID" != rocky ]; then
echo "For Red Hat family distros, the Wally install script has only been tested on RHEL and Rocky Linux. Your distro \ printf "%s\n" "For Red Hat family distros, the Wally install script has only been tested on RHEL and Rocky Linux. Your distro " \
is $PRETTY_NAME. The regular Red Hat install will be attempted, but there will likely be issues." "is $PRETTY_NAME. The regular Red Hat install will be attempted, but there will likely be issues."
fi fi
if [ "${VERSION_ID:0:1}" = 8 ]; then if [ "${VERSION_ID:0:1}" = 8 ]; then
RHEL_VERSION=8 RHEL_VERSION=8
elif [ "${VERSION_ID:0:1}" = 9 ]; then elif [ "${VERSION_ID:0:1}" = 9 ]; then
RHEL_VERSION=9 RHEL_VERSION=9
else else
echo "The Wally install script is only compatible with versions 8 and 9 of RHEL and Rocky Linux. You have version $VERSION." echo "The Wally install script is only compatible with versions 8 and 9 of RHEL and Rocky Linux. You have version $VERSION."
exit 1 exit 1
fi fi
elif [[ "$ID" = ubuntu || "$ID_LIKE" = *ubuntu* ]]; then elif [[ "$ID" = ubuntu || "$ID_LIKE" = *ubuntu* ]]; then
FAMILY=ubuntu FAMILY=ubuntu
if [ "$ID" != ubuntu ]; then if [ "$ID" != ubuntu ]; then
echo "For Ubuntu family distros, the Wally install script has only been tested on standard Ubuntu. Your distro \ printf "%s\n" "For Ubuntu family distros, the Wally install script has only been tested on standard Ubuntu. Your distro " \
is $PRETTY_NAME. The regular Ubuntu install will be attempted, but there may be issues." "is $PRETTY_NAME. The regular Ubuntu install will be attempted, but there may be issues."
fi fi
else else
echo "The Wally install script is currently only compatible with Ubuntu and Red Hat family \ printf "%s\n" "The Wally install script is currently only compatible with Ubuntu and Red Hat family " \
(RHEL or Rocky Linux) distros. Your detected distro is $PRETTY_NAME. You may try manually running the \ "(RHEL or Rocky Linux) distros. Your detected distro is $PRETTY_NAME. You may try manually running the " \
commands in this script, but it is likely that some will need to be altered." "commands in this script, but it is likely that some will need to be altered."
exit 1 exit 1
fi fi
# Check if root # Check if root
@ -81,16 +81,16 @@ ROOT=$( [ "${EUID:=$(id -u)}" = 0 ] && echo true || echo false);
# All tools will be installed under the $RISCV directory. By default, if run as root (with sudo) this is set to # All tools will be installed under the $RISCV directory. By default, if run as root (with sudo) this is set to
# /opt/riscv. Otherwise, it is set to ~/riscv. This value can be overridden with an argument passed to the script. # /opt/riscv. Otherwise, it is set to ~/riscv. This value can be overridden with an argument passed to the script.
if [ "$ROOT" = true ]; then if [ "$ROOT" = true ]; then
export RISCV="${1:-/opt/riscv}" export RISCV="${1:-/opt/riscv}"
else else
export RISCV="${1:-$HOME/riscv}" export RISCV="${1:-$HOME/riscv}"
fi fi
export PATH=$PATH:$RISCV/bin:/usr/bin export PATH=$PATH:$RISCV/bin:/usr/bin
export PKG_CONFIG_PATH=$RISCV/lib64/pkgconfig:$RISCV/lib/pkgconfig:$RISCV/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=$RISCV/lib64/pkgconfig:$RISCV/lib/pkgconfig:$RISCV/share/pkgconfig:$PKG_CONFIG_PATH
mkdir -p "$RISCV" mkdir -p "$RISCV"
echo -e "Detected information" echo "Detected information"
echo "Distribution: $PRETTY_NAME" echo "Distribution: $PRETTY_NAME"
echo "Version: $VERSION" echo "Version: $VERSION"
echo "Running as root: $ROOT" echo "Running as root: $ROOT"
@ -103,56 +103,56 @@ echo -e "***********************************************************************
echo -e "*************************************************************************\n" echo -e "*************************************************************************\n"
# Installs appropriate packages for rhel or ubuntu distros, picking apt or dnf appropriately # Installs appropriate packages for rhel or ubuntu distros, picking apt or dnf appropriately
if [ "$FAMILY" = rhel ]; then if [ "$FAMILY" = rhel ]; then
# Enable extra package repos # Enable extra package repos
sudo dnf install -y dnf-plugins-core sudo dnf install -y dnf-plugins-core
if [ "$ID" = rhel ]; then if [ "$ID" = rhel ]; then
sudo subscription-manager repos --enable "codeready-builder-for-rhel-$RHEL_VERSION-$(arch)-rpms" sudo subscription-manager repos --enable "codeready-builder-for-rhel-$RHEL_VERSION-$(arch)-rpms"
sudo dnf install -y "https://dl.fedoraproject.org/pub/epel/epel-release-latest-$RHEL_VERSION.noarch.rpm" sudo dnf install -y "https://dl.fedoraproject.org/pub/epel/epel-release-latest-$RHEL_VERSION.noarch.rpm"
else else
if [ "$RHEL_VERSION" = 8 ]; then if [ "$RHEL_VERSION" = 8 ]; then
sudo dnf config-manager -y --set-enabled powertools sudo dnf config-manager -y --set-enabled powertools
else # Version 9 else # Version 9
sudo dnf config-manager -y --set-enabled crb sudo dnf config-manager -y --set-enabled crb
fi
sudo dnf install -y epel-release
fi fi
sudo dnf install -y epel-release
fi
# Update packages and install additional core tools # Update packages and install additional core tools
sudo dnf update -y sudo dnf update -y
sudo dnf group install -y "Development Tools" sudo dnf group install -y "Development Tools"
# Packages are grouped by which tool requires them, split by line. # Packages are grouped by which tool requires them, split by line.
# If mutltipole tools need a package, it is included in the first tool only # If mutltipole tools need a package, it is included in the first tool only
# General/Wally specific, riscv-gnu-toolchain, qemu, spike, verilator, buildroot # General/Wally specific, riscv-gnu-toolchain, qemu, spike, verilator, buildroot
sudo dnf install -y git make cmake python3.12 python3-pip curl wget ftp tar pkgconfig dialog mutt ssmtp gcc-gfortran \ sudo dnf install -y git make cmake python3.12 python3-pip curl wget ftp tar pkgconfig dialog mutt ssmtp gcc-gfortran \
autoconf automake libmpc-devel mpfr-devel gmp-devel gawk bison flex texinfo gperf libtool patchutils bc gcc gcc-c++ zlib-devel expat-devel libslirp-devel \ autoconf automake libmpc-devel mpfr-devel gmp-devel gawk bison flex texinfo gperf libtool patchutils bc gcc gcc-c++ zlib-devel expat-devel libslirp-devel \
glib2-devel libfdt-devel pixman-devel bzip2 ninja-build \ glib2-devel libfdt-devel pixman-devel bzip2 ninja-build \
dtc boost-regex boost-system \ dtc boost-regex boost-system \
help2man perl clang ccache gperftools numactl mold \ help2man perl clang ccache gperftools numactl mold \
ncurses-base ncurses ncurses-libs ncurses-devel ncurses-base ncurses ncurses-libs ncurses-devel
# Extra packages not availale in rhel8, nice for verialtor and needed for sail respectively # Extra packages not availale in rhel8, nice for verialtor and needed for sail respectively
if [ "$RHEL_VERSION" = 9 ]; then if [ "$RHEL_VERSION" = 9 ]; then
sudo dnf install -y perl-doc z3 sudo dnf install -y perl-doc z3
fi fi
# A newer version of gcc is required for qemu # A newer version of gcc is required for qemu
sudo dnf install -y gcc-toolset-13* sudo dnf install -y gcc-toolset-13*
source /opt/rh/gcc-toolset-13/enable # activate gcc13 source /opt/rh/gcc-toolset-13/enable # activate gcc13
elif [ "$FAMILY" = ubuntu ]; then elif [ "$FAMILY" = ubuntu ]; then
# Update and Upgrade tools (see https://itsfoss.com/apt-update-vs-upgrade/) # Update and Upgrade tools (see https://itsfoss.com/apt-update-vs-upgrade/)
sudo apt update -y sudo apt update -y
sudo apt upgrade -y sudo apt upgrade -y
# Packages are grouped by which tool requires them, split by line. # Packages are grouped by which tool requires them, split by line.
# If mutltipole tools need a package, it is included in the first tool only # If mutltipole tools need a package, it is included in the first tool only
# General/Wally specific, riscv-gnu-toolchain, qemu, spike, verilator, sail, buildroot # General/Wally specific, riscv-gnu-toolchain, qemu, spike, verilator, sail, buildroot
sudo apt install -y git make cmake python3 python3-pip python3-venv curl wget ftp tar pkg-config dialog mutt ssmtp gfortran \ sudo apt install -y git make cmake python3 python3-pip python3-venv curl wget ftp tar pkg-config dialog mutt ssmtp gfortran \
autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat1-dev ninja-build libglib2.0-dev libslirp-dev \ autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat1-dev ninja-build libglib2.0-dev libslirp-dev \
libfdt-dev libpixman-1-dev \ libfdt-dev libpixman-1-dev \
device-tree-compiler libboost-regex-dev libboost-system-dev \ device-tree-compiler libboost-regex-dev libboost-system-dev \
help2man perl g++ clang ccache libgoogle-perftools-dev numactl mold perl-doc libfl2 libfl-dev zlib1g \ help2man perl g++ clang ccache libgoogle-perftools-dev numactl mold perl-doc libfl2 libfl-dev zlib1g \
opam z3 \ opam z3 \
ncurses-base ncurses-bin libncurses-dev ncurses-base ncurses-bin libncurses-dev
fi fi
echo -e "\n*************************************************************************" echo -e "\n*************************************************************************"
@ -164,12 +164,12 @@ echo -e "***********************************************************************
# and installed packages are isolated from the rest of the system. # and installed packages are isolated from the rest of the system.
cd "$RISCV" cd "$RISCV"
if [ ! -e "$RISCV"/riscv-python/bin/activate ]; then if [ ! -e "$RISCV"/riscv-python/bin/activate ]; then
# If python3.12 is avaiable, use it. Otherise, use whatever version of python3 is installed. # If python3.12 is avaiable, use it. Otherise, use whatever version of python3 is installed.
if [ "$(which python3.12)" ]; then if [ "$(which python3.12)" ]; then
python3.12 -m venv riscv-python python3.12 -m venv riscv-python
else else
python3 -m venv riscv-python python3 -m venv riscv-python
fi fi
fi fi
source "$RISCV"/riscv-python/bin/activate # activate python virtual environment source "$RISCV"/riscv-python/bin/activate # activate python virtual environment
@ -180,49 +180,49 @@ pip install -U riscv_isac # to generate new tests, such as quads with fp_dataset
# z3 is eeded for sail and not availabe from dnf for rhel 8. Meson is needed to build extra dependencies # z3 is eeded for sail and not availabe from dnf for rhel 8. Meson is needed to build extra dependencies
if [ "$RHEL_VERSION" = 8 ]; then if [ "$RHEL_VERSION" = 8 ]; then
pip install -U z3-solver meson pip install -U z3-solver meson
fi fi
source "$RISCV"/riscv-python/bin/activate # reload python virtual environment source "$RISCV"/riscv-python/bin/activate # reload python virtual environment
# Extra dependecies needed for rhel 8 that don't have new enough versions available from dnf # Extra dependecies needed for rhel 8 that don't have new enough versions available from dnf
if [ "$RHEL_VERSION" = 8 ]; then if [ "$RHEL_VERSION" = 8 ]; then
# Newer versin of glib required for Qemu. # Newer versin of glib required for Qemu.
# Anything newer than this won't build on red hat 8 # Anything newer than this won't build on red hat 8
if [ ! -e "$RISCV"/include/glib-2.0 ]; then if [ ! -e "$RISCV"/include/glib-2.0 ]; then
echo -e "\n*************************************************************************" echo -e "\n*************************************************************************"
echo -e "*************************************************************************" echo -e "*************************************************************************"
echo -e "Installing glib" echo -e "Installing glib"
echo -e "*************************************************************************" echo -e "*************************************************************************"
echo -e "*************************************************************************\n" echo -e "*************************************************************************\n"
cd "$RISCV" cd "$RISCV"
wget https://download.gnome.org/sources/glib/2.70/glib-2.70.5.tar.xz wget https://download.gnome.org/sources/glib/2.70/glib-2.70.5.tar.xz
tar -xJf glib-2.70.5.tar.xz tar -xJf glib-2.70.5.tar.xz
rm glib-2.70.5.tar.xz rm glib-2.70.5.tar.xz
cd glib-2.70.5 cd glib-2.70.5
meson setup _build --prefix="$RISCV" meson setup _build --prefix="$RISCV"
meson compile -C _build meson compile -C _build
meson install -C _build meson install -C _build
cd "$RISCV" cd "$RISCV"
rm -rf glib-2.70.5 rm -rf glib-2.70.5
fi fi
# Newer version of gmp needed for sail-riscv model # Newer version of gmp needed for sail-riscv model
if [ ! -e "$RISCV"/include/gmp.h ]; then if [ ! -e "$RISCV"/include/gmp.h ]; then
echo -e "\n*************************************************************************" echo -e "\n*************************************************************************"
echo -e "*************************************************************************" echo -e "*************************************************************************"
echo -e "Installing gmp" echo -e "Installing gmp"
echo -e "*************************************************************************" echo -e "*************************************************************************"
echo -e "*************************************************************************\n" echo -e "*************************************************************************\n"
cd "$RISCV" cd "$RISCV"
wget https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz wget https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz
tar -xJf gmp-6.3.0.tar.xz tar -xJf gmp-6.3.0.tar.xz
rm gmp-6.3.0.tar.xz rm gmp-6.3.0.tar.xz
cd gmp-6.3.0 cd gmp-6.3.0
./configure --prefix="$RISCV" ./configure --prefix="$RISCV"
make -j ${NUM_THREADS} make -j ${NUM_THREADS}
make install make install
cd "$RISCV" cd "$RISCV"
rm -rf gmp-6.3.0 rm -rf gmp-6.3.0
fi fi
fi fi
# gcc cross-compiler (https://github.com/riscv-collab/riscv-gnu-toolchain) # gcc cross-compiler (https://github.com/riscv-collab/riscv-gnu-toolchain)
@ -236,11 +236,11 @@ echo -e "***********************************************************************
echo -e "*************************************************************************\n" echo -e "*************************************************************************\n"
cd "$RISCV" cd "$RISCV"
if [[ ((! -e riscv-gnu-toolchain) && ($(git clone https://github.com/riscv/riscv-gnu-toolchain) || true)) || ($(cd riscv-gnu-toolchain; git fetch; git rev-parse HEAD) != $(cd riscv-gnu-toolchain; git rev-parse origin/master)) || (! -e $RISCV/riscv-gnu-toolchain/stamps/build-gcc-newlib-stage2) ]]; then if [[ ((! -e riscv-gnu-toolchain) && ($(git clone https://github.com/riscv/riscv-gnu-toolchain) || true)) || ($(cd riscv-gnu-toolchain; git fetch; git rev-parse HEAD) != $(cd riscv-gnu-toolchain; git rev-parse origin/master)) || (! -e $RISCV/riscv-gnu-toolchain/stamps/build-gcc-newlib-stage2) ]]; then
cd riscv-gnu-toolchain cd riscv-gnu-toolchain
git checkout master git checkout master
git pull git pull
./configure --prefix="${RISCV}" --with-multilib-generator="rv32e-ilp32e--;rv32i-ilp32--;rv32im-ilp32--;rv32iac-ilp32--;rv32imac-ilp32--;rv32imafc-ilp32f--;rv32imafdc-ilp32d--;rv64i-lp64--;rv64ic-lp64--;rv64iac-lp64--;rv64imac-lp64--;rv64imafdc-lp64d--;rv64im-lp64--;" ./configure --prefix="${RISCV}" --with-multilib-generator="rv32e-ilp32e--;rv32i-ilp32--;rv32im-ilp32--;rv32iac-ilp32--;rv32imac-ilp32--;rv32imafc-ilp32f--;rv32imafdc-ilp32d--;rv64i-lp64--;rv64ic-lp64--;rv64iac-lp64--;rv64imac-lp64--;rv64imafdc-lp64d--;rv64im-lp64--;"
make -j ${NUM_THREADS} make -j ${NUM_THREADS}
fi fi
# elf2hex (https://github.com/sifive/elf2hex) # elf2hex (https://github.com/sifive/elf2hex)
@ -258,12 +258,12 @@ echo -e "***********************************************************************
cd "$RISCV" cd "$RISCV"
export PATH=$RISCV/bin:$PATH export PATH=$RISCV/bin:$PATH
if [[ ((! -e elf2hex) && ($(git clone https://github.com/sifive/elf2hex.git) || true)) || ($(cd elf2hex; git fetch; git rev-parse HEAD) != $(cd elf2hex; git rev-parse origin/master)) || (! -e $RISCV/bin/riscv64-unknown-elf-elf2bin) ]]; then if [[ ((! -e elf2hex) && ($(git clone https://github.com/sifive/elf2hex.git) || true)) || ($(cd elf2hex; git fetch; git rev-parse HEAD) != $(cd elf2hex; git rev-parse origin/master)) || (! -e $RISCV/bin/riscv64-unknown-elf-elf2bin) ]]; then
cd elf2hex cd elf2hex
git reset --hard && git clean -f && git checkout master && git pull git reset --hard && git clean -f && git checkout master && git pull
autoreconf -i autoreconf -i
./configure --target=riscv64-unknown-elf --prefix="$RISCV" ./configure --target=riscv64-unknown-elf --prefix="$RISCV"
make make
make install make install
fi fi
# QEMU (https://www.qemu.org/docs/master/system/target-riscv.html) # QEMU (https://www.qemu.org/docs/master/system/target-riscv.html)
@ -274,11 +274,11 @@ echo -e "***********************************************************************
echo -e "*************************************************************************\n" echo -e "*************************************************************************\n"
cd "$RISCV" cd "$RISCV"
if [[ ((! -e qemu) && ($(git clone --recurse-submodules https://github.com/qemu/qemu) || true)) || ($(cd qemu; git fetch --recurse-submodules=yes; git rev-parse HEAD) != $(cd qemu; git rev-parse origin/master)) || (! -e $RISCV/include/qemu-plugin.h) ]]; then if [[ ((! -e qemu) && ($(git clone --recurse-submodules https://github.com/qemu/qemu) || true)) || ($(cd qemu; git fetch --recurse-submodules=yes; git rev-parse HEAD) != $(cd qemu; git rev-parse origin/master)) || (! -e $RISCV/include/qemu-plugin.h) ]]; then
cd qemu cd qemu
git reset --hard && git clean -f && git checkout master && git pull --recurse-submodules git reset --hard && git clean -f && git checkout master && git pull --recurse-submodules
./configure --target-list=riscv64-softmmu --prefix="$RISCV" ./configure --target-list=riscv64-softmmu --prefix="$RISCV"
make -j ${NUM_THREADS} make -j ${NUM_THREADS}
make install make install
fi fi
# Spike (https://github.com/riscv-software-src/riscv-isa-sim) # Spike (https://github.com/riscv-software-src/riscv-isa-sim)
@ -291,13 +291,13 @@ echo -e "***********************************************************************
echo -e "*************************************************************************\n" echo -e "*************************************************************************\n"
cd "$RISCV" cd "$RISCV"
if [[ ((! -e riscv-isa-sim) && ($(git clone https://github.com/riscv-software-src/riscv-isa-sim) || true)) || ($(cd riscv-isa-sim; git fetch; git rev-parse HEAD) != $(cd riscv-isa-sim; git rev-parse origin/master)) || (! -e $RISCV/lib/pkgconfig/riscv-riscv.pc) ]]; then if [[ ((! -e riscv-isa-sim) && ($(git clone https://github.com/riscv-software-src/riscv-isa-sim) || true)) || ($(cd riscv-isa-sim; git fetch; git rev-parse HEAD) != $(cd riscv-isa-sim; git rev-parse origin/master)) || (! -e $RISCV/lib/pkgconfig/riscv-riscv.pc) ]]; then
cd riscv-isa-sim cd riscv-isa-sim
git reset --hard && git clean -f && git checkout master && git pull git reset --hard && git clean -f && git checkout master && git pull
mkdir -p build mkdir -p build
cd build cd build
../configure --prefix="$RISCV" ../configure --prefix="$RISCV"
make -j ${NUM_THREADS} make -j ${NUM_THREADS}
make install make install
fi fi
# Wally needs Verilator 5.021 or later. # Wally needs Verilator 5.021 or later.
@ -309,14 +309,14 @@ echo -e "***********************************************************************
echo -e "*************************************************************************\n" echo -e "*************************************************************************\n"
cd "$RISCV" cd "$RISCV"
if [[ ((! -e verilator) && ($(git clone https://github.com/verilator/verilator) || true)) || ($(cd verilator; git fetch; git rev-parse HEAD) != $(cd verilator; git rev-parse origin/master)) || (! -e $RISCV/share/pkgconfig/verilator.pc) ]]; then if [[ ((! -e verilator) && ($(git clone https://github.com/verilator/verilator) || true)) || ($(cd verilator; git fetch; git rev-parse HEAD) != $(cd verilator; git rev-parse origin/master)) || (! -e $RISCV/share/pkgconfig/verilator.pc) ]]; then
# unsetenv VERILATOR_ROOT # For csh; ignore error if on bash # unsetenv VERILATOR_ROOT # For csh; ignore error if on bash
unset VERILATOR_ROOT # For bash unset VERILATOR_ROOT # For bash
cd verilator cd verilator
git reset --hard && git clean -f && git checkout master && git pull git reset --hard && git clean -f && git checkout master && git pull
autoconf # Create ./configure script autoconf # Create ./configure script
./configure --prefix="$RISCV" # Configure and create Makefile ./configure --prefix="$RISCV" # Configure and create Makefile
make -j ${NUM_THREADS} # Build Verilator itself (if error, try just 'make') make -j ${NUM_THREADS} # Build Verilator itself (if error, try just 'make')
make install make install
fi fi
# RISC-V Sail Model (https://github.com/riscv/sail-riscv) # RISC-V Sail Model (https://github.com/riscv/sail-riscv)
@ -328,17 +328,17 @@ fi
# but a binary release of it should be available soon, removing the need to use opam. # but a binary release of it should be available soon, removing the need to use opam.
cd "$RISCV" cd "$RISCV"
if [ "$FAMILY" = rhel ]; then if [ "$FAMILY" = rhel ]; then
echo -e "\n*************************************************************************" echo -e "\n*************************************************************************"
echo -e "*************************************************************************" echo -e "*************************************************************************"
echo -e "Installing Opam" echo -e "Installing Opam"
echo -e "*************************************************************************" echo -e "*************************************************************************"
echo -e "*************************************************************************\n" echo -e "*************************************************************************\n"
mkdir -p opam mkdir -p opam
cd opam cd opam
wget https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh wget https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh
printf '%s\n' "$RISCV"/bin Y | sh install.sh # the print command provides $RISCV/bin as the installation path when prompted printf '%s\n' "$RISCV"/bin Y | sh install.sh # the print command provides $RISCV/bin as the installation path when prompted
cd "$RISCV" cd "$RISCV"
rm -rf opam rm -rf opam
fi fi
echo -e "\n*************************************************************************" echo -e "\n*************************************************************************"
@ -359,15 +359,15 @@ echo -e "Installing RISC-V Sail Model"
echo -e "*************************************************************************" echo -e "*************************************************************************"
echo -e "*************************************************************************\n" echo -e "*************************************************************************\n"
if [[ ((! -e sail-riscv) && ($(git clone https://github.com/riscv/sail-riscv.git) || true)) || ($(cd sail-riscv; git fetch; git rev-parse HEAD) != $(cd sail-riscv; git rev-parse origin/master)) || (! -e $RISCV/bin/riscv_sim_RV32) ]]; then if [[ ((! -e sail-riscv) && ($(git clone https://github.com/riscv/sail-riscv.git) || true)) || ($(cd sail-riscv; git fetch; git rev-parse HEAD) != $(cd sail-riscv; git rev-parse origin/master)) || (! -e $RISCV/bin/riscv_sim_RV32) ]]; then
eval $(opam config env) eval $(opam config env)
cd sail-riscv cd sail-riscv
git reset --hard && git clean -f && git checkout master && git pull git reset --hard && git clean -f && git checkout master && git pull
export OPAMCLI=2.0 # Sail is not compatible with opam 2.1 as of 4/16/24 export OPAMCLI=2.0 # Sail is not compatible with opam 2.1 as of 4/16/24
ARCH=RV64 make -j ${NUM_THREADS} c_emulator/riscv_sim_RV64 ARCH=RV64 make -j ${NUM_THREADS} c_emulator/riscv_sim_RV64
ARCH=RV32 make -j ${NUM_THREADS} c_emulator/riscv_sim_RV32 ARCH=RV32 make -j ${NUM_THREADS} c_emulator/riscv_sim_RV32
cd "$RISCV" cd "$RISCV"
ln -sf ../sail-riscv/c_emulator/riscv_sim_RV64 bin/riscv_sim_RV64 ln -sf ../sail-riscv/c_emulator/riscv_sim_RV64 bin/riscv_sim_RV64
ln -sf ../sail-riscv/c_emulator/riscv_sim_RV32 bin/riscv_sim_RV32 ln -sf ../sail-riscv/c_emulator/riscv_sim_RV32 bin/riscv_sim_RV32
fi fi
# riscof # riscof
@ -387,8 +387,8 @@ echo -e "***********************************************************************
mkdir -p "$RISCV"/cad/lib mkdir -p "$RISCV"/cad/lib
cd "$RISCV"/cad/lib cd "$RISCV"/cad/lib
if [[ ((! -e sky130_osu_sc_t12) && ($(git clone https://foss-eda-tools.googlesource.com/skywater-pdk/libs/sky130_osu_sc_t12) || true)) || ($(cd sky130_osu_sc_t12; git fetch; git rev-parse HEAD) != $(cd sky130_osu_sc_t12; git rev-parse origin/main)) ]]; then if [[ ((! -e sky130_osu_sc_t12) && ($(git clone https://foss-eda-tools.googlesource.com/skywater-pdk/libs/sky130_osu_sc_t12) || true)) || ($(cd sky130_osu_sc_t12; git fetch; git rev-parse HEAD) != $(cd sky130_osu_sc_t12; git rev-parse origin/main)) ]]; then
cd sky130_osu_sc_t12 cd sky130_osu_sc_t12
git reset --hard && git clean -f && git checkout main && git pull git reset --hard && git clean -f && git checkout main && git pull
fi fi
# site-setup script # site-setup script
@ -399,9 +399,9 @@ echo -e "***********************************************************************
echo -e "*************************************************************************\n" echo -e "*************************************************************************\n"
cd "$RISCV" cd "$RISCV"
if [ ! -e "${RISCV}"/site-setup.sh ]; then if [ ! -e "${RISCV}"/site-setup.sh ]; then
wget https://raw.githubusercontent.com/openhwgroup/cvw/main/site-setup.sh wget https://raw.githubusercontent.com/openhwgroup/cvw/main/site-setup.sh
wget https://raw.githubusercontent.com/openhwgroup/cvw/main/site-setup.csh wget https://raw.githubusercontent.com/openhwgroup/cvw/main/site-setup.csh
if [ "$FAMILY" = rhel ]; then if [ "$FAMILY" = rhel ]; then
echo "source /opt/rh/gcc-toolset-13/enable" >> site-setup.sh echo "source /opt/rh/gcc-toolset-13/enable" >> site-setup.sh
fi fi
fi fi

View File

@ -41,7 +41,7 @@ limit stacksize unlimited
setenv IDV $RISCV/ImperasDV-OpenHW setenv IDV $RISCV/ImperasDV-OpenHW
if ($?IDV) then if ($?IDV) then
# echo "Imperas exists" # echo "Imperas exists"
setenv IMPERAS_HOME $IDV/Imperas setenv IMPERAS_HOME $IDV/Imperas
setenv IMPERAS_PERSONALITY CPUMAN_DV_ASYNC setenv IMPERAS_PERSONALITY CPUMAN_DV_ASYNC
setenv ROOTDIR ~/ setenv ROOTDIR ~/

View File

@ -43,7 +43,7 @@ ulimit -c 234613
export IDV=$RISCV/ImperasDV-OpenHW export IDV=$RISCV/ImperasDV-OpenHW
if [ -e "$IDV" ]; then if [ -e "$IDV" ]; then
# echo "Imperas exists" # echo "Imperas exists"
export IMPERAS_HOME=$IDV/Imperas export IMPERAS_HOME=$IDV/Imperas
export IMPERAS_PERSONALITY=CPUMAN_DV_ASYNC export IMPERAS_PERSONALITY=CPUMAN_DV_ASYNC
export ROOTDIR=~/ export ROOTDIR=~/