proc place_ports_1 {} { set unplaced_ports [get_ports {*sms* LSI* *bist* }] set y_start [expr 14.995 + 0.36*2] set y $y_start set dy 0.36 foreach_in_collection port $unplaced_ports { set direction [get_attribute $port direction] set_port_location -coordinate "0 $y" -layer_name M5 -layer_area "0 $y 0.07 [expr $y + 0.07]" $port set_attribute $port direction $direction set y [expr $y + $dy] change_selection $port break } }
If you using write_floor_plan command to write port location, you will see commands like following:
set obj [get_terminal {"psroBaseAddress[12]"}] set_attribute -quiet $obj layer M2 set_attribute -quiet $obj owner_port {psroBaseAddress[12]} set_attribute -quiet $obj bbox {{0.925 0.000} {0.995 0.070}} set_attribute -quiet $obj status Unplaced set_attribute -quiet $obj access_direction Down set_attribute -quiet $obj direction input set_attribute -quiet $obj eeq_class 0
Based on above command, we can place port using the similar commands.
proc place_ports {} { set unplaced_ports [get_ports {*sms* LSI* *bist* }] set y_start [expr 14.995 + 0.36*2] set y $y_start set dy 0.36 foreach_in_collection port $unplaced_ports { set icccmd "" set terminal [ get_terminals -of $port ] set direction [get_attribute $port direction] set icccmd "set obj \[get_terminal \{\"[get_attribute $terminal name]\"\}\] \n" set icccmd "$icccmd set_attribute -quiet \$obj layer M5 \n" set icccmd "$icccmd set_attribute -quiet \$obj owner_port \{[get_attribute $port name]\} \n" set icccmd "$icccmd set_attribute -quiet \$obj bbox \{\{0 $y\} \{0.07 [expr $y+0.07]\}\} \n" set icccmd "$icccmd set_attribute -quiet \$obj status Unplaced \n" set icccmd "$icccmd set_attribute -quiet \$obj access_direction Left \n" set icccmd "$icccmd set_attribute -quiet \$obj direction $direction \n" set icccmd "$icccmd set_attribute -quiet \$obj eeq_class 0 \n" #echo $icccmd eval $icccmd set y [expr $y + $dy] } }
set ports [ get_ports -filter "layer==M3 || layer==M5 || layer==M7 && bbox_lly < 10" ] set sports [ sort_collection $ports bbox_llx ] set location_list [list] array set location_array {} set prellx 0 foreach_in_collection p $sports { set llx [ get_attribute $p bbox_llx ] if { $prellx == $llx } { } else { set location_array($llx) 0 lappend location_list $llx echo $llx } set prellx $llx } #set location_list [ lsort $location_list ] set index 0 foreach llx $location_list { if { $index == 0} { set new_location $llx } else { set new_location [expr $new_location + 0.27] } set index [ expr $index + 1] #echo $index $llx $new_location set location_array($llx) $new_location } foreach_in_collection p $sports { set llx [get_attribute $p bbox_llx] set new_llx $location_array($llx) set dx [expr $new_llx -$llx] move_objects -delta "$dx 0" $p #echo $llx $new_llx $dx }