Skip to content

Commit

Permalink
Support Visualizer in Questa 2024.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsAsplund committed Jan 30, 2025
1 parent ce51561 commit 9fa4f37
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
9 changes: 8 additions & 1 deletion vunit/sim_if/modelsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,14 @@ def _get_vsim_flags(self, config, output_path, optimize_design):

return vsim_flags

def _get_gui_option(self):
"""
Return the option used to start in GUI mode.
This is required to support Questa Visualizer.
"""
return "-visualizer" if self._debugger == "visualizer" else "-gui"

def _get_load_flags(self, config, output_path, optimize_design):
"""
Return extra flags needed for the first vsim call in GUI mode when early load is enabled.
Expand Down Expand Up @@ -712,7 +720,6 @@ def _get_load_flags(self, config, output_path, optimize_design):
"-wlf",
f"{fix_path(str(Path(output_path) / 'vsim.wlf'))}",
pli_str,
"-visualizer",
"-f",
f"{fix_path(str(generics_file_name))}",
]
Expand Down
13 changes: 11 additions & 2 deletions vunit/sim_if/vsim_simulator_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,15 +314,15 @@ def _create_gui_script(self, common_file_name, config):

return tcl

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

try:
args = [
str(Path(self._prefix) / "vsim"),
"-gui" if gui else "-c",
gui_option if gui else "-c",
"-l",
str(Path(batch_file_name).parent / "transcript"),
"-do",
Expand Down Expand Up @@ -386,6 +386,14 @@ def _get_load_flags(self, config, output_path, optimize_design): # pylint: disa
"""
return []

def _get_gui_option(self):
"""
Return the option used to start in GUI mode.
This is required to support Questa Visualizer.
"""
return "-gui"

def simulate(self, output_path, test_suite_name, config, elaborate_only):
"""
Run a test bench
Expand Down Expand Up @@ -422,6 +430,7 @@ def simulate(self, output_path, test_suite_name, config, elaborate_only):
return self._run_batch_file(
str(gui_file_name),
gui=True,
gui_option=self._get_gui_option(),
extra_args=self._get_load_flags(config, output_path, optimize_design) if early_load else None,
)

Expand Down

0 comments on commit 9fa4f37

Please sign in to comment.