3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-04-23 05:15:30 +00:00

Use the test Makefile for all examples

* Rename and move sbysrc/demo[123].sby to docs/examples/demos
    * Make them use multiple tasks for multiple engines
* Scan docs/examples for sby files for make test
* `make ci` is now `NOSKIP` by default
* Skip scripts using `verific` w/o yosys verific support
    * This does not fail even with NOSKIP set
This commit is contained in:
Jannis Harder 2022-06-13 13:20:33 +02:00
parent 1d21513a47
commit 499371fd39
18 changed files with 77 additions and 92 deletions

View file

@ -26,6 +26,7 @@ def collect(path):
collect(Path("."))
collect(Path("../docs/examples"))
out_file = Path("make/rules/collect.mk")
out_file.parent.mkdir(exist_ok=True)

View file

@ -36,6 +36,15 @@ if __name__ == "__main__":
with open("make/rules/found_tools") as found_tools_file:
found_tools = set(tool.strip() for tool in found_tools_file.readlines())
if 'verific' in required_tools:
result = subprocess.run(["yosys", "-qp", "read -verific"], capture_output=True)
if result.returncode:
print()
print(f"SKIPPING {target}: requires yosys with verific support")
print()
exit()
required_tools.remove('verific')
missing_tools = sorted(
f"`{tool}`" for tool in required_tools if tool not in found_tools
)

View file

@ -1,15 +1,17 @@
TESTDIR ?= ..
test:
@$(MAKE) -C .. $(SUBDIR)/$@
@$(MAKE) -C $(TESTDIR) $(SUBDIR)/$@
.PHONY: test refresh IMPLICIT_PHONY
IMPLICIT_PHONY:
refresh:
@$(MAKE) -C .. refresh
@$(MAKE) -C $(TESTDIR) refresh
help:
@$(MAKE) -C .. help
@$(MAKE) -C $(TESTDIR) help
%: IMPLICIT_PHONY
@$(MAKE) -C .. $(SUBDIR)/$@
@$(MAKE) -C $(TESTDIR) $(SUBDIR)/$@

View file

@ -56,6 +56,9 @@ with rules_file.open("w") as rules:
solvers.add(solver)
engine_solvers.add((engine, solver))
if any(line.startswith("read -verific") or line.startswith("verific") for line in info["script"]):
required_tools.add("verific")
required_tools = sorted(required_tools)
print(f".PHONY: {target}", file=rules)