proc j_get_driver_input { j_args } {
if { [get_pins -quiet $j_args ] != "" } {
if { [get_nets -of_objects $j_args ] != "" } {
set j_net [get_nets -of_objects $j_args ]
set j_driver_pin [get_pins -of_objects $j_net -filter "direction == out" ]
if { [sizeof_coll $j_driver_pin ] == 1 } {
set j_driver_cell [get_cells -of_objects $j_driver_pin ]
set j_driver_cell_ref [get_attr $j_driver_cell ref_name ]
if { [regexp BUF $j_driver_cell_ref ] || [regexp INV $j_driver_cell_ref ] } {
return [get_object_name [get_pins -of_objects $j_driver_cell -filter "direction == in && port_type == signal" ] ]
}
}
}
}
}
change_selection
foreach_in_collection j_obj [get_pins -of_objects [get_cells xxx/xxx/u_part0 ]] {
set j_pin_name [get_attr $j_obj full_name]
set j_direction [get_attr $j_obj direction ]
set j_port_type [get_attr $j_obj port_type ]
if { $j_port_type == "signal" } {
if { $j_direction == "in" } {
if { [j_get_driver_input $j_obj ] != "" } {
set j_driver_input [j_get_driver_input $j_obj ]
set j_driver_cell [get_cells -of_objects $j_driver_input ]
set j_driver_cell_name [get_attr $j_driver_cell full_name ]
set j_driver_cell_ref [get_attr $j_driver_cell ref_name ]
set j_safe 0
set j_head_flag 0
while { [regexp BUF $j_driver_cell_ref ] || [regexp INV $j_driver_cell_ref ] && $j_safe < 50 } {
incr j_safe
set j_driver_cell [get_cells -of_objects $j_driver_input ]
set j_driver_cell_name [get_attr $j_driver_cell full_name ]
set j_driver_cell_ref [get_attr $j_driver_cell ref_name ]
puts "$j_driver_cell_name $j_driver_cell_ref"
change_selection -add [get_cells $j_driver_cell_name ]
if { [j_get_driver_input $j_driver_input ] == "" } {
break
} else {
set j_driver_input [j_get_driver_input $j_driver_input ]
}
}
}
}
}
}
|