Skip to content

Commit

Permalink
fix(GHDL): --elaborate should -e, not --elab-run
Browse files Browse the repository at this point in the history
  • Loading branch information
umarcor committed Apr 8, 2019
1 parent f135038 commit c6ee833
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions vunit/ghdl_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,17 @@ def compile_vhdl_file_command(self, source_file):
cmd += [source_file.name]
return cmd

def _get_sim_command(self, config, output_path):
def _get_command(self, config, output_path, elaborate_only):
"""
Return GHDL simulation command
"""
cmd = [join(self._prefix, self.executable)]
cmd += ['--elab-run']

if elaborate_only:
cmd += ["-e"]
else:
cmd += ["--elab-run"]

cmd += ['--std=%s' % self._std_str(self._vhdl_standard)]
cmd += ['--work=%s' % config.library_name]
cmd += ['--workdir=%s' % self._project.get_library(config.library_name).directory]
Expand All @@ -197,15 +202,14 @@ def _get_sim_command(self, config, output_path):
config.architecture_name))]
cmd += config.sim_options.get("ghdl.elab_flags", [])
cmd += [config.entity_name, config.architecture_name]
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"]
if not elaborate_only:
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"]
return cmd

def simulate(self, # pylint: disable=too-many-locals
Expand All @@ -221,12 +225,9 @@ def simulate(self, # pylint: disable=too-many-locals
if not exists(script_path):
os.makedirs(script_path)

cmd = self._get_sim_command(config, script_path)

if elaborate_only:
cmd += ["--no-run"]
cmd = self._get_command(config, script_path, elaborate_only)

if self._gtkwave_fmt is not None:
if (self._gtkwave_fmt is not None) and not elaborate_only:
data_file_name = join(script_path, "wave.%s" % self._gtkwave_fmt)

if exists(data_file_name):
Expand Down

0 comments on commit c6ee833

Please sign in to comment.