spec
check_yosys
vloghammer_tb.tar.bz2
+temp
+log_test_*
--- /dev/null
+log_pass() {
+ printf "%-15s %s %s %s\n" "$1" "$2" "`printf "%20s" "$2" | tr -d a-zA-Z0-9_ | tr ' ' .`" "pass."
+}
+
+log_fail() {
+ printf "%-15s %s %s %s\n" "$1" "$2" "`printf "%20s" "$2" | tr -d a-zA-Z0-9_ | tr ' ' .`" "FAIL."
+}
tar --strip=1 -xjf vloghammer_tb.tar.bz2
make clean
-make -j4 YOSYS_BIN=$PWD/../../yosys YOSYS_SCRIPT="proc;;" check_yosys
+make -j4 EXIT_ON_ERROR=1 YOSYS_BIN=$PWD/../../yosys YOSYS_SCRIPT="proc;;" check_yosys
+make -j4 -f test_makefile MODE=share
--- /dev/null
+
+MODE := share
+TESTS := $(shell ls rtl/ | sed 's,\.v$$,,' )
+
+run: $(addprefix log_test_$(MODE)/,$(addsuffix .txt,$(TESTS)))
+
+log_test_$(MODE)/%.txt: rtl/%.v
+ @bash test_$(MODE).sh $<
+
--- /dev/null
+#!/bin/bash
+
+set -e
+mkdir -p log_test_share
+source common.sh
+
+f=$1
+n=$(basename ${f%.v})
+
+rm -f log_test_share/$n.txt
+rm -f log_test_share/$n.err
+
+if ! ../../yosys -q -l log_test_share/$n.out - 2> /dev/null <<- EOT
+ read_verilog $f
+ proc;;
+
+ copy $n gold
+ rename $n work
+
+ cd work
+ share -aggressive
+ cd ..
+
+ miter -equiv -ignore_gold_x -make_outputs -make_outcmp gold work miter
+ flatten miter
+ sat -verify -prove trigger 0 -show-inputs -show-outputs miter
+EOT
+then
+ log_fail test_share $n
+ mv log_test_share/$n.out log_test_share/$n.err
+ exit 1
+fi
+
+log_pass test_share $n
+mv log_test_share/$n.out log_test_share/$n.txt
+exit 0
+