Skip to content

Commit 56e0135

Browse files
committed
gpl: rename macros to large instances,
avoid conflicting definition of macros from eplace (instances with more than 6 rows hieght) Signed-off-by: Augusto Berndt <[email protected]>
1 parent 1cfc5f4 commit 56e0135

File tree

4 files changed

+21
-28
lines changed

4 files changed

+21
-28
lines changed

src/gpl/src/nesterovBase.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,7 +1685,7 @@ NesterovBase::NesterovBase(NesterovBaseVars nbVars,
16851685
srand(42);
16861686
// area update from pb
16871687
stdInstsArea_ = pb_->stdInstsArea();
1688-
macroInstsArea_ = pb_->macroInstsArea();
1688+
large_insts_area_ = pb_->largeInstsArea();
16891689

16901690
int dbu_per_micron = pb_->db()->getChip()->getBlock()->getDbUnitsPerMicron();
16911691

@@ -1838,7 +1838,7 @@ void NesterovBase::initFillerGCells()
18381838

18391839
float tmp_targetDensity
18401840
= static_cast<float>(stdInstsArea_)
1841-
/ static_cast<float>(whiteSpaceArea_ - macroInstsArea_)
1841+
/ static_cast<float>(whiteSpaceArea_ - large_insts_area_)
18421842
+ 0.01;
18431843
// targetDensity initialize
18441844
if (nbVars_.useUniformTargetDensity) {
@@ -2163,7 +2163,7 @@ int64_t NesterovBase::getNesterovInstsArea() const
21632163
{
21642164
return stdInstsArea_
21652165
+ static_cast<int64_t>(
2166-
std::round(pb_->macroInstsArea() * targetDensity_));
2166+
std::round(pb_->largeInstsArea() * targetDensity_));
21672167
}
21682168

21692169
float NesterovBase::getSumPhi() const
@@ -2224,15 +2224,15 @@ void NesterovBase::updateAreas()
22242224
{
22252225
// bloating can change the following :
22262226
// stdInstsArea and macroInstsArea
2227-
stdInstsArea_ = macroInstsArea_ = 0;
2227+
stdInstsArea_ = large_insts_area_ = 0;
22282228
for (auto it = nb_gcells_.begin(); it < nb_gcells_.end(); ++it) {
22292229
auto& gCell = *it; // old-style loop for old OpenMP
22302230
if (!gCell) {
22312231
continue;
22322232
}
22332233
if (gCell->isLargeInstance()) {
2234-
macroInstsArea_ += static_cast<int64_t>(gCell->dx())
2235-
* static_cast<int64_t>(gCell->dy());
2234+
large_insts_area_ += static_cast<int64_t>(gCell->dx())
2235+
* static_cast<int64_t>(gCell->dy());
22362236
} else if (gCell->isStdInstance()) {
22372237
stdInstsArea_ += static_cast<int64_t>(gCell->dx())
22382238
* static_cast<int64_t>(gCell->dy());

src/gpl/src/nesterovBase.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,6 @@ class Bin
553553
void setInstPlacedArea(int64_t area);
554554

555555
void addNonPlaceAreaBiNormal(int64_t area);
556-
// void addInstPlacedArea(int64_t area);
557556
void addFillerArea(int64_t area);
558557

559558
void addNonPlaceArea(int64_t area);
@@ -645,11 +644,6 @@ inline void Bin::addNonPlaceAreaBiNormal(int64_t area)
645644
non_place_area_binormal_ += area;
646645
}
647646

648-
// inline void Bin::addInstPlacedArea(int64_t area)
649-
// {
650-
// instPlacedArea_ += area;
651-
// }
652-
653647
inline void Bin::addNonPlaceArea(int64_t area)
654648
{
655649
non_place_area_ += area;
@@ -986,7 +980,7 @@ class NesterovBase
986980
// This is mainly used for NesterovLoop
987981
int64_t getNesterovInstsArea() const;
988982
int64_t getStdInstArea() const { return this->stdInstsArea_; }
989-
int64_t getMacroInstArea() const { return this->macroInstsArea_; }
983+
int64_t getLargeInstArea() const { return this->large_insts_area_; }
990984

991985
// sum phi and target density
992986
// used in NesterovPlace
@@ -1144,7 +1138,7 @@ class NesterovBase
11441138
int64_t initial_filler_area_ = 0;
11451139

11461140
int64_t stdInstsArea_ = 0;
1147-
int64_t macroInstsArea_ = 0;
1141+
int64_t large_insts_area_ = 0;
11481142

11491143
std::vector<GCell> fillerStor_;
11501144
std::vector<GCellHandle> nb_gcells_;

src/gpl/src/placerBase.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ void Instance::setExtId(int extId)
246246
extId_ = extId;
247247
}
248248

249-
// ePlace macro definition
250249
bool Instance::isPbLargeInstance() const
251250
{
252251
return is_large_instance_;
@@ -814,7 +813,7 @@ void PlacerBaseCommon::init()
814813
instStor_.push_back(temp_inst);
815814

816815
if (temp_inst.dy() > siteSizeY_ * 6) {
817-
macroInstsArea_ += temp_inst.area();
816+
large_insts_area_ += temp_inst.area();
818817
}
819818
}
820819

@@ -1056,10 +1055,9 @@ void PlacerBase::init()
10561055
placeInsts_.push_back(inst);
10571056
int64_t instArea = inst->area();
10581057
placeInstsArea_ += instArea;
1059-
// macro cells should be
1060-
// macroInstsArea_
1058+
// ePlace macros are defined as taller than 6 rows
10611059
if (inst->dy() > siteSizeY_ * 6) {
1062-
macroInstsArea_ += instArea;
1060+
large_insts_area_ += instArea;
10631061
}
10641062
// smaller or equal height cells should be
10651063
// stdInstArea_
@@ -1358,7 +1356,7 @@ void PlacerBase::printInfo() const
13581356
21,
13591357
format_label_um2,
13601358
"Large instances area:",
1361-
block->dbuAreaToMicrons(macroInstsArea_));
1359+
block->dbuAreaToMicrons(large_insts_area_));
13621360

13631361
if (util >= 100.1) {
13641362
log_->error(GPL, 301, "Utilization {:.3f} % exceeds 100%.", util);
@@ -1372,9 +1370,9 @@ void PlacerBase::unlockAll()
13721370
}
13731371
}
13741372

