Skip to content
Closed
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
2 changes: 1 addition & 1 deletion src/mpl/src/rtl_mp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ std::vector<odb::dbInst*> MacroPlacer::findOverlappedMacros(odb::dbInst* macro)
const odb::Rect& source_macro_bbox = macro->getBBox()->getBox();

for (odb::dbInst* inst : block->getInsts()) {
if (!inst->isBlock() || !inst->isPlaced()) {
if (inst == macro || !inst->isBlock() || !inst->isPlaced()) {
continue;
}

Expand Down
5 changes: 5 additions & 0 deletions src/mpl/test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ COMPULSORY_TESTS = [
"orientation_improve1",
"orientation_improve2",
"orientation_improve3",
"place_macro_already_placed_overlap",
"place_macro_right_angle_rotation",
"placement_blockages1",
"rerun1",
Expand Down Expand Up @@ -242,6 +243,10 @@ filegroup(
"testcases/orientation_improve1.def",
"testcases/orientation_improve1.lef",
],
"place_macro_already_placed_overlap": [
"testcases/place_macro_already_placed_overlap.def",
"testcases/place_macro_right_angle_rotation.lef",
],
"place_macro_right_angle_rotation": [
"testcases/place_macro_right_angle_rotation.def",
"testcases/place_macro_right_angle_rotation.lef",
Expand Down
8 changes: 8 additions & 0 deletions src/mpl/test/place_macro_already_placed_overlap.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[INFO ODB-0227] LEF file: ./Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
[INFO ODB-0227] LEF file: ./testcases/place_macro_right_angle_rotation.lef, created 1 library cells
[INFO ODB-0128] Design: place_macro_already_placed_overlap
[INFO ODB-0131] Created 3 components and 3 component-terminals.
[INFO MPL-0035] Macro macro placed. Bounding box (40.000um, 40.000um), (140.000um, 440.000um). Orientation R0
[ERROR MPL-0041] Couldn't place macro. Found overlap with other macros: other_left.
[ERROR MPL-0041] Couldn't place macro. Found overlap with other macros: other_right.
Other placed macros still reject overlaps.
27 changes: 27 additions & 0 deletions src/mpl/test/place_macro_already_placed_overlap.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Test that place_macro ignores the macro being moved during overlap checks.
source "helpers.tcl"

read_lef "./Nangate45/Nangate45.lef"
read_lef "./testcases/place_macro_right_angle_rotation.lef"

read_def "./testcases/place_macro_already_placed_overlap.def"

set block [ord::get_db_block]
set macro [$block findInst macro]
check "target starts placed" { $macro isPlaced } 1

place_macro -macro_name macro -location {40 40} -exact
check "target moves to the requested location" { $macro getLocation } {80000 80000}

foreach {name location} {
other_left {200 20}
other_right {400 20}
} {
# A successful place_macro locks the target; each rejection check must be movable.
$macro setPlacementStatus PLACED
check "reject overlap with $name" {
catch { place_macro -macro_name macro -location $location -exact } error_code
} 1
check "report overlap with $name" { set error_code } MPL-0041
}
puts "Other placed macros still reject overlaps."
14 changes: 14 additions & 0 deletions src/mpl/test/testcases/place_macro_already_placed_overlap.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
VERSION 5.8 ;
DIVIDERCHAR "/" ;
BUSBITCHARS "[]" ;
DESIGN place_macro_already_placed_overlap ;
UNITS DISTANCE MICRONS 2000 ;
DIEAREA ( 0 0 ) ( 1200000 1200000 ) ;
ROW ROW_0 FreePDK45_38x28_10R_NP_162NW_34O 0 0 N DO 3157 BY 1 STEP 380 0 ;
ROW ROW_1 FreePDK45_38x28_10R_NP_162NW_34O 0 1117200 FS DO 3157 BY 1 STEP 380 0 ;
COMPONENTS 3 ;
- macro RECT_MACRO_100x400 + PLACED ( 40000 40000 ) N ;
- other_left RECT_MACRO_100x400 + PLACED ( 400000 40000 ) N ;
- other_right RECT_MACRO_100x400 + PLACED ( 800000 40000 ) N ;
END COMPONENTS
END DESIGN
Loading