@@ -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 [...]
14891497void 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
16371645bool ClusteringEngine::partitionerSolutionIsFullyUnbalanced (
0 commit comments