@@ -66,7 +66,7 @@ SACoreSoftMacro::SACoreSoftMacro(PhysicalHierarchy* tree,
6666 root_ (tree->root.get())
6767{
6868 boundary_weight_ = soft_weights.boundary ;
69- macro_blockage_weight_ = soft_weights.macro_blockage ;
69+ soft_blockage_weight_ = soft_weights.soft_blockage ;
7070 notch_weight_ = soft_weights.notch ;
7171 resize_prob_ = resize_prob;
7272 notch_h_th_ = notch_h_threshold;
@@ -126,14 +126,14 @@ float SACoreSoftMacro::getNormBoundaryPenalty() const
126126 return norm_boundary_penalty_;
127127}
128128
129- float SACoreSoftMacro::getMacroBlockagePenalty () const
129+ float SACoreSoftMacro::getSoftBlockagePenalty () const
130130{
131- return macro_blockage_penalty_ ;
131+ return soft_blockage_penalty_ ;
132132}
133133
134- float SACoreSoftMacro::getNormMacroBlockagePenalty () const
134+ float SACoreSoftMacro::getNormSoftBlockagePenalty () const
135135{
136- return norm_macro_blockage_penalty_ ;
136+ return norm_soft_blockage_penalty_ ;
137137}
138138
139139float SACoreSoftMacro::getNotchPenalty () const
@@ -170,9 +170,9 @@ float SACoreSoftMacro::calNormCost() const
170170 if (norm_boundary_penalty_ > 0.0 ) {
171171 cost += boundary_weight_ * boundary_penalty_ / norm_boundary_penalty_;
172172 }
173- if (norm_macro_blockage_penalty_ > 0.0 ) {
174- cost += macro_blockage_weight_ * macro_blockage_penalty_
175- / norm_macro_blockage_penalty_ ;
173+ if (norm_soft_blockage_penalty_ > 0.0 ) {
174+ cost += soft_blockage_weight_ * soft_blockage_penalty_
175+ / norm_soft_blockage_penalty_ ;
176176 }
177177 if (norm_fixed_macros_penalty_ > 0.0 ) {
178178 cost += fixed_macros_weight_ * fixed_macros_penalty_
@@ -191,7 +191,7 @@ void SACoreSoftMacro::calPenalty()
191191 calGuidancePenalty ();
192192 calFencePenalty ();
193193 calBoundaryPenalty ();
194- calMacroBlockagePenalty ();
194+ calSoftBlockagePenalty ();
195195 calNotchPenalty ();
196196 calFixedMacrosPenalty ();
197197 if (graphics_) {
@@ -255,7 +255,7 @@ void SACoreSoftMacro::saveState()
255255 pre_guidance_penalty_ = guidance_penalty_;
256256 pre_fence_penalty_ = fence_penalty_;
257257 pre_boundary_penalty_ = boundary_penalty_;
258- pre_macro_blockage_penalty_ = macro_blockage_penalty_ ;
258+ pre_soft_blockage_penalty_ = soft_blockage_penalty_ ;
259259 pre_notch_penalty_ = notch_penalty_;
260260}
261261
@@ -288,7 +288,7 @@ void SACoreSoftMacro::restoreState()
288288 guidance_penalty_ = pre_guidance_penalty_;
289289 fence_penalty_ = pre_fence_penalty_;
290290 boundary_penalty_ = pre_boundary_penalty_;
291- macro_blockage_penalty_ = pre_macro_blockage_penalty_ ;
291+ soft_blockage_penalty_ = pre_soft_blockage_penalty_ ;
292292 notch_penalty_ = pre_notch_penalty_;
293293}
294294
@@ -302,7 +302,7 @@ void SACoreSoftMacro::initialize()
302302 std::vector<float > guidance_penalty_list;
303303 std::vector<float > fence_penalty_list;
304304 std::vector<float > boundary_penalty_list;
305- std::vector<float > macro_blockage_penalty_list ;
305+ std::vector<float > soft_blockage_penalty_list ;
306306 std::vector<float > notch_penalty_list;
307307 std::vector<float > area_penalty_list;
308308 std::vector<float > fixed_macros_penalty_list;
@@ -329,7 +329,7 @@ void SACoreSoftMacro::initialize()
329329 guidance_penalty_list.push_back (guidance_penalty_);
330330 fence_penalty_list.push_back (fence_penalty_);
331331 boundary_penalty_list.push_back (boundary_penalty_);
332- macro_blockage_penalty_list .push_back (macro_blockage_penalty_ );
332+ soft_blockage_penalty_list .push_back (soft_blockage_penalty_ );
333333 notch_penalty_list.push_back (notch_penalty_);
334334 fixed_macros_penalty_list.push_back (fixed_macros_penalty_);
335335 }
@@ -341,7 +341,7 @@ void SACoreSoftMacro::initialize()
341341 norm_guidance_penalty_ = calAverage (guidance_penalty_list);
342342 norm_fence_penalty_ = calAverage (fence_penalty_list);
343343 norm_boundary_penalty_ = calAverage (boundary_penalty_list);
344- norm_macro_blockage_penalty_ = calAverage (macro_blockage_penalty_list );
344+ norm_soft_blockage_penalty_ = calAverage (soft_blockage_penalty_list );
345345 norm_notch_penalty_ = calAverage (notch_penalty_list);
346346 norm_fixed_macros_penalty_ = calAverage (fixed_macros_penalty_list);
347347
@@ -367,8 +367,8 @@ void SACoreSoftMacro::initialize()
367367 norm_fence_penalty_ = 1.0 ;
368368 }
369369
370- if (norm_macro_blockage_penalty_ <= 1e-4 ) {
371- norm_macro_blockage_penalty_ = 1.0 ;
370+ if (norm_soft_blockage_penalty_ <= 1e-4 ) {
371+ norm_soft_blockage_penalty_ = 1.0 ;
372372 }
373373
374374 if (norm_boundary_penalty_ <= 1e-4 ) {
@@ -393,7 +393,7 @@ void SACoreSoftMacro::initialize()
393393 guidance_penalty_ = guidance_penalty_list[i];
394394 fence_penalty_ = fence_penalty_list[i];
395395 boundary_penalty_ = boundary_penalty_list[i];
396- macro_blockage_penalty_ = macro_blockage_penalty_list [i];
396+ soft_blockage_penalty_ = soft_blockage_penalty_list [i];
397397 notch_penalty_ = notch_penalty_list[i];
398398 fixed_macros_penalty_ = fixed_macros_penalty_list[i];
399399 cost_list.push_back (calNormCost ());
@@ -474,29 +474,29 @@ void SACoreSoftMacro::calBoundaryPenalty()
474474 }
475475}
476476
477- // Penalty for overlapping between clusters with macros and macro blockages.
478- // There may be situations in which we cannot guarantee that there will be
479- // no overlap, so we consider:
477+ // Penalty for overlapping between clusters with macros and virtual blockages
478+ // generated by the macro placer. There may be situations in which we cannot
479+ // guarantee that there will be no overlap, so we consider:
480480// 1) Number of macros to prioritize clusters with more macros.
481481// 2) The macro area percentage over the cluster's total area so that
482482// mixed clusters with large std cell area have less penalty.
483- void SACoreSoftMacro::calMacroBlockagePenalty ()
483+ void SACoreSoftMacro::calSoftBlockagePenalty ()
484484{
485- macro_blockage_penalty_ = 0.0 ;
486- if (blockages_ .empty () || macro_blockage_weight_ <= 0.0 ) {
485+ soft_blockage_penalty_ = 0.0 ;
486+ if (soft_blockages_ .empty () || soft_blockage_weight_ <= 0.0 ) {
487487 return ;
488488 }
489489
490490 int tot_num_macros = 0 ;
491- for (const auto & macro_id : pos_seq_) {
491+ for (const int macro_id : pos_seq_) {
492492 tot_num_macros += macros_[macro_id].getNumMacro ();
493493 }
494494 if (tot_num_macros <= 0 ) {
495495 return ;
496496 }
497497
498- for (auto & blockage : blockages_ ) {
499- for (const auto & macro_id : pos_seq_) {
498+ for (const odb::Rect & blockage : soft_blockages_ ) {
499+ for (const int macro_id : pos_seq_) {
500500 const SoftMacro& soft_macro = macros_[macro_id];
501501 if (soft_macro.getNumMacro () > 0 ) {
502502 odb::Rect overlap;
@@ -511,18 +511,19 @@ void SACoreSoftMacro::calMacroBlockagePenalty()
511511 const float macro_dominance
512512 = cluster->getMacroArea () / static_cast <float >(cluster->getArea ());
513513
514- macro_blockage_penalty_
514+ soft_blockage_penalty_
515515 += overlap.area () * soft_macro.getNumMacro () * macro_dominance;
516516 }
517517 }
518518 }
519519 // normalization
520- macro_blockage_penalty_ = macro_blockage_penalty_ / tot_num_macros;
520+ soft_blockage_penalty_ = soft_blockage_penalty_ / tot_num_macros;
521521 if (graphics_) {
522- graphics_->setMacroBlockagePenalty ({" Macro Blockage" ,
523- macro_blockage_weight_,
524- macro_blockage_penalty_,
525- norm_macro_blockage_penalty_});
522+ graphics_->setSoftBlockagePenalty (
523+ {.name = " Soft Blockage" ,
524+ .weight = soft_blockage_weight_,
525+ .value = soft_blockage_penalty_,
526+ .normalization_factor = norm_soft_blockage_penalty_});
526527 }
527528}
528529
@@ -995,10 +996,10 @@ void SACoreSoftMacro::printResults() const
995996 boundary_weight_,
996997 boundary_penalty_,
997998 norm_boundary_penalty_});
998- report ({" Macro Blockage" ,
999- macro_blockage_weight_ ,
1000- macro_blockage_penalty_ ,
1001- norm_macro_blockage_penalty_ });
999+ report ({. name = " Soft Blockage" ,
1000+ . weight = soft_blockage_weight_ ,
1001+ . value = soft_blockage_penalty_ ,
1002+ . normalization_factor = norm_soft_blockage_penalty_ });
10021003 report ({" Notch" , notch_weight_, notch_penalty_, norm_notch_penalty_});
10031004 reportTotalCost ();
10041005 if (logger_->debugCheck (MPL , " hierarchical_macro_placement" , 2 )) {
@@ -1173,10 +1174,9 @@ int SACoreSoftMacro::getSegmentIndex(const int segment,
11731174 return index;
11741175}
11751176
1176- // The blockages here are only those that overlap with the annealing outline.
1177- void SACoreSoftMacro::addBlockages (const std::vector<odb::Rect>& blockages)
1177+ void SACoreSoftMacro::setSoftBlockages (const RectList& soft_blockages)
11781178{
1179- blockages_. insert (blockages_. end (), blockages. begin (), blockages. end ()) ;
1179+ soft_blockages_ = soft_blockages ;
11801180}
11811181
11821182std::vector<odb::Point> SACoreSoftMacro::getClustersLocations () const
0 commit comments