@@ -41,6 +41,7 @@ ClusteringEngine::ClusteringEngine(odb::dbBlock* block,
4141
4242void ClusteringEngine::run ()
4343{
44+ design_metrics_ = computeModuleMetrics (block_->getTopModule ());
4445 init ();
4546
4647 if (!tree_->has_unfixed_macros ) {
@@ -86,9 +87,6 @@ void ClusteringEngine::setTree(PhysicalHierarchy* tree)
8687// initialize the tree with data from the design.
8788void ClusteringEngine::init ()
8889{
89- setFloorplanShape ();
90- design_metrics_ = computeModuleMetrics (block_->getTopModule ());
91-
9290 const std::vector<odb::dbInst*> unfixed_macros = getUnfixedMacros ();
9391 if (unfixed_macros.empty ()) {
9492 tree_->has_unfixed_macros = false ;
@@ -97,6 +95,7 @@ void ClusteringEngine::init()
9795 }
9896
9997 setDieArea ();
98+ setFloorplanShape ();
10099 searchForFixedInstsInsideFloorplanShape ();
101100
102101 tree_->macro_with_halo_area = computeMacroWithHaloArea (unfixed_macros);
@@ -197,8 +196,6 @@ Metrics* ClusteringEngine::computeModuleMetrics(odb::dbModule* module)
197196 float macro_area = 0.0 ;
198197
199198 const odb::Rect& core = block_->getCoreArea ();
200- const odb::Rect macro_placement_area
201- = micronsToDbu (block_, tree_->floorplan_shape );
202199
203200 for (odb::dbInst* inst : module ->getInsts ()) {
204201 if (isIgnoredInst (inst)) {
@@ -207,16 +204,7 @@ Metrics* ClusteringEngine::computeModuleMetrics(odb::dbModule* module)
207204
208205 float inst_area = computeMicronArea (inst);
209206
210- if (inst->isBlock ()) {
211- if (inst->isFixed ()) {
212- const odb::Rect inst_box = inst->getBBox ()->getBox ();
213- if (!macro_placement_area.contains (inst_box)) {
214- continue ;
215- }
216-
217- tree_->has_fixed_macros = true ;
218- }
219-
207+ if (inst->isBlock ()) { // a macro
220208 num_macro += 1 ;
221209 macro_area += inst_area;
222210
@@ -235,6 +223,10 @@ Metrics* ClusteringEngine::computeModuleMetrics(odb::dbModule* module)
235223 generateMacroAndCoreDimensionsTable (macro.get (), core));
236224 }
237225
226+ if (macro->isFixed ()) {
227+ tree_->has_fixed_macros = true ;
228+ }
229+
238230 tree_->maps .inst_to_hard [inst] = std::move (macro);
239231 } else {
240232 num_std_cell += 1 ;
@@ -889,7 +881,8 @@ DataFlowHypergraph ClusteringEngine::computeHypergraph(
889881bool ClusteringEngine::isIgnoredInst (odb::dbInst* inst)
890882{
891883 odb::dbMaster* master = inst->getMaster ();
892- return master->isPad () || master->isCover () || master->isEndCap ();
884+ return master->isPad () || master->isCover () || master->isEndCap ()
885+ || inst->getITerms ().empty ();
893886}
894887
895888// Forward or Backward DFS search to find sequential paths from/to IO pins based
0 commit comments