mirror of
https://github.com/YosysHQ/sby.git
synced 2025-04-07 14:45:18 +00:00
Better checking of available solvers
Check for required auxiliary tools and always regenerate the make rules when the set of available tools changes.
This commit is contained in:
parent
939e000036
commit
dc22d97362
|
@ -2,6 +2,23 @@ test:
|
||||||
|
|
||||||
.PHONY: test clean refresh help
|
.PHONY: test clean refresh help
|
||||||
|
|
||||||
|
TOOL_LIST := \
|
||||||
|
btorsim \
|
||||||
|
yices \
|
||||||
|
aigbmc \
|
||||||
|
avy \
|
||||||
|
bitwuzla \
|
||||||
|
boolector \
|
||||||
|
btormc \
|
||||||
|
cvc4 \
|
||||||
|
mathsat \
|
||||||
|
pono \
|
||||||
|
suprove \
|
||||||
|
yices-smt2 \
|
||||||
|
yices \
|
||||||
|
yosys-abc \
|
||||||
|
z3
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@cat make/help.txt
|
@cat make/help.txt
|
||||||
|
|
||||||
|
@ -15,5 +32,12 @@ make/rules/test/%.mk:
|
||||||
python3 make/test_rules.py $<
|
python3 make/test_rules.py $<
|
||||||
|
|
||||||
ifneq (help,$(MAKECMDGOALS))
|
ifneq (help,$(MAKECMDGOALS))
|
||||||
|
|
||||||
|
FIND_TOOLS := $(shell \
|
||||||
|
TOOLS=$$(which $(TOOL_LIST) 2>/dev/null || true); \
|
||||||
|
echo $$TOOLS | cmp -s make/rules/found_tools || echo $$TOOLS > make/rules/found_tools \
|
||||||
|
)
|
||||||
|
|
||||||
include make/rules/collect.mk
|
include make/rules/collect.mk
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -37,7 +37,7 @@ with out_file.open("w") as output:
|
||||||
print(f"{out_file}: {checked_dir}", file=output)
|
print(f"{out_file}: {checked_dir}", file=output)
|
||||||
|
|
||||||
for test in tests:
|
for test in tests:
|
||||||
print(f"make/rules/test/{test}.mk: {test}", file=output)
|
print(f"make/rules/test/{test}.mk: {test} make/rules/found_tools", file=output)
|
||||||
for ext in [".sh", ".py"]:
|
for ext in [".sh", ".py"]:
|
||||||
script_file = test.parent / (test.stem + ext)
|
script_file = test.parent / (test.stem + ext)
|
||||||
if script_file.exists():
|
if script_file.exists():
|
||||||
|
|
|
@ -26,6 +26,8 @@ def parse_engine(engine):
|
||||||
return engine, default_solvers.get(engine)
|
return engine, default_solvers.get(engine)
|
||||||
|
|
||||||
|
|
||||||
|
# When adding new tools, also update TOOL_LIST in Makefile to make sure we regenerate
|
||||||
|
# the rules when the user installs or removes any of the tools
|
||||||
REQUIRED_TOOLS = {
|
REQUIRED_TOOLS = {
|
||||||
("smtbmc", "yices"): ["yices-smt2"],
|
("smtbmc", "yices"): ["yices-smt2"],
|
||||||
("smtbmc", "z3"): ["z3"],
|
("smtbmc", "z3"): ["z3"],
|
||||||
|
@ -34,11 +36,12 @@ REQUIRED_TOOLS = {
|
||||||
("smtbmc", "boolector"): ["boolector"],
|
("smtbmc", "boolector"): ["boolector"],
|
||||||
("smtbmc", "bitwuzla"): ["bitwuzla"],
|
("smtbmc", "bitwuzla"): ["bitwuzla"],
|
||||||
("smtbmc", "abc"): ["yosys-abc"],
|
("smtbmc", "abc"): ["yosys-abc"],
|
||||||
("aiger", "suprove"): ["suprove"],
|
("aiger", "suprove"): ["suprove", "yices"],
|
||||||
("aiger", "avy"): ["avy"],
|
("aiger", "avy"): ["avy", "yices"],
|
||||||
("aiger", "aigbmc"): ["aigbmc"],
|
("aiger", "aigbmc"): ["aigbmc", "yices"],
|
||||||
("btor", "btormc"): ["btormc"],
|
("btor", "btormc"): ["btormc", "btorsim"],
|
||||||
("btor", "pono"): ["pono"],
|
("btor", "pono"): ["pono", "btorsim"],
|
||||||
|
("abc"): ["yices"],
|
||||||
}
|
}
|
||||||
|
|
||||||
rules_file = Path("make/rules/test") / sby_dir / (sby_file.name + ".mk")
|
rules_file = Path("make/rules/test") / sby_dir / (sby_file.name + ".mk")
|
||||||
|
@ -63,7 +66,9 @@ with rules_file.open("w") as rules:
|
||||||
for engine in info["engines"]:
|
for engine in info["engines"]:
|
||||||
engine, solver = parse_engine(engine)
|
engine, solver = parse_engine(engine)
|
||||||
engines.add(engine)
|
engines.add(engine)
|
||||||
required_tools.update(REQUIRED_TOOLS.get((engine, solver), ()))
|
required_tools.update(
|
||||||
|
REQUIRED_TOOLS.get((engine, solver), REQUIRED_TOOLS.get(engine, ()))
|
||||||
|
)
|
||||||
if solver:
|
if solver:
|
||||||
solvers.add(solver)
|
solvers.add(solver)
|
||||||
engine_solvers.add((engine, solver))
|
engine_solvers.add((engine, solver))
|
||||||
|
|
Loading…
Reference in a new issue