Added tests/vloghtb/test_share.sh

This commit is contained in:
Clifford Wolf 2014-07-20 13:20:52 +02:00
parent 6f450d0224
commit 2e358bd667
5 changed files with 57 additions and 1 deletions

View File

@ -5,3 +5,5 @@ scripts
spec
check_yosys
vloghammer_tb.tar.bz2
temp
log_test_*

7
tests/vloghtb/common.sh Normal file
View File

@ -0,0 +1,7 @@
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."
}

View File

@ -7,5 +7,6 @@ wget http://www.clifford.at/yosys/nogit/vloghammer_tb.tar.bz2
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

View File

@ -0,0 +1,9 @@
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 $<

View File

@ -0,0 +1,37 @@
#!/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