mirror of
https://github.com/YosysHQ/yosys.git
synced 2026-08-22 06:07:26 +02:00
Converted cxxrtl
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#!/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} >/dev/null 2>&1",
|
||||
])
|
||||
|
||||
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" >/dev/null 2>&1;',
|
||||
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()
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/bash
|
||||
source ../common-env.sh
|
||||
|
||||
set -e
|
||||
|
||||
run_subtest () {
|
||||
local subtest=$1; shift
|
||||
|
||||
${CXX:-g++} -std=c++11 -O2 -o cxxrtl-test-${subtest} -I../../backends/cxxrtl/runtime test_${subtest}.cc -lstdc++
|
||||
./cxxrtl-test-${subtest}
|
||||
}
|
||||
|
||||
run_subtest value
|
||||
run_subtest value_fuzz
|
||||
|
||||
# Compile-only test.
|
||||
../../yosys -p "read_verilog test_unconnected_output.v; select =*; proc; clean; write_cxxrtl cxxrtl-test-unconnected_output.cc" >/dev/null 2>&1
|
||||
${CXX:-g++} -std=c++11 -c -o cxxrtl-test-unconnected_output -I../../backends/cxxrtl/runtime cxxrtl-test-unconnected_output.cc
|
||||
Reference in New Issue
Block a user