@@ -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
@@ -1114,22 +1116,23 @@ Resizer::repairHoldViolations(VertexSet &ends,
11141116 LibertyCell *buffer_cell)
11151117{
11161118 inserted_buffer_count_ = 0 ;
1117- Slack worst_slack, prev_slack ;
1119+ Slack worst_slack;
11181120 Vertex *worst_vertex;
11191121 sta_->worstSlack (MinMax::min (), worst_slack, worst_vertex);
1120- prev_slack = worst_slack * 2 ;
1122+ debugPrint1 (debug_, " repair_hold" , 1 , " worst_slack=%s\n " ,
1123+ units_->timeUnit ()->asString (worst_slack, 3 ));
1124+ int repair_count = 1 ;
11211125
11221126 int pass = 1 ;
11231127 while (worst_slack < 0.0
11241128 // Make sure we are making progress.
1125- && abs (worst_slack - prev_slack) > abs (prev_slack) * .001 ) {
1126- debugPrint2 (debug_, " repair_hold" , 1 , " pass %d worst_slack=%s\n " ,
1127- pass,
1128- units_->timeUnit ()->asString (worst_slack, 3 ));
1129- repairHoldPass (ends, buffer_cell);
1129+ && repair_count > 0 ) {
1130+ debugPrint1 (debug_, " repair_hold" , 1 , " pass %d\n " , pass);
1131+ repair_count = repairHoldPass (ends, buffer_cell);
11301132 sta_->findRequireds ();
1131- prev_slack = worst_slack;
11321133 sta_->worstSlack (MinMax::min (), worst_slack, worst_vertex);
1134+ debugPrint1 (debug_, " repair_hold" , 1 , " worst_slack=%s\n " ,
1135+ units_->timeUnit ()->asString (worst_slack, 3 ));
11331136 pass++;
11341137 }
11351138 if (inserted_buffer_count_ > 0 ) {
@@ -1138,7 +1141,7 @@ Resizer::repairHoldViolations(VertexSet &ends,
11381141 }
11391142}
11401143
1141- void
1144+ int
11421145Resizer::repairHoldPass (VertexSet &ends,
11431146 LibertyCell *buffer_cell)
11441147{
@@ -1172,6 +1175,7 @@ Resizer::repairHoldPass(VertexSet &ends,
11721175 }
11731176 }
11741177 }
1178+ return repair_count;
11751179}
11761180
11771181void
0 commit comments