cvw/sim/lint-wally

35 lines
1.4 KiB
Plaintext
Raw Normal View History

2021-05-03 21:32:05 +00:00
#!/bin/bash
# check for warnings in Verilog code
2024-01-29 22:51:21 +00:00
# The verilator lint tool is faster and better than Questa so it is best to run this first.
export PATH=$PATH:/usr/local/bin/
verilator=`which verilator`
basepath=$(dirname $0)/..
if [ "$1" == "-nightly" ]; then
configs=(rv32e rv64gc rv32gc rv32imc rv32i rv64i) # fdqh_rv64gc
derivconfigs=`ls $WALLY/config/deriv`
for entry in $derivconfigs
do
configs[${#configs[@]}]=$entry
done
else
configs=(rv32e rv64gc rv32gc rv32imc rv32i rv64i fdqh_rv64gc)
fi
for config in ${configs[@]}; do
2021-04-29 18:48:41 +00:00
echo "$config linting..."
if !($verilator --no-timing --lint-only --top-module wallywrapper "-I$basepath/config/shared" "-I$basepath/config/$config" "-I$basepath/config/deriv/$config" $basepath/src/cvw.sv $basepath/testbench/wallywrapper.sv $basepath/src/*/*.sv $basepath/src/*/*/*.sv --relative-includes ); then
2021-04-29 18:48:41 +00:00
echo "Exiting after $config lint due to errors or warnings"
exit 1
fi
done
echo "All lints run with no errors or warnings"
# --lint-only just runs lint rather than trying to compile and simulate
2023-10-18 12:38:36 +00:00
# -I points to the include directory where files such as `include config.vh are found
2021-10-25 17:05:41 +00:00
# For more exhaustive (and sometimes spurious) warnings, add --Wall to the Verilator command
# Unfortunately, this produces a bunch of UNUSED and UNDRIVEN signal warnings in blocks that are configured to not exist.