2008年12月25日星期四

tcl在DC中的使用-----part2

1.如何查询当前design的registers占leaf cell的比重呢?
registers数目可以用all_registers来得到,下面为tcl脚本:
set leafcells [get_cells *]
set flops [all_registers]
set cnt_leaf [size_of_collection $leafcells]
set cnt_flops [size_of_collection $flops]
set precentage [expr 100.0 * $cnt_flops / $cnt_leaf]
unset flops

实际上all_registers可以用另一种方法得到:
get_cells * -filter "is_sequential == true",在filter中常用的操作符有 == =~ !~ defined() undefined()。

2 timing path的深入操作上面标出了timing path最常用的七个属性,注意不能用get_object_name来对某条timing path在操作,因为timing path没有name的属性。只有具有name属性的单个对象的集合才可以使用get_object_name或者get_attribute XXX full_name。所以get_timing_paths要结合get_attribute使用。另外需要注意的是使用get_attribute得到的属性也有可能是一个集合,糊涂了是把。看看下面的例子:
get_timing_paths有很多的option,基本上和report_timing的option是一样的。因此用起来很方便。

没有评论: