2024-04-03 17:39:02 +00:00
|
|
|
#!/bin/bash
|
2024-04-20 21:12:55 +00:00
|
|
|
# VCS Compilation for WALLY
|
|
|
|
# Divya Kohli, Rose Thompson, David Harris 2024
|
2024-04-21 05:52:08 +00:00
|
|
|
# Note: VCS produces warning about unsupported Linux Version, but runs successfully
|
2024-04-20 21:12:55 +00:00
|
|
|
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
|
2024-04-03 17:39:02 +00:00
|
|
|
|
2024-04-20 21:12:55 +00:00
|
|
|
CFG=${WALLY}/config
|
|
|
|
SRC=${WALLY}/src
|
|
|
|
TB=${WALLY}/testbench
|
2024-04-03 17:39:02 +00:00
|
|
|
# Set CONFIG_VARIANT from the first script argument
|
|
|
|
#CONFIG_VARIANT=${1:-rv64i}
|
|
|
|
CONFIG_VARIANT=${1}
|
|
|
|
# Set TESTSUITE from the second script argument
|
|
|
|
TESTSUITE=$2
|
2024-05-02 18:52:54 +00:00
|
|
|
WKDIR=wkdir/${1}_${2}
|
2024-04-03 17:39:02 +00:00
|
|
|
|
2024-05-02 18:52:54 +00:00
|
|
|
if [ ! -d "$WKDIR" ]; then
|
|
|
|
#echo "Directory $WKDIR does not exist. Creating it now..."
|
|
|
|
mkdir -p "$WKDIR"
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
echo "Directory $WKDIR created successfully."
|
|
|
|
else
|
|
|
|
echo "Failed to create directory $WKDIR."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Directory $WKDIR already exists."
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -n "$4" ]]; then
|
|
|
|
GUI="-gui"
|
|
|
|
else
|
|
|
|
GUI=""
|
|
|
|
fi
|
2024-04-20 21:12:55 +00:00
|
|
|
|
|
|
|
INCLUDE_DIRS=$(find ${SRC} -type d | xargs -I {} echo -n "{} ")
|
|
|
|
SOURCE_PATH="+incdir+${CFG}/${CONFIG_VARIANT} +incdir+${CFG}/deriv/${CONFIG_VARIANT} +incdir+${CFG}/shared +define+ +define+P.XLEN=64 +define+FPGA=0 +incdir+${TB} ${SRC}/cvw.sv +incdir+${SRC}"
|
|
|
|
|
|
|
|
SIMFILES="$INCLUDE_DIRS $(find ${SRC} -name "*.sv" ! -path "${SRC}/generic/clockgater.sv" ! -path "${SRC}/generic/mem/rom1p1r_128x64.sv" ! -path "${SRC}/generic/mem/ram2p1r1wbe_128x64.sv" ! -path "${SRC}/generic/mem/rom1p1r_128x32.sv" ! -path "${SRC}/generic/mem/ram2p1r1wbe_512x64.sv") ${TB}/testbench.sv $(find ${TB}/common -name "*.sv" ! -path "${TB}/common/wallyTracer.sv")"
|
2024-04-03 17:39:02 +00:00
|
|
|
OUTPUT="sim_out"
|
|
|
|
|
|
|
|
clean() {
|
2024-05-02 18:52:54 +00:00
|
|
|
rm -rf ${WKDIR}/*
|
2024-04-03 17:39:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Clean and run simulation with VCS
|
|
|
|
clean
|
2024-04-04 00:26:41 +00:00
|
|
|
#vcs +lint=all,noGCWM -simprofile -sverilog +vc -Mupdate -line -full64 -kdb -lca -debug_access+all+reverse -v2k_generate ${SOURCE_PATH} +define+TEST=$TESTSUITE $SIMFILES -o $OUTPUT -error=NOODV
|
2024-04-21 05:52:08 +00:00
|
|
|
# lint ignores Unused Inputs (UI), Unnamed Assertipons (SVA-UA), Dynamic Type Sensitivty [IDTS], Null Statement [NS], Unequal Length in Comparison Operation [ULCO]
|
2024-05-02 18:52:54 +00:00
|
|
|
vcs +lint=all,noGCWM,noUI,noSVA-UA,noIDTS,noNS,noULCO,noCAWM-L,noWMIA-L,noSV-PIU -simprofile -suppress -sverilog +vc -Mupdate -line -full64 -kdb -lca -debug_access+all+reverse ${SOURCE_PATH} $SIMFILES -o ${WKDIR}/$OUTPUT -simdir ${WKDIR} -error=NOODV -work ${WKDIR} ${GUI}
|
|
|
|
./${WKDIR}/$OUTPUT +TEST=${TESTSUITE} +fsdb+gate=off | tee ${WKDIR}/${WKDIR}.out
|