Skip to content

Commit 2a276be

Browse files
oscargusLarsAsplund
authored andcommitted
Fix review comments
1 parent 3b62ce5 commit 2a276be

File tree

4 files changed

+21
-26
lines changed

4 files changed

+21
-26
lines changed

docs/news.d/1002.feature.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
[GHDL/NVC] Arbitrary waveform viewers are now supported by passing the `--viewer`
2-
command line arugment. As a consequence, ``ghdl.gtkwave_script.gui`` and
1+
[GHDL/NVC] Arbitrary waveform viewers are now supported by passing the ``--viewer``
2+
command line argument. As a consequence, ``ghdl.gtkwave_script.gui`` and
33
``nvc.gtkwave_script.gui`` are deprecated in favour of ``ghdl.viewer_script.gui``
44
and ``nvc.viewer_script.gui``, respectively. The ``--gtkwave-args`` and
5-
``--gtkwave-fmt`` command line argument is deprecated in favour of ``--viewer-args``
5+
``--gtkwave-fmt`` command line arguments are deprecated in favour of ``--viewer-args``
66
and ``--viewer-fmt``, respectively. ``ghdl.viewer.gui`` and ``nvc.viewer.gui`` can
7-
be used to set the preferred viewer from the run-file. Finally, if the requested
8-
viewer does not exists, ``gtkwave`` or ``surfer`` is used, in that order. This
9-
also means that VUnit uses ``surfer`` if ``gtkwave`` is not installed.
7+
be used to set the preferred viewer from the run-file. If no viewer is explicitly
8+
requested, ``gtkwave`` or ``surfer`` is used, in that order. This also means that
9+
VUnit now uses ``surfer`` if ``gtkwave`` is not installed.
1010

1111
[NVC] It is possible to get VCD waveform files by passing ``--viewer-fmt=vcd``.
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"""
99

1010

11-
class OSSMixin:
11+
class ViewerMixin:
1212
"""
1313
Mixin class for handling common viewer functionality for the GHDL and NVC simulators.
1414
"""
@@ -35,8 +35,7 @@ def _get_viewer(self, config):
3535
"""
3636
Determine the waveform viewer to use.
3737
38-
Falls back to gtkwave or surfer, in that order, if none is provided or the provided
39-
cannot be found.
38+
Falls back to gtkwave or surfer, in that order, if none is provided.
4039
"""
4140
viewer = self._viewer or config.sim_options.get(self.name + ".viewer.gui", None)
4241

vunit/sim_if/ghdl.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
from ..ostools import Process
2222
from . import SimulatorInterface, ListOfStringOption, StringOption, BooleanOption
2323
from ..vhdl_standard import VHDL
24-
from ._ossmixin import OSSMixin
24+
from ._viewermixin import ViewerMixin
2525

2626
LOGGER = logging.getLogger(__name__)
2727

2828

29-
class GHDLInterface(SimulatorInterface, OSSMixin): # pylint: disable=too-many-instance-attributes
29+
class GHDLInterface(SimulatorInterface, ViewerMixin): # pylint: disable=too-many-instance-attributes
3030
"""
3131
Interface for GHDL simulator
3232
"""
@@ -100,7 +100,7 @@ def __init__( # pylint: disable=too-many-arguments
100100
backend="llvm",
101101
):
102102
SimulatorInterface.__init__(self, output_path, gui)
103-
OSSMixin.__init__(
103+
ViewerMixin.__init__(
104104
self,
105105
gui=gui,
106106
viewer=viewer,
@@ -132,7 +132,7 @@ def _get_version_output(cls, prefix):
132132
@classmethod
133133
def _get_help_output(cls, prefix):
134134
"""
135-
Get the output of 'ghdl --version'
135+
Get the output of 'ghdl --help'
136136
"""
137137
return subprocess.check_output([str(Path(prefix) / cls.executable), "--help"]).decode()
138138

@@ -392,11 +392,9 @@ def simulate(self, output_path, test_suite_name, config, elaborate_only): # pyl
392392
status = False
393393

394394
if config.sim_options.get(self.name + ".gtkwave_script.gui", None):
395-
warn_str = (
396-
"%s.gtkwave_script.gui is deprecated and will be removed " % self.name # pylint: disable=C0209
397-
+ "in a future version, use %s.viewer_script.gui instead" % self.name # pylint: disable=C0209
398-
)
399-
LOGGER.warning(warn_str)
395+
LOGGER.warning("%s.gtkwave_script.gui is deprecated and will be removed "
396+
"in a future version, use %s.viewer_script.gui instead",
397+
self.name, self.name)
400398

401399
if self._gui and not elaborate_only:
402400
cmd = [self._get_viewer(config)] + shlex.split(self._viewer_args) + [data_file_name]

vunit/sim_if/nvc.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
from ..ostools import Process
2121
from . import SimulatorInterface, ListOfStringOption, StringOption
2222
from . import run_command
23-
from ._ossmixin import OSSMixin
23+
from ._viewermixin import ViewerMixin
2424
from ..vhdl_standard import VHDL
2525

2626
LOGGER = logging.getLogger(__name__)
2727

2828

29-
class NVCInterface(SimulatorInterface, OSSMixin): # pylint: disable=too-many-instance-attributes
29+
class NVCInterface(SimulatorInterface, ViewerMixin): # pylint: disable=too-many-instance-attributes
3030
"""
3131
Interface for NVC simulator
3232
"""
@@ -80,7 +80,7 @@ def __init__( # pylint: disable=too-many-arguments
8080
if viewer_fmt == "ghw":
8181
LOGGER.warning("NVC does not support ghw, defaulting to fst")
8282
viewer_fmt = None # Defaults to FST later
83-
OSSMixin.__init__(self, gui=gui, viewer=viewer, viewer_fmt=viewer_fmt, viewer_args=viewer_args)
83+
ViewerMixin.__init__(self, gui=gui, viewer=viewer, viewer_fmt=viewer_fmt, viewer_args=viewer_args)
8484

8585
self._prefix = prefix
8686
self._project = None
@@ -305,11 +305,9 @@ def simulate(
305305
status = False
306306

307307
if config.sim_options.get(self.name + ".gtkwave_script.gui", None):
308-
warn_str = (
309-
"%s.gtkwave_script.gui is deprecated and will be removed " % self.name # pylint: disable=C0209
310-
+ "in a future version, use %s.viewer_script.gui instead" % self.name # pylint: disable=C0209
311-
)
312-
LOGGER.warning(warn_str)
308+
LOGGER.warning("%s.gtkwave_script.gui is deprecated and will be removed "
309+
"in a future version, use %s.viewer_script.gui instead",
310+
self.name, self.name)
313311

314312
if self._gui and not elaborate_only:
315313
cmd = [self._get_viewer(config)] + shlex.split(self._viewer_args) + [str(wave_file)]

0 commit comments

Comments
 (0)