2014-06-14 12:56:22 -05:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
2016-09-15 03:00:29 -05:00
|
|
|
OPTIND=1
|
|
|
|
count=100
|
|
|
|
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-06-14 12:56:22 -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-06-14 12:56:22 -05:00
|
|
|
|
|
|
|
cd temp
|
|
|
|
echo "running tests.."
|
2016-09-15 03:00:29 -05:00
|
|
|
for ((i = 0; i < $count; i++)); do
|
2014-06-14 12:56:22 -05:00
|
|
|
echo -n "[$i]"
|
|
|
|
idx=$( printf "%05d" $i )
|
2014-11-09 04:02:20 -06:00
|
|
|
../../../yosys -qq uut_${idx}.ys
|
2014-06-14 12:56:22 -05:00
|
|
|
iverilog -o uut_${idx}_tb uut_${idx}_tb.v uut_${idx}.v uut_${idx}_syn.v
|
2014-06-15 02:31:03 -05:00
|
|
|
./uut_${idx}_tb | tee uut_${idx}.err
|
|
|
|
if test -s uut_${idx}.err; then
|
2015-08-14 15:23:01 -05:00
|
|
|
echo "Note: Make sure that 'iverilog' is an up-to-date git checkout of Icarus Verilog."
|
2014-06-15 02:31:03 -05:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
rm -f uut_${idx}.err
|
2014-06-14 12:56:22 -05:00
|
|
|
done
|
|
|
|
echo
|
|
|
|
|