Skip to content

flow: add RTLMP_KEEP_CLUSTERING option - #4412

Open
jorge-ferreira-pii wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:feature-MPL-cluster
Open

flow: add RTLMP_KEEP_CLUSTERING option#4412
jorge-ferreira-pii wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:feature-MPL-cluster

Conversation

@jorge-ferreira-pii

@jorge-ferreira-pii jorge-ferreira-pii commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

rtl_macro_placer can run with the -keep_clustering_data flag (which is off by default), so the physical hierarchy that its clustering engine builds is kept in the database as dbGroups and stays inspectable after the run: The Web GUI Hierarchy Browser panel lists the clusters, and save_image -web -display_option {cluster_view true} plots it headless.

Part of issue #7959

@jorge-ferreira-pii jorge-ferreira-pii self-assigned this Aug 11, 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 adds the -keep_clustering_data flag to additional_rtlmp_args in flow/scripts/macro_place_util.tcl. The reviewer noted that if the RTLMP_ARGS environment variable is defined, it will overwrite all_args and bypass this new flag. They suggested appending -keep_clustering_data after the RTLMP_ARGS check to ensure the flag is always applied.

Comment thread flow/scripts/macro_place_util.tcl Outdated
append_env_var additional_rtlmp_args RTLMP_NOTCH_WT -notch_weight 1
append_env_var additional_rtlmp_args RTLMP_RPT_DIR -report_directory 1

append additional_rtlmp_args " -keep_clustering_data"

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.

medium

If the environment variable RTLMP_ARGS is defined, all_args is completely overwritten by $::env(RTLMP_ARGS) (lines 68-70), which will bypass the -keep_clustering_data flag added here. To ensure that the clustering tree is always stored in the ODB as intended, consider appending -keep_clustering_data to all_args after the RTLMP_ARGS check rather than appending it to additional_rtlmp_args here.

@openroad-ci

openroad-ci commented Aug 11, 2026

Copy link
Copy Markdown
Member

🔍 QoR check

Metrics reflect the PR merge build — i.e. what will land on the target branch. Advisory — results are log-only and do not affect build status. The authoritative QoR gate remains the local rules-file check.

Commit 443ac67 · Jenkins build #3 · Baseline: build

61 design(s) checked — 0 with regression(s), 0 without a comparable baseline.
Design Variant Verdict local vs inline passed / failed / missing
asap7/aes base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/aes-block base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/aes-mbff base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/aes_lvt base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/cva6 base ✅ pass ✅ MATCH 12 / 0 / 0
asap7/ethmac base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/ethmac_lvt base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/gcd-ccs base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/jpeg_lvt base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/mock-alu base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/mock-cpu base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/riscv32i-mock-sram base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/swerv_wrapper base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/uart base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/aes base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/aes-hybrid base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/uart-blocks base ✅ pass ✅ MATCH 25 / 0 / 0
gt2n/aes base ✅ pass ✅ MATCH 25 / 0 / 0
gt2n/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
gt2n/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/aes base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/i2c-gpio-expander base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/spi base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/aes base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/ariane133 base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/ariane136 base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/black_parrot base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/bp_be_top base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/bp_fe_top base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/bp_multi_top base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/dynamic_node base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/mempool_group base ✅ pass ✅ MATCH 12 / 0 / 0
nangate45/swerv base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/swerv_wrapper base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/tinyRocket base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/aes base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/chameleon base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/microwatt base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/aes base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0

@AcKoucher

Copy link
Copy Markdown
Contributor

I don't think -keep_clustering_data should be on by default. It's for debugging and could possibly interfere with other types of groups during placement.

@jorge-ferreira-pii

Copy link
Copy Markdown
Contributor Author

I don't think -keep_clustering_data should be on by default. It's for debugging and could possibly interfere with other types of groups during placement.

I wasn't aware it could interfere with other group types. I've updated the default value of -keep_clustering_data to false.

@AcKoucher AcKoucher 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.

The name of this PR doesn't tell what it is actually doing. Please, adjust it.

Comment thread flow/scripts/macro_place_util.tcl Outdated
append_env_var additional_rtlmp_args RTLMP_BOUNDARY_WT -boundary_weight 1
append_env_var additional_rtlmp_args RTLMP_NOTCH_WT -notch_weight 1
append_env_var additional_rtlmp_args RTLMP_RPT_DIR -report_directory 1
# Off by default: an inspection aid that most runs do not need.

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.

Redundant

Comment on lines +1466 to +1467
stages:
- floorplan

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.

default: 0

Comment thread flow/scripts/variables.yaml Outdated
Comment on lines +1453 to +1465
Set to 1 to keep the physical hierarchy that the RTL macro placer's
clustering engine builds, stored in the ODB as nested dbGroups of type
VISUAL_DEBUG. An inspection aid, off by default: the web viewer's Clusters
panel then lists the clusters and can color the layout by cluster, and
`save_image -web -display_option {cluster_view true}` plots it headless.
The clustering itself runs either way, so the only cost is storing it -
around 1% of the macro placement runtime on the largest ORFS cluster tree
(nangate45/bp_quad, 220 macros, 98 clusters) and a few KB of ODB. On a
design that uses power domains or region groups, the instances already
owned by one of those stay in it and are left out of the clustering data
(reported once as MPL-0078), since an instance belongs to a single dbGroup -
so those cells show up uncolored in the Clusters view. Ignored when
RTLMP_ARGS is set, which replaces the whole argument list.

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.

Don't cite other things apart from MPL behavior here, it ends up polluting the docs.

Set it to 1 and the macro placer runs with -keep_clustering_data, which
keeps the physical hierarchy its clustering engine builds in the ODB as
nested dbGroups.  That is what makes the partitioning inspectable after
the run: the web viewer's Clusters panel lists it, and `save_image -web
-display_option {cluster_view true}` plots it headless.

Off by default, for two reasons.  It is an inspection aid that most runs
do not need, and the clusters take ownership of the instances they hold --
an instance belongs to a single dbGroup -- so on a design with power
domains or region groups it would take them away from those.  OpenROAD
leaves such instances alone and reports them (MPL-0078), but there is no
reason to spend the ODB on a tree nobody asked for.

The clustering itself runs either way, so the only cost of turning it on
is storing the result: measured on nangate45/bp_quad (220 macros, 1.18M
instances, 98 clusters over 3 levels -- the largest cluster tree among the
ORFS designs) the macro placer goes from 137.8s to 139.9s, inside the
annealer's own run-to-run spread, and the ODB grows ~22KB on 90MB.

Note that RTLMP_ARGS still replaces the whole argument list, so flows
setting it must pass -keep_clustering_data themselves.

Part of The-OpenROAD-Project/OpenROAD#7959

Signed-off-by: Jorge Ferreira <jorge.ferreira@precisioninno.com>

@AcKoucher AcKoucher 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.

@jorge-ferreira-pii Please, fix the PR title, it's still misleading as you're only adding the option here.

Two more things:

  1. Avoid adding information that is not related to the changes themselves in the commit message. It's very long and it's not very helpful.
  2. Please, don't force-push after a review - we lose the history.

@jorge-ferreira-pii jorge-ferreira-pii changed the title flow: always store the MPL clustering tree in the ODB flow: add RTLMP_KEEP_CLUSTERING option Aug 12, 2026
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.

3 participants