Skip to content

Commit

Permalink
ghdl_interface: with ghdl_e, save runtime args to JSON file
Browse files Browse the repository at this point in the history
  • Loading branch information
umarcor authored and eine committed Feb 20, 2020
1 parent 58ce760 commit 2654e27
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions vunit/sim_if/ghdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
Interface for GHDL simulator
"""

from pathlib import Path
from os.path import exists, join, abspath
import os
import logging
import subprocess
import shlex
from json import dump
from sys import stdout # To avoid output catched in non-verbose mode
from warnings import warn
from ..exceptions import CompileError
Expand Down Expand Up @@ -277,6 +279,23 @@ def _get_command(self, config, output_path, elaborate_only, ghdl_e, wave_file):
cmd += sim
if elaborate_only:
cmd += ["--no-run"]
else:
try:
os.makedirs(output_path, mode=0o777)
except OSError:
pass
with open(join(output_path, "args.json"), "w") as fname:
dump(
{
"bin": str(
Path(output_path)
/ ("%s-%s" % (config.entity_name, config.architecture_name))
),
"build": cmd[1:],
"sim": sim,
},
fname,
)

return cmd

Expand Down

0 comments on commit 2654e27

Please sign in to comment.