How can I make Modelsim warn me about 'X' signal?

主宰稳场 提交于 2019-12-04 17:13:14

You can use the when command to carry out a desired action when a condition is met. The find command can extract signals from the design hierarchy. Look at the Modelsim command reference documentation to see all of its options. The examine command is used to determine the length of arrays and scalar type signals. This example will not work on record types.

proc whenx {sig action} {
  when -label $sig "$sig = [string repeat X [string length [examine $sig]]]" $action
}

foreach s [find signals -r /*] {whenx $s "echo \"$s is an X at \$now\""}

This example does not handle arrays which are only partially X's. While you can use array indices in the when expression to test individual bits, it isn't clear how to determine the bounds of an array programmatically in Modelsim tcl.

You can cancel all when conditions with nowhen *.

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