3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-07 09:55:20 +00:00
yosys/tests/simple_abc9/run-test.sh
Zachary Snow b6904a8e53 Set aside extraneous tests in simple_abc9 test suite
New test cases on one branch may be automatically copied from simple/ to
simple_abc9/, causing failures when switching to another branch. This
updates the simple_abc9 script to set aside extraneous tests in a
non-destructive way.
2021-03-01 12:13:11 -05:00

51 lines
1.2 KiB
Bash
Executable file

#!/bin/bash
OPTIND=1
seed="" # default to no seed specified
while getopts "S:" opt
do
case "$opt" in
S) arg="${OPTARG#"${OPTARG%%[![:space:]]*}"}" # remove leading space
seed="SEED=$arg" ;;
esac
done
shift "$((OPTIND-1))"
# check for Icarus Verilog
if ! command -v iverilog > /dev/null ; then
echo "$0: Error: Icarus Verilog 'iverilog' not found."
exit 1
fi
for file in `ls *.v *.sv`; do
if [ ! -f "../simple/$file" -a "$file" != "abc9.v" ]; then
echo "Warning: $file is in simple_abc9/, but not in simple/"
backup="$file.bak"
if [ -f "$backup" ]; then
if cmp "$file" "$backup" > /dev/null; then
echo " => $backup already exists and matches; removing $file"
rm "$file"
else
echo " => $backup already exists but differs; leaving $file in place"
fi
else
echo " => moving $file to $backup"
mv -i "$file" "$backup"
fi
fi
done
cp ../simple/*.v .
cp ../simple/*.sv .
DOLLAR='?'
exec ${MAKE:-make} -f ../tools/autotest.mk $seed *.v *.sv EXTRA_FLAGS="-n 300 -p '\
hierarchy; \
synth -run coarse; \
opt -full; \
techmap; \
abc9 -lut 4 -box ../abc9.box; \
clean; \
check -assert; \
select -assert-none t:${DOLLAR}_NOT_ t:${DOLLAR}_AND_ %%; \
setattr -mod -unset blackbox'"