2021-12-05 04:25:33 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-03-04 05:00:07 +00:00
|
|
|
# setup.sh
|
2021-12-05 04:25:33 +00:00
|
|
|
# David_Harris@hmc.edu and kekim@hmc.edu 1 December 2021
|
2024-03-12 21:47:56 +00:00
|
|
|
# Set up tools for cvw
|
|
|
|
|
|
|
|
# optionally have .bashrc or .bash_profile source this file with
|
|
|
|
#if [ -f ~/cvw/setup.sh ]; then
|
|
|
|
# source ~/cvw/setup.sh
|
|
|
|
#fi
|
|
|
|
|
2023-02-04 12:29:27 +00:00
|
|
|
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
|
2021-12-05 04:25:33 +00:00
|
|
|
|
2022-01-24 23:21:09 +00:00
|
|
|
echo "Executing Wally setup.sh"
|
2021-12-05 04:25:33 +00:00
|
|
|
|
2024-03-12 21:47:56 +00:00
|
|
|
# Path to RISC-V Tools
|
2024-07-19 05:05:56 +00:00
|
|
|
if [ -d /opt/riscv ]; then
|
2024-06-28 22:02:16 +00:00
|
|
|
export RISCV=/opt/riscv
|
2024-07-19 05:05:56 +00:00
|
|
|
elif [ -d ~/riscv ]; then
|
2024-06-28 22:02:16 +00:00
|
|
|
export RISCV=~/riscv
|
|
|
|
else
|
|
|
|
# set the $RISCV directory here and remove the subsequent two lines
|
|
|
|
# export RISCV=
|
|
|
|
echo "\$RISCV directory not found. Checked /opt/riscv and ~/riscv. Edit setup.sh to point to your custom \$RISCV directory."
|
2024-08-08 07:01:14 +00:00
|
|
|
exit 1
|
2024-06-28 22:02:16 +00:00
|
|
|
fi
|
|
|
|
echo \$RISCV set to "${RISCV}"
|
2024-03-12 21:47:56 +00:00
|
|
|
|
2022-03-04 05:00:07 +00:00
|
|
|
# Path to Wally repository
|
2024-06-28 22:02:16 +00:00
|
|
|
WALLY=$(dirname "${BASH_SOURCE[0]:-$0}")
|
2022-03-04 05:00:07 +00:00
|
|
|
export WALLY=$(cd "$WALLY" && pwd)
|
2024-06-28 22:02:16 +00:00
|
|
|
echo \$WALLY set to "${WALLY}"
|
2022-03-04 05:00:07 +00:00
|
|
|
# utility functions in Wally repository
|
2024-06-29 07:29:01 +00:00
|
|
|
export PATH=$WALLY/bin:$PATH
|
2023-03-03 23:54:35 +00:00
|
|
|
|
2024-08-08 07:01:14 +00:00
|
|
|
# Verilator needs a larger core file size to simulate CORE-V Wally
|
2024-07-26 04:35:52 +00:00
|
|
|
ulimit -c 300000
|
|
|
|
|
2024-03-12 21:47:56 +00:00
|
|
|
# load site licenses and tool locations
|
2024-07-19 05:05:56 +00:00
|
|
|
if [ -e "${RISCV}"/site-setup.sh ]; then
|
|
|
|
source "${RISCV}"/site-setup.sh
|
|
|
|
else
|
|
|
|
echo "site-setup.sh not found in \$RISCV directory. Rerun wally-toolchain-install.sh to automatically download it."
|
|
|
|
fi
|
2024-03-12 21:47:56 +00:00
|
|
|
|
|
|
|
echo "setup done"
|