diff --git a/tests/sva/runtest.sh b/tests/sva/runtest.sh index 84e797390..7692a5f9a 100644 --- a/tests/sva/runtest.sh +++ b/tests/sva/runtest.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -ex +set -e prefix=${1%.ok} prefix=${prefix%.sv} @@ -58,16 +58,33 @@ generate_sby() { } if [ -f $prefix.ys ]; then + set -x $PWD/../../yosys -q -e "Assert .* failed." -s $prefix.ys elif [ -f $prefix.sv ]; then generate_sby pass > ${prefix}_pass.sby generate_sby fail > ${prefix}_fail.sby - sby --yosys $PWD/../../yosys -f ${prefix}_pass.sby - sby --yosys $PWD/../../yosys -f ${prefix}_fail.sby + + # Check that SBY is up to date enough for this yosys version + if sby --help | grep -q -e '--status'; then + set -x + sby --yosys $PWD/../../yosys -f ${prefix}_pass.sby + sby --yosys $PWD/../../yosys -f ${prefix}_fail.sby + else + echo "sva test '${prefix}' requires an up to date SBY, skipping" + fi else generate_sby pass > ${prefix}.sby - sby --yosys $PWD/../../yosys -f ${prefix}.sby + + # Check that SBY is up to date enough for this yosys version + if sby --help | grep -q -e '--status'; then + set -x + sby --yosys $PWD/../../yosys -f ${prefix}.sby + else + echo "sva test '${prefix}' requires an up to date SBY, skipping" + fi fi +{ set +x; } &>/dev/null + touch $prefix.ok