Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated ghdl_interface.py per #458 #459

Merged
merged 4 commits into from
Mar 23, 2019
Merged

Updated ghdl_interface.py per #458 #459

merged 4 commits into from
Mar 23, 2019

Conversation

GlenNicholls
Copy link
Contributor

This update allows a TCL script to be passed to GTKWave when the -g flag is passed if the environment has the set_sim_option('ghdl.init_file.gui', '<fileName>.tcl') set. The limitation is that only a single file can be passed, however <fileName>.tcl can source other TCL scripts if desired.

@GlenNicholls
Copy link
Contributor Author

Another thing to note is that ghdl.init_file.gui might be better suited as gtkwave.init_file.gui to avoid confusion, but I left it using the interface name for simplicity.

@kraigher
Copy link
Collaborator

As you mentioned it would be good if the name conveyed that gtkwave was involved. Maybe calling the sim_option ghdl.gtkwave_script would be better.

Also the sim option should be mentioned in the documentation. The source for the documentation is within ui.py where there is a list of sim options in a docstring. Just adding the new option there with a small description is enough.

…th changing sim option to be more obvious about how GTK is involved
vunit/ui.py Outdated
``ghdl.gtkwave_script.gui``
A user defined TCL-file that is sourced after the design has been loaded in the GUI.
For example this can be used to configure the waveform viewer.
During script evaluation the ``vunit_tb_path`` variable is defined
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see how vunit_tb_path tcl variable is available so this documentation is inaccurate. Maybe copy paste error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, sorry about that

Suggested change
During script evaluation the ``vunit_tb_path`` variable is defined

@umarcor
Copy link
Member

umarcor commented Jun 25, 2019

I tried adding vu.set_sim_option('ghdl.gtkwave_script.gui', 'addWave.tcl') to my run.py, where addWave.tcl is #455 (comment). It fails with:

GTKWave Analyzer v3.3.101 (w)1999-2019 BSI

[0] start time.
[1400000000] end time.
GTKWAVE | Executing Tcl script '"/src/addWave.tcl"'
GTKWAVE | couldn't read file ""/src/addWave.tcl"": no such file or directory
WM Destroy

However, if I replace https://github.com/VUnit/vunit/blob/master/vunit/ghdl_interface.py#L276 with cmd += ["--script", "{}".format(abspath(init_file))], it works as expected.

@GlenNicholls, might those additional double quotes be platform-dependent?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants