yosys/tests/cxxrtl/generate_mk.py

30 lines
914 B
Python
Raw Normal View History

2026-03-24 07:43:30 +01:00
#!/usr/bin/env python3
import sys
sys.path.append("..")
import gen_tests_makefile
def run_subtest(name):
gen_tests_makefile.generate_cmd_test(f"cxxrtl_{name}", [
2026-03-26 08:14:16 +01:00
f"$${{CXX:-g++}} -std=c++11 -O2 -o cxxrtl-test-{name} -I../../backends/cxxrtl/runtime test_{name}.cc -lstdc++",
2026-03-25 11:46:08 +01:00
f"./cxxrtl-test-{name}",
2026-03-24 07:43:30 +01:00
])
def compile_only():
gen_tests_makefile.generate_cmd_test("cxxrtl_unconnected_output", [
2026-03-26 08:14:16 +01:00
'$(YOSYS) -p "read_verilog test_unconnected_output.v; select =*; proc; clean; write_cxxrtl cxxrtl-test-unconnected_output.cc"',
2026-03-24 07:43:30 +01:00
f'$${{CXX:-g++}} -std=c++11 -c -o cxxrtl-test-unconnected_output -I../../backends/cxxrtl/runtime cxxrtl-test-unconnected_output.cc',
])
def main():
def callback():
run_subtest("value")
run_subtest("value_fuzz")
compile_only()
gen_tests_makefile.generate_custom(callback)
if __name__ == "__main__":
main()