Skip to content

Commit 1b66a59

Browse files
authored
Merge pull request #10133 from AcKoucher/mpl-default-halo
mpl: make default halo live in HierRTLMP
2 parents 61932e8 + 4caddfe commit 1b66a59

4 files changed

Lines changed: 21 additions & 14 deletions

File tree

src/mpl/src/clusterEngine.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@ void ClusteringEngine::setTree(PhysicalHierarchy* tree)
8383
}
8484

8585
void ClusteringEngine::setHalos(
86-
std::map<odb::dbInst*, HardMacro::Halo>& macro_to_halo)
86+
const HardMacro::Halo& default_halo,
87+
const std::map<odb::dbInst*, HardMacro::Halo>& macro_to_halo)
8788
{
89+
default_halo_ = default_halo;
8890
macro_to_halo_ = macro_to_halo;
8991
}
9092

@@ -315,10 +317,10 @@ void ClusteringEngine::reportDesignData()
315317
block_->dbuAreaToMicrons(design_metrics_->getStdCellArea()),
316318
design_metrics_->getNumMacro(),
317319
block_->dbuAreaToMicrons(design_metrics_->getMacroArea()),
318-
block_->dbuToMicrons(tree_->default_halo.left),
319-
block_->dbuToMicrons(tree_->default_halo.bottom),
320-
block_->dbuToMicrons(tree_->default_halo.right),
321-
block_->dbuToMicrons(tree_->default_halo.top),
320+
block_->dbuToMicrons(default_halo_.left),
321+
block_->dbuToMicrons(default_halo_.bottom),
322+
block_->dbuToMicrons(default_halo_.right),
323+
block_->dbuToMicrons(default_halo_.top),
322324
block_->dbuAreaToMicrons(tree_->macro_with_halo_area),
323325
block_->dbuAreaToMicrons(design_metrics_->getStdCellArea()
324326
+ design_metrics_->getMacroArea()),
@@ -2084,13 +2086,13 @@ void ClusteringEngine::createHardMacros()
20842086
if (inst->getHalo()->isSoft()) {
20852087
halo = HardMacro::Halo(inst->getHalo());
20862088
} else {
2087-
halo = {std::max(inst_halo.xMin(), tree_->default_halo.left),
2088-
std::max(inst_halo.yMin(), tree_->default_halo.bottom),
2089-
std::max(inst_halo.xMax(), tree_->default_halo.right),
2090-
std::max(inst_halo.yMax(), tree_->default_halo.top)};
2089+
halo = {std::max(inst_halo.xMin(), default_halo_.left),
2090+
std::max(inst_halo.yMin(), default_halo_.bottom),
2091+
std::max(inst_halo.xMax(), default_halo_.right),
2092+
std::max(inst_halo.yMax(), default_halo_.top)};
20912093
}
20922094
} else {
2093-
halo = tree_->default_halo;
2095+
halo = default_halo_;
20942096
}
20952097

20962098
auto macro = std::make_unique<HardMacro>(inst, halo);

src/mpl/src/clusterEngine.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ struct PhysicalHierarchy
5757
BoundaryRegionList available_regions_for_unconstrained_pins;
5858
ClusterToBoundaryRegionMap io_cluster_to_constraint;
5959

60-
HardMacro::Halo default_halo;
6160
int64_t macro_with_halo_area{0};
6261

6362
// The constraint set by the user.
@@ -104,7 +103,8 @@ class ClusteringEngine
104103
void run();
105104

106105
void setTree(PhysicalHierarchy* tree);
107-
void setHalos(std::map<odb::dbInst*, HardMacro::Halo>& macro_to_halo);
106+
void setHalos(const HardMacro::Halo& default_halo,
107+
const std::map<odb::dbInst*, HardMacro::Halo>& macro_to_halo);
108108

109109
// Methods to update the tree as the hierarchical
110110
// macro placement runs.
@@ -251,6 +251,8 @@ class ClusteringEngine
251251
IOBundleSpans io_bundle_spans_;
252252

253253
std::unordered_set<odb::dbInst*> ignorable_macros_;
254+
255+
HardMacro::Halo default_halo_;
254256
std::map<odb::dbInst*, HardMacro::Halo> macro_to_halo_;
255257
};
256258

src/mpl/src/hier_rtlmp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ void HierRTLMP::setGlobalFence(odb::Rect global_fence)
113113

114114
void HierRTLMP::setDefaultHalo(int halo_width, int halo_height)
115115
{
116-
tree_->default_halo = {halo_width, halo_height, halo_width, halo_height};
116+
default_halo_ = {halo_width, halo_height, halo_width, halo_height};
117117
}
118118

119119
void HierRTLMP::setGuidanceRegions(
@@ -270,7 +270,7 @@ void HierRTLMP::runMultilevelAutoclustering()
270270

271271
// Set target structure
272272
clustering_engine_->setTree(tree_.get());
273-
clustering_engine_->setHalos(macro_to_halo_);
273+
clustering_engine_->setHalos(default_halo_, macro_to_halo_);
274274
clustering_engine_->run();
275275

276276
if (!tree_->has_unfixed_macros) {

src/mpl/src/hier_rtlmp.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,10 @@ class HierRTLMP
293293

294294
std::map<std::string, odb::Rect> fences_; // macro_name, fence
295295
std::map<odb::dbInst*, odb::Rect> guides_; // Macro -> Guidance Region
296+
297+
HardMacro::Halo default_halo_;
296298
std::map<odb::dbInst*, HardMacro::Halo> macro_to_halo_;
299+
297300
std::vector<odb::Rect> placement_blockages_;
298301
std::vector<odb::Rect> io_blockages_;
299302

0 commit comments

Comments
 (0)