Skip to content

Commit

Permalink
feat(ghdl_interface): save runtime args to txt file
Browse files Browse the repository at this point in the history
  • Loading branch information
umarcor committed Apr 21, 2019
1 parent 0f00d74 commit aea2f8b
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions vunit/ghdl_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,23 +211,36 @@ def _get_command(self, config, output_path, ghdl_e):
cmd += ['--work=%s' % config.library_name]
cmd += ['--workdir=%s' % self._project.get_library(config.library_name).directory]
cmd += ['-P%s' % lib.directory for lib in self._project.get_libraries()]

bin_path = join(
output_path,
"%s-%s" % (config.entity_name, config.architecture_name)
)
if self._has_output_flag():
cmd += ['-o', join(output_path, "%s-%s" % (config.entity_name,
config.architecture_name))]
cmd += ['-o', bin_path]
cmd += config.sim_options.get("ghdl.elab_flags", [])
objs = config.sim_options.get("objects", [])
if objs:
cmd += ["-Wl," + " ".join(objs)]

cmd += [config.entity_name, config.architecture_name]

sim = config.sim_options.get("ghdl.sim_flags", [])
for name, value in config.generics.items():
sim += ['-g%s=%s' % (name, value)]
sim += ['--assert-level=%s' % config.vhdl_assert_stop_level]
if config.sim_options.get("disable_ieee_warnings", False):
sim += ["--ieee-asserts=disable"]

if not ghdl_e:
cmd += config.sim_options.get("ghdl.sim_flags", [])
for name, value in config.generics.items():
cmd += ['-g%s=%s' % (name, value)]
cmd += ['--assert-level=%s' % config.vhdl_assert_stop_level]
if config.sim_options.get("disable_ieee_warnings", False):
cmd += ["--ieee-asserts=disable"]
cmd += sim
else:
try:
os.makedirs(output_path, mode=0o777)
except OSError:
pass
with open(join(output_path, 'args.txt'), 'w') as f:
for item in [bin_path] + sim:
f.write("%s\n" % item)

return cmd

Expand Down

0 comments on commit aea2f8b

Please sign in to comment.