mirror of
https://github.com/openhwgroup/cvw.git
synced 2025-06-28 01:32:49 -04:00
Cleanup setup scripts and ensure they don't kill your shell
This commit is contained in:
parent
0dfd106ce5
commit
5437606914
2 changed files with 43 additions and 35 deletions
23
setup.sh
23
setup.sh
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
# setup.sh
|
# setup.sh
|
||||||
# David_Harris@hmc.edu and kekim@hmc.edu 1 December 2021
|
# David_Harris@hmc.edu and kekim@hmc.edu 1 December 2021
|
||||||
|
# jcarlin@hmc.edu 2025
|
||||||
# Set up tools for cvw
|
# Set up tools for cvw
|
||||||
|
|
||||||
# optionally have .bashrc or .bash_profile source this file with
|
# optionally have .bashrc or .bash_profile source this file with
|
||||||
|
@ -11,6 +12,11 @@
|
||||||
|
|
||||||
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
|
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
|
||||||
|
|
||||||
|
# Colors for terminal output
|
||||||
|
WARNING_COLOR='\033[93m'
|
||||||
|
FAIL_COLOR='\033[91m'
|
||||||
|
ENDC='\033[0m' # Reset to default color
|
||||||
|
|
||||||
echo "Executing Wally setup.sh"
|
echo "Executing Wally setup.sh"
|
||||||
|
|
||||||
# Path to RISC-V Tools
|
# Path to RISC-V Tools
|
||||||
|
@ -21,14 +27,15 @@ elif [ -d ~/riscv ]; then
|
||||||
else
|
else
|
||||||
# set the $RISCV directory here and remove the subsequent two lines
|
# set the $RISCV directory here and remove the subsequent two lines
|
||||||
# export RISCV=
|
# export RISCV=
|
||||||
echo "\$RISCV directory not found. Checked /opt/riscv and ~/riscv. Edit setup.sh to point to your custom \$RISCV directory."
|
echo -e "${FAIL_COLOR}\$RISCV directory not found. Checked /opt/riscv and ~/riscv. Edit setup.sh to point to your custom \$RISCV directory.${ENDC}"
|
||||||
exit 1
|
return 1
|
||||||
fi
|
fi
|
||||||
echo \$RISCV set to "${RISCV}"
|
echo \$RISCV set to "${RISCV}"
|
||||||
|
|
||||||
# Path to Wally repository
|
# Path to Wally repository
|
||||||
WALLY=$(dirname "${BASH_SOURCE[0]:-$0}")
|
WALLY=$(dirname "${BASH_SOURCE[0]:-$0}")
|
||||||
export WALLY=$(cd "$WALLY" && pwd)
|
WALLY=$(cd "$WALLY" && pwd)
|
||||||
|
export WALLY
|
||||||
echo \$WALLY set to "${WALLY}"
|
echo \$WALLY set to "${WALLY}"
|
||||||
# utility functions in Wally repository
|
# utility functions in Wally repository
|
||||||
export PATH=$WALLY/bin:$PATH
|
export PATH=$WALLY/bin:$PATH
|
||||||
|
@ -37,7 +44,7 @@ export PATH=$WALLY/bin:$PATH
|
||||||
if [ -e "${WALLY}"/addins/cvw-arch-verif/setup.sh ]; then
|
if [ -e "${WALLY}"/addins/cvw-arch-verif/setup.sh ]; then
|
||||||
source "${WALLY}"/addins/cvw-arch-verif/setup.sh
|
source "${WALLY}"/addins/cvw-arch-verif/setup.sh
|
||||||
else
|
else
|
||||||
echo "setup.sh not found in \$WALLY/addins/cvw-arch-verif directory. Make sure you cloned the submodules."
|
echo -e "${WARNING_COLOR}setup.sh not found in \$WALLY/addins/cvw-arch-verif directory. Make sure you cloned the submodules.${ENDC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Verilator needs a larger core file size to simulate CORE-V Wally
|
# Verilator needs a larger core file size to simulate CORE-V Wally
|
||||||
|
@ -47,15 +54,15 @@ ulimit -c 300000
|
||||||
if [ -e "${RISCV}"/site-setup.sh ]; then
|
if [ -e "${RISCV}"/site-setup.sh ]; then
|
||||||
source "${RISCV}"/site-setup.sh
|
source "${RISCV}"/site-setup.sh
|
||||||
else
|
else
|
||||||
echo "site-setup.sh not found in \$RISCV directory. Rerun wally-toolchain-install.sh to automatically download it."
|
echo -e "${ERROR_COLOR}site-setup.sh not found in \$RISCV directory. Rerun wally-toolchain-install.sh to automatically download it.${ENDC}"
|
||||||
exit 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e "${WALLY}/.git/hooks/pre-commit" ]; then
|
if [ ! -e "${WALLY}/.git/hooks/pre-commit" ]; then
|
||||||
pushd "${WALLY}" || exit 1
|
pushd "${WALLY}" || return 1
|
||||||
echo "Installing pre-commit hooks"
|
echo "Installing pre-commit hooks"
|
||||||
pre-commit install
|
pre-commit install
|
||||||
popd || exit
|
popd || return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "setup done"
|
echo "setup done"
|
||||||
|
|
|
@ -2,20 +2,27 @@
|
||||||
|
|
||||||
# site-setup.sh
|
# site-setup.sh
|
||||||
# David_Harris@hmc.edu and kekim@hmc.edu 1 December 2021
|
# David_Harris@hmc.edu and kekim@hmc.edu 1 December 2021
|
||||||
|
# jcarlin@hmc.edu 2025
|
||||||
# System Admin should install this into $RISCV/site-setup.sh
|
# System Admin should install this into $RISCV/site-setup.sh
|
||||||
# $RISCV is typically /opt/riscv
|
# It is automatically placed in the $RISCV directory by wally-toolchain-install.sh
|
||||||
|
# $RISCV is typically /opt/riscv or ~/riscv
|
||||||
# System Admin must update the licenses and paths for localization.
|
# System Admin must update the licenses and paths for localization.
|
||||||
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
|
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
|
||||||
|
|
||||||
|
# Colors for terminal output
|
||||||
|
FAIL_COLOR='\033[91m'
|
||||||
|
ENDC='\033[0m' # Reset to default color
|
||||||
|
|
||||||
# license servers and commercial CAD tool paths
|
# license servers and commercial CAD tool paths
|
||||||
# Must edit these based on your local environment.
|
# Must edit these based on your local environment.
|
||||||
export MGLS_LICENSE_FILE=27002@zircon.eng.hmc.edu # Change this to your Siemens license server for Questa
|
export MGLS_LICENSE_FILE=27002@zircon.eng.hmc.edu # Change this to your Siemens license server for Questa
|
||||||
export SNPSLMD_LICENSE_FILE=27020@zircon.eng.hmc.edu # Change this to your Synopsys license server
|
export SNPSLMD_LICENSE_FILE=27020@zircon.eng.hmc.edu # Change this to your Synopsys license server
|
||||||
export IMPERASD_LICENSE_FILE=27020@zircon.eng.hmc.edu # Change this to your Imperas license server
|
export IMPERASD_LICENSE_FILE=27020@zircon.eng.hmc.edu # Change this to your Imperas license server
|
||||||
export QUESTA_HOME=/cad/mentor/questa_sim-2023.4/questasim # Change this for your path to Questa, excluding bin
|
export BREKER_LICENSE_FILE=1819@zircon.eng.hmc.edu # Change this to your Breker license server
|
||||||
|
export QUESTA_HOME=/cad/mentor/QUESTA # Change this for your path to Questa, excluding bin
|
||||||
export DC_HOME=/cad/synopsys/SYN # Change this for your path to Synopsys DC, excluding bin
|
export DC_HOME=/cad/synopsys/SYN # Change this for your path to Synopsys DC, excluding bin
|
||||||
export VCS_HOME=/cad/synopsys/vcs/U-2023.03-SP2-4 # Change this for your path to Synopsys VCS, excluding bin
|
export VCS_HOME=/cad/synopsys/VCS # Change this for your path to Synopsys VCS, excluding bin
|
||||||
export BREKER_HOME=/cad/breker/trek5-2.1.11-GCC6_el7 # Change this for your path to Breker Trek
|
export BREKER_HOME=/cad/breker/TREK # Change this for your path to Breker Trek
|
||||||
|
|
||||||
# Tools
|
# Tools
|
||||||
# Questa and Synopsys
|
# Questa and Synopsys
|
||||||
|
@ -31,10 +38,6 @@ export SYN_MW=/home/jstine/MW
|
||||||
export SYN_memory=/home/jstine/WallyMem/rv64gc/
|
export SYN_memory=/home/jstine/WallyMem/rv64gc/
|
||||||
#export osumemory=/import/yukari1/pdk/TSMC/WallyMem/rv64gc/
|
#export osumemory=/import/yukari1/pdk/TSMC/WallyMem/rv64gc/
|
||||||
|
|
||||||
# Environmental variables for CTG (https://github.com/riscv-software-src/riscv-ctg)
|
|
||||||
export RISCVCTG=/home/harris/repos/riscv-ctg
|
|
||||||
|
|
||||||
|
|
||||||
# GCC
|
# GCC
|
||||||
if [ -z "$LD_LIBRARY_PATH" ]; then
|
if [ -z "$LD_LIBRARY_PATH" ]; then
|
||||||
export LD_LIBRARY_PATH=$RISCV/riscv64-unknown-elf/lib
|
export LD_LIBRARY_PATH=$RISCV/riscv64-unknown-elf/lib
|
||||||
|
@ -50,36 +53,34 @@ export PATH=$PATH:$RISCV/bin
|
||||||
if [ -e "$RISCV"/riscv-python/bin/activate ]; then
|
if [ -e "$RISCV"/riscv-python/bin/activate ]; then
|
||||||
source "$RISCV"/riscv-python/bin/activate
|
source "$RISCV"/riscv-python/bin/activate
|
||||||
else
|
else
|
||||||
echo "Python virtual environment not found. Rerun wally-toolchain-install.sh to automatically create it."
|
echo -e "${FAIL_COLOR}Python virtual environment not found. Rerun wally-toolchain-install.sh to automatically create it.${ENDC}"
|
||||||
exit 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Environment variables needed for RISCV-DV
|
# Environment variables needed for RISCV-DV
|
||||||
export RISCV_GCC=$(which riscv64-unknown-elf-gcc) # Copy this as it is
|
export RISCV_GCC=$(which riscv64-unknown-elf-gcc)
|
||||||
export RISCV_OBJCOPY=$(which riscv64-unknown-elf-objcopy) # Copy this as it is
|
export RISCV_OBJCOPY=$(which riscv64-unknown-elf-objcopy)
|
||||||
export SPIKE_PATH=$RISCV/bin # Copy this as it is
|
export SPIKE_PATH=$RISCV/bin
|
||||||
|
|
||||||
# Imperas OVPsim; put this in if you are using it
|
|
||||||
#export PATH=$RISCV/imperas-riscv-tests/riscv-ovpsim-plus/bin/Linux64:$PATH
|
|
||||||
#export LD_LIBRARY_PATH=$RISCV/imperas_riscv_tests/riscv-ovpsim-plus/bin/Linux64:$LD_LIBRARY_PATH
|
|
||||||
|
|
||||||
# Imperas DV setup
|
# Imperas DV setup
|
||||||
export IDV=$RISCV/ImperasDV-OpenHW
|
export IMPERAS_HOME=$RISCV/ImperasDV-OpenHW
|
||||||
if [ -e "$IDV" ]; then
|
if [ -e "$IMPERAS_HOME" ]; then
|
||||||
# echo "Imperas exists"
|
|
||||||
export IMPERAS_HOME=$IDV
|
|
||||||
export IMPERAS_PERSONALITY=CPUMAN_DV_ASYNC
|
export IMPERAS_PERSONALITY=CPUMAN_DV_ASYNC
|
||||||
export ROOTDIR=~/
|
source "${IMPERAS_HOME}"/bin/setup.sh &> /dev/null || {
|
||||||
source "${IMPERAS_HOME}"/bin/setup.sh
|
echo -e "${FAIL_COLOR}ImperasDV setup failed${ENDC}"
|
||||||
setupImperas "${IMPERAS_HOME}"
|
return 1
|
||||||
export PATH=$IDV/scripts/cvw:$PATH
|
}
|
||||||
|
setupImperas "${IMPERAS_HOME}" &> /dev/null || {
|
||||||
|
echo -e "${FAIL_COLOR}setupImperas failed${ENDC}"
|
||||||
|
return 1
|
||||||
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Use newer gcc version for older distros
|
# Use newer gcc version for older distros
|
||||||
if [ -e /opt/rh/gcc-toolset-13/enable ]; then
|
if [ -e /opt/rh/gcc-toolset-13/enable ]; then
|
||||||
source /opt/rh/gcc-toolset-13/enable # Red Hat Family
|
source /opt/rh/gcc-toolset-13/enable # Red Hat Family
|
||||||
elif [ -e $RISCV/gcc-13 ]; then
|
elif [ -e "$RISCV"/gcc-13 ]; then
|
||||||
export PATH=$RISCV/gcc-13/bin:$PATH # SUSE Family
|
export PATH=$RISCV/gcc-13/bin:$PATH # SUSE Family
|
||||||
elif [ -e $RISCV/gcc-10 ]; then
|
elif [ -e "$RISCV"/gcc-10 ]; then
|
||||||
export PATH=$RISCV/gcc-10/bin:$PATH # Ubuntu 20.04 LTS
|
export PATH=$RISCV/gcc-10/bin:$PATH # Ubuntu 20.04 LTS
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue