@@ -1031,37 +1031,39 @@ Point
10311031Resizer::tieLocation (Pin *load,
10321032 int separation)
10331033{
1034- dbInst *db_inst = db_network_->staToDb (network_->instance (load));
1035- dbBox *bbox = db_inst->getBBox ();
10361034 Point load_loc = db_network_->location (load);
10371035 int load_x = load_loc.getX ();
10381036 int load_y = load_loc.getY ();
1039- int left_dist = abs (load_x - bbox->xMin ());
1040- int right_dist = abs (load_x - bbox->xMax ());
1041- int bot_dist = abs (load_y - bbox->yMin ());
1042- int top_dist = abs (load_y - bbox->yMax ());
10431037 int tie_x = load_x;
10441038 int tie_y = load_y;
1045- if (left_dist < right_dist
1046- && left_dist < bot_dist
1047- && left_dist < top_dist)
1048- // left
1049- tie_x -= separation;
1050- if (right_dist < left_dist
1051- && right_dist < bot_dist
1052- && right_dist < top_dist)
1053- // right
1054- tie_x += separation;
1055- if (bot_dist < left_dist
1056- && bot_dist < right_dist
1057- && bot_dist < top_dist)
1058- // bot
1059- tie_y -= separation;
1060- if (top_dist < left_dist
1061- && top_dist < right_dist
1062- && top_dist < bot_dist)
1063- // top
1064- tie_y += separation;
1039+ if (!network_->isTopLevelPort (load)) {
1040+ dbInst *db_inst = db_network_->staToDb (network_->instance (load));
1041+ dbBox *bbox = db_inst->getBBox ();
1042+ int left_dist = abs (load_x - bbox->xMin ());
1043+ int right_dist = abs (load_x - bbox->xMax ());
1044+ int bot_dist = abs (load_y - bbox->yMin ());
1045+ int top_dist = abs (load_y - bbox->yMax ());
1046+ if (left_dist < right_dist
1047+ && left_dist < bot_dist
1048+ && left_dist < top_dist)
1049+ // left
1050+ tie_x -= separation;
1051+ if (right_dist < left_dist
1052+ && right_dist < bot_dist
1053+ && right_dist < top_dist)
1054+ // right
1055+ tie_x += separation;
1056+ if (bot_dist < left_dist
1057+ && bot_dist < right_dist
1058+ && bot_dist < top_dist)
1059+ // bot
1060+ tie_y -= separation;
1061+ if (top_dist < left_dist
1062+ && top_dist < right_dist
1063+ && top_dist < bot_dist)
1064+ // top
1065+ tie_y += separation;
1066+ }
10651067 if (core_exists_)
10661068 return closestPtInRect (core_, tie_x, tie_y);
10671069 else
0 commit comments