From a0aed2320868f142ac69aea3f5a7429a99766423 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Fri, 28 Jun 2024 15:21:30 -0700 Subject: [PATCH] Update cshell setup scripts --- bin/wally-tool-chain-install-unified.sh | 1 + setup.csh | 15 +++++++++++++-- site-setup.csh | 20 +++++++++++++------- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/bin/wally-tool-chain-install-unified.sh b/bin/wally-tool-chain-install-unified.sh index 9a41af59a..4ff99d0d5 100755 --- a/bin/wally-tool-chain-install-unified.sh +++ b/bin/wally-tool-chain-install-unified.sh @@ -401,5 +401,6 @@ if [ ! -e "${RISCV}"/site-setup.sh ]; then 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 + echo "source /opt/rh/gcc-toolset-13/enable" >> site-setup.csh fi fi \ No newline at end of file diff --git a/setup.csh b/setup.csh index 62a99f376..ae86d4737 100755 --- a/setup.csh +++ b/setup.csh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/csh # setup.csh # james.stine@okstate.edu 18 February 2023 @@ -11,7 +11,17 @@ alias extend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) setenv \!:1 ${\!:1}:\!:2;ec alias prepend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) setenv \!:1 "\!:2":${\!:1};echo Added \!:2 to \!:1' # Path to RISC-V Tools -setenv RISCV /opt/riscv # change this if you installed the tools in a different location +if ( -e /opt/riscv ) then + setenv RISCV /opt/riscv +else if ( -e ~/riscv ) then + setenv RISCV ~/riscv +else + # set the $RISCV directory here and remove the subsequent two lines + # setenv RISCV + echo "\$RISCV directory not found. Checked /opt/riscv and ~/riscv. Edit setup.sh to point to your custom \$RISCV directory." + exit 1; +endif +echo \$RISCV set to "${RISCV}" # Path to Wally repository setenv WALLY $PWD @@ -19,6 +29,7 @@ echo '$WALLY set to ' ${WALLY} # utility functions in Wally repository extend PATH $WALLY/bin +# load site licenses and tool locations source $RISCV/site-setup.csh echo "setup done" diff --git a/site-setup.csh b/site-setup.csh index d2a52e720..4f8411a02 100644 --- a/site-setup.csh +++ b/site-setup.csh @@ -8,24 +8,30 @@ setenv MGLS_LICENSE_FILE 27002@zircon.eng.hmc.edu # Change this setenv SNPSLMD_LICENSE_FILE 27020@zircon.eng.hmc.edu # Change this to your Synopsys license server setenv QUESTAPATH /cad/mentor/questa_sim-2022.4_2/questasim/bin # Change this for your path to Questa setenv SNPSPATH /cad/synopsys/SYN/bin # Change this for your path to Design Compiler +setenv VCSPATH /cad/synopsys/vcs/U-2023.03-SP2-4/bin # Change this for your path to Synopsys VCS # Tools # Questa and Synopsys extend PATH $QUESTAPATH extend PATH $SNPSPATH +extend PATH $VCSPATH # GCC -prepend LD_LIBRARY_PATH $RISCV/riscv-gnu-toolchain/lib -prepend LD_LIBRARY_PATH $RISCV/riscv-gnu-toolchain/riscv64-unknown-elf/lib -extend PATH $RISCV/riscv-gnu-toolchain/bin # GCC tools -extend PATH $RISCV/riscv-gnu-toolchain/riscv64-unknown-elf/bin # GCC tools +extend LD_LIBRARY_PATH $RISCV/riscv64-unknown-elf/lib -# Spike +# RISC-V Tools extend LD_LIBRARY_PATH $RISCV/lib +extend LD_LIBRARY_PATH $RISCV/lib64 extend PATH $RISCV/bin -# Verilator -extend PATH /usr/local/bin/verilator # Change this for your path to Verilator +# Activate riscv-python Virtual Environment +source "$RISCV"/riscv-python/bin/activate + +# environment variables needed for RISCV-DV +setenv RISCV_GCC $(which riscv64-unknown-elf-gcc) # Copy this as it is +setenv RISCV_OBJCOPY $(which riscv64-unknown-elf-objcopy) # Copy this as it is +setenv SPIKE_PATH $RISCV/bin # Change this for your path to riscv-isa-sim (spike) + # Verilator needs a larger stack to simulate CORE-V Wally limit stacksize unlimited