Skip to content

fix: behavioral_macros emits VDD/VSS pins so PDN can stitch the macro#711

Merged
oharboe merged 1 commit into
mainfrom
fix-behavioral-macros-power-sim
Apr 30, 2026
Merged

fix: behavioral_macros emits VDD/VSS pins so PDN can stitch the macro#711
oharboe merged 1 commit into
mainfrom
fix-behavioral-macros-power-sim

Conversation

@oharboe
Copy link
Copy Markdown
Collaborator

@oharboe oharboe commented Apr 30, 2026

Summary

Behavioral memory macros (@bazel-orfs//tools/memory_macro_scaler:behavioral_macros) were dropping VDD/VSS pins from their generated .lef. The first downstream project to wire behavioral_macros into a real SAIF-driven power-simulation flow (Pinata-Consulting/ascenium#22358) hit the gap immediately:

[WARNING PDN-0231] vectorUnit/vrf_slice0_ext is not connected to any power/ground nets.
[WARNING PDN-0231] branchPredictor/loop.specEntries_ext is not connected to any power/ground nets.
... [hundreds of memory instances] ...

Every behavioral memory stayed off the parent power grid; the parent's report_power then accounted zero macro power. The .lib was already power-aware (per-pin internal_power, cell-level default_cell_leakage_power) — the gap was strictly LEF-side, matching the precedent that fakeram_*.lib shipped with the asap7 platform also has no pg_pin declarations.

Fix

generate_lef() now appends PIN VDD / PIN VSS (with USE POWER / USE GROUND) to the stub LEF, and rewrite_lef() lays them down as full-width horizontal M4 stripes — the same shape fakeram_*.lef uses. The OBS rectangle is split into segments around the PG stripe rows so the blockage doesn't hide the pin geometry from PDN's macro-pin search.

Test plan

  • python3 -m unittest memory_macro_scaler_test — all 57 existing tests pass; new test_generate_lef_has_pg_pins covers PIN VDD/VSS presence with the right USE classification and full-width M4 stripe geometry
  • Validation build of the consumer that surfaced the gap (Pinata-Consulting/ascenium //hardware/tile:report_power and //hardware/aptos-run:cts-8-Saif-run) currently in flight; the ascenium-side PR vendors this same change as a git_override patch and will drop it after this lands

Behavioral memory macros previously omitted PG (VDD/VSS) pins from the
generated .lef.  When the parent design's floorplan ran PDN, every
instance triggered

    [WARNING PDN-0231] <inst> is not connected to any power/ground nets.

and the macros stayed off the parent power grid. Downstream the parent's
SAIF-driven `report_power` then accounted zero macro power, and the
calling project's power-report flow effectively saw the memories as
free. The first project to wire behavioral_macros into a real
power-simulation pipeline (Pinata-Consulting/ascenium#22358) hit this.

Add VDD/VSS to the stub LEF in `generate_lef()` and teach
`rewrite_lef()` to emit them as full-width horizontal M4 stripes — the
same shape `fakeram_*.lef` from the asap7 platform uses, which is the
minimum geometry PDN can find via overlap with parent stripes. Carve
the stripe rows out of the M4 OBS rectangle so the blockage doesn't
hide the PG pin geometry from the macro-pin search.

Adds `test_generate_lef_has_pg_pins` covering: PIN VDD/VSS exist with
USE POWER / USE GROUND; both stripes span the full macro width on M4.
The existing 57 tests stay green.

The .lib doesn't need pg_pin declarations to match — the asap7
platform's own fakeram_*.lib ships without them and OpenSTA reads them
fine, so the gap was strictly LEF-side.
@oharboe oharboe merged commit d9f8b75 into main Apr 30, 2026
1 check passed
@oharboe oharboe deleted the fix-behavioral-macros-power-sim branch April 30, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant