Skip to content

Commit a853559

Browse files
committed
Added VUnit menu in Questa/Modelsim GUI.
1 parent 1197afd commit a853559

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

vunit/sim_if/modelsim.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,22 @@ def _create_run_function():
787787
}
788788
"""
789789

790+
@staticmethod
791+
def _create_vunit_menu():
792+
"""
793+
Create a menu in the GUI to call the VUnit commands.
794+
"""
795+
tcl = 'add_menu "" VUnit\n'
796+
tcl += 'add_menuitem "" VUnit "Run" vunit_run\n'
797+
tcl += 'add_menuitem "" VUnit "Restart" vunit_restart\n'
798+
tcl += 'add_menuitem "" VUnit "Compile" vunit_compile\n'
799+
tcl += 'add_menuitem "" VUnit "Load Design" vunit_load\n'
800+
tcl += 'add_menuitem "" VUnit "Run User Init File" vunit_user_init\n'
801+
tcl += 'add_separator "" VUnit\n'
802+
tcl += 'add_menuitem "" VUnit "Help" vunit_help\n'
803+
804+
return tcl
805+
790806
def _vopt_extra_args(self, config):
791807
"""
792808
Determine vopt_extra_args

vunit/sim_if/vsim_simulator_mixin.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,19 @@ def _source_tcl_file(file_name, config, message):
301301
)
302302
return tcl
303303

304+
@staticmethod
305+
def _create_vunit_menu():
306+
"""
307+
Create a menu in the GUI to call the VUnit commands.
308+
"""
309+
return ""
310+
304311
def _create_gui_script(self, common_file_name, config):
305312
"""
306313
Create the user facing script which loads common functions and prints a help message
307314
"""
308315
tcl = f'source "{fix_path(common_file_name)!s}"\n'
316+
tcl += self._create_vunit_menu()
309317
tcl += self._create_user_init_function(config)
310318
tcl += "if {![vunit_load]} {\n"
311319
tcl += " vunit_user_init\n"

0 commit comments

Comments
 (0)