mirror of https://github.com/YosysHQ/yosys.git
Merge pull request #2380 from Xiretza/parallel-tests
Clean up and parallelize testsuite
This commit is contained in:
commit
2412e75495
|
@ -1,20 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
{
|
||||
echo "all::"
|
||||
for x in *.ys; do
|
||||
echo "all:: run-$x"
|
||||
echo "run-$x:"
|
||||
echo " @echo 'Running $x..'"
|
||||
echo " @../../../yosys -ql ${x%.ys}.log -w 'Yosys has only limited support for tri-state logic at the moment.' $x"
|
||||
done
|
||||
for s in *.sh; do
|
||||
if [ "$s" != "run-test.sh" ]; then
|
||||
echo "all:: run-$s"
|
||||
echo "run-$s:"
|
||||
echo " @echo 'Running $s..'"
|
||||
echo " @bash $s"
|
||||
fi
|
||||
done
|
||||
} > run-test.mk
|
||||
exec ${MAKE:-make} -f run-test.mk
|
||||
set -eu
|
||||
source ../../gen-tests-makefile.sh
|
||||
run_tests --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"
|
||||
|
|
|
@ -1,20 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
{
|
||||
echo "all::"
|
||||
for x in *.ys; do
|
||||
echo "all:: run-$x"
|
||||
echo "run-$x:"
|
||||
echo " @echo 'Running $x..'"
|
||||
echo " @../../../yosys -ql ${x%.ys}.log -w 'Yosys has only limited support for tri-state logic at the moment.' $x"
|
||||
done
|
||||
for s in *.sh; do
|
||||
if [ "$s" != "run-test.sh" ]; then
|
||||
echo "all:: run-$s"
|
||||
echo "run-$s:"
|
||||
echo " @echo 'Running $s..'"
|
||||
echo " @bash $s"
|
||||
fi
|
||||
done
|
||||
} > run-test.mk
|
||||
exec ${MAKE:-make} -f run-test.mk
|
||||
set -eu
|
||||
source ../../gen-tests-makefile.sh
|
||||
run_tests --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"
|
||||
|
|
|
@ -1,20 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
{
|
||||
echo "all::"
|
||||
for x in *.ys; do
|
||||
echo "all:: run-$x"
|
||||
echo "run-$x:"
|
||||
echo " @echo 'Running $x..'"
|
||||
echo " @../../../yosys -ql ${x%.ys}.log -w 'Yosys has only limited support for tri-state logic at the moment.' $x"
|
||||
done
|
||||
for s in *.sh; do
|
||||
if [ "$s" != "run-test.sh" ]; then
|
||||
echo "all:: run-$s"
|
||||
echo "run-$s:"
|
||||
echo " @echo 'Running $s..'"
|
||||
echo " @bash $s"
|
||||
fi
|
||||
done
|
||||
} > run-test.mk
|
||||
exec ${MAKE:-make} -f run-test.mk
|
||||
set -eu
|
||||
source ../../gen-tests-makefile.sh
|
||||
run_tests --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"
|
||||
|
|
|
@ -1,20 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
{
|
||||
echo "all::"
|
||||
for x in *.ys; do
|
||||
echo "all:: run-$x"
|
||||
echo "run-$x:"
|
||||
echo " @echo 'Running $x..'"
|
||||
echo " @../../../yosys -ql ${x%.ys}.log -w 'Yosys has only limited support for tri-state logic at the moment.' $x"
|
||||
done
|
||||
for s in *.sh; do
|
||||
if [ "$s" != "run-test.sh" ]; then
|
||||
echo "all:: run-$s"
|
||||
echo "run-$s:"
|
||||
echo " @echo 'Running $s..'"
|
||||
echo " @bash $s"
|
||||
fi
|
||||
done
|
||||
} > run-test.mk
|
||||
exec ${MAKE:-make} -f run-test.mk
|
||||
set -eu
|
||||
source ../../gen-tests-makefile.sh
|
||||
run_tests --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"
|
||||
|
|
|
@ -1,20 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
{
|
||||
echo "all::"
|
||||
for x in *.ys; do
|
||||
echo "all:: run-$x"
|
||||
echo "run-$x:"
|
||||
echo " @echo 'Running $x..'"
|
||||
echo " @../../../yosys -ql ${x%.ys}.log -w 'Yosys has only limited support for tri-state logic at the moment.' $x"
|
||||
done
|
||||
for s in *.sh; do
|
||||
if [ "$s" != "run-test.sh" ]; then
|
||||
echo "all:: run-$s"
|
||||
echo "run-$s:"
|
||||
echo " @echo 'Running $s..'"
|
||||
echo " @bash $s"
|
||||
fi
|
||||
done
|
||||
} > run-test.mk
|
||||
exec ${MAKE:-make} -f run-test.mk
|
||||
set -eu
|
||||
source ../../gen-tests-makefile.sh
|
||||
run_tests --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"
|
||||
|
|
|
@ -1,20 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
{
|
||||
echo "all::"
|
||||
for x in *.ys; do
|
||||
echo "all:: run-$x"
|
||||
echo "run-$x:"
|
||||
echo " @echo 'Running $x..'"
|
||||
echo " @../../../yosys -ql ${x%.ys}.log -w 'Yosys has only limited support for tri-state logic at the moment.' $x"
|
||||
done
|
||||
for s in *.sh; do
|
||||
if [ "$s" != "run-test.sh" ]; then
|
||||
echo "all:: run-$s"
|
||||
echo "run-$s:"
|
||||
echo " @echo 'Running $s..'"
|
||||
echo " @bash $s"
|
||||
fi
|
||||
done
|
||||
} > run-test.mk
|
||||
exec ${MAKE:-make} -f run-test.mk
|
||||
set -eu
|
||||
source ../../gen-tests-makefile.sh
|
||||
run_tests --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"
|
||||
|
|
|
@ -1,20 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
{
|
||||
echo "all::"
|
||||
for x in *.ys; do
|
||||
echo "all:: run-$x"
|
||||
echo "run-$x:"
|
||||
echo " @echo 'Running $x..'"
|
||||
echo " @../../../yosys -ql ${x%.ys}.log -w 'Yosys has only limited support for tri-state logic at the moment.' $x"
|
||||
done
|
||||
for s in *.sh; do
|
||||
if [ "$s" != "run-test.sh" ]; then
|
||||
echo "all:: run-$s"
|
||||
echo "run-$s:"
|
||||
echo " @echo 'Running $s..'"
|
||||
echo " @bash $s"
|
||||
fi
|
||||
done
|
||||
} > run-test.mk
|
||||
exec ${MAKE:-make} -f run-test.mk
|
||||
set -eu
|
||||
source ../../gen-tests-makefile.sh
|
||||
run_tests --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"
|
||||
|
|
|
@ -0,0 +1,94 @@
|
|||
set -eu
|
||||
|
||||
YOSYS_BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"/../ >/dev/null 2>&1 && pwd)"
|
||||
|
||||
# $ generate_target target_name test_command
|
||||
generate_target() {
|
||||
target_name=$1
|
||||
test_command=$2
|
||||
echo "all: $target_name"
|
||||
echo ".PHONY: $target_name"
|
||||
echo "$target_name:"
|
||||
printf "\t@%s\n" "$test_command"
|
||||
printf "\t@echo 'Passed %s'\n" "$target_name"
|
||||
}
|
||||
|
||||
# $ generate_ys_test ys_file [yosys_args]
|
||||
generate_ys_test() {
|
||||
ys_file=$1
|
||||
yosys_args=${2:-}
|
||||
generate_target "$ys_file" "$YOSYS_BASEDIR/yosys -ql ${ys_file%.*}.log $yosys_args $ys_file"
|
||||
}
|
||||
|
||||
# $ generate_bash_test bash_file
|
||||
generate_bash_test() {
|
||||
bash_file=$1
|
||||
generate_target "$bash_file" "bash -v $bash_file >${bash_file%.*}.log 2>&1"
|
||||
}
|
||||
|
||||
# $ generate_tests [-y|--yosys-scripts] [-s|--prove-sv] [-b|--bash] [-a|--yosys-args yosys_args]
|
||||
generate_tests() {
|
||||
do_ys=false
|
||||
do_sv=false
|
||||
do_sh=false
|
||||
yosys_args=""
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
arg="$1"
|
||||
case "$arg" in
|
||||
-y|--yosys-scripts)
|
||||
do_ys=true
|
||||
shift
|
||||
;;
|
||||
-s|--prove-sv)
|
||||
do_sv=true
|
||||
shift
|
||||
;;
|
||||
-b|--bash)
|
||||
do_sh=true
|
||||
shift
|
||||
;;
|
||||
-a|--yosys-args)
|
||||
yosys_args+="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo >&2 "Unknown argument: $1"
|
||||
exit 1
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ ! ( $do_ys = true || $do_sv = true || $do_sh = true ) ]]; then
|
||||
echo >&2 "Error: No file types selected"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ".PHONY: all"
|
||||
echo "all:"
|
||||
|
||||
if [[ $do_ys = true ]]; then
|
||||
for x in *.ys; do
|
||||
generate_ys_test "$x" "$yosys_args"
|
||||
done
|
||||
fi;
|
||||
if [[ $do_sv = true ]]; then
|
||||
for x in *.sv; do
|
||||
if [ ! -f "${x%.sv}.ys" ]; then
|
||||
generate_ys_test "$x" "-p \"prep -top top; sat -verify -prove-asserts\" $yosys_args"
|
||||
fi;
|
||||
done
|
||||
fi;
|
||||
if [[ $do_sh == true ]]; then
|
||||
for s in *.sh; do
|
||||
if [ "$s" != "run-test.sh" ]; then
|
||||
generate_bash_test "$s"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
run_tests() {
|
||||
generate_tests "$@" > run-test.mk
|
||||
exec ${MAKE:-make} -f run-test.mk
|
||||
}
|
|
@ -9,12 +9,12 @@ while getopts "A:S:" opt
|
|||
do
|
||||
case "$opt" in
|
||||
A) abcopt="-A $OPTARG" ;;
|
||||
S) seed="-S $OPTARG" ;;
|
||||
S) seed="$OPTARG" ;;
|
||||
esac
|
||||
done
|
||||
shift "$((OPTIND-1))"
|
||||
|
||||
bash ../tools/autotest.sh $abcopt $seed -G *.v
|
||||
${MAKE:-make} -f ../tools/autotest.mk SEED="$seed" EXTRA_FLAGS="$abcopt" *.v
|
||||
|
||||
for f in `egrep -l 'expect-(wr-ports|rd-ports|rd-clk)' *.v`; do
|
||||
echo -n "Testing expectations for $f .."
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
*.log
|
||||
run-test.mk
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
for x in *.ys; do
|
||||
echo "Running $x.."
|
||||
../../yosys -ql ${x%.ys}.log $x
|
||||
done
|
||||
set -eu
|
||||
source ../gen-tests-makefile.sh
|
||||
run_tests --yosys-scripts
|
||||
|
|
|
@ -22,12 +22,23 @@ mkdir -p temp
|
|||
echo "generating tests.."
|
||||
python3 generate.py -c $count $seed
|
||||
|
||||
echo "running tests.."
|
||||
{
|
||||
echo ".PHONY: all"
|
||||
echo "all:"
|
||||
|
||||
for i in $( ls temp/*.ys | sed 's,[^0-9],,g; s,^0*\(.\),\1,g;' ); do
|
||||
echo -n "[$i]"
|
||||
idx=$( printf "%05d" $i )
|
||||
../../yosys -ql temp/uut_${idx}.log temp/uut_${idx}.ys
|
||||
echo ".PHONY: test-$idx"
|
||||
echo "all: test-$idx"
|
||||
echo "test-$idx:"
|
||||
printf "\t@%s\n" \
|
||||
"echo -n [$i]" \
|
||||
"../../yosys -ql temp/uut_${idx}.log temp/uut_${idx}.ys"
|
||||
done
|
||||
} > temp/makefile
|
||||
|
||||
echo "running tests.."
|
||||
${MAKE:-make} -f temp/makefile
|
||||
echo
|
||||
|
||||
failed_share=$( echo $( gawk '/^#job#/ { j=$2; db[j]=0; } /^Removing [246] cells/ { delete db[j]; } END { for (j in db) print(j); }' temp/all_share_log.txt ) )
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
*.log
|
||||
run-test.mk
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
for x in *.ys; do
|
||||
echo "Running $x.."
|
||||
../../yosys -ql ${x%.ys}.log $x
|
||||
done
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
source ../gen-tests-makefile.sh
|
||||
run_tests --yosys-scripts
|
||||
|
|
|
@ -17,5 +17,4 @@ if ! command -v iverilog > /dev/null ; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
shopt -s nullglob
|
||||
exec ${MAKE:-make} -f ../tools/autotest.mk $seed *.{sv,v}
|
||||
|
|
|
@ -1,20 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
{
|
||||
echo "all::"
|
||||
for x in *.ys; do
|
||||
echo "all:: run-$x"
|
||||
echo "run-$x:"
|
||||
echo " @echo 'Running $x..'"
|
||||
echo " @../../yosys -ql ${x%.ys}.log $x"
|
||||
done
|
||||
for x in *.sv; do
|
||||
if [ ! -f "${x%.sv}.ys" ]; then
|
||||
echo "all:: check-$x"
|
||||
echo "check-$x:"
|
||||
echo " @echo 'Checking $x..'"
|
||||
echo " @../../yosys -ql ${x%.sv}.log -p \"prep -top top; sat -verify -prove-asserts\" $x"
|
||||
fi
|
||||
done
|
||||
} > run-test.mk
|
||||
exec ${MAKE:-make} -f run-test.mk
|
||||
set -eu
|
||||
source ../gen-tests-makefile.sh
|
||||
run_tests --yosys-scripts --prove-sv
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -ev
|
||||
set -e
|
||||
|
||||
../../yosys -b 'verilog -noattr' -o mem_simple_4x1_synth.v -p 'proc; opt; memory -nomap; techmap -map mem_simple_4x1_map.v;; techmap; opt; abc;; stat' mem_simple_4x1_uut.v
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
set -ev
|
||||
set -e
|
||||
|
||||
../../yosys -p 'hierarchy -top top; techmap -map recursive_map.v -max_iter 1; select -assert-count 2 t:sub; select -assert-count 2 t:bar' recursive.v
|
||||
|
|
|
@ -1,20 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
{
|
||||
echo "all::"
|
||||
for x in *.ys; do
|
||||
echo "all:: run-$x"
|
||||
echo "run-$x:"
|
||||
echo " @echo 'Running $x..'"
|
||||
echo " @../../yosys -ql ${x%.ys}.log -e 'select out of bounds' $x"
|
||||
done
|
||||
for s in *.sh; do
|
||||
if [ "$s" != "run-test.sh" ]; then
|
||||
echo "all:: run-$s"
|
||||
echo "run-$s:"
|
||||
echo " @echo 'Running $s..'"
|
||||
echo " @bash $s > ${s%.sh}.log 2>&1"
|
||||
fi
|
||||
done
|
||||
} > run-test.mk
|
||||
exec ${MAKE:-make} -f run-test.mk
|
||||
set -eu
|
||||
source ../gen-tests-makefile.sh
|
||||
run_tests --yosys-scripts --bash --yosys-args "-e 'select out of bounds'"
|
||||
|
|
|
@ -1,20 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
{
|
||||
echo "all::"
|
||||
for x in *.ys; do
|
||||
echo "all:: run-$x"
|
||||
echo "run-$x:"
|
||||
echo " @echo 'Running $x..'"
|
||||
echo " @../../yosys -ql ${x%.ys}.log $x"
|
||||
done
|
||||
for s in *.sh; do
|
||||
if [ "$s" != "run-test.sh" ]; then
|
||||
echo "all:: run-$s"
|
||||
echo "run-$s:"
|
||||
echo " @echo 'Running $s..'"
|
||||
echo " @bash $s"
|
||||
fi
|
||||
done
|
||||
} > run-test.mk
|
||||
exec ${MAKE:-make} -f run-test.mk
|
||||
set -eu
|
||||
source ../gen-tests-makefile.sh
|
||||
run_tests --yosys-scripts --bash
|
||||
|
|
|
@ -1,20 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
{
|
||||
echo "all::"
|
||||
for x in *.ys; do
|
||||
echo "all:: run-$x"
|
||||
echo "run-$x:"
|
||||
echo " @echo 'Running $x..'"
|
||||
echo " @../../yosys -ql ${x%.ys}.log $x"
|
||||
done
|
||||
for s in *.sh; do
|
||||
if [ "$s" != "run-test.sh" ]; then
|
||||
echo "all:: run-$s"
|
||||
echo "run-$s:"
|
||||
echo " @echo 'Running $s..'"
|
||||
echo " @bash $s"
|
||||
fi
|
||||
done
|
||||
} > run-test.mk
|
||||
exec ${MAKE:-make} -f run-test.mk
|
||||
set -eu
|
||||
source ../gen-tests-makefile.sh
|
||||
run_tests --yosys-scripts --bash
|
||||
|
|
Loading…
Reference in New Issue