Skip to content

Commit 79defb4

Browse files
committed
Rewrite nmigen to RTLIL conversion code
Signed-off-by: Robert Winkler <rwinkler@antmicro.com>
1 parent 23a18e4 commit 79defb4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sphinxcontrib_hdl_diagrams/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,12 @@ def diagram_netlistsvg(ipath, opath, module='top', flatten=False,
365365

366366

367367
def nmigen_to_rtlil(fname, oname):
368-
subprocess.run([sys.executable, fname], stdout=open(oname, "w"),
369-
shell=False, check=True)
368+
assert os.path.exists(fname)
369+
370+
output_dir = os.path.dirname(oname)
371+
os.makedirs(output_dir, exist_ok=True)
372+
cmd = "{python} {script} > {output}".format(python=sys.executable, script=fname, output=oname)
373+
subprocess.run(cmd, shell=True, check=True)
370374

371375

372376
def render_diagram(self, code, options, format, skin, yosys_script):

0 commit comments

Comments
 (0)