From c469be883b80137c9d3d79287b72d05aaaa17128 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Mon, 28 Jul 2014 09:15:40 +0200 Subject: [PATCH] Improvements in tests/vloghtb --- tests/vloghtb/common.sh | 21 +++++++++++---------- tests/vloghtb/test_mapopt.sh | 7 ++++++- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/tests/vloghtb/common.sh b/tests/vloghtb/common.sh index 3f7fc258d..3965b04ca 100644 --- a/tests/vloghtb/common.sh +++ b/tests/vloghtb/common.sh @@ -11,27 +11,28 @@ log_fail() test_autotest() { # Usage: - # test_autotest + # test_autotest test_name="$1" - mod_name="$2" - vlog_file="$3" - shift 3 + synth_cmd="$2" + mod_name="$3" + vlog_file="$4" mkdir -p log_test_$test_name rm -rf log_test_$test_name/$mod_name.* - cp $vlog_file log_test_$test_name/$mod_name.v + ../../yosys -q -l log_test_$test_name/$mod_name.out -o log_test_$test_name/$mod_name.v -p "$synth_cmd" "$vlog_file" + cat spec/${mod_name}_spec.v scripts/check.v >> log_test_$test_name/$mod_name.v + iverilog -o log_test_$test_name/$mod_name.bin -D"REFDAT_FN=\"refdat/${mod_name}_refdat.txt\"" log_test_$test_name/$mod_name.v - cd log_test_$test_name - if bash ../../tools/autotest.sh "$@" $mod_name.v > /dev/null 2>&1; then - mv $mod_name.out $mod_name.txt + if log_test_$test_name/$mod_name.bin 2>&1 | tee -a log_test_$test_name/$mod_name.out | grep -q '++OK++'; then + mv log_test_$test_name/$mod_name.out log_test_$test_name/$mod_name.txt log_pass test_$test_name $mod_name else + mv log_test_$test_name/$mod_name.out log_test_$test_name/$mod_name.err log_fail test_$test_name $mod_name + exit 1 fi - - cd .. } test_equiv() diff --git a/tests/vloghtb/test_mapopt.sh b/tests/vloghtb/test_mapopt.sh index ba39adb31..61528c2b4 100644 --- a/tests/vloghtb/test_mapopt.sh +++ b/tests/vloghtb/test_mapopt.sh @@ -6,7 +6,12 @@ source common.sh f=$1 n=$(basename ${f%.v}) +mkdir -p log_test_mapopt +rm -f log_test_mapopt/$n.* + test_equiv mapopt_1 "opt -fine; techmap; opt" "-set-def-inputs" $n $f -test_autotest mapopt_2 $n $f -p "opt; techmap -extern; opt" +test_autotest mapopt_2 "proc; opt; techmap; opt" $n $f + +tail -n20 log_test_mapopt_1/$n.txt log_test_mapopt_2/$n.txt > log_test_mapopt/$n.txt exit 0 -- 2.30.2