From 71339f620d777343e488681f5c9069b7a7d2860f Mon Sep 17 00:00:00 2001 From: Kim Taylor Date: Fri, 12 Jul 2024 15:34:00 +1000 Subject: [PATCH] Add flag to generate FST file from NVC. --- vunit/sim_if/nvc.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/vunit/sim_if/nvc.py b/vunit/sim_if/nvc.py index 8f64ecae3..843ae9991 100644 --- a/vunit/sim_if/nvc.py +++ b/vunit/sim_if/nvc.py @@ -47,6 +47,19 @@ class NVCInterface(SimulatorInterface): # pylint: disable=too-many-instance-att StringOption("nvc.gtkwave_script.gui"), ] + @staticmethod + def add_arguments(parser): + """ + Add command line arguments + """ + group = parser.add_argument_group("nvc", description="NVC specific flags") + group.add_argument( + "--nvc-fst", + action="store_true", + default=False, + help=("Generate wave file in FST format."), + ) + @classmethod def from_args(cls, args, output_path, **kwargs): """ @@ -58,6 +71,7 @@ def from_args(cls, args, output_path, **kwargs): prefix=prefix, gui=args.gui, num_threads=args.num_threads, + nvc_fst=args.nvc_fst, ) @classmethod @@ -73,6 +87,7 @@ def __init__( # pylint: disable=too-many-arguments prefix, num_threads, gui=False, + nvc_fst=False, gtkwave_args="", ): SimulatorInterface.__init__(self, output_path, gui) @@ -84,6 +99,7 @@ def __init__( # pylint: disable=too-many-arguments self._gui = gui self._gtkwave_args = gtkwave_args + self._nvc_fst = nvc_fst self._vhdl_standard = None self._coverage_test_dirs = set() @@ -251,7 +267,7 @@ def simulate(self, output_path, test_suite_name, config, elaborate_only): # pyl if not script_path.exists(): makedirs(script_path) - if self._gui: + if self._gui or self._nvc_fst: wave_file = script_path / (f"{config.entity_name}.fst") if wave_file.exists(): remove(wave_file)