0

I'm using QuestaSim/ModelSim and I would like to automatically rewrite the signal names displayed in the waveform. When my testbench starts, a default command loads all top-level signals into the waveform viewer:

add wave testharness/*

When I rename the added signals, the following commands are created in a waveform save file (*.wdo):

add wave -noupdate -label SerialClock_Wire /iic_controller_tb/testharness/SerialClock_Wire

So a label with a shorter name can be applied to each signal.

I would like to iterate all top-level signals or signals in a given hierarchy and add them to the waveform, while shortening their names (removing the path prefix).

How can I do such iteration and name shortening?

Paebbels
  • 15,573
  • 13
  • 70
  • 139
  • Wouldn't just displaying the signal name help, without the hierarchy. Would `config wave -signalnamewidth 1` work? Check [this](http://stackoverflow.com/questions/11804835/is-there-a-way-to-toggle-leaf-names-in-modelsim-through-the-tcl-api) answer out. If not it's TCL, so you need to able to query the simulation database for a list of signals at a particular node and tinker around with strings. – fpga_magik Nov 29 '16 at 10:55
  • 1
    Try using this (there may be better _TCL_ ways) `set sigs [find signals {-internal} sim:/mytestbench/mytop/myblock/*] foreach a $sigs { # do something with $a }` – fpga_magik Nov 29 '16 at 11:11

1 Answers1

2

In the bottom left corner of the wave window in ModelSim, there is a tiny icon that looks like a seashell.
Clicking it toggles between the full names and the leaf names, which is exactly the functionality you are referring to.

Giulio Caccin
  • 2,962
  • 6
  • 36
  • 57