Feature request: Tcl commands to restart/reload simulation and waveforms in GTKWave
When using ModelSim, commands (such as vunit_compile, vunit_run and vunit_restart) are provided, which can be used to easily restart the simulation, without having to close ModelSim and re-run VUnit.
When using GHDL or NVC with GTKWave, there are no such commands. The closest I was able to get was to re-run VUnit with the --gtkwave-fmt option (which only exists for GHDL, not for NVC) in order to re-run the simulation and generate a new wave file without starting a new GTKWave instance, and then click the reload button in GTKWave. This is not nearly as smooth as the ModelSim experience, since you need to open a separate terminal, remember to use the --gtkwave-fmt option and click a button in GTKWave. But the end result is still very nice, GTKWave remembers which signals you had added and just reloads the waveforms.
So that got me thinking: could the vunit_restart etc. Tcl commands be added to GTKWave, to make this process as easy as it is in ModelSim? Obviously ModelSim is quite different from GTKWave, so I don't know if it makes sense to add exactly the same Tcl commands. But the main thing I would like to see is something similar to the vunit_restart command in ModelSim.
But from where do we execute the commands? ModelSim has the Transcript view, but GTKWave doesn't have this, right? Well, GTKWave has something analogous, which is the --wish flag:
-W,--wish
Enables Tcl command line on stdio. All script commands can be
typed in on stdin.
See also: https://gtkwave.sourceforge.net/gtkwave.pdf
If this flag is added to GTKWave by VUnit here (for GHDL):
https://github.com/VUnit/vunit/blob/e63cf90bd59a2a17679ddb11db5164535f266257/vunit/sim_if/ghdl.py#L361-L369
then you are able to run GTKWave Tcl commands in the same terminal used to run VUnit with the --gui flag.
So from there, you would be able to run the vunit_restart command, which should do something like:
- Recompile the VHDL files.
- Re-run the simulation using GHDL/NVC, and generate new wave files.
- Reload the wave file in GTKWave.
- This could be implemented using the
gtkwave::reLoadFileTcl command, see https://gtkwave.sourceforge.net/gtkwave.pdf
- This could be implemented using the