foreach par [get_object_name [get_cells * -filter "is_hierarchical==true"]] {
foreach_in_collection p [filter [get_pins $par/*] "@direction == in && direction != internal"] {
set net [get_object_name $p]
if {[get_attribute -quiet [get_nets -quiet $net] object_class] == "net"} {
set clock [get_attribute [ filter [all_connected [get_nets $net] -leaf] "@direction == out" ] clocks]
} else {
set clock [get_attribute [get_pins $p] clocks]
}
if {$clock == "" } {
} else {
set port_name $net
echo $par,[get_object_name $clock],$port_name }}}