Skip to content

gpl: add option to compute density subtracting macro area from the denominator - #12111

Merged
AcKoucher merged 4 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:gpl-uniform-density-unplaced-macros
Nov 17, 2026
Merged

AcKoucher merged 4 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:gpl-uniform-density-unplaced-macros

Conversation

@AcKoucher

@AcKoucher AcKoucher commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Currently in ORFS we use GPL's uniform density as "std cell utilization" for MPL (which is just an odd name for std cell density). As GPL is capable of placing every cell in the design including the macros, the uniform density is computed accordingly i.e., as if it were going to place them:

density = (std_area + target_density * movable_macro_area) / (core - fixed - unusable)

The fact that we use such density for std cells in MPL causes a discrepancy between the utilization that MPL and GPL see, because, for MPL, the density should refer strictly to the std cells. That means the area of the macros must be treated as area that is not movable by GPL when computing the uniform density. We achieve that by simply subtracting the macro area from the denominator:

density = std_area / (core - fixed - unusable - macro_master_area)

Note that there is already an innate discrepancy between the density that these tools see, because MPL precisely bloats the std cell clusters with the value set by the user and GPL may not reach that target value.

Observation regarding the naming idea here: initially I thought of -unfixed_macros_as_fixed/placed, however, that is not precise, because a placed/fixed macro has a location in the die, which is definitely not the case. After some thinking, I decided that being a bit more literal for this case helps us more than harms us.

That said, this PR:

  • Adds an option to compute the density subtracting the macro area from the density denominator.
  • Makes get_global_placement_uniform_density a proper command rather than a "developer" command which I think makes sense as it is used in production on ORFS.

Type of Change

  • New feature
  • Documentation update

Impact

None. Results will change when the option is used in ORFS.

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 included tests to prevent regressions.
  • I have signed my commits (DCO).

Related Issues

Found when working on #11592

Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
@AcKoucher AcKoucher self-assigned this Nov 3, 2026
@github-actions github-actions Bot added the size/S label Nov 3, 2026

@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 introduces the -unplaced_macros_as_fixed option to the get_global_placement_uniform_density command, allowing unplaced macros to be treated as fixed instances during density calculations. However, several issues were identified in the review: the new flag is parsed in Tcl but not passed to the underlying C++ implementation, making it ignored; unplaced macros assigned to specific regions are incorrectly excluded from those regions' area calculations; and the regression test passes coincidentally without actually validating the new flag's functionality.

Comment thread src/gpl/src/replace.tcl Resolved
Comment thread src/gpl/src/placerBase.cpp Resolved
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
@AcKoucher
AcKoucher marked this pull request as ready for review November 4, 2026 19:14
@AcKoucher
AcKoucher requested a review from a team as a code owner November 4, 2026 19:14
@AcKoucher
AcKoucher requested a review from LucasYuki November 4, 2026 19:14
@AcKoucher

Copy link
Copy Markdown
Contributor Author

The wording of the feature is not exactly accurate. I'm marking this as a draft and will ping when it's ready to review.

@AcKoucher
AcKoucher marked this pull request as draft November 9, 2026 20:08
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
@AcKoucher AcKoucher changed the title gpl: add uniform density option to consider macros as placed gpl: add option to compute density subtracting macro area from the denominator Nov 17, 2026
@AcKoucher
AcKoucher marked this pull request as ready for review November 17, 2026 00:06
@AcKoucher

Copy link
Copy Markdown
Contributor Author

@LucasYuki Ready for review.

@AcKoucher
AcKoucher merged commit 51b4aef into The-OpenROAD-Project:master Nov 17, 2026
20 checks passed
@AcKoucher
AcKoucher deleted the gpl-uniform-density-unplaced-macros branch November 17, 2026 14:08
Comment thread src/gpl/src/placerBase.cpp Resolved
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