diff --git a/src/grt/src/fastroute/src/utility.cpp b/src/grt/src/fastroute/src/utility.cpp index f57ea9da3d..eff5869100 100644 --- a/src/grt/src/fastroute/src/utility.cpp +++ b/src/grt/src/fastroute/src/utility.cpp @@ -964,9 +964,8 @@ void FastRouteCore::layerAssignmentV4() } treenodes[n2a].assigned = true; - - } // edge len > 0 - } // eunmerating edges + } + } } } @@ -2141,8 +2140,7 @@ int FastRouteCore::edgeShift(Tree& t, int net) // add the cost of all edges adjacent to the two steiner nodes for (l = 0; l < nbrCnt[n1]; l++) { n3 = nbr[n1][l]; - if (n3 != n2) // exclude current edge n1-n2 - { + if (n3 != n2) { // exclude current edge n1-n2 cost1 = cost2 = 0; if (t.branch[n1].x < t.branch[n3].x) { smallX = t.branch[n1].x; @@ -2167,12 +2165,11 @@ int FastRouteCore::edgeShift(Tree& t, int net) cost2 += v_edges_[m][smallX].est_usage; } costH[j] += std::min(cost1, cost2); - } // if(n3!=n2) - } // loop l + } + } for (l = 0; l < nbrCnt[n2]; l++) { n3 = nbr[n2][l]; - if (n3 != n1) // exclude current edge n1-n2 - { + if (n3 != n1) { // exclude current edge n1-n2 cost1 = cost2 = 0; if (t.branch[n2].x < t.branch[n3].x) { smallX = t.branch[n2].x; @@ -2197,9 +2194,9 @@ int FastRouteCore::edgeShift(Tree& t, int net) cost2 += v_edges_[m][smallX].est_usage; } costH[j] += std::min(cost1, cost2); - } // if(n3!=n1) - } // loop l - } // loop j + } + } + } bestCost = BIG_INT; Pos = t.branch[n1].y; for (j = minY; j <= maxY; j++) { @@ -2208,8 +2205,7 @@ int FastRouteCore::edgeShift(Tree& t, int net) Pos = j; } } - if (Pos != t.branch[n1].y) // find a better position than current - { + if (Pos != t.branch[n1].y) { // find a better position than current benefit = costH[t.branch[n1].y] - bestCost; if (benefit > bestBenefit) { bestBenefit = benefit; @@ -2219,8 +2215,7 @@ int FastRouteCore::edgeShift(Tree& t, int net) } } - } else // a vertical edge - { + } else { // a vertical edge // find the shifting range for the edge (minX~maxX) maxX1 = minX1 = t.branch[n1].x; for (j = 0; j < 3; j++) { @@ -2242,8 +2237,7 @@ int FastRouteCore::edgeShift(Tree& t, int net) maxX = std::min(maxX1, maxX2); // find the best position (least total usage) to shift - if (minX < maxX) // more than 1 possible positions - { + if (minX < maxX) { // more than 1 possible positions for (j = minX; j <= maxX; j++) { costV[j] = 0; for (k = t.branch[n1].y; k < t.branch[n2].y; k++) { @@ -2278,12 +2272,11 @@ int FastRouteCore::edgeShift(Tree& t, int net) cost2 += v_edges_[m][smallX].est_usage; } costV[j] += std::min(cost1, cost2); - } // if(n3!=n2) - } // loop l + } + } for (l = 0; l < nbrCnt[n2]; l++) { n3 = nbr[n2][l]; - if (n3 != n1) // exclude current edge n1-n2 - { + if (n3 != n1) { // exclude current edge n1-n2 cost1 = cost2 = 0; if (j < t.branch[n3].x) { smallX = j; @@ -2308,9 +2301,9 @@ int FastRouteCore::edgeShift(Tree& t, int net) cost2 += v_edges_[m][smallX].est_usage; } costV[j] += std::min(cost1, cost2); - } // if(n3!=n1) - } // loop l - } // loop j + } + } + } bestCost = BIG_INT; Pos = t.branch[n1].x; for (j = minX; j <= maxX; j++) { @@ -2319,8 +2312,7 @@ int FastRouteCore::edgeShift(Tree& t, int net) Pos = j; } } - if (Pos != t.branch[n1].x) // find a better position than current - { + if (Pos != t.branch[n1].x) { // find a better position than current benefit = costV[t.branch[n1].x] - bestCost; if (benefit > bestBenefit) { bestBenefit = benefit; @@ -2329,27 +2321,23 @@ int FastRouteCore::edgeShift(Tree& t, int net) } } } - - } // else (a vertical edge) - - } // loop i + } + } if (bestBenefit > 0) { n1 = pairN1[bestPair]; n2 = pairN2[bestPair]; - if (t.branch[n1].y == t.branch[n2].y) // horizontal edge - { + if (t.branch[n1].y == t.branch[n2].y) { // horizontal edge t.branch[n1].y = bestPos; t.branch[n2].y = bestPos; - } // vertical edge - else { + } else { // vertical edge t.branch[n1].x = bestPos; t.branch[n2].x = bestPos; } numShift++; } - } // while(bestBenefit>0) + } return (numShift); } @@ -2455,13 +2443,12 @@ int FastRouteCore::edgeShiftNew(Tree& t, int net) } numShift += edgeShift(t, net); } - } // if(isPair) + } - } // if(pairCnt>0) - else + } else { iter = 3; - - } // while + } + } return (numShift); }