-
Notifications
You must be signed in to change notification settings - Fork 270
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
Feature Request: Add arg parse options for adding waveforms to viewer #455
Comments
I think that this would be a very interesting feature. It is quite a pain to generate the |
For GHDL/GTKWave specifically, the script I am working on above is simply grabbing signals from the file that has already been created, so I don't think this would be an issue since there is no call to entity names/signals specifically. For modelsim, this is how I have approached it in the past, although I haven't yet gone through the exercise of figuring out how this would work for any name in the hierarchy path. I'm sure there is a way, I just don't know what that way is.
|
EDIT: The following is the final script I have come up with for GTKWave. This will add all signals to a group with their path name as the name for the group. I have also added the
|
I use a tcl file for GTKWave also, but I add the signals manually. Nice idea to put some automation to this. But I always would use this with max_depth set to 1. Simply because I don't want all signals in my waveform. I never had a use case to add all of them, even not at work with Modelsim/Questa. For many designs with a lot of signals, I would get a lot of signals in the waveform viewer that I don't need - most of them would even deviate me from the important ones. |
@tmeissner I see your point, however, I somewhat disagree with that notion. Before I get to the solution to your problem, let me preface this with my argument against that idea for ModelSim/Questa/Aldec. In these simulators, when you are bug hunting and forget to add a waveform, you have to restart the simulation waveform after adding a new signal which I find to be a huge time sink when you know a bug isn't cropping up until 2ms into simulation. I've found this to be exponentially worse when trying to debug huge designs (or with things like PCIe/10/20/40G ethernet etc.) where you absolutely have to include a lot of your design because unit testing didn't catch something you're having issues tracing. If I know something is broken inside a specific component, but I don't know exactly where, it is nice having all the waveforms present to sift through. I do see your point, but I find this type of thing tremendously useful when I'm jumping into a legacy simulation that takes literally ages to run :/ I have added a flag for |
I also understand your point. I will give a try. I assume, that the script doesn’t rely on vunit? Because I don’t have a running vunit project at home. I would try it with a plain vhdl testbench of a project of my own. |
You are correct, this does not rely on VUnit. This is just passing commands onto GTKWave to basically perform the following:
The only limitation is my script expects the signal path name in each facility to be deliminated by a |
@GlenNicholls I've tested the tcl script with a test design of mine. It works, however, every vector I get numerous times in the wave window. I've attached a screenshot which shows the behaviour: |
@GlenNicholls I've made a (very ugly & hackish) change to your script that vectors are only added once instead of multiple times. Maybe (definitely) there is a better way to do that, possibly GTKwave has an API function which can be used to find out of a signal is a vector or something like that. The change looks like this. Instead of adding all paths: # if we found match, append path to group key
if {$add_wave > 0} {
# create dict with key:<group_name> and value:<path>
set key $group_name
set value $path
# append element to group key
dict lappend dictGroup $key $value
} I filter out the equal ones by cutting the last vector notation ([]) and comparing the resulting path to the last processed one: # if we found match, append path to group key
if {$add_wave > 0} {
set elements [ split $path \[ ]
if { [ llength $elements ] > 1 } {
set var [ lreplace $elements end end ]
set path [ join $var \[ ]
}
if {$old_path ne $path} {
# create dict with key:<group_name> and value:<path>
set key $group_name
set value $path
set old_path $path
# append element to group key
dict lappend dictGroup $key $value
}
} I know that it's ugly and I assume that that don't works for every case. But for my design it works as desired. I only get the signals I want in my wave viewer: |
Interesting, I did not realize GTK would add a duplicate, I will revisit this soon. I think the API has a setting to remove all duplicate waveforms, but I'm not positive. Either way, this looks like a reasonable fix to me. There could probably be fancier checking on the signal names as this might break when adding signals to an entity that was generated with a |
I have an update for ModelSim that I will be testing and modifying to somewhat replicate the functionality above. I found this which is basically what I did for GTK. |
If you're curious, I have created a script for ModelSim. This one does not support adding by entity/path names yet as I have a few ideas for keeping this script in a single location. My plan is to eventually pass these procedures information from each test to add everything to the waveform viewer, but there is some functionality I would like to see in VUnit before I work on that.
|
As commented in #459, I tried the scripts in this issue. The version in #455 (comment) does replicate all the std_logic_vector signals as many times as the number of bits. Unfortunately, the fix by @tmeissner, complained about Apart from that, it seems that a single level of hierarchy is created. I think it'd be useful to make this 'flat' visualization optional, so it's also possible to show the hierarchy in the waveform. @GlenNicholls, do you have these scripts (for GtkWave, ModelSim/QuestaSim, etc.) available at any public repo? |
Hello, I hope the following will help you. The same grouping problem occurs to me with gtkwave and I solved in my python module (wavedisp) to generate wave file descriptions for gtkwave/modelsim/rivierapro https://github.com/cclienti/wavedisp The major issue that I figured out to group signal was the missing hierarchy of names after added them in gtkwave. But there is a very simple solution that does not require any development. You can add at the beginning of the tcl script loaded by gtkwave a line that shows the complete hierarchy in the added signal panel. After that, the grouping command will require the full hierarchy name in order to group signals. gtkwave::/Edit/Set_Trace_Max_Hier 0 At the you can restore the value gtkwave::/Edit/Set_Trace_Max_Hier 1 A small example from one of my design that you can invoke with the '-T' option of gtkwave: # Wavedisp generated gtkwave file
gtkwave::/Edit/Set_Trace_Max_Hier 0
gtkwave::addSignalsFromList [list {dclkfifolut_tb.DUT.read_ptr_gray.bin}]
gtkwave::addSignalsFromList [list {dclkfifolut_tb.DUT.read_ptr_gray.gray}]
gtkwave::/Edit/UnHighlight_All
gtkwave::/Edit/Highlight_Regexp {^dclkfifolut_tb.DUT.read_ptr_gray.bin}
gtkwave::/Edit/Highlight_Regexp {^dclkfifolut_tb.DUT.read_ptr_gray.gray}
gtkwave::/Edit/Create_Group {read_ptr_gray}
gtkwave::/Edit/UnHighlight_All
gtkwave::/Edit/Set_Trace_Max_Hier 1 |
So I am working on polishing the GTK interface and am running into problems with records. Do you know any methods to recognize when a signal is a record? My assumption for creating a group name is it is the common path before the final value
Here, My script recognizes that Ideally, I would see the following groups I create:
But instead, I see
|
This is in relation to #665 and also #455 After debugging an IP core from a vendor, I found that with cores that have massive hierarchy trees (With tens or hundreds of files), it is easier to navigate the GUI when adding signals to the waveform viewer replicates the design hierarchy. The PR noted above currently puts the path of the entity in the group name, but this became difficult to navigate. Instead, it would be better if nested groups were created so it would be easier to navigate and cross-reference signals: For each entity in the hierarchy, it is much cleaner if it is added as a sub-group to the parent group. I began the notation of adding all signals to the In short, when adding all waves by depth, the wave viewer should mock the hierarchy list. This will be quite a bit of work and debugging I think since there will need to be lists/dictionaries to keep track of the entire hierarchy. In ModelSim and Aldec tools, this is easier since it is possible to add waves with the |
I think it would be a nice feature to allow the user to use a flag to display all signals at a user-specified hierarchy depth when they pass the
-g
flag to open the GUI. I get really annoyed having to manually add waveforms when I don't yet know what I'm looking for, so I end up adding all of them. GTKWave offers groups that can be named, ModelSim offers groups as well that can be named, and Active-HDL/Riviera-Pro offer virtual signal busses (I believe withadd -virtual "name_for_virtual" path/to/desired/entity/*
).Here is rough-draft of what i am referring to for GTK:
This will go through and add all waveforms to the viewer that are at
depth
, so I am working on figuring out how to name groups,gtkwave::/Edit/Create_Group
, from the command line for the following. It would be nice to tell VUnit that I want to see all signals at and before hierarchy depth of 3 and it would do the following in the waveform viewer:Currently, if this feature is of interest, I can pass along all the commands to add signals to groups (except GTKWave since I haven't yet figured out how to name a group from the command line) or virtuals for ModelSim and Active-HDL since I have those already. I just haven't yet made my scripts generic enough like what I have attempted to do above for GTK.
For GTK I know I can execute my .tcl with the
-g --gtkwave-args=-Sscript.tcl
, but this is tedious doing this every time and also means I either need to hardcode a path to my script, or have a copy with all of my run.py scripts.EDIT: I just figured out that if you do
gtkwave::/Edit/Create_Group "some name"
to name a group/comment from the command line.The text was updated successfully, but these errors were encountered: