Skip to content

Commit

Permalink
grt: remove unnecessary comments
Browse files Browse the repository at this point in the history
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
  • Loading branch information
eder-matheus committed Nov 27, 2024
1 parent eef1daa commit 5ee297e
Showing 1 changed file with 28 additions and 41 deletions.
69 changes: 28 additions & 41 deletions src/grt/src/fastroute/src/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -964,9 +964,8 @@ void FastRouteCore::layerAssignmentV4()
}

treenodes[n2a].assigned = true;

} // edge len > 0
} // eunmerating edges
}
}
}
}

Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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++) {
Expand All @@ -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;
Expand All @@ -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++) {
Expand All @@ -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++) {
Expand Down Expand Up @@ -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;
Expand All @@ -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++) {
Expand All @@ -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;
Expand All @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 5ee297e

Please sign in to comment.