当我们需要做congestion分析时,可能需要在device视图中标注模块的位置。如下图所示一步步地操作。
可是当我们的dcp文件非常大时,每点一下可能都会卡顿很长时间。如果又需要标注很多模块,那么一个个地点击就会很费时费力。
这时,我们可以考虑用tcl脚本来实现,记录和分享下我所使用的模块高亮脚本。这个脚本里的参数值1-20对应上图中的Color 1-20。
#source ../../../../../highlight_module.tcl
################## use the tcl as follow #####################################################
# highlight_module part/ufs3_db_mphy_wrapper 20(Valid values are integers from 1 to 20)
# highlight_module part/ufs3_db_mphy_wrapper 0(清除高亮)
proc highlight_module {module_name {color_index 2}} {
# 启动 GUI(如果是非 GUI 模式不会报错)
catch {start_gui}
# 构造正则匹配路径
set pattern "${module_name}/*"
# 获取模块本体及其下所有 leaf cells
set leaf_cells [get_cells -quiet -hier -filter "NAME == \"$module_name\" || (IS_PRIMITIVE && NAME =~ \"$pattern\")"]
if {[llength $leaf_cells] == 0} {
puts "No matching cells found under module: $module_name"
return
}
if {$color_index == 0} {
# 清除高亮
catch {unhighlight_objects $leaf_cells}
puts "Unhighlighted [llength $leaf_cells] cells under module: $module_name."
} else {
# 先清除再高亮
catch {unhighlight_objects $leaf_cells}
highlight_objects -color_index $color_index $leaf_cells
puts "Highlighted [llength $leaf_cells] cells under module: $module_name with color index $color_index."
}
}
如果想清除所有模块的高亮显示,可以在Tcl Console窗口中输入如下命令:
unhighlight_objects [get_cells -hierarchical]