Search code examples
foreachtclmodelsimwaveformquestasim

How can I rewrite all signal names to a shorter name?


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?


Solution

  • 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.