innovus中自动获取Design中memory容量的tcl脚本
发布网友
发布时间:2023-08-16 07:26
我来回答
共1个回答
热心网友
时间:2023-08-24 08:44
主要思想是抓取memory的lib文件然后获取详细信息进行计算
=======================================================
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"