Skip to content

Commit 2593936

Browse files
authored
Merge pull request The-OpenROAD-Project#9416 from gadfort/ifp-error
ifp: create error when no rows are created for any sites
2 parents 230a5fd + 195a2bb commit 2593936

File tree

5 files changed

+40
-8
lines changed

5 files changed

+40
-8
lines changed

src/ifp/src/InitFloorplan.cc

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ void InitFloorplan::makeUniformRows(odb::dbSite* base_site,
681681
const uint32_t site_dx = base_site->getWidth();
682682
const int rows_x = core_dx / site_dx;
683683

684-
auto make_rows = [&](dbSite* site) {
684+
auto make_rows = [&](dbSite* site) -> int {
685685
const uint32_t site_dy = site->getHeight();
686686
int rows_y = core_dy / site_dy;
687687
bool flip = flipped_sites.find(site) != flipped_sites.end();
@@ -716,13 +716,20 @@ void InitFloorplan::makeUniformRows(odb::dbSite* base_site,
716716
site_dx);
717717
y += site_dy;
718718
}
719-
logger_->info(IFP,
720-
1,
721-
"Added {} rows of {} site {}.",
722-
rows_y,
723-
rows_x,
724-
site->getName());
719+
if (rows_y == 0) {
720+
logger_->warn(IFP, 61, "No rows created for site {}.", site->getName());
721+
} else {
722+
logger_->info(IFP,
723+
1,
724+
"Added {} rows of {} site {}.",
725+
rows_y,
726+
rows_x,
727+
site->getName());
728+
}
729+
return rows_y;
725730
};
731+
732+
int total_rows = 0;
726733
for (const auto& [name, site] : sites_by_name) {
727734
if (site->getHeight() % base_site->getHeight() != 0) {
728735
logger_->error(
@@ -734,9 +741,13 @@ void InitFloorplan::makeUniformRows(odb::dbSite* base_site,
734741
base_site->getName(),
735742
block_->dbuToMicrons(base_site->getHeight()));
736743
}
737-
make_rows(site);
744+
total_rows += make_rows(site);
738745
}
739746
block_->setCoreArea(block_->computeCoreArea());
747+
748+
if (total_rows == 0) {
749+
logger_->error(IFP, 65, "No rows created in the core area.");
750+
}
740751
}
741752

742753
int InitFloorplan::getOffset(dbSite* base_hybrid_site,

src/ifp/test/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ COMPULSORY_TESTS = [
1919
"init_floorplan9",
2020
"init_floorplan10",
2121
"init_floorplan11",
22+
"init_floorplan12",
2223
"init_floorplan_dbl_row",
2324
"init_floorplan_even_rows",
2425
"init_floorplan_flip_sites",

src/ifp/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ or_integration_tests(
1414
init_floorplan9
1515
init_floorplan10
1616
init_floorplan11
17+
init_floorplan12
1718
init_floorplan_dbl_row
1819
init_floorplan_even_rows
1920
init_floorplan_flip_sites

src/ifp/test/init_floorplan12.ok

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
2+
[WARNING IFP-0028] Core area lower left (1.000, 1.000) snapped to (1.140, 1.400).
3+
[WARNING IFP-0061] No rows created for site FreePDK45_38x28_10R_NP_162NW_34O.
4+
[ERROR IFP-0065] No rows created in the core area.
5+
IFP-0065

src/ifp/test/init_floorplan12.tcl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# init_floorplan
2+
source "helpers.tcl"
3+
read_lef Nangate45/Nangate45.lef
4+
read_liberty Nangate45/Nangate45_typ.lib
5+
read_verilog reg1.v
6+
link_design top
7+
8+
catch {
9+
initialize_floorplan -utilization 99 \
10+
-aspect_ratio 0.2 \
11+
-core_space 1 \
12+
-site FreePDK45_38x28_10R_NP_162NW_34O
13+
} err
14+
puts $err

0 commit comments

Comments
 (0)