Skip to content

mpl: fix partitioner fails on cluster dominated by a macro#10581

Draft
joaomai wants to merge 7 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:mpl-huge-macro-partitioner
Draft

mpl: fix partitioner fails on cluster dominated by a macro#10581
joaomai wants to merge 7 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:mpl-huge-macro-partitioner

Conversation

@joaomai
Copy link
Copy Markdown
Contributor

@joaomai joaomai commented Jun 2, 2026

Summary

Updates the breakLargeFlatCluster method to take into consideration clusters dominated by a macro (over 50% of the cluster area corresponds to a single macro), which makes the partitioning problem too difficult or impossible down the line.

Type of Change

  • Bug fix

Impact

Tool doesn't fail for clusters dominated by a single macro.

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).

QuantamHD and others added 6 commits June 2, 2026 11:39
This error seems to occur when you have a macro dominated
block with just a few standard cells. Added a test case
that I validated failed with HEAD and passes with my change.

B:513351985
Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>

clang-format

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
@joaomai joaomai self-assigned this Jun 2, 2026
@github-actions github-actions Bot added the size/M label Jun 2, 2026
Copy link
Copy Markdown
Contributor

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

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 a mechanism to handle clusters dominated by a single large macro in the ClusteringEngine. When a macro's area exceeds half of the parent cluster's area, it is manually split into its own HardMacroCluster to prevent partitioning issues with TritonPart's weighted min-cut algorithm. New tests are added to verify this behavior. The review feedback points out a critical logic bug where the function fails to return if the remaining cluster is no longer large, leading to unnecessary partitioning. Additionally, improvements are suggested for safety (checking if the macro list is empty before finding the max element), type safety (avoiding a reference to a pointer in a temporary vector), and a typo correction.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/mpl/src/clusterEngine.cpp Outdated
@joaomai joaomai changed the title mpl: partitioner fails on cluster dominated by a macro mpl: fix partitioner fails on cluster dominated by a macro Jun 2, 2026
Signed-off-by: João Mai <jmai@precisioninno.com>
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.

2 participants