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

日志

PT_LoL_count

已有 20 次阅读2019-9-7 19:07

#redrict parray
proc prtarray {a_ {pattern *}} {
    set user_name [sh whoami]
    global clk_group_
    set init_out "rm ~$user_name/Documents/LoLcount_$clk_group_.tcl"
    sh eval $init_out
    set f [open "~$user_name/Documents/LoLcount_$clk_group_.tcl" a]
    upvar 1 $a_ array
    if {![array exists array]} {
        return -code error "\"$a_\" isn't an array"
    }
    set maxl 0
    set names [lsort [array names array $pattern]]
    foreach name $names {
        if {[string length $name] > $maxl} {
            set maxl [string length $name]
        }
    }
    set maxl [expr {$maxl + [string length $a_] + 2}]
    foreach name $names {
        set nameString [format "%s( %s )" $a_ $name]
        puts $f [format "%-*s = %s" $maxl $nameString $array($name)]
    }
    close $f
}

#main
proc lolcount {args} {
    parse_proc_arguments -args ${args} options
        set clk_group_ $options(-group)

array unset arr
set aa [list]
set path1  [get_timing_paths -max_paths 100 -group $clk_group_ -slack_lesser_than 99999]
foreach_in_collection path $path1 {
    set n [sizeof_collection [get_attribute [get_attribute $path points ] object]]
    set n [expr ($n -1)/2]
    lappend aa $n
    }
foreach b $aa {
    if { $b in [array names arr]} {
        set arr($b)  [expr [lindex [array get arr $b ] 1] +1]
    } else {
        set arr($b) 1
    }
}
#parray arr
#print
array unset ssz
set count_st 5
set i_count $count_st
set count_end 40
while {$i_count <= $count_end } {
    set ssz($i_count) 0
    incr i_count
    }
set z [lsort [array names arr]]
set x [llength z]
set j 0
while {$j < $x} {
    foreach zz $z {
    set i_count $zz
    set step_count $count_end
    while {$i_count <= $step_count} {
        set ssz($i_count) [expr [lindex [array get ssz $i_count ] 1] + [lindex [array get arr $zz ] 1]]
        incr i_count
    }
    incr j
    }
}
parray ssz
#output
prtarray ssz
}

define_proc_attributes lolcount \
-info "\n print LoL for specific clock group, input value is CLK group name; if you want to adjust count step or range, download this script to local and help yourself : )\n array index for LoL less than this value and corresponding element for LoL path counts\n " \
-define_args {
    { -group          "clock group you want to count LoL"     "" string {required}}
}

#统计clk group的lol;
#parray 是tcl proc, 默认stdout是输出到屏幕的; 这里重写一下 重定向输出到文件; 顺便改一下输出格式 方便后面交给awk处理。

评论 (0 个评论)

facelist

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

关闭

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

关于我们|联系我们|ET创芯网 ( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2019-9-16 09:04 , Processed in 0.026496 second(s), 9 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

返回顶部