rioshiina的个人空间 http://blog.eetop.cn/rioshiina [收藏] [复制] [分享] [RSS]

日志

local cell analyse

已有 137 次阅读2019-12-5 18:17

set window [lindex [gui_get_window_ids ] 1]
gui_mouse_tool -start REGION_TOOL -window $window

proc cell_attr {} {
scan [gui_get_region] "{%f %f} {%f %f}" left bottom right top
set totalarea 0
set totreg 0
set totfeed 0
set totbuf 0
set totclk 0
set totdel 0
set logcel [dict create 0 0]
set selectedarea [expr ($right-$left)*($top-$bottom)]
set cmd01 "get_objects_by_location -filter \"is_physical_only == false \" -classes \{cell\} -within \{\{$left $bottom\} \{$right $top\}\}"
set cells [eval $cmd01]
foreach_in_collection cell01 $cells {
    set cellarea [get_attribute [ get_cells $cell01] area]
    set totalarea [expr $totalarea + $cellarea]
    set cell01_ref [get_attribute $cell01 -name ref_name]
    set cell01_ful [get_attribute $cell01 -name full_name]
    set cell01_com [get_attribute $cell01 -name is_combinational]
    if {[regexp {false} $cell01_com]} {
        incr totreg   
    } elseif { [regexp {([A-Z]+[0-9]+_)([A-Z]+[0-9]*_)(CK)} $cell01_ref]} {
        incr totclk
    } elseif {[regexp {BUF} $cell01_ref]} {
        incr totbuf    
    } elseif {[regexp {([A-Z]+[0-9]+_)(DEL)(_[A-Z]+[0-9]*)} $cell01_ref]} {
        incr totdel
    } elseif {[regexp {([A-Z]+[0-9]+_)(.*)(_)} $cell01_ref tot val1 val2 val3]} {
        if {[dict exists $logcel $val2]} {
            dict incr logcel $val2 
        } else {
            dict append logcel $val2 "1"
        }
    
    } else {
    puts "err!"
    puts $cell01_ref
    }
    }

set density [expr $totalarea/$selectedarea]
dict unset logcel 0
dict for {k v} $logcel {puts "$k--$v";}
set res_o [format "total cell area = %f \nselected area = %f \nlocal desity = %f \ntotreg = %d \ntotbuf = %d \ntotclk = %d \ntotdel = %d" $totalarea $selectedarea $density $totreg $totbuf $totclk $totdel ]
puts "$res_o"

}

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

关闭

站长推荐上一条 /4 下一条

小黑屋| 关于我们| 联系我们| 在线咨询 |  EETOP 创芯网 ( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2020-1-27 21:46 , Processed in 0.028217 second(s), 7 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

返回顶部