From ba51d64ad98510d4a5944558b2586feb3930fd30 Mon Sep 17 00:00:00 2001 From: jeffhsu3 Date: Sat, 10 Oct 2026 13:06:36 -0700 Subject: [PATCH] asap7: keep the PDN on the routing grid and tracks The ASAP7 PDN scripts place power vias and stripes where the design rule manual's grid, track and via-width rules cannot hold: - pdngen stacks the M2-to-M5 connections on the M2 rails, every 270 nm, which is off M4's 24 nm grid; the stacked M3/M4 pads are wider than their cuts. Now -min_width_layers {M3 M4} -ongrid {M4}. - 0.12 um M5 straps take V4 cuts narrower than the strap. The straps are now minimum width (0.024 um) and -snap_to_grid, at a fifth of the pitch (1.08 um, 0.432 um at the BLOCKS top level) so the M5 metal is the same. M6 straps are -snap_to_grid too. - Rings: the new ring_offsets.tcl computes per-side core offsets that put every ring wire on its layer's tracks. The BLOCKS ring's M5 is 0.408 (0.504 is over M5's 0.48 maximum) and its M6 0.288, the width M6_M5widePWR1p152 makes a flush V5 for; BLOCK's ring M5 is minimum width for the V4s at its corners. Checked with gdscheck's asap7 openroad suite (the DRM, less the rules the tech LEF does not give the router): gcd 602 -> 0, aes 14449 -> 0, aes-block 114821 -> 15756 (what remains is macro placement off the fin/gate grid and tech LEF via and width gaps). Detailed routing has no DRC errors on all three. Worst-case static IR drop (VDD) is lower than before: gcd 0.61% -> 0.40% aes 4.56% -> 2.80% aes-block 0.44% -> 0.17% gcd and aes built with SYNTH_USE_SYN=0; syn currently writes DEF at 100 units per micron, which rounds the GDS to 10 nm. Co-Authored-By: Claude Opus 5.5 Signed-off-by: jeffhsu3 --- .../openRoad/pdn/BLOCKS_grid_strategy.tcl | 23 ++++++++---- .../openRoad/pdn/BLOCK_grid_strategy.tcl | 17 +++++---- .../pdn/grid_strategy-M1-M2-M5-M6.tcl | 15 ++++++-- .../asap7/openRoad/pdn/ring_offsets.tcl | 37 +++++++++++++++++++ 4 files changed, 75 insertions(+), 17 deletions(-) create mode 100644 flow/platforms/asap7/openRoad/pdn/ring_offsets.tcl diff --git a/flow/platforms/asap7/openRoad/pdn/BLOCKS_grid_strategy.tcl b/flow/platforms/asap7/openRoad/pdn/BLOCKS_grid_strategy.tcl index 2c971d7e45..524029180b 100644 --- a/flow/platforms/asap7/openRoad/pdn/BLOCKS_grid_strategy.tcl +++ b/flow/platforms/asap7/openRoad/pdn/BLOCKS_grid_strategy.tcl @@ -1,5 +1,6 @@ # Top level PDN for macros using BLOCK_grid_strategy.tcl source $::env(SCRIPTS_DIR)/util.tcl +source [file join [file dirname [info script]] ring_offsets.tcl] #################################### # global connections @@ -18,16 +19,24 @@ set_voltage_domain -name {CORE} -power {VDD} -ground {VSS} define_pdn_grid -name {top} -voltage_domains {CORE} -pins {M6} add_pdn_stripe -grid {top} -layer {M1} -width {0.018} -pitch {0.54} -offset {0} -followpins add_pdn_stripe -grid {top} -layer {M2} -width {0.018} -pitch {0.54} -offset {0} -followpins -add_pdn_ring -grid {top} -layers {M5 M6} -widths {0.504 0.544} -spacings {0.096} \ - -core_offset {0.504} - -add_pdn_stripe -grid {top} -layer {M5} -width {0.12} -spacing {0.072} -pitch {2.16} \ - -offset {1.50} -extend_to_core_ring +# The ring on the routing tracks: each wire an odd number of track widths, each +# width plus spacing a whole number of track pitches, and the offsets from the +# core chosen to centre the wires on tracks. M5 is 0.408, a width the LEF allows +# under the 0.48 maximum; +# M6 is 0.288, the one width M6_M5widePWR1p152 makes a V5 bar as wide as. +add_pdn_ring -grid {top} -layers {M5 M6} -widths {0.408 0.288} -spacings {0.072 0.096} \ + -core_offsets [asap7_ring_core_offsets M6 0.288 M5 0.408 0.504] + +# Minimum-width M5 straps: a V4 cut is then as wide as its M5 (V4.M5.AUX.2). +# Five times as many as the 0.12 um straps they replace, for the IR drop. +add_pdn_stripe -grid {top} -layer {M5} -width {0.024} -spacing {0.072} -pitch {0.432} \ + -offset {1.50} -extend_to_core_ring -snap_to_grid add_pdn_stripe -grid {top} -layer {M6} -width {0.288} -spacing {0.096} -pitch {4.32} \ - -offset {1.504} -extend_to_core_ring + -offset {1.504} -extend_to_core_ring -snap_to_grid add_pdn_connect -grid {top} -layers {M1 M2} -add_pdn_connect -grid {top} -layers {M2 M5} +# M3 and M4 at minimum width and the M4 pad on the M4 tracks, not on the M2 rails. +add_pdn_connect -grid {top} -layers {M2 M5} -min_width_layers {M3 M4} -ongrid {M4} add_pdn_connect -grid {top} -layers {M5 M6} #################################### diff --git a/flow/platforms/asap7/openRoad/pdn/BLOCK_grid_strategy.tcl b/flow/platforms/asap7/openRoad/pdn/BLOCK_grid_strategy.tcl index 0b54067ea9..a3d1a78113 100644 --- a/flow/platforms/asap7/openRoad/pdn/BLOCK_grid_strategy.tcl +++ b/flow/platforms/asap7/openRoad/pdn/BLOCK_grid_strategy.tcl @@ -1,4 +1,5 @@ # macro level counterpart to BLOCKS_grid_strategy.tcl +source [file join [file dirname [info script]] ring_offsets.tcl] #################################### # global connections @@ -14,20 +15,22 @@ set_voltage_domain -name {CORE} -power {VDD} -ground {VSS} #################################### # standard cell grid # M1 M2 are for follow pin, width derived from PG rail in standard cell -# M5 stripe width rerived from one of width allowed in LEF, offset and pitch -# put stripe on M5 track -# M4 M5 ring follow stripe width +# M5 stripes at minimum width on the M5 tracks: a V4 cut is then as wide as its +# M5 (V4.M5.AUX.2), so the same holds where they meet the M4 ring +# The M4 M5 ring on the routing tracks (see ring_offsets.tcl); its M5 at +# minimum width for the V4s at the ring's corners #################################### define_pdn_grid -name {top} -voltage_domains {CORE} -pins {M5} -add_pdn_ring -grid {top} -layers {M5 M4} -widths {0.12 0.12} -spacings {0.072} -core_offset {0.084} +add_pdn_ring -grid {top} -layers {M5 M4} -widths {0.024 0.12} -spacings {0.072} \ + -core_offsets [asap7_ring_core_offsets M4 0.12 M5 0.024 0.084] add_pdn_stripe -grid {top} -layer {M1} -width {0.018} -pitch {0.54} -offset {0} -followpins add_pdn_stripe -grid {top} -layer {M2} -width {0.018} -pitch {0.54} -offset {0} -followpins -add_pdn_stripe -grid {top} -layer {M5} -width {0.12} -spacing {0.072} -pitch {2.976} -offset {1.5} \ - -extend_to_core_ring +add_pdn_stripe -grid {top} -layer {M5} -width {0.024} -spacing {0.072} -pitch {2.976} -offset {1.5} \ + -extend_to_core_ring -snap_to_grid add_pdn_connect -grid {top} -layers {M1 M2} -add_pdn_connect -grid {top} -layers {M2 M5} +add_pdn_connect -grid {top} -layers {M2 M5} -min_width_layers {M3 M4} -ongrid {M4} add_pdn_connect -grid {top} -layers {M4 M5} diff --git a/flow/platforms/asap7/openRoad/pdn/grid_strategy-M1-M2-M5-M6.tcl b/flow/platforms/asap7/openRoad/pdn/grid_strategy-M1-M2-M5-M6.tcl index 1202b0fc82..90977e6683 100644 --- a/flow/platforms/asap7/openRoad/pdn/grid_strategy-M1-M2-M5-M6.tcl +++ b/flow/platforms/asap7/openRoad/pdn/grid_strategy-M1-M2-M5-M6.tcl @@ -17,10 +17,19 @@ set_voltage_domain -name {CORE} -power {VDD} -ground {VSS} define_pdn_grid -name {top} -voltage_domains {CORE} -pins {M6} add_pdn_stripe -grid {top} -layer {M1} -width {0.018} -pitch {0.54} -offset {0} -followpins add_pdn_stripe -grid {top} -layer {M2} -width {0.018} -pitch {0.54} -offset {0} -followpins -add_pdn_stripe -grid {top} -layer {M5} -width {0.12} -spacing {0.072} -pitch {5.4} -offset {0.300} -add_pdn_stripe -grid {top} -layer {M6} -width {0.288} -spacing {0.096} -pitch {5.4} -offset {0.513} +# Minimum-width M5 straps on the M5 tracks: a V4 cut is then as wide as its M5 +# (V4.M5.AUX.2) and the strap's edges lie on the 24 nm grid (M5.AUX.1, W.4). +# Five times as many as the 0.12 um straps they replace, at a fifth of the +# pitch, so the M5 metal and the M2-to-M5 stacks keep the IR drop down. +add_pdn_stripe -grid {top} -layer {M5} -width {0.024} -spacing {0.072} -pitch {1.08} -offset {0.300} \ + -snap_to_grid +add_pdn_stripe -grid {top} -layer {M6} -width {0.288} -spacing {0.096} -pitch {5.4} -offset {0.513} \ + -snap_to_grid add_pdn_connect -grid {top} -layers {M1 M2} -add_pdn_connect -grid {top} -layers {M2 M5} +# The M2-to-M5 stacks: M3 and M4 at minimum width, so each cut is as wide as the +# metal over it (V2.M3.AUX.2), and the M4 pad on the M4 tracks rather than +# centred on the 270 nm M2 rails, which are off M4's 24 nm grid (M4.AUX.1/2). +add_pdn_connect -grid {top} -layers {M2 M5} -min_width_layers {M3 M4} -ongrid {M4} add_pdn_connect -grid {top} -layers {M5 M6} #################################### # macro grids diff --git a/flow/platforms/asap7/openRoad/pdn/ring_offsets.tcl b/flow/platforms/asap7/openRoad/pdn/ring_offsets.tcl new file mode 100644 index 0000000000..32c2c5db35 --- /dev/null +++ b/flow/platforms/asap7/openRoad/pdn/ring_offsets.tcl @@ -0,0 +1,37 @@ +# Core offsets {left bottom right top} for an add_pdn_ring on hlayer (horizontal, +# width hwidth) and vlayer (vertical, width vwidth) that centre every ring wire +# on its layer's routing tracks, so its edges also fall on the ASAP7 routing grid. +# Each offset is at least min_offset. The ring's width plus spacing on each +# layer must be a whole number of track pitches for the outer rings to stay on +# the tracks too. Tracks must exist (make_tracks) before this is called. +proc asap7_ring_core_offsets { hlayer hwidth vlayer vwidth min_offset } { + set block [ord::get_db_block] + set tech [ord::get_db_tech] + set core [$block getCoreArea] + set min [ord::microns_to_dbu $min_offset] + + set offsets {} + foreach { layer width axis lo hi } [list \ + $vlayer $vwidth X [$core xMin] [$core xMax] \ + $hlayer $hwidth Y [$core yMin] [$core yMax]] { + set grid [$block findTrackGrid [$tech findLayer $layer]] + lassign [$grid getGridPattern$axis 0] origin count step + set w [ord::microns_to_dbu $width] + # The low edge of a wire centred on a track, modulo the track pitch. + set residue [expr { ($origin - $w / 2) % $step }] + + # Low side: the wire's low edge is lo - offset - w. + set edge [expr { $lo - $min - $w }] + set edge [expr { $edge - (($edge - $residue) % $step) }] + set low_offset [expr { $lo - $w - $edge }] + + # High side: the wire's low edge is hi + offset. + set edge [expr { $hi + $min }] + set edge [expr { $edge + (($residue - $edge) % $step) }] + set high_offset [expr { $edge - $hi }] + + lappend offsets $low_offset $high_offset + } + lassign $offsets left right bottom top + return [lmap v [list $left $bottom $right $top] { ord::dbu_to_microns $v }] +}