Is there a way to toggle leaf names in ModelSim through the TCL API?

£可爱£侵袭症+ 提交于 2019-12-05 16:37:33

问题


I am looking for a way to toggle leaf names of the nets in ModelSim view, in GUI mode. In other words, an equivalent of pressing "Toggle leaf names <-> full names" button:

I am aware of the way of adding short names. For example, I've been using code like this:

add wave -group "stimulus" -label "valid" ${sim_module}/aso_src0_valid
add wave -group "stimulus" -label "ready" ${sim_module}/aso_src0_ready
add wave -group "stimulus" -label "data" -radix ascii ${sim_module}/aso_src0_data
add wave -group "stimulus" -label "begin" ${sim_module}/aso_src0_startofpacket
add wave -group "stimulus" -label "end" ${sim_module}/aso_src0_endofpacket
add wave -group "stimulus" -label "error" ${sim_module}/aso_src0_error

However, for a quick simulation script sketch-up when I would like to add all signals for a module that seems like too much to type, and so I just do this:

add wave -group "stimulus" "/aso_src0_*"

And by default it shows full names under the group "stimulus". I could not find a parameter of add function or another function that toggles between leaf and full names. Given how powerful ModelSim is, it is hard to believe it doesn't have this API or other easy way to achieve what I want. So is there a way and what is it?


回答1:


config wave -signalnamewidth 1

From ModelSim Reference Manual, v6.5e:

-signalnamewidth [<value>] 

(optional) Controls the number of hierarchical regions displayed as part of a signal name shown in the pathname pane. Related Tcl variable is PrefWave(SignalNameWidth). Can also be set with the WaveSignalNameWidth variable in the modelsim.ini file.

<value> — Any non-negative integer where the default is 0 (display the full path. For example,1 displays only the leaf path element, 2 displays the last two path elements, and so on.



来源:https://stackoverflow.com/questions/11804835/is-there-a-way-to-toggle-leaf-names-in-modelsim-through-the-tcl-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!