Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion src/pad/src/PadPlacer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <iterator>
#include <limits>
Expand Down Expand Up @@ -1486,7 +1487,7 @@ bool PlacerPadPlacer::padSpreading(
last_idx = j;
}
}
bound_pos = last_idx == insts.size()
bound_pos = last_idx + 1 == insts.size()
? getRowEnd(insts[last_idx])
: positions[insts[last_idx + 1]]->center;
} else {
Expand Down Expand Up @@ -1570,6 +1571,12 @@ odb::PtrMap<odb::dbInst, int> PlacerPadPlacer::padSpreading(
positions[inst] = std::move(anchors);
}

std::vector<int> check_positions;
check_positions.reserve(positions.size());
for (const auto& [inst, anchor] : positions) {
check_positions.push_back(anchor->center);
}

for (int k = 0; k < kMaxIterations; k++) {
// Update coeff schedule
const float kRepel1 = kRepelStart
Expand All @@ -1586,6 +1593,26 @@ odb::PtrMap<odb::dbInst, int> PlacerPadPlacer::padSpreading(
positions, initial_positions, k, kSpring1, kRepel1, kDamper)) {
break;
}

bool changed = false;
size_t idx = 0;
for (const auto& [inst, anchor] : positions) {
if (anchor->center != check_positions[idx]) {
changed = true;
}
// update check positions
check_positions[idx] = anchor->center;
idx++;
}
if (!changed) {
// Place instances for better debugging
placeInstances(positions);
getLogger()->error(
utl::PAD,
47,
"Pad placement unable to legalize pads after {} iterations.",
k);
}
}

// convert to regular placement information
Expand Down
1 change: 1 addition & 0 deletions src/pad/test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ COMPULSORY_TESTS = [
"place_pads_bumps_bump_overlap",
"place_pads_bumps_strategy_placer_blockages",
"place_pads_bumps_strategy",
"place_pads_placer_fullyblocked",
"place_pads_too_many",
"place_pads_uniform",
"place_pads_uniform_slip",
Expand Down
1 change: 1 addition & 0 deletions src/pad/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ or_integration_tests(
place_pads_bumps_strategy
place_pad_wrong_master
place_pads_bumps
place_pads_placer_fullyblocked
place_pads_too_many
place_pads_uniform
place_pads_uniform_slip
Expand Down
Loading
Loading