Skip to content

nvc: Waveform files are only generated with --gui option #1099

@tmeissner

Description

@tmeissner

It seems that when using nvc as simulator, the waveforms set with --viewer-fmt format are only generated when using the --gui option of the Python runner. With ghdl, this isn't the case, waveforms are generated regardless of the --gui option.

I think, the problem is in nvc.py simulate() method:

First, wave_file is only set to a value if _gui is set:

vunit/vunit/sim_if/nvc.py

Lines 260 to 265 in acf7e7f

if self._gui:
wave_file = script_path / (f"{config.entity_name}.{self._viewer_fmt or 'fst'}")
if wave_file.exists():
remove(wave_file)
else:
wave_file = None

Later if wave_file is set, the nvc --wave is added to the command line:

vunit/vunit/sim_if/nvc.py

Lines 295 to 296 in acf7e7f

if wave_file:
cmd += [f"--wave={wave_file}"]

In ghdl.py, creation of the waveform export command line option is only dependent on _viewer_fmt, but not on _gui:

vunit/vunit/sim_if/ghdl.py

Lines 368 to 375 in acf7e7f

if self._viewer_fmt is not None:
data_file_name = str(Path(script_path) / f"wave.{self._viewer_fmt!s}")
if Path(data_file_name).exists():
remove(data_file_name)
else:
data_file_name = None
cmd = self._get_command(config, script_path, elaborate_only, ghdl_e, test_suite_name, data_file_name)

vunit/vunit/sim_if/ghdl.py

Lines 327 to 333 in acf7e7f

if wave_file:
if self._viewer_fmt == "ghw":
sim += [f"--wave={wave_file!s}"]
elif self._viewer_fmt == "vcd":
sim += [f"--vcd={wave_file!s}"]
elif self._viewer_fmt == "fst":
sim += [f"--fst={wave_file!s}"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions