用calibre比较两个Layout
有时候需要将两个Layout进行比较,看它们有哪些不一样。
以前在用calibre时,还要写一个command file,特别是layer map需要改变,特别繁琐
干脆就用calibre tcl写了个script,直接比较,一步到位,省去了不少的麻烦。
贴到这里来跟大家共享,嘿嘿,我在这里学到了不少的东西,当然自己也要贴些东西上来呀
#!/bin/sh -f
#The next line starts to use calibre \
exec $MGC_HOME/bin/calibredrv "$0" "$@"
if { $argc != 2 } {
puts stdout "ERROR:USAGE:xor2gds.tcl gds1 gds2"
exit 0
}
set gds1 [layout create [lindex $argv 0]]
set gds2 [layout create [lindex $argv 1]]
if { [file exist xor2gds.cal] } {
file delete xor2gds.cal
}
set layerMap_raw1 [$gds1 layernames]
set layerMap_raw2 [$gds2 layernames]
set topCell1 [$gds1 topcell]
set topCell2 [$gds2 topcell]
exec echo "LAYOUT PATH [lindex $argv 0]" >> xor2gds.cal
exec echo "LAYOUT PRIMARY $topCell1" >> xor2gds.cal
exec echo "LAYOUT SYSTEM GDSII" >> xor2gds.cal
exec echo "LAYOUT PATH2 [lindex $argv 1]" >> xor2gds.cal
exec echo "LAYOUT PRIMARY2 $topCell2" >> xor2gds.cal
exec echo "LAYOUT SYSTEM2 GDSII" >> xor2gds.cal
exec echo "LAYOUT BUMP2 200" >> xor2gds.cal
exec echo "DRC RESULTS DATABASE \"./xor2gds.db\"" >> xor2gds.cal
exec echo "DRC SUMMARY REPORT \"./xor2gds.sum\"" >> xor2gds.cal
foreach {layerNum layerName} $layerMap_raw1 {
exec echo "$layerNum $layerName " >> layerMap_raw
}
foreach {layerNum layerName} $layerMap_raw2 {
exec echo "$layerNum $layerName " >> layerMap_raw
}
set layerMap [exec sort layerMap_raw uniq]
file delete layerMap_raw
set i 1
foreach {layerNum layerName} $layerMap {
set layerNum_new [expr $layerNum + 200]
set layerName_origin L$layerName
append layerName "_new"
set layerName_new L$layerName
exec echo "layer $layerName_origin $layerNum" >> xor2gds.cal
exec echo "layer $layerName_new $layerNum_new" >> xor2gds.cal
exec echo "\
rule$i {
xor $layerName_origin $layerName_new
} " >> xor2gds.cal
incr i
}
#Run DRC
exec calibre -drc -hier xor2gds.cal > xor2gds.log