Skip to content

Commit 9fa4f37

Browse files
committed
Support Visualizer in Questa 2024.2.
1 parent ce51561 commit 9fa4f37

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

vunit/sim_if/modelsim.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,14 @@ def _get_vsim_flags(self, config, output_path, optimize_design):
685685

686686
return vsim_flags
687687

688+
def _get_gui_option(self):
689+
"""
690+
Return the option used to start in GUI mode.
691+
692+
This is required to support Questa Visualizer.
693+
"""
694+
return "-visualizer" if self._debugger == "visualizer" else "-gui"
695+
688696
def _get_load_flags(self, config, output_path, optimize_design):
689697
"""
690698
Return extra flags needed for the first vsim call in GUI mode when early load is enabled.
@@ -712,7 +720,6 @@ def _get_load_flags(self, config, output_path, optimize_design):
712720
"-wlf",
713721
f"{fix_path(str(Path(output_path) / 'vsim.wlf'))}",
714722
pli_str,
715-
"-visualizer",
716723
"-f",
717724
f"{fix_path(str(generics_file_name))}",
718725
]

vunit/sim_if/vsim_simulator_mixin.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,15 +314,15 @@ def _create_gui_script(self, common_file_name, config):
314314

315315
return tcl
316316

317-
def _run_batch_file(self, batch_file_name, gui=False, extra_args=None):
317+
def _run_batch_file(self, batch_file_name, gui=False, gui_option="-gui", extra_args=None):
318318
"""
319319
Run a test bench in batch by invoking a new vsim process from the command line
320320
"""
321321

322322
try:
323323
args = [
324324
str(Path(self._prefix) / "vsim"),
325-
"-gui" if gui else "-c",
325+
gui_option if gui else "-c",
326326
"-l",
327327
str(Path(batch_file_name).parent / "transcript"),
328328
"-do",
@@ -386,6 +386,14 @@ def _get_load_flags(self, config, output_path, optimize_design): # pylint: disa
386386
"""
387387
return []
388388

389+
def _get_gui_option(self):
390+
"""
391+
Return the option used to start in GUI mode.
392+
393+
This is required to support Questa Visualizer.
394+
"""
395+
return "-gui"
396+
389397
def simulate(self, output_path, test_suite_name, config, elaborate_only):
390398
"""
391399
Run a test bench
@@ -422,6 +430,7 @@ def simulate(self, output_path, test_suite_name, config, elaborate_only):
422430
return self._run_batch_file(
423431
str(gui_file_name),
424432
gui=True,
433+
gui_option=self._get_gui_option(),
425434
extra_args=self._get_load_flags(config, output_path, optimize_design) if early_load else None,
426435
)
427436

0 commit comments

Comments
 (0)