1375-
int64_t PlacerBase::macroInstsArea() const
1373+
int64_t PlacerBase::largeInstsArea() const
13761374
{
1377-
return macroInstsArea_;
1375+
return large_insts_area_;
13781376
}
13791377

13801378
// https://stackoverflow.com/questions/33333363/built-in-mod-vs-custom-mod-function-improve-the-performance-of-modulus-op

src/gpl/src/placerBase.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ class Instance
109109
int ux_ = 0;
110110
int uy_ = 0;
111111
int extId_ = INT_MIN;
112+
// ePlace macro definition (instances larger than 6 row height)
112113
bool is_large_instance_ = false;
113114
bool is_locked_ = false;
114115
};
@@ -311,7 +312,7 @@ class PlacerBaseCommon
311312
int64_t getHpwl() const;
312313
void printInfo() const;
313314

314-
int64_t getMacroInstsArea() const { return macroInstsArea_; }
315+
int64_t getLargeInstsArea() const { return large_insts_area_; }
315316

316317
odb::dbDatabase* db() const { return db_; }
317318

@@ -343,7 +344,7 @@ class PlacerBaseCommon
343344
int siteSizeX_ = 0;
344345
int siteSizeY_ = 0;
345346

346-
int64_t macroInstsArea_ = 0;
347+
int64_t large_insts_area_ = 0;
347348

348349
void init();
349350
void reset();
@@ -386,7 +387,7 @@ class PlacerBase
386387

387388
int64_t placeInstsArea() const { return placeInstsArea_; }
388389
int64_t nonPlaceInstsArea() const { return nonPlaceInstsArea_; }
389-
int64_t macroInstsArea() const;
390+
int64_t largeInstsArea() const;
390391
int64_t stdInstsArea() const { return stdInstsArea_; }
391392

392393
odb::dbDatabase* db() const { return db_; }
@@ -417,10 +418,10 @@ class PlacerBase
417418
int64_t placeInstsArea_ = 0;
418419
int64_t nonPlaceInstsArea_ = 0;
419420

420-
// macroInstsArea_ + stdInstsArea_ = placeInstsArea_;
421-
// macroInstsArea_ should be separated
421+
// large_insts_area_ + stdInstsArea_ = placeInstsArea_;
422+
// large_insts_area_ should be separated
422423
// because of target_density tuning
423-
int64_t macroInstsArea_ = 0;
424+
int64_t large_insts_area_ = 0;
424425
int64_t stdInstsArea_ = 0;
425426

426427
std::shared_ptr<PlacerBaseCommon> pbCommon_;

0 commit comments

Comments
 (0)