DeepWok / mase

Machine-Learning Accelerator System Exploration Tools
Other
105 stars 52 forks source link

_emit_cocotb_test attempts to access unnamed variable #58

Open JoachimSand opened 4 months ago

JoachimSand commented 4 months ago
def _emit_cocotb_test(graph):
    test_template = f"""
import cocotb

{inspect.getsource(test)}
"""

    tb_path = Path.home() / ".mase" / "top" / "hardware" / "test" / "mase_top_tb"
    tb_path.mkdir(parents=True, exist_ok=True)
    with open(tb_path / "test.py", "w") as f:
        f.write(test_template)

    # In this format-string below
    verilator_build = f"""
#!/bin/bash
# This script is used to build the verilator simulation
verilator --binary --build {verilator_buff}
"""
    verilator_file = os.path.join(sim_dir, "build.sh")
    with open(verilator_file, "w", encoding="utf-8") as outf:
        outf.write(verilator_build)

In the above snippet from ./machop/chop/passes/graph/transforms/verilog/emit_tb.py there is an undefined reference to verilator_buff.