Skip to content

Commit b407479

Browse files
authored
Merge pull request #7619 from joaomai/mpl-honor-macro-thresh
mpl: honor macro thresholds
2 parents a70a71e + 27f60e4 commit b407479

3 files changed

Lines changed: 22 additions & 9 deletions

File tree

src/mpl/src/clusterEngine.cpp

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,8 @@ void ClusteringEngine::multilevelAutocluster(Cluster* parent)
12501250
level_++;
12511251
updateSizeThresholds();
12521252

1253-
if (force_split_root || (parent->getNumStdCell() > max_std_cell_)) {
1253+
if (force_split_root || (parent->getNumStdCell() > max_std_cell_)
1254+
|| (parent->getNumMacro() > max_macro_)) {
12541255
breakCluster(parent);
12551256
updateSubTree(parent);
12561257

@@ -1475,24 +1476,26 @@ void ClusteringEngine::updateSubTree(Cluster* parent)
14751476
for (int i = 0; i < new_children.size(); ++i) {
14761477
auto& child = new_children[i];
14771478
child->setParent(parent);
1478-
if (child->getNumStdCell() > max_std_cell_) {
1479+
if (isLargeFlatCluster(child.get())) {
14791480
breakLargeFlatCluster(child.get());
14801481
}
14811482
}
14821483
}
14831484

1485+
bool ClusteringEngine::isLargeFlatCluster(const Cluster* cluster) const
1486+
{
1487+
return (cluster->getDbModules().empty()
1488+
&& (cluster->getLeafStdCells().size() > max_std_cell_
1489+
|| cluster->getLeafMacros().size() > max_macro_));
1490+
}
1491+
14841492
// Break large flat clusters with TritonPart
14851493
// Binary coding method to differentiate partitions:
14861494
// cluster -> cluster_0, cluster_1
14871495
// cluster_0 -> cluster_0_0, cluster_0_1
14881496
// cluster_1 -> cluster_1_0, cluster_1_1 [...]
14891497
void ClusteringEngine::breakLargeFlatCluster(Cluster* parent)
14901498
{
1491-
// Check if the cluster is a large flat cluster
1492-
if (!parent->getDbModules().empty()
1493-
|| parent->getLeafStdCells().size() < max_std_cell_) {
1494-
return;
1495-
}
14961499
updateInstancesAssociation(parent);
14971500

14981501
std::map<int, int> cluster_vertex_id_map;
@@ -1630,8 +1633,13 @@ void ClusteringEngine::breakLargeFlatCluster(Cluster* parent)
16301633

16311634
// Recursive break the cluster
16321635
// until the size of the cluster is less than max_num_inst_
1633-
breakLargeFlatCluster(parent);
1634-
breakLargeFlatCluster(raw_part_1);
1636+
if (isLargeFlatCluster(parent)) {
1637+
breakLargeFlatCluster(parent);
1638+
}
1639+
1640+
if (isLargeFlatCluster(raw_part_1)) {
1641+
breakLargeFlatCluster(raw_part_1);
1642+
}
16351643
}
16361644

16371645
bool ClusteringEngine::partitionerSolutionIsFullyUnbalanced(

src/mpl/src/clusterEngine.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ class ClusteringEngine
202202
void createCluster(odb::dbModule* module, Cluster* parent);
203203
void createCluster(Cluster* parent);
204204
void updateSubTree(Cluster* parent);
205+
bool isLargeFlatCluster(const Cluster* cluster) const;
205206
void breakLargeFlatCluster(Cluster* parent);
206207
bool partitionerSolutionIsFullyUnbalanced(const std::vector<int>& solution,
207208
int num_other_cluster_vertices);

test/orfs/mock-array/BUILD

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ orfs_flow(
130130
),
131131
"MACRO_PLACE_HALO": "0 2.16",
132132
"RTLMP_BOUNDARY_WT": "0",
133+
"RTLMP_MAX_INST" :"250",
134+
"RTLMP_MIN_INST" :"50",
135+
"RTLMP_MAX_MACRO" :"64",
136+
"RTLMP_MIN_MACRO" :"8",
133137
"PDN_TCL": "$(PLATFORM_DIR)/openRoad/pdn/BLOCKS_grid_strategy.tcl",
134138
"MACRO_ROWS_HALO_X": "0.5",
135139
"MACRO_ROWS_HALO_Y": "0.5",

0 commit comments

Comments
 (0)