3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-04-25 05:13:34 +00:00

Convert autotest script wrapper

This commit is contained in:
Miodrag Milanovic 2026-03-16 13:07:11 +01:00
parent 896fac04ed
commit 488f144245
10 changed files with 101 additions and 110 deletions

View file

@ -110,3 +110,23 @@ def generate_custom(callback, extra=None):
callback()
finally:
sys.stdout = old
def generate_autotest_file(test_file):
cmd = f"../tools/autotest.sh -G -j ${{SEEDOPT}} ${{EXTRA_FLAGS}} {test_file} >/dev/null 2>&1"
generate_target(test_file, cmd)
def generate_autotest(pattern, extra_flags):
with open("Makefile", "w") as f:
old = sys.stdout
sys.stdout = f
try:
print_header([ f"EXTRA_FLAGS = {extra_flags}",
"SEED ?=",
"ifneq ($(strip $(SEED)),)",
" SEEDOPT=-S$(SEED)",
"endif"
])
for f in sorted(glob.glob(pattern)):
generate_autotest_file(f)
finally:
sys.stdout = old