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:
|
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:
|
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:
|
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) |
|
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}"] |
It seems that when using nvc as simulator, the waveforms set with
--viewer-fmtformat are only generated when using the--guioption of the Python runner. With ghdl, this isn't the case, waveforms are generated regardless of the--guioption.I think, the problem is in nvc.py
simulate()method:First,
wave_fileis only set to a value if_guiis set:vunit/vunit/sim_if/nvc.py
Lines 260 to 265 in acf7e7f
Later if
wave_fileis set, the nvc--waveis added to the command line:vunit/vunit/sim_if/nvc.py
Lines 295 to 296 in acf7e7f
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
vunit/vunit/sim_if/ghdl.py
Lines 327 to 333 in acf7e7f