Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions vunit/sim_if/modelsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,22 @@ def _create_run_function():
}
"""

@staticmethod
def _create_vunit_menu():
"""
Create a menu in the GUI to call the VUnit commands.
"""
tcl = 'add_menu "" VUnit\n'
tcl += 'add_menuitem "" VUnit "Run" vunit_run\n'
tcl += 'add_menuitem "" VUnit "Restart" vunit_restart\n'
tcl += 'add_menuitem "" VUnit "Compile" vunit_compile\n'
tcl += 'add_menuitem "" VUnit "Load Design" vunit_load\n'
tcl += 'add_menuitem "" VUnit "Run User Init File" vunit_user_init\n'
tcl += 'add_separator "" VUnit\n'
tcl += 'add_menuitem "" VUnit "Help" vunit_help\n'

return tcl

def _vopt_extra_args(self, config):
"""
Determine vopt_extra_args
Expand Down
8 changes: 8 additions & 0 deletions vunit/sim_if/vsim_simulator_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,19 @@ def _source_tcl_file(file_name, config, message):
)
return tcl

@staticmethod
def _create_vunit_menu():
"""
Create a menu in the GUI to call the VUnit commands.
"""
return ""

def _create_gui_script(self, common_file_name, config):
"""
Create the user facing script which loads common functions and prints a help message
"""
tcl = f'source "{fix_path(common_file_name)!s}"\n'
tcl += self._create_vunit_menu()
tcl += self._create_user_init_function(config)
tcl += "if {![vunit_load]} {\n"
tcl += " vunit_user_init\n"
Expand Down
Loading