HDLUtils / hdlregression

MIT License
15 stars 5 forks source link

Fix issue with vsim command in run.do file causing Modelsim to always run in GUI mode #7

Closed svnesbo closed 1 year ago

svnesbo commented 1 year ago

Issue: When specifying set_simulator(simulator=options.simulator, com_options=default_directives, path=path), if path is set to something else than None then modelsim will launch in gui mode even though the -g parameter is not set. But note that although it launches the GUI, it is running the run.do file, not the gui.do file. So the HDLregression help is not printed, and you don’t have the option of typing qc in Modelsim to "quit completely" and terminate the regression.

The reason seems to be that when running _get_simulator_call for modelsim, then we get the exe with vsim_exec = self._get_simulator_executable('vsim'), which when the path is set will include the path. This seems to make modelsim think it is an external program to be run instead of an internal command. Since the vsim command is then passed without the -c option it will start in GUI.

Fix: vsim_exec should not be set to the full path of Modelsim when it is written to the run.do file, because vsim,vcom, vmap etc. are commands that are already recognized by Modelsim in a do file. This PR simply replaces the vsim executable + path with just the vsim command.