innovus中自動(dòng)獲取Design中memory容量的tcl腳本

主要思想是抓取memory的lib文件然后獲取詳細(xì)信息進(jìn)行計(jì)算

=======================================================

set MemAll [get_property [get_cells -hierarchical -filter {is_memory_cell == true} ] ref_lib_cell_name]

set MemType [lsort -u $MemAll]

#puts $MemType

set byte 8

set AllMemcapB 0

set AllMemcapK 0

set AllMemcapM 0

set address_width_format "? ? ? address_width : "

set word_width_format "? ? ? word_width : "

puts "=====================Memory Library Infomation Summary=========================="

puts "MemoryCellName? MemoryCellNumber? LibFilePath:"

foreach MemType_n $MemType {

set Memnum [llength [dbGet top.insts.cell.name $MemType_n]]

set libPath [lindex [get_property [get_lib -of_objects [get_lib_cell $MemType_n]] source_file_name] 0]

puts "$MemType_n? $Memnum? $libPath"

set lib_info [open $libPath r]

while {[gets $lib_info line] >=0} {

if {[string match $address_width_format* $line]} {

set AddressWidth [string trimright [string trimleft $line $address_width_format] ";"]

#puts $AddressWidth

}

if {[string match $word_width_format* $line]} {

set WordWidth [string trimright [string trimleft $line $word_width_format] ";"]

#puts $WordWidth

}

}

close $lib_info

set MemcapB [expr ((pow(2,$AddressWidth))*$WordWidth*$Memnum)/$byte]

set MemcapK [expr $MemcapB/1024]

set MemcapM [expr $MemcapK/1024]

set AllMemcapB [expr $MemcapB + $AllMemcapB]

set AllMemcapK [expr $MemcapK + $AllMemcapK]

set AllMemcapM [expr $MemcapM + $AllMemcapM]

#puts "$AllMemcapB $AllMemcapK $AllMemcapM"

}

puts "===============================Summary End======================================"

puts "All of Memories capacitances are $AllMemcapB Byte ;$AllMemcapK KB ;$AllMemcapM MB .\n"

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容