Update setup scripts and automatically copy site-setup to $RISCV

This commit is contained in:
Jordan Carlin 2024-06-28 15:02:16 -07:00
parent 4a28310c0e
commit f7c688c44f
3 changed files with 42 additions and 23 deletions

View File

@ -70,7 +70,7 @@ is $PRETTY_NAME. The regular Ubuntu install will be attempted, but there may be
fi fi
else else
echo "The Wally install script is currently only compatible with Ubuntu and Red Hat family \ echo "The Wally install script is currently only compatible with Ubuntu and Red Hat family \
(RHEL or Rocky Linux) distros. Your detected distro is $ID. 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
@ -371,7 +371,7 @@ fi
# riscof # riscof
echo -e "\n*************************************************************************" echo -e "\n*************************************************************************"
echo -e "*************************************************************************" echo -e "*************************************************************************"
echo -e "Installing riscof" echo -e "Installing Riscof"
echo -e "*************************************************************************" echo -e "*************************************************************************"
echo -e "*************************************************************************\n" echo -e "*************************************************************************\n"
pip3 install git+https://github.com/riscv/riscof.git pip3 install git+https://github.com/riscv/riscof.git
@ -388,3 +388,18 @@ if [[ ((! -e sky130_osu_sc_t12) && ($(git clone https://foss-eda-tools.googlesou
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
echo -e "\n*************************************************************************"
echo -e "*************************************************************************"
echo -e "Downloading Site Setup Script"
echo -e "*************************************************************************"
echo -e "*************************************************************************\n"
cd "$RISCV"
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.csh
if [ "$FAMILY" = rhel ]; then
echo "source /opt/rh/gcc-toolset-13/enable" >> site-setup.sh
fi
fi

View File

@ -14,23 +14,26 @@
echo "Executing Wally setup.sh" echo "Executing Wally setup.sh"
# Path to RISC-V Tools # Path to RISC-V Tools
export RISCV=/opt/riscv # change this if you installed the tools in a different location if [ -e /opt/riscv ]; then
export RISCV=/opt/riscv
elif [ -e ~/riscv ]; then
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."
exit 1;
fi
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) export WALLY=$(cd "$WALLY" && pwd)
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
# Verilator needs a larger stack to simulate CORE-V Wally
ulimit -c 234613
# load site licenses and tool locations # load site licenses and tool locations
if [ -f ${RISCV}/site-setup.sh ]; then source "${RISCV}"/site-setup.sh
source ${RISCV}/site-setup.sh
else
source ${WALLY}/site-setup.sh
fi
echo "setup done" echo "setup done"

View File

@ -20,19 +20,22 @@ export VCS_HOME=/cad/synopsys/vcs/U-2023.03-SP2-4 # Change thi
export PATH=$QUESTA_HOME/bin:$DC_HOME/bin:$VCS_HOME/bin:$PATH export PATH=$QUESTA_HOME/bin:$DC_HOME/bin:$VCS_HOME/bin:$PATH
# GCC # GCC
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$RISCV/riscv-gnu-toolchain/lib:$RISCV/riscv-gnu-toolchain/riscv64-unknown-elf/lib export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$RISCV/riscv64-unknown-elf/lib
# Spike # RISC-V Tools
export LD_LIBRARY_PATH=$RISCV/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=$RISCV/lib:$RISCV/lib64:$LD_LIBRARY_PATH
export PATH=$PATH:$RISCV/bin export PATH=$PATH:$RISCV/bin
# Verilator # Activate riscv-python Virtual Environment
export PATH=/usr/local/bin/verilator:$PATH # Change this for your path to Verilator source "$RISCV"/riscv-python/bin/activate
# 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) # Copy this as it is
export RISCV_OBJCOPY=`which riscv64-unknown-elf-objcopy` # Copy this as it is export RISCV_OBJCOPY=$(which riscv64-unknown-elf-objcopy) # Copy this as it is
export SPIKE_PATH=/usr/bin # Change this for your path to riscv-isa-sim (spike) export SPIKE_PATH=$RISCV/bin # Change this for your path to riscv-isa-sim (spike)
# Verilator needs a larger stack to simulate CORE-V Wally
ulimit -c 234613
# Imperas OVPsim; put this in if you are using it # Imperas OVPsim; put this in if you are using it
#export PATH=$RISCV/imperas-riscv-tests/riscv-ovpsim-plus/bin/Linux64:$PATH #export PATH=$RISCV/imperas-riscv-tests/riscv-ovpsim-plus/bin/Linux64:$PATH
@ -48,5 +51,3 @@ if [ -e "$IDV" ]; then
setupImperas ${IMPERAS_HOME} setupImperas ${IMPERAS_HOME}
export PATH=$IDV/scripts/cvw:$PATH export PATH=$IDV/scripts/cvw:$PATH
fi fi