test: restore verific handling, nicer naming

This commit is contained in:
Emil J. Tywoniak 2024-12-13 10:24:47 +01:00
parent 603e5eb30a
commit 6240aec433
24 changed files with 86 additions and 93 deletions

132
Makefile
View File

@ -842,80 +842,69 @@ else
ABCOPT="" ABCOPT=""
endif endif
# Tests that generate .mk with tests/gen-tests-makefile.sh
MK_TEST_DIRS =
MK_TEST_DIRS += tests/arch/anlogic
MK_TEST_DIRS += tests/arch/ecp5
MK_TEST_DIRS += tests/arch/efinix
MK_TEST_DIRS += tests/arch/gatemate
MK_TEST_DIRS += tests/arch/gowin
MK_TEST_DIRS += tests/arch/ice40
MK_TEST_DIRS += tests/arch/intel_alm
MK_TEST_DIRS += tests/arch/machxo2
MK_TEST_DIRS += tests/arch/microchip
MK_TEST_DIRS += tests/arch/nanoxplore
MK_TEST_DIRS += tests/arch/nexus
MK_TEST_DIRS += tests/arch/quicklogic/pp3
MK_TEST_DIRS += tests/arch/quicklogic/qlf_k6n10f
MK_TEST_DIRS += tests/arch/xilinx
MK_TEST_DIRS += tests/opt
MK_TEST_DIRS += tests/sat
MK_TEST_DIRS += tests/sim
MK_TEST_DIRS += tests/svtypes
MK_TEST_DIRS += tests/techmap
MK_TEST_DIRS += tests/various
ifeq ($(ENABLE_VERIFIC),1)
ifneq ($(YOSYS_NOVERIFIC),1)
MK_TEST_DIRS += tests/verific
endif
endif
MK_TEST_DIRS += tests/verilog
########################### # Tests that don't generate .mk
# TESTS THAT GENERATE .MK # SH_TEST_DIRS =
########################### SH_TEST_DIRS += tests/simple
PARALLEL_TEST_DIRS = SH_TEST_DIRS += tests/simple_abc9
PARALLEL_TEST_DIRS += tests/arch/anlogic SH_TEST_DIRS += tests/hana
PARALLEL_TEST_DIRS += tests/arch/ecp5 SH_TEST_DIRS += tests/asicworld
PARALLEL_TEST_DIRS += tests/arch/efinix # SH_TEST_DIRS += tests/realmath
PARALLEL_TEST_DIRS += tests/arch/gatemate SH_TEST_DIRS += tests/share
PARALLEL_TEST_DIRS += tests/arch/gowin SH_TEST_DIRS += tests/opt_share
PARALLEL_TEST_DIRS += tests/arch/ice40 SH_TEST_DIRS += tests/fsm
PARALLEL_TEST_DIRS += tests/arch/intel_alm SH_TEST_DIRS += tests/memlib
PARALLEL_TEST_DIRS += tests/arch/machxo2 SH_TEST_DIRS += tests/bram
PARALLEL_TEST_DIRS += tests/arch/microchip SH_TEST_DIRS += tests/svinterfaces
PARALLEL_TEST_DIRS += tests/arch/nanoxplore SH_TEST_DIRS += tests/xprop
PARALLEL_TEST_DIRS += tests/arch/nexus SH_TEST_DIRS += tests/select
PARALLEL_TEST_DIRS += tests/arch/quicklogic/pp3 SH_TEST_DIRS += tests/proc
PARALLEL_TEST_DIRS += tests/arch/quicklogic/qlf_k6n10f SH_TEST_DIRS += tests/blif
PARALLEL_TEST_DIRS += tests/arch/xilinx SH_TEST_DIRS += tests/arch
PARALLEL_TEST_DIRS += tests/opt SH_TEST_DIRS += tests/rpc
PARALLEL_TEST_DIRS += tests/sat SH_TEST_DIRS += tests/memfile
PARALLEL_TEST_DIRS += tests/sim SH_TEST_DIRS += tests/fmt
PARALLEL_TEST_DIRS += tests/svtypes SH_TEST_DIRS += tests/cxxrtl
PARALLEL_TEST_DIRS += tests/techmap
PARALLEL_TEST_DIRS += tests/various
PARALLEL_TEST_DIRS += tests/verific
PARALLEL_TEST_DIRS += tests/verilog
# FIXME: Removed YOSYS_NOVERIFIC - temporarily?
# PARALLEL_TEST_DIRS += verific/extensions/tests/passing
##################################
# TESTS THAT DO NOT GENERATE .MK #
##################################
SEED_TEST_DIRS =
SEED_TEST_DIRS += tests/simple
SEED_TEST_DIRS += tests/simple_abc9
SEED_TEST_DIRS += tests/hana
SEED_TEST_DIRS += tests/asicworld
# TODO dig up why is this commented out
# SEED_TEST_DIRS += tests/realmath
SEED_TEST_DIRS += tests/share
SEED_TEST_DIRS += tests/opt_share
SEED_TEST_DIRS += tests/fsm
SEED_TEST_DIRS += tests/memlib
SEED_TEST_DIRS += tests/bram
SEED_TEST_DIRS += tests/svinterfaces
SEED_TEST_DIRS += tests/xprop
SEED_TEST_DIRS += tests/select
SEED_TEST_DIRS += tests/proc
SEED_TEST_DIRS += tests/blif
SEED_TEST_DIRS += tests/arch
SEED_TEST_DIRS += tests/rpc
SEED_TEST_DIRS += tests/memfile
SEED_TEST_DIRS += tests/fmt
SEED_TEST_DIRS += tests/cxxrtl
ifeq ($(ENABLE_FUNCTIONAL_TESTS),1) ifeq ($(ENABLE_FUNCTIONAL_TESTS),1)
SEED_TEST_DIRS += tests/functional SH_TEST_DIRS += tests/functional
endif endif
################################ # Tests that don't generate .mk and need special args
# TESTS THAT NEED SPECIAL ARGS # SH_ABC_TEST_DIRS =
################################ SH_ABC_TEST_DIRS += tests/memories
SH_ABC_TEST_DIRS += tests/aiger
ABC_TEST_DIRS =
ABC_TEST_DIRS += tests/memories
ABC_TEST_DIRS += tests/aiger
############
# THE GUTS #
############
# seed-tests/ is a dummy string, not a directory # seed-tests/ is a dummy string, not a directory
.PHONY: seed-tests .PHONY: seed-tests
seed-tests: $(SEED_TEST_DIRS:%=seed-tests/%) seed-tests: $(SH_TEST_DIRS:%=seed-tests/%)
.PHONY: seed-tests/% .PHONY: seed-tests/%
seed-tests/%: %/run-test.sh $(TARGETS) $(EXTRA_TARGETS) seed-tests/%: %/run-test.sh $(TARGETS) $(EXTRA_TARGETS)
+cd $* && bash run-test.sh $(SEEDOPT) +cd $* && bash run-test.sh $(SEEDOPT)
@ -923,14 +912,14 @@ seed-tests/%: %/run-test.sh $(TARGETS) $(EXTRA_TARGETS)
# abcopt-tests/ is a dummy string, not a directory # abcopt-tests/ is a dummy string, not a directory
.PHONY: abcopt-tests .PHONY: abcopt-tests
abcopt-tests: $(ABC_TEST_DIRS:%=abcopt-tests/%) abcopt-tests: $(SH_ABC_TEST_DIRS:%=abcopt-tests/%)
abcopt-tests/%: %/run-test.sh $(TARGETS) $(EXTRA_TARGETS) abcopt-tests/%: %/run-test.sh $(TARGETS) $(EXTRA_TARGETS)
+cd $* && bash run-test.sh $(ABCOPT) $(SEEDOPT) +cd $* && bash run-test.sh $(ABCOPT) $(SEEDOPT)
+@echo "...passed tests in $*" +@echo "...passed tests in $*"
# makefile-tests/ is a dummy string, not a directory # makefile-tests/ is a dummy string, not a directory
.PHONY: makefile-tests .PHONY: makefile-tests
makefile-tests: $(PARALLEL_TEST_DIRS:%=makefile-tests/%) makefile-tests: $(MK_TEST_DIRS:%=makefile-tests/%)
# this target actually emits .mk files # this target actually emits .mk files
%.mk: %.mk:
+cd $(dir $*) && bash run-test.sh +cd $(dir $*) && bash run-test.sh
@ -942,6 +931,11 @@ makefile-tests/%: %/run-test.mk $(TARGETS) $(EXTRA_TARGETS)
test: makefile-tests abcopt-tests seed-tests test: makefile-tests abcopt-tests seed-tests
@echo "" @echo ""
@echo " Passed \"make test\"." @echo " Passed \"make test\"."
ifeq ($(ENABLE_VERIFIC),1)
ifeq ($(YOSYS_NOVERIFIC),1)
@echo " Ran tests without verific support due to YOSYS_NOVERIFIC=1."
endif
endif
@echo "" @echo ""
VALGRIND ?= valgrind --error-exitcode=1 --leak-check=full --show-reachable=yes --errors-for-leak-kinds=all VALGRIND ?= valgrind --error-exitcode=1 --leak-check=full --show-reachable=yes --errors-for-leak-kinds=all

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
source ../../gen-tests-makefile.sh 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.'" generate_mk --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
source ../../gen-tests-makefile.sh 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.'" generate_mk --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
source ../../gen-tests-makefile.sh 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.'" generate_mk --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
source ../../gen-tests-makefile.sh 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.'" generate_mk --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
source ../../gen-tests-makefile.sh 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.'" generate_mk --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
source ../../gen-tests-makefile.sh 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.'" generate_mk --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
source ../../gen-tests-makefile.sh 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.'" generate_mk --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
source ../../gen-tests-makefile.sh 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.'" generate_mk --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
source ../../gen-tests-makefile.sh 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.'" generate_mk --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
source ../../gen-tests-makefile.sh 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.'" generate_mk --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
source ../../gen-tests-makefile.sh 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.'" generate_mk --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
source ../../../gen-tests-makefile.sh 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.'" generate_mk --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"

