Skip to content

Commit a536809

Browse files
authored
Merge pull request #10332 from The-OpenROAD-Project-staging/mpl-pusher-overlap-bugfix
mpl: check Pusher moves overlaps correctly
2 parents a825b1a + 384e394 commit a536809

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

src/mpl/src/pusher.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,15 @@ void Pusher::pushMacroClusterToCoreBoundaries(
179179
}
180180

181181
std::vector<HardMacro*> hard_macros = macro_cluster->getHardMacros();
182+
// Check based on the shape of the macro cluster to avoid iterating each
183+
// of its HardMacros.
184+
odb::Rect cluster_box = macro_cluster->getBBox();
182185

183186
for (const auto& [boundary, distance] : boundaries_distance) {
184187
if (distance == 0) {
185188
continue;
186189
}
187190

188-
// Check based on the shape of the macro cluster to avoid iterating each
189-
// of its HardMacros.
190-
odb::Rect cluster_box = macro_cluster->getBBox();
191-
192191
moveMacroClusterBox(cluster_box, boundary, distance);
193192

194193
debugPrint(logger_,

src/mpl/test/cpp/TestPusher.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,7 @@ TEST_F(TestPusher, PushRevertedVertical)
296296

297297
// When pushing a macro cluster toward its closest boundaries would cause an
298298
// overlap with a macro diagonal to the pushed macro, push the macro the bottom
299-
// The Pusher is biased by the Boundary enum ordering of boundaries (B > L > T >
300-
// R), the current behaviour results in overlapping macros.
301-
// TODO: update the overlap code
299+
// The Pusher is biased by the Boundary enum ordering (B > L > T > R).
302300
TEST_F(TestPusher, PushRevertedBiased)
303301
{
304302
auto root = makeRootWithStdCells();
@@ -316,7 +314,7 @@ TEST_F(TestPusher, PushRevertedBiased)
316314
pusher.pushMacrosToCoreBoundaries();
317315

318316
// Last push (left) is reverted, bottom push is kept
319-
EXPECT_EQ(raw_hard_macro_1->getX(), 0);
317+
EXPECT_EQ(raw_hard_macro_1->getX(), 10000);
320318
EXPECT_EQ(raw_hard_macro_1->getY(), 0);
321319
}
322320

0 commit comments

Comments
 (0)