3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-04-21 03:13:32 +00:00
yosys/tests/cxxrtl/generate_mk.py
2026-03-25 11:46:08 +01:00

29 lines
916 B
Python

#!/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}", [
f"$${{CXX:-g++}} -std=c++11 -O2 -o cxxrtl-test-{name} -I../../backends/cxxrtl/runtime test_{name}.cc -lstdc++;",
f"./cxxrtl-test-{name}",
])
def compile_only():
gen_tests_makefile.generate_cmd_test("cxxrtl_unconnected_output", [
'$(YOSYS) -p "read_verilog test_unconnected_output.v; select =*; proc; clean; write_cxxrtl cxxrtl-test-unconnected_output.cc";',
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()