From 6582e7940deb555ea8be66fb8fc552cff1cd861c Mon Sep 17 00:00:00 2001 From: Jorge Ferreira Date: Tue, 11 Aug 2026 02:23:00 +0000 Subject: [PATCH] flow: add RTLMP_KEEP_CLUSTERING to store the MPL clustering tree 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 --- docs/user/FlowVariables.md | 2 ++ flow/scripts/macro_place_util.tcl | 2 ++ flow/scripts/variables.json | 7 +++++++ flow/scripts/variables.yaml | 7 +++++++ 4 files changed, 18 insertions(+) diff --git a/docs/user/FlowVariables.md b/docs/user/FlowVariables.md index 221406f855..71a0a824e5 100644 --- a/docs/user/FlowVariables.md +++ b/docs/user/FlowVariables.md @@ -255,6 +255,7 @@ configuration file. | RTLMP_FENCE_LY| Defines the lower left Y coordinate for the global fence bounding box in microns.| 0.0| | RTLMP_FENCE_UX| Defines the upper right X coordinate for the global fence bounding box in microns.| 0.0| | RTLMP_FENCE_UY| Defines the upper right Y coordinate for the global fence bounding box in microns.| 0.0| +| RTLMP_KEEP_CLUSTERING| Set to 1 to store the RTL macro placer's clustering hierarchy in the ODB as nested dbGroups.| 0| | RTLMP_MAX_INST| Maximum number of standard cells in a cluster. If unset, rtl_macro_placer will calculate a value based on the design attributes.| | | RTLMP_MAX_LEVEL| Maximum depth of the physical hierarchy tree.| 2| | RTLMP_MAX_MACRO| Maximum number of macros in a cluster. If unset, rtl_macro_placer will calculate a value based on the design attributes.| | @@ -429,6 +430,7 @@ configuration file. - [RTLMP_FENCE_LY](#RTLMP_FENCE_LY) - [RTLMP_FENCE_UX](#RTLMP_FENCE_UX) - [RTLMP_FENCE_UY](#RTLMP_FENCE_UY) +- [RTLMP_KEEP_CLUSTERING](#RTLMP_KEEP_CLUSTERING) - [RTLMP_MAX_INST](#RTLMP_MAX_INST) - [RTLMP_MAX_LEVEL](#RTLMP_MAX_LEVEL) - [RTLMP_MAX_MACRO](#RTLMP_MAX_MACRO) diff --git a/flow/scripts/macro_place_util.tcl b/flow/scripts/macro_place_util.tcl index 70ac5ea23f..9fb06ff989 100644 --- a/flow/scripts/macro_place_util.tcl +++ b/flow/scripts/macro_place_util.tcl @@ -53,6 +53,8 @@ if { [find_macros] != "" } { 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 + append_env_var additional_rtlmp_args RTLMP_KEEP_CLUSTERING \ + -keep_clustering_data 0 append_env_var additional_rtlmp_args RTLMP_FENCE_LX -fence_lx 1 append_env_var additional_rtlmp_args RTLMP_FENCE_LY -fence_ly 1 append_env_var additional_rtlmp_args RTLMP_FENCE_UX -fence_ux 1 diff --git a/flow/scripts/variables.json b/flow/scripts/variables.json index d0d8d0dbbf..f6eedeaca3 100644 --- a/flow/scripts/variables.json +++ b/flow/scripts/variables.json @@ -998,6 +998,13 @@ "floorplan" ] }, + "RTLMP_KEEP_CLUSTERING": { + "default": 0, + "description": "Set to 1 to store the RTL macro placer's clustering hierarchy in the ODB as nested dbGroups.\n", + "stages": [ + "floorplan" + ] + }, "RTLMP_MAX_INST": { "description": "Maximum number of standard cells in a cluster. If unset, rtl_macro_placer will calculate a value based on the design attributes.\n", "stages": [ diff --git a/flow/scripts/variables.yaml b/flow/scripts/variables.yaml index ae24b8359c..c829d4079e 100644 --- a/flow/scripts/variables.yaml +++ b/flow/scripts/variables.yaml @@ -1448,6 +1448,13 @@ RTLMP_ARGS: Overrides all other RTL macro placer arguments. stages: - floorplan +RTLMP_KEEP_CLUSTERING: + description: > + Set to 1 to store the RTL macro placer's clustering hierarchy in the ODB as + nested dbGroups. + default: 0 + stages: + - floorplan GDS_ALLOW_EMPTY: description: > Single regular expression of module names of macros that have no .gds file