Can any1 help me to point out the error with this to identify a bufferchain? Thanks in advance
proc buffer_chain {} {
set buffer_inv_cells [get_object_name [get_cells -hier -filter "ref_name =~ BUF*" ] ]
foreach cell $buffer_inv_cells {
set bf_temp [list $cell ];
set i 0
while { [llength $bf_temp] > 0 } {
set bf [lindex $bf_temp $i ] ;
incr i ;
if { [sizeof_collection [all_fanout -from ${bf}/Y* -flat -levels 1 -only_cells ] ] > 2 } {
#echo " Buffer/Inv $bf_temp is part of a buffer tree and not a buffer chain " ;
break ;
} else {
if {[sizeof_collection [get_cells[all_fanout -from ${bf}/Y* -flat -levels 1 -only_cells ] -filter "ref_name =~ BUF*" ]]!=0} {
# echo " Found the next stage in the buffer chain " ;
set a [get_object_name [all_fanout -from $bf/Y* -flat -levels 1 -only_cells ] ]
lappend bf_temp [lindex $a [expr [llength $a] -1 ]] ;
} else {
#echo " Found the end of the buffer tree " ;
set b [get_object_name [all_fanout -from $bf/Y* -flat -levels 1 -only_cells ] ]
echo " Buffer Chain starts at $cell and ends at $b] ";
break ;
}
}
}
}
}
buffer_chain