Skip to content

Commit a3500c8

Browse files
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 <jorge.ferreira@precisioninno.com>
1 parent ab244fc commit a3500c8

4 files changed

Lines changed: 28 additions & 0 deletions

File tree

‎docs/user/FlowVariables.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ configuration file.
255255
| <a name="RTLMP_FENCE_LY"></a>RTLMP_FENCE_LY| Defines the lower left Y coordinate for the global fence bounding box in microns.| 0.0|
256256
| <a name="RTLMP_FENCE_UX"></a>RTLMP_FENCE_UX| Defines the upper right X coordinate for the global fence bounding box in microns.| 0.0|
257257
| <a name="RTLMP_FENCE_UY"></a>RTLMP_FENCE_UY| Defines the upper right Y coordinate for the global fence bounding box in microns.| 0.0|
258+
| <a name="RTLMP_KEEP_CLUSTERING"></a>RTLMP_KEEP_CLUSTERING| 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.| |
258259
| <a name="RTLMP_MAX_INST"></a>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.| |
259260
| <a name="RTLMP_MAX_LEVEL"></a>RTLMP_MAX_LEVEL| Maximum depth of the physical hierarchy tree.| 2|
260261
| <a name="RTLMP_MAX_MACRO"></a>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.
429430
- [RTLMP_FENCE_LY](#RTLMP_FENCE_LY)
430431
- [RTLMP_FENCE_UX](#RTLMP_FENCE_UX)
431432
- [RTLMP_FENCE_UY](#RTLMP_FENCE_UY)
433+
- [RTLMP_KEEP_CLUSTERING](#RTLMP_KEEP_CLUSTERING)
432434
- [RTLMP_MAX_INST](#RTLMP_MAX_INST)
433435
- [RTLMP_MAX_LEVEL](#RTLMP_MAX_LEVEL)
434436
- [RTLMP_MAX_MACRO](#RTLMP_MAX_MACRO)

‎flow/scripts/macro_place_util.tcl‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ if { [find_macros] != "" } {
5353
append_env_var additional_rtlmp_args RTLMP_BOUNDARY_WT -boundary_weight 1
5454
append_env_var additional_rtlmp_args RTLMP_NOTCH_WT -notch_weight 1
5555
append_env_var additional_rtlmp_args RTLMP_RPT_DIR -report_directory 1
56+
# Off by default: an inspection aid that most runs do not need.
57+
append_env_var additional_rtlmp_args RTLMP_KEEP_CLUSTERING \
58+
-keep_clustering_data 0
5659
append_env_var additional_rtlmp_args RTLMP_FENCE_LX -fence_lx 1
5760
append_env_var additional_rtlmp_args RTLMP_FENCE_LY -fence_ly 1
5861
append_env_var additional_rtlmp_args RTLMP_FENCE_UX -fence_ux 1

‎flow/scripts/variables.json‎

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎flow/scripts/variables.yaml‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,6 +1448,23 @@ RTLMP_ARGS:
14481448
Overrides all other RTL macro placer arguments.
14491449
stages:
14501450
- floorplan
1451+
RTLMP_KEEP_CLUSTERING:
1452+
description: >
1453+
Set to 1 to keep the physical hierarchy that the RTL macro placer's
1454+
clustering engine builds, stored in the ODB as nested dbGroups of type
1455+
VISUAL_DEBUG. An inspection aid, off by default: the web viewer's Clusters
1456+
panel then lists the clusters and can color the layout by cluster, and
1457+
`save_image -web -display_option {cluster_view true}` plots it headless.
1458+
The clustering itself runs either way, so the only cost is storing it -
1459+
around 1% of the macro placement runtime on the largest ORFS cluster tree
1460+
(nangate45/bp_quad, 220 macros, 98 clusters) and a few KB of ODB. On a
1461+
design that uses power domains or region groups, the instances already
1462+
owned by one of those stay in it and are left out of the clustering data
1463+
(reported once as MPL-0078), since an instance belongs to a single dbGroup -
1464+
so those cells show up uncolored in the Clusters view. Ignored when
1465+
RTLMP_ARGS is set, which replaces the whole argument list.
1466+
stages:
1467+
- floorplan
14511468
GDS_ALLOW_EMPTY:
14521469
description: >
14531470
Single regular expression of module names of macros that have no .gds file

0 commit comments

Comments
 (0)