abc9: suppress warnings when no compatible + used flop boxes formed
[yosys.git] / tests / share / run-test.sh
1 #!/bin/bash
2
3 # run this test many times:
4 # time bash -c 'for ((i=0; i<100; i++)); do echo "-- $i --"; bash run-test.sh || exit 1; done'
5
6 set -e
7
8 OPTIND=1
9 count=100
10 seed="" # default to no seed specified
11 while getopts "c:S:" opt
12 do
13 case "$opt" in
14 c) count="$OPTARG" ;;
15 S) seed="-S $OPTARG" ;;
16 esac
17 done
18 shift "$((OPTIND-1))"
19
20 rm -rf temp
21 mkdir -p temp
22 echo "generating tests.."
23 python3 generate.py -c $count $seed
24
25 echo "running tests.."
26 for i in $( ls temp/*.ys | sed 's,[^0-9],,g; s,^0*\(.\),\1,g;' ); do
27 echo -n "[$i]"
28 idx=$( printf "%05d" $i )
29 ../../yosys -ql temp/uut_${idx}.log temp/uut_${idx}.ys
30 done
31 echo
32
33 failed_share=$( echo $( gawk '/^#job#/ { j=$2; db[j]=0; } /^Removing [246] cells/ { delete db[j]; } END { for (j in db) print(j); }' temp/all_share_log.txt ) )
34 if [ -n "$failed_share" ]; then
35 echo "Resource sharing failed for the following test cases: $failed_share"
36 false
37 fi
38
39 exit 0