[i=s] 本帖最后由 走来走去 于 2020-6-25 14:30 编辑 [/i]
proc j_create_signal_ports { args_port args_pin args_direction } {
if { [get_ports -quiet -of [get_flat_nets -of $args_pin ] ] == "" } {
create_port -port_type signal $args_port
if { $args_direction == "OUT" } { connect_pins -driver [get_pins $args_pin ] [get_ports $args_port ] }
if { $args_direction == "IN" } { connect_pins -driver [get_ports $args_port ] [get_pins $args_pin ] }
} elseif { [get_attr [get_ports -quiet -of [get_flat_nets -of $args_pin ] ] name ] != $args_port } {
set_attribute -objects [get_ports -quiet -of [get_flat_nets -of $args_pin ] ] -name name -value $args_port
}
set j_pin_bbox [get_attr [get_pins $args_pin ] bbox ]
set j_pin_center_x [expr ( [lindex [lindex $j_pin_bbox 0 ] 0 ] + [lindex [lindex $j_pin_bbox 1 ] 0 ] )/2 ]
set j_pin_center_y [expr ( [lindex [lindex $j_pin_bbox 0 ] 1 ] + [lindex [lindex $j_pin_bbox 1 ] 1 ] )/2 ]
set j_net_name [get_attr [get_nets -top_net_of_hierarchical_group -segments -of [get_pins $args_pin ] ] name ]
set j_pin_center_x_m1 [expr $j_pin_center_x - 1 ]
set j_pin_center_x_p1 [expr $j_pin_center_x + 1 ]
set j_pin_center_y_m1 [expr $j_pin_center_y - 1 ]
set j_pin_center_y_p1 [expr $j_pin_center_y + 1 ]
set j_bump_cell [ get_cells -hier \
-intersect [list [list $j_pin_center_x_m1 $j_pin_center_y_m1 ] [list $j_pin_center_x_p1 $j_pin_center_y_p1 ] ] \
-filter "ref_name =~ PAD_ANA*" ]
if { $args_direction == "OUT" } { connect_pins -driver [get_pins $args_pin ] [get_pins -of $j_bump_cell ] }
if { $args_direction == "IN" } { connect_pins -driver [get_ports $args_port ] [get_pins -of $j_bump_cell ] }
set j_bump_orient [get_attr $j_bump_cell orientation ]
set j_bump_bbox [get_attr $j_bump_cell bbox ]
set j_bump_center_x [expr ( [lindex [lindex $j_bump_bbox 0 ] 0 ] + [lindex [lindex $j_bump_bbox 1 ] 0 ] )/2 ]
set j_bump_center_y [expr ( [lindex [lindex $j_bump_bbox 0 ] 1 ] + [lindex [lindex $j_bump_bbox 1 ] 1 ] )/2 ]
if { $j_bump_orient == "R0" } {
puts "$args_port $j_bump_center_x [expr $j_bump_center_y - 25.0625 ]"
create_terminal -of [create_shape -net $j_net_name -shape_type rect -layer LB -boundary [list [list [expr $j_bump_center_x - 1 ] [expr $j_bump_center_y - 26.0625 ] ] [list [expr $j_bump_center_x + 1 ] [expr $j_bump_center_y - 24.0625 ] ] ] ]
} elseif { $j_bump_orient == "R270" } {
puts "$args_port [expr $j_bump_center_x - 25.0625 ] $j_bump_center_y "
create_terminal -of [create_shape -net $j_net_name -shape_type rect -layer LB -boundary [list [list [expr $j_bump_center_x - 26.0625 ] [expr $j_bump_center_y - 1 ] ] [list [expr $j_bump_center_x - 24.0625 ] [expr $j_bump_center_y + 1 ] ] ] ]
}
}
j_create_signal_ports DAC_IOUTNI /pad/instance/name/IOPAD OUT
|