Skip to content

Commit 67f0055

Browse files
authored
Merge pull request #10488 from gadfort/pdn-min-area
pdn: add basic handling of lef58 area rule
2 parents 7f17122 + 5cb1ab2 commit 67f0055

7 files changed

Lines changed: 12392 additions & 5 deletions

File tree

src/odb/src/swig/common/containers.i

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ WRAP_DB_CONTAINER(odb::dbSite)
3939
WRAP_DB_CONTAINER(odb::dbTarget)
4040
WRAP_DB_CONTAINER(odb::dbTech)
4141
WRAP_DB_CONTAINER(odb::dbTechLayer)
42+
WRAP_DB_CONTAINER(odb::dbTechLayerAreaRule)
4243
WRAP_DB_CONTAINER(odb::dbTechLayerArraySpacingRule)
4344
WRAP_DB_CONTAINER(odb::dbTechLayerCornerSpacingRule)
4445
WRAP_DB_CONTAINER(odb::dbTechLayerCutClassRule)

src/pdn/src/techlayer.cpp

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,18 +235,35 @@ odb::Rect TechLayer::adjustToMinArea(
235235
const odb::Rect& rect,
236236
const std::optional<odb::dbTechLayerDir>& dir) const
237237
{
238-
if (!layer_->hasArea()) {
238+
const bool has_rules = !layer_->getTechLayerAreaRules().empty();
239+
if (!has_rules && !layer_->hasArea()) {
239240
return rect;
240241
}
241242

242-
const double min_area = layer_->getArea();
243-
if (min_area == 0.0) {
243+
const int dbu_per_micron = getLefUnits();
244+
int min_area = 0;
245+
if (has_rules) {
246+
for (auto* rule : layer_->getTechLayerAreaRules()) {
247+
const int layer_min_area = rule->getArea();
248+
if (layer_min_area == 0) {
249+
continue;
250+
}
251+
// TODO: Check width rules
252+
// TODO: Check length rules
253+
// TODO: Check except rules
254+
min_area = std::max(min_area, layer_min_area * dbu_per_micron);
255+
}
256+
} else {
257+
const double layer_min_area = layer_->getArea();
258+
min_area = layer_min_area * dbu_per_micron * dbu_per_micron;
259+
}
260+
261+
if (min_area == 0) {
244262
return rect;
245263
}
246264

247265
// make sure minimum area is honored
248-
const int dbu_per_micron = getLefUnits();
249-
const double area = min_area * dbu_per_micron * dbu_per_micron;
266+
const double area = min_area;
250267

251268
odb::Rect new_rect = rect;
252269

src/pdn/test/BUILD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ COMPULSORY_TESTS = [
5353
"core_grid_strap_outside_core",
5454
"core_grid_via_snap",
5555
"core_grid_with_M6_min_area",
56+
"core_grid_with_M6_min_area_rule",
5657
"core_grid_with_M7_pins",
5758
"core_grid_with_bterms",
5859
"core_grid_with_dual_rings",
@@ -203,6 +204,7 @@ filegroup(
203204
"nangate_bsg_black_parrot/floorplan_flipchip.def",
204205
"nangate_bsg_black_parrot/floorplan_flipchip_nogrid.def",
205206
"nangate_bsg_black_parrot/floorplan_flipchip_short.def",
207+
"nangate_data/Nangate45.lef",
206208
"nangate_existing/floorplan.def",
207209
"nangate_gcd/floorplan.def",
208210
"nangate_gcd/floorplan_obstructions.def",
@@ -281,6 +283,7 @@ filegroup(
281283
"asap7_macro_covered_partial": ["asap7_failed_macro_grid.def"],
282284
"asap7_macro_notcovered": ["asap7_failed_macro_grid.def"],
283285
"core_grid_auto_domain": ["core_grid.defok"],
286+
"core_grid_with_M6_min_area_rule": ["core_grid_with_M6_min_area.defok"],
284287
"core_grid_with_rings_connect": ["core_grid_with_rings.defok"],
285288
"macros_channel_recursive_repair": [
286289
"ihp_ethmac/tech.lef",

src/pdn/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ or_integration_tests(
4949
core_grid_strap_outside_core
5050
core_grid_via_snap
5151
core_grid_with_M6_min_area
52+
core_grid_with_M6_min_area_rule
5253
core_grid_with_M7_pins
5354
core_grid_with_bterms
5455
core_grid_with_dual_rings
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[INFO ODB-0227] LEF file: nangate_data/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
2+
[INFO ODB-0128] Design: gcd
3+
[INFO ODB-0130] Created 54 pins.
4+
[INFO ODB-0131] Created 482 components and 2074 component-terminals.
5+
[INFO ODB-0133] Created 385 nets and 1110 connections.
6+
[INFO PDN-0001] Inserting grid: Core
7+
No differences found.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# test for rounding on M6 for min area
2+
source "helpers.tcl"
3+
4+
read_lef nangate_data/Nangate45.lef
5+
read_def nangate_gcd/floorplan.def
6+
7+
add_global_connection -net VDD -pin_pattern VDD -power
8+
add_global_connection -net VSS -pin_pattern VSS -ground
9+
10+
set_voltage_domain -power VDD -ground VSS
11+
12+
define_pdn_grid -name "Core" -pins metal7
13+
add_pdn_stripe -followpins -layer metal1
14+
add_pdn_stripe -followpins -layer metal2
15+
16+
add_pdn_stripe -layer metal4 -width 0.48 -pitch 15.0 -offset 2.0
17+
add_pdn_stripe -layer metal7 -width 1.40 -pitch 20.0 -offset 2.0
18+
19+
add_pdn_connect -layers {metal1 metal2}
20+
add_pdn_connect -layers {metal2 metal4}
21+
add_pdn_connect -layers {metal4 metal7}
22+
23+
pdngen
24+
25+
set def_file [make_result_file core_grid_with_M6_min_area.def]
26+
write_def $def_file
27+
diff_files core_grid_with_M6_min_area.defok $def_file

0 commit comments

Comments
 (0)