summaryrefslogtreecommitdiff
path: root/tests/fsm/run-test.sh
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-08-08 13:12:18 +0200
committerClifford Wolf <clifford@clifford.at>2014-08-08 13:12:18 +0200
commitc07774b0b674805014b3ea16b28a01d40ba83d11 (patch)
treee39f39d11ea2ab2d961020fd122d06a5267fd8c8 /tests/fsm/run-test.sh
parent622ebab6710815324fa7250554b56f673862b479 (diff)
Added FSM test bench
Diffstat (limited to 'tests/fsm/run-test.sh')
-rwxr-xr-xtests/fsm/run-test.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/fsm/run-test.sh b/tests/fsm/run-test.sh
new file mode 100755
index 00000000..697ed935
--- /dev/null
+++ b/tests/fsm/run-test.sh
@@ -0,0 +1,30 @@
+#!/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
+
+rm -rf temp
+mkdir -p temp
+echo "generating tests.."
+python generate.py
+
+{
+ all_targets="all_targets:"
+ echo "all: all_targets"
+ 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]'"
+ echo " @../../yosys -ql temp/uut_${idx}.log temp/uut_${idx}.ys"
+ all_targets="$all_targets temp/uut_${idx}.log"
+ done
+ echo "$all_targets"
+} > temp/makefile
+
+echo "running tests.."
+${MAKE:-make} -f temp/makefile
+echo
+
+exit 0