Skip to content

Commit 057ae0b

Browse files
force clustering for root cluster smaller than max threshold
Signed-off-by: Ravi Varadarajan <rvaradarajan@ucsd.edu>
1 parent 249bd4d commit 057ae0b

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

src/mpl2/src/hier_rtlmp.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,12 @@ void HierRTLMP::hierRTLMacroPlacer()
330330

331331
// Create physical hierarchy tree in a post-order DFS manner
332332
logger_->report("Call multi level clustering max level: {}", max_num_level_);
333+
333334
multiLevelCluster(root_cluster_); // Recursive call for creating the tree
334335
logger_->report("Print Physical Hierarchy Tree ** max_hier_level: {}",
335336
max_hier_level_);
336337
printPhysicalHierarchyTree(root_cluster_, 0);
337338

338-
339339
//
340340
// Break leaf clusters into a standard-cell cluster and a hard-macro cluster
341341
// And merge macros into clusters based on connection signatures and
@@ -361,7 +361,7 @@ void HierRTLMP::hierRTLMacroPlacer()
361361
"Print Physical Hierarchy Tree after breaking mixed clusters **");
362362
printPhysicalHierarchyTree(root_cluster_, 0);
363363

364-
//logger_->error(MPL, 9991, "Force exit");
364+
// logger_->error(MPL, 9991, "Force exit");
365365

366366
// Map the macros in each cluster to their HardMacro objects
367367
for (auto& [cluster_id, cluster] : cluster_map_) {
@@ -742,6 +742,19 @@ void HierRTLMP::createBundledIOs()
742742
//
743743
void HierRTLMP::multiLevelCluster(Cluster* parent)
744744
{
745+
bool force_split = false;
746+
if (level_ == 0) {
747+
// check if root cluster is below the max size of a leaf cluster
748+
// Force create child clusters in this case
749+
int leaf_cluster_size
750+
= max_num_inst_base_ / std::pow(coarsening_ratio_, max_num_level_ - 1);
751+
if (parent->getNumStdCell() < leaf_cluster_size)
752+
force_split = true;
753+
logger_->report(
754+
"Set fource split: leaf cluster size: {} root cluster size: {}",
755+
leaf_cluster_size,
756+
parent->getNumStdCell());
757+
}
745758
if (level_ >= max_num_level_) { // limited by the user-specified parameter
746759
return;
747760
}
@@ -781,8 +794,7 @@ void HierRTLMP::multiLevelCluster(Cluster* parent)
781794
max_num_inst_,
782795
min_num_inst_);
783796

784-
if (/*parent->getNumMacro() > max_num_macro_ ||*/ parent->getNumStdCell()
785-
> max_num_inst_) {
797+
if (force_split || (parent->getNumStdCell() > max_num_inst_)) {
786798
if ((max_num_level_ - level_) > max_hier_level_)
787799
max_hier_level_ = max_num_level_ - level_;
788800
breakCluster(parent); // Break the parent cluster into children clusters

0 commit comments

Comments
 (0)