flow: add RTLMP_KEEP_CLUSTERING option - #4412
Conversation
There was a problem hiding this comment.
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.
| 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" |
There was a problem hiding this comment.
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.
🔍 QoR checkMetrics 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 61 design(s) checked — 0 with regression(s), 0 without a comparable baseline.
|
|
I don't think |
7bba822 to
a3500c8
Compare
I wasn't aware it could interfere with other group types. I've updated the default value of -keep_clustering_data to false. |
AcKoucher
left a comment
There was a problem hiding this comment.
The name of this PR doesn't tell what it is actually doing. Please, adjust it.
| 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. |
| stages: | ||
| - floorplan |
| 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. |
There was a problem hiding this comment.
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>
a3500c8 to
6582e79
Compare
There was a problem hiding this comment.
@jorge-ferreira-pii Please, fix the PR title, it's still misleading as you're only adding the option here.
Two more things:
- 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.
- Please, don't force-push after a review - we lose the history.
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