View File

@ -2,4 +2,4 @@
set -eu set -eu
python3 mem_gen.py python3 mem_gen.py
source ../../../gen-tests-makefile.sh source ../../../gen-tests-makefile.sh
run_tests --yosys-scripts --bash generate_mk --yosys-scripts --bash

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
source ../../gen-tests-makefile.sh 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.'" generate_mk --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"

View File

@ -105,7 +105,6 @@ generate_tests() {
fi fi
} }
run_tests() { generate_mk() {
generate_tests "$@" > run-test.mk generate_tests "$@" > run-test.mk
# exec ${MAKE:-make} -f run-test.mk
} }

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
source ../gen-tests-makefile.sh source ../gen-tests-makefile.sh
run_tests --yosys-scripts generate_mk --yosys-scripts

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
source ../gen-tests-makefile.sh source ../gen-tests-makefile.sh
run_tests --yosys-scripts generate_mk --yosys-scripts

View File

@ -9,4 +9,4 @@ find tb/* -name tb*.v | while read name; do
iverilog -o tb/$test_name.out $name $verilog_name iverilog -o tb/$test_name.out $name $verilog_name
./tb/$test_name.out -fst ./tb/$test_name.out -fst
done done
run_tests --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'" generate_mk --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
source ../gen-tests-makefile.sh source ../gen-tests-makefile.sh
run_tests --yosys-scripts --prove-sv generate_mk --yosys-scripts --prove-sv

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
source ../gen-tests-makefile.sh source ../gen-tests-makefile.sh
run_tests --yosys-scripts --tcl-scripts --bash --yosys-args "-e 'select out of bounds'" generate_mk --yosys-scripts --tcl-scripts --bash --yosys-args "-e 'select out of bounds'"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
source ../gen-tests-makefile.sh source ../gen-tests-makefile.sh
run_tests --yosys-scripts --bash generate_mk --yosys-scripts --bash

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
source ../gen-tests-makefile.sh source ../gen-tests-makefile.sh
run_tests --yosys-scripts --bash generate_mk --yosys-scripts --bash

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
source ../gen-tests-makefile.sh source ../gen-tests-makefile.sh
run_tests --yosys-scripts --bash generate_mk --yosys-scripts --bash