2024-03-12 21:47:56 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# site-setup.sh
|
|
|
|
# David_Harris@hmc.edu and kekim@hmc.edu 1 December 2021
|
|
|
|
# System Admin should install this into $RISCV/site-setup.sh
|
|
|
|
# $RISCV is typically /opt/riscv
|
|
|
|
# System Admin must update the licenses and paths for localization.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
|
|
|
|
|
|
|
|
# license servers and commercial CAD tool paths
|
|
|
|
# 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
|
2024-08-08 07:45:20 +00:00
|
|
|
export SNPSLMD_LICENSE_FILE=27020@zircon.eng.hmc.edu # Change this to your Synopsys license server
|
2024-04-26 22:55:39 +00:00
|
|
|
export QUESTA_HOME=/cad/mentor/questa_sim-2023.4/questasim # Change this for your path to Questa, excluding bin
|
2024-04-03 21:05:07 +00:00
|
|
|
export DC_HOME=/cad/synopsys/SYN # Change this for your path to Synopsys Design Compiler, excluding bin
|
2024-08-08 07:45:20 +00:00
|
|
|
export VCS_HOME=/cad/synopsys/vcs/U-2023.03-SP2-4 # Change this for your path to Synopsys VCS, excluding bin
|
2024-03-12 21:47:56 +00:00
|
|
|
|
|
|
|
# Tools
|
|
|
|
# Questa and Synopsys
|
2024-04-28 02:51:23 +00:00
|
|
|
export PATH=$QUESTA_HOME/bin:$DC_HOME/bin:$VCS_HOME/bin:$PATH
|
2024-03-12 21:47:56 +00:00
|
|
|
|
|
|
|
# GCC
|
2024-07-26 20:37:48 +00:00
|
|
|
if [ -z "$LD_LIBRARY_PATH" ]; then
|
|
|
|
export LD_LIBRARY_PATH=$RISCV/riscv64-unknown-elf/lib
|
|
|
|
else
|
|
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$RISCV/riscv64-unknown-elf/lib
|
|
|
|
fi
|
2024-03-12 21:47:56 +00:00
|
|
|
|
2024-06-28 22:02:16 +00:00
|
|
|
# RISC-V Tools
|
2024-07-27 18:35:59 +00:00
|
|
|
export LD_LIBRARY_PATH=$RISCV/lib:$RISCV/lib64:$LD_LIBRARY_PATH:$RISCV/lib/x86_64-linux-gnu/
|
2024-04-16 14:51:24 +00:00
|
|
|
export PATH=$PATH:$RISCV/bin
|
2024-03-12 21:47:56 +00:00
|
|
|
|
2024-06-28 22:02:16 +00:00
|
|
|
# Activate riscv-python Virtual Environment
|
2024-07-19 05:05:56 +00:00
|
|
|
if [ -e "$RISCV"/riscv-python/bin/activate ]; then
|
|
|
|
source "$RISCV"/riscv-python/bin/activate
|
|
|
|
else
|
|
|
|
echo "Python virtual environment not found. Rerun wally-toolchain-install.sh to automatically create it."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-07-26 20:37:48 +00:00
|
|
|
# Environment variables needed for RISCV-DV
|
2024-06-28 22:02:16 +00:00
|
|
|
export RISCV_GCC=$(which riscv64-unknown-elf-gcc) # Copy this as it is
|
|
|
|
export RISCV_OBJCOPY=$(which riscv64-unknown-elf-objcopy) # Copy this as it is
|
2024-07-26 20:37:48 +00:00
|
|
|
export SPIKE_PATH=$RISCV/bin # Copy this as it is
|
2024-06-28 22:02:16 +00:00
|
|
|
|
2024-03-12 21:47:56 +00:00
|
|
|
# Imperas OVPsim; put this in if you are using it
|
2024-06-29 07:29:01 +00:00
|
|
|
#export PATH=$RISCV/imperas-riscv-tests/riscv-ovpsim-plus/bin/Linux64:$PATH
|
2024-03-12 21:47:56 +00:00
|
|
|
#export LD_LIBRARY_PATH=$RISCV/imperas_riscv_tests/riscv-ovpsim-plus/bin/Linux64:$LD_LIBRARY_PATH
|
|
|
|
|
2024-07-26 20:37:48 +00:00
|
|
|
# Imperas DV setup
|
2024-03-12 21:47:56 +00:00
|
|
|
export IDV=$RISCV/ImperasDV-OpenHW
|
|
|
|
if [ -e "$IDV" ]; then
|
2024-06-29 07:29:01 +00:00
|
|
|
# echo "Imperas exists"
|
2024-03-12 21:47:56 +00:00
|
|
|
export IMPERAS_HOME=$IDV/Imperas
|
|
|
|
export IMPERAS_PERSONALITY=CPUMAN_DV_ASYNC
|
|
|
|
export ROOTDIR=~/
|
2024-07-27 18:35:59 +00:00
|
|
|
source "${IMPERAS_HOME}"/bin/setup.sh
|
|
|
|
setupImperas "${IMPERAS_HOME}"
|
2024-03-12 21:47:56 +00:00
|
|
|
export PATH=$IDV/scripts/cvw:$PATH
|
|
|
|
fi
|
2024-08-09 06:44:40 +00:00
|
|
|
|
|
|
|
# Use newer gcc version for older distros
|
|
|
|
if [ -e /opt/rh/gcc-toolset-13/enable ]; then
|
|
|
|
source /opt/rh/gcc-toolset-13/enable # Red Hat Family
|
|
|
|
elif [ -e $RISCV/gcc-10 ]; then
|
|
|
|
export PATH=$RISCV/gcc-10/bin:$PATH # Ubuntu 20.04 LTS
|
|
|
|
fi
|