|
9 | 9 | #include <iterator> |
10 | 10 | #include <limits> |
11 | 11 | #include <map> |
| 12 | +#include <memory> |
12 | 13 | #include <optional> |
13 | 14 | #include <set> |
14 | 15 | #include <tuple> |
@@ -157,7 +158,7 @@ int PadPlacer::convertRowIndexToPos(int index) const |
157 | 158 | start = origin.y(); |
158 | 159 | } |
159 | 160 |
|
160 | | - return start + index * row_->getSpacing(); |
| 161 | + return start + (index * row_->getSpacing()); |
161 | 162 | } |
162 | 163 |
|
163 | 164 | int PadPlacer::placeInstance(int index, |
@@ -1019,9 +1020,8 @@ int PlacerPadPlacer::getNearestLegalPosition(odb::dbInst* inst, |
1019 | 1020 | } |
1020 | 1021 | if ((target - start) < (end - target)) { |
1021 | 1022 | return start; |
1022 | | - } else { |
1023 | | - return end; |
1024 | 1023 | } |
| 1024 | + return end; |
1025 | 1025 | } |
1026 | 1026 | return target; |
1027 | 1027 | } |
@@ -1308,10 +1308,10 @@ bool PlacerPadPlacer::padSpreading( |
1308 | 1308 | total_move += std::abs(move_by); |
1309 | 1309 |
|
1310 | 1310 | const int move_to = convertRowIndexToPos(snapToRowSite( |
1311 | | - curr_pos + move_by - positions[curr]->width / 2)) |
1312 | | - + positions[curr]->width / 2; |
| 1311 | + curr_pos + move_by - (positions[curr]->width / 2))) |
| 1312 | + + (positions[curr]->width / 2); |
1313 | 1313 | positions[curr]->setLocation(std::max(prev_pos, std::min(next_pos, move_to)) |
1314 | | - - positions[curr]->width / 2); |
| 1314 | + - (positions[curr]->width / 2)); |
1315 | 1315 | debugPrint(getLogger(), |
1316 | 1316 | utl::PAD, |
1317 | 1317 | "Place", |
@@ -1366,17 +1366,15 @@ std::map<odb::dbInst*, int> PlacerPadPlacer::padSpreading( |
1366 | 1366 |
|
1367 | 1367 | for (int k = 0; k < kMaxIterations; k++) { |
1368 | 1368 | // Update coeff schedule |
1369 | | - const float kRepel1 |
1370 | | - = kRepelStart |
1371 | | - + (kRepelEnd - kRepelStart) * k / static_cast<float>(kMaxIterations); |
1372 | | - const float kSpring1 |
1373 | | - = k > kSpringIterEnd |
1374 | | - ? 0 |
1375 | | - : (k > kSpringIterInfluence |
1376 | | - ? kSpringStart |
1377 | | - * (kSpringItrRange - (k - kSpringIterInfluence)) |
1378 | | - / static_cast<float>(kSpringItrRange) |
1379 | | - : kSpringStart); |
| 1369 | + const float kRepel1 = kRepelStart |
| 1370 | + + ((kRepelEnd - kRepelStart) * k |
| 1371 | + / static_cast<float>(kMaxIterations)); |
| 1372 | + const float kString2 |
| 1373 | + = k > kSpringIterInfluence |
| 1374 | + ? kSpringStart * (kSpringItrRange - (k - kSpringIterInfluence)) |
| 1375 | + / static_cast<float>(kSpringItrRange) |
| 1376 | + : kSpringStart; |
| 1377 | + const float kSpring1 = k > kSpringIterEnd ? 0 : kString2; |
1380 | 1378 |
|
1381 | 1379 | if (padSpreading( |
1382 | 1380 | positions, initial_positions, k, kSpring1, kRepel1, kDamper)) { |
@@ -1434,8 +1432,6 @@ int PlacerPadPlacer::getNumberOfRoutes() const |
1434 | 1432 | { |
1435 | 1433 | int count = 0; |
1436 | 1434 | for (odb::dbInst* inst : getInsts()) { |
1437 | | - std::vector<int64_t> lengths; |
1438 | | - const odb::Point inst_center = inst->getBBox()->getBox().center(); |
1439 | 1435 | if (iterm_connections_.find(inst) != iterm_connections_.end()) { |
1440 | 1436 | count += 1; |
1441 | 1437 | } |
|
0 commit comments