2023-12-28 23:22:29 +01:00
|
|
|
import os
|
2024-08-07 01:46:15 +02:00
|
|
|
import tempfile
|
|
|
|
|
|
|
|
|
|
from manta.cli import gen, inst
|
2023-12-28 23:22:29 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_verilog_gen():
|
|
|
|
|
with tempfile.TemporaryDirectory() as tmp_dir:
|
|
|
|
|
print("Created temporary directory at", tmp_dir)
|
|
|
|
|
|
|
|
|
|
gen("test/test_verilog_gen.yaml", tmp_dir + "/manta.v")
|
|
|
|
|
|
|
|
|
|
if not os.path.isfile(tmp_dir + "/manta.v"):
|
|
|
|
|
raise ValueError("No Verilog file generated!")
|
2024-08-06 16:08:59 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_inst_gen():
|
|
|
|
|
inst_string = inst("test/test_verilog_gen.yaml")
|
|
|
|
|
|
|
|
|
|
if not inst_string:
|
|
|
|
|
raise ValueError("No Verilog instantiation generated!")
|