Skip to content

Commit

Permalink
mpl2: improve name and avoid clusters to be pushed toward blocked bou…
Browse files Browse the repository at this point in the history
…ndaries

Signed-off-by: Arthur Koucher <[email protected]>
  • Loading branch information
AcKoucher committed Sep 27, 2024
1 parent ede06cd commit 8543487
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/mpl2/src/SimulatedAnnealingCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,12 @@ void SimulatedAnnealingCore<T>::addBoundaryDistToWirelength(
+= net_weight
* std::min(
{dist_to_left, dist_to_right, dist_to_bottom, dist_to_top});
} else if (constraint_boundary == Boundary::L
|| constraint_boundary == Boundary::R) {
} else if (constraint_boundary == Boundary::L && !left_is_blocked_
|| constraint_boundary == Boundary::R && !right_is_blocked_) {
const float x2 = io.getPinX();
wirelength_ += net_weight * std::abs(x2 - x1);
} else { // Top or Bottom
} else if (constraint_boundary == Boundary::T && !top_is_blocked_
|| constraint_boundary == Boundary::B && !bottom_is_blocked_) {
const float y2 = io.getPinY();
wirelength_ += net_weight * std::abs(y2 - y1);
}
Expand Down
5 changes: 3 additions & 2 deletions src/mpl2/src/clusterEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,8 @@ void ClusteringEngine::createIOCluster(
void ClusteringEngine::setBlockedBoundariesForIOs()
{
const float blocked_boundary_threshold = 0.7;
std::map<Boundary, float> blockage_extension_map = getBlockageExtensionMap();
std::map<Boundary, float> blockage_extension_map
= computeBlockageExtensionMap();

for (const auto [boundary, blockage_extension] : blockage_extension_map) {
if (blockage_extension >= blocked_boundary_threshold) {
Expand All @@ -428,7 +429,7 @@ void ClusteringEngine::setBlockedBoundariesForIOs()

// Computes how much blocked each boundary is for IOs base on PPL exclude
// contraints.
std::map<Boundary, float> ClusteringEngine::getBlockageExtensionMap()
std::map<Boundary, float> ClusteringEngine::computeBlockageExtensionMap()
{
std::map<Boundary, float> blockage_extension_map;

Expand Down
2 changes: 1 addition & 1 deletion src/mpl2/src/clusterEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class ClusteringEngine
void setBaseThresholds();
void createIOClusters();
void setBlockedBoundariesForIOs();
std::map<Boundary, float> getBlockageExtensionMap();
std::map<Boundary, float> computeBlockageExtensionMap();
Boundary getConstraintBoundary(const odb::Rect& die,
const odb::Rect& constraint_region);
void createIOCluster(const odb::Rect& die,
Expand Down

0 comments on commit 8543487

Please sign in to comment.