Skip to content

[gpl] Include internal power in MBFF clustering cost#10075

Merged
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:mbff-improve-power-modeling
Apr 12, 2026
Merged

[gpl] Include internal power in MBFF clustering cost#10075
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:mbff-improve-power-modeling

Conversation

@openroad-ci

@openroad-ci openroad-ci commented Apr 7, 2026

Copy link
Copy Markdown
Member

Summary

The MBFF algorithm previously used only leakage power to decide whether
to replace single-bit flip-flops with multi-bit cells. For flip-flops,
internal power dominates total power, and MBFF cells share scan (SE/SI)
and clock structures across bits, giving 40-90% savings on those pins.
Ignoring internal power caused clustering to increase total power on
some PDKs.

Add getInternalEnergy() which sums average internal energy across all
pins (CK, D, Q, SE, SI) from Liberty internal_power tables. Use this
alongside leakage in three places:

  • SetRatios: norm_power_ uses total estimated power (leakage +
    internal_energy * clock_activity) so the ILP cost function reflects
    total power, not just leakage.
  • ReadLibs: select best tray per size by minimum total estimated power
    instead of minimum leakage, so cells with lower total power (e.g. SVT
    over LVT) are preferred even when their leakage is higher.
  • SetVars: select the single-bit baseline cell by lowest total estimated
    power, with both leakage and internal energy paired from the same cell.

Clock period is obtained from SDC before ReadLibs runs so tray selection
can account for internal power. Falls back to leakage-only when no
clock is defined or no internal_power tables exist.

Type of Change

  • New feature

Verification

  • I have verified that the local build succeeds (./etc/Build.sh).
  • I have run the relevant tests and they pass.
  • My code follows the repository's formatting guidelines.
  • I have signed my commits (DCO).

@maliberty

Copy link
Copy Markdown
Member

@mikesinouye please test this on your internal designs. I'm seeing improvement on some of our designs.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request integrates clock pin internal power into the MBFF cost metric, ensuring more accurate power estimation during clustering. The changes include adding a method to calculate clock pin energy, updating the cost calculation logic, and caching clock periods. I have identified a potential division-by-zero risk in the cost normalization logic, a performance concern regarding redundant STA lookups within the SetVars loop, and a violation of the style guide regarding the use of magic numbers for clock activity calculations.

Comment thread src/gpl/src/mbff.cpp Outdated
Comment thread src/gpl/src/mbff.cpp Outdated
Comment thread src/gpl/src/mbff.cpp Outdated
@github-actions

github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Comment thread src/gpl/src/mbff.cpp Outdated
@openroad-ci openroad-ci force-pushed the mbff-improve-power-modeling branch from c194db0 to eee27b3 Compare April 9, 2026 18:26
@github-actions github-actions Bot added the size/M label Apr 9, 2026
@maliberty maliberty changed the title [gpl] Include clock pin internal power in MBFF clustering cost [gpl] Include internal power in MBFF clustering cost Apr 9, 2026
@github-actions

github-actions Bot commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@maliberty

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eee27b3ea3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/gpl/src/mbff.cpp Outdated
Comment thread src/gpl/src/mbff.cpp Outdated
@openroad-ci openroad-ci force-pushed the mbff-improve-power-modeling branch 2 times, most recently from 68e9145 to 2961689 Compare April 12, 2026 01:06
@github-actions

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@openroad-ci openroad-ci force-pushed the mbff-improve-power-modeling branch from 2961689 to 3f3b92b Compare April 12, 2026 04:06

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment thread src/gpl/src/mbff.cpp Outdated
The MBFF algorithm previously used only leakage power to decide whether
to replace single-bit flip-flops with multi-bit cells.  For flip-flops,
internal power dominates total power, and MBFF cells share scan (SE/SI)
and clock structures across bits, giving 40-90% savings on those pins.
Ignoring internal power caused clustering to increase total power on
some PDKs.

Add getInternalEnergy() which sums average internal energy across all
pins (CK, D, Q, SE, SI) from Liberty internal_power tables.  Use this
alongside leakage in three places:

- SetRatios: norm_power_ uses total estimated power (leakage +
  internal_energy * clock_activity) so the ILP cost function reflects
  total power, not just leakage.
- ReadLibs: select best tray per size by minimum total estimated power
  instead of minimum leakage, so cells with lower total power (e.g. SVT
  over LVT) are preferred even when their leakage is higher.
- SetVars: select the single-bit baseline cell by lowest total estimated
  power, with both leakage and internal energy paired from the same cell.

Clock period is obtained from SDC before ReadLibs runs so tray selection
can account for internal power.  Falls back to leakage-only when no
clock is defined or no internal_power tables exist.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@openroad-ci openroad-ci force-pushed the mbff-improve-power-modeling branch from 3f3b92b to ae5c013 Compare April 12, 2026 04:21
@github-actions

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@maliberty maliberty merged commit aec50a4 into The-OpenROAD-Project:master Apr 12, 2026
14 of 16 checks passed
@maliberty maliberty deleted the mbff-improve-power-modeling branch April 12, 2026 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants