2014-08-08 06:12:18 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# run this test many times:
|
|
|
|
# time bash -c 'for ((i=0; i<100; i++)); do echo "-- $i --"; bash run-test.sh || exit 1; done'
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2016-09-15 03:00:29 -05:00
|
|
|
OPTIND=1
|
2019-08-17 07:37:07 -05:00
|
|
|
count=50
|
2016-09-15 03:00:29 -05:00
|
|
|
seed="" # default to no seed specified
|
|
|
|
while getopts "c:S:" opt
|
|
|
|
do
|
|
|
|
case "$opt" in
|
|
|
|
c) count="$OPTARG" ;;
|
|
|
|
S) seed="-S $OPTARG" ;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
shift "$((OPTIND-1))"
|
|
|
|
|
2014-08-08 06:12:18 -05:00
|
|
|
rm -rf temp
|
|
|
|
mkdir -p temp
|
|
|
|
echo "generating tests.."
|
2016-09-15 03:00:29 -05:00
|
|
|
python3 generate.py -c $count $seed
|
2014-08-08 06:12:18 -05:00
|
|
|
|
|
|
|
{
|
|
|
|
all_targets="all_targets:"
|
|
|
|
echo "all: all_targets"
|
2014-08-21 10:40:49 -05:00
|
|
|
echo " @echo"
|
2014-08-08 06:12:18 -05:00
|
|
|
for i in $( ls temp/*.ys | sed 's,[^0-9],,g; s,^0*\(.\),\1,g;' ); do
|
|
|
|
idx=$( printf "%05d" $i )
|
|
|
|
echo "temp/uut_${idx}.log: temp/uut_${idx}.ys temp/uut_${idx}.v"
|
|
|
|
echo " @echo -n '[$i]'"
|
2014-08-09 07:49:51 -05:00
|
|
|
echo " @../../yosys -ql temp/uut_${idx}.out temp/uut_${idx}.ys"
|
|
|
|
echo " @mv temp/uut_${idx}.out temp/uut_${idx}.log"
|
2014-08-08 07:30:45 -05:00
|
|
|
echo " @grep -q 'SAT proof finished' temp/uut_${idx}.log && echo -n K || echo -n T"
|
2014-08-08 06:12:18 -05:00
|
|
|
all_targets="$all_targets temp/uut_${idx}.log"
|
|
|
|
done
|
|
|
|
echo "$all_targets"
|
|
|
|
} > temp/makefile
|
|
|
|
|
|
|
|
echo "running tests.."
|
|
|
|
${MAKE:-make} -f temp/makefile
|
|
|
|
|
|
|
|
exit 0
|