Skip to content

Commit 6ccf3d4

Browse files
pdn: prevent pad connections from targeting macro grid shapes (#10490)
Pad direct connections (PadDirectConnectionStraps) snap to the closest valid STRIPE/RING target on a connectable layer. isTargetShape() accepted any such shape regardless of its owning grid. When a macro (instance) PDN grid is built before the core grid, its in-core stripes become visible target candidates; with no core target on the pad-connect layer near the pad, the pad connection snapped to a macro stripe and extended deep into the core. Reject shapes owned by an instance grid (Grid::kInstance) as pad-connect targets so pad connections only land on core/existing grid shapes. Add regression test pads_black_parrot_macro_grid (CMake + Bazel) that reproduces the symptom: baseline reports 99 pad connections extending into the core (worst reach ~1.4mm); with the fix, 0. Signed-off-by: Saurav Singh <saurav.singh@fermions.co>
1 parent 4c26918 commit 6ccf3d4

5 files changed

Lines changed: 124 additions & 0 deletions

File tree

src/pdn/src/straps.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,6 +1590,19 @@ bool PadDirectConnectionStraps::refineShape(
15901590

15911591
bool PadDirectConnectionStraps::isTargetShape(const Shape* shape) const
15921592
{
1593+
// Pad direct connections run from a pad pin toward the core power grid. They
1594+
// must not target shapes that belong to an instance (macro) grid: those
1595+
// stripes sit inside the core over the macro, and snapping a pad connection
1596+
// to them drags the connection deep into the core (issue #10490). Only
1597+
// shapes owned by core/existing grids are valid landing targets.
1598+
const auto* component = shape->getGridComponent();
1599+
if (component != nullptr) {
1600+
const auto* grid = component->getGrid();
1601+
if (grid != nullptr && grid->type() == Grid::kInstance) {
1602+
return false;
1603+
}
1604+
}
1605+
15931606
if (target_shapes_type_) {
15941607
return shape->getType() == target_shapes_type_.value();
15951608
}

src/pdn/test/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ COMPULSORY_TESTS = [
115115
"pads_black_parrot_flipchip_connect_overpads",
116116
"pads_black_parrot_grid_define",
117117
"pads_black_parrot_limit_connect",
118+
"pads_black_parrot_macro_grid",
118119
"pads_black_parrot_max_width",
119120
"pads_black_parrot_no_connect",
120121
"pads_black_parrot_offset",

src/pdn/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ or_integration_tests(
111111
pads_black_parrot_flipchip_connect_overpads
112112
pads_black_parrot_grid_define
113113
pads_black_parrot_limit_connect
114+
pads_black_parrot_macro_grid
114115
pads_black_parrot_max_width
115116
pads_black_parrot_no_connect
116117
pads_black_parrot_offset
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
2+
[INFO ODB-0227] LEF file: nangate_bsg_black_parrot/dummy_pads.lef, created 24 library cells
3+
[INFO ODB-0227] LEF file: Nangate45/fakeram45_64x32.lef, created 1 library cells
4+
[INFO ODB-0128] Design: soc_bsg_black_parrot
5+
[INFO ODB-0130] Created 141 pins.
6+
[INFO ODB-0131] Created 1514 components and 1480 component-terminals.
7+
[INFO ODB-0132] Created 2 special nets and 268 connections.
8+
[INFO ODB-0133] Created 350 nets and 390 connections.
9+
[INFO PDN-0001] Inserting grid: sram - repro_sram
10+
[INFO PDN-0001] Inserting grid: Core
11+
pad connections extending into core: 0
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Regression for issue #10490: a macro PDN grid must not cause pad direct
2+
# connections to extend into the core.
3+
#
4+
# When pad direct-connect is enabled at the grid level
5+
# (define_pdn_grid -connect_to_pads), a pad connection snaps to the closest
6+
# STRIPE/RING target on a connectable layer. If a macro (instance) PDN grid is
7+
# built first, its in-core stripes become visible target candidates and -- when
8+
# there is no core target on the pad-connect layer near the pad -- the pad
9+
# connection used to snap to those macro stripes, dragging the connection deep
10+
# into the core.
11+
#
12+
# The fix makes PadDirectConnectionStraps::isTargetShape() reject shapes owned
13+
# by an instance grid, so pad connections only land on core/existing grid
14+
# shapes. This test asserts that no pad connection extends past the core
15+
# boundary.
16+
source "helpers.tcl"
17+
18+
read_lef Nangate45/Nangate45.lef
19+
read_lef nangate_bsg_black_parrot/dummy_pads.lef
20+
read_lef Nangate45/fakeram45_64x32.lef
21+
22+
read_def nangate_bsg_black_parrot/floorplan.def
23+
24+
set block [ord::get_db_block]
25+
set db [ord::get_db]
26+
27+
# Place an SRAM macro just inside the core, above the south VDD/VSS pads.
28+
set master [$db findMaster fakeram45_64x32]
29+
set inst [odb::dbInst_create $block $master "repro_sram"]
30+
$inst setOrigin 850000 450000
31+
$inst setPlacementStatus FIRM
32+
foreach iterm [$inst getITerms] {
33+
set name [[$iterm getMTerm] getName]
34+
if { [string match "*VDD*" $name] } {
35+
odb::dbITerm_connect $iterm [$block findNet VDD]
36+
} elseif { [string match "*VSS*" $name] } {
37+
odb::dbITerm_connect $iterm [$block findNet VSS]
38+
}
39+
}
40+
41+
add_global_connection -net VDD -pin_pattern {^VDD$} -power
42+
add_global_connection -net VDD -pin_pattern {^VDDPE$}
43+
add_global_connection -net VDD -pin_pattern {^VDDCE$}
44+
add_global_connection -net VSS -pin_pattern {^VSS$} -ground
45+
add_global_connection -net VSS -pin_pattern {^VSSE$}
46+
47+
set_voltage_domain -power VDD -ground VSS
48+
49+
# Define the macro grid first so it is built before the Core grid; its in-core
50+
# metal8 stripes are then visible as candidate targets when the Core grid's pad
51+
# direct-connections are created.
52+
define_pdn_grid -macro -name "sram" -instances "repro_sram"
53+
add_pdn_stripe -layer metal8 -width 1.40 -pitch 6.0 -offset 0.5
54+
add_pdn_stripe -layer metal9 -width 1.40 -pitch 6.0 -offset 0.5
55+
add_pdn_connect -layers {metal8 metal9}
56+
57+
# Core grid with grid-level pad connect. The ring is on metal9/metal10 only,
58+
# so the pad metal8 connection has no metal8 ring near the pads.
59+
define_pdn_grid -name "Core" -starts_with "POWER" -connect_to_pads
60+
add_pdn_ring -grid "Core" -layers {metal9 metal10} -widths 5.0 \
61+
-spacings 2.0 -core_offsets 2
62+
63+
add_pdn_stripe -layer metal4 -width 0.48 -pitch 56.0 -offset 2.24
64+
add_pdn_stripe -layer metal7 -width 1.40 -pitch 40.0 -offset 2.70
65+
add_pdn_stripe -layer metal8 -width 1.40 -pitch 200.0 -offset 100.0
66+
add_pdn_stripe -layer metal9 -width 1.40 -pitch 40.0 -offset 2.70
67+
68+
add_pdn_connect -layers {metal4 metal7}
69+
add_pdn_connect -layers {metal7 metal8}
70+
add_pdn_connect -layers {metal8 metal9}
71+
add_pdn_connect -layers {metal9 metal10}
72+
73+
pdngen
74+
75+
set core [$block getCoreArea]
76+
set core_ymin [$core yMin]
77+
78+
# A genuine south pad connection is a narrow vertical metal8 shape rooted in the
79+
# pad (ymin within the pad y-extent). Assert that none extends into the core.
80+
set pad_top 352000
81+
set bad 0
82+
foreach net {VDD VSS} {
83+
set dnet [$block findNet $net]
84+
foreach swire [$dnet getSWires] {
85+
foreach wire [$swire getWires] {
86+
if { [$wire isVia] } { continue }
87+
if { [[$wire getTechLayer] getName] != "metal8" } { continue }
88+
set xmin [$wire xMin]; set ymin [$wire yMin]
89+
set xmax [$wire xMax]; set ymax [$wire yMax]
90+
set dx [expr {$xmax - $xmin}]; set dy [expr {$ymax - $ymin}]
91+
if { $dx < 5000 && $dy > $dx && $ymin <= $pad_top && $ymax > $core_ymin } {
92+
incr bad
93+
}
94+
}
95+
}
96+
}
97+
98+
puts "pad connections extending into core: $bad"

0 commit comments

Comments
 (0)