Skip to content

Commit 8219307

Browse files
committed
gpl: rename some functions for nesterovBase,
Signed-off-by: Augusto Berndt <[email protected]>
1 parent aae6516 commit 8219307

File tree

5 files changed

+23
-24
lines changed

5 files changed

+23
-24
lines changed

src/gpl/src/graphics.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ void Graphics::drawInitial(gui::Painter& painter)
144144
void Graphics::drawForce(gui::Painter& painter)
145145
{
146146
for (const auto& nb : nbVec_) {
147-
const auto& bins = nb->getNins();
147+
const auto& bins = nb->getBins();
148148
if (bins.empty()) {
149149
continue;
150150
}
@@ -270,7 +270,7 @@ void Graphics::drawNesterov(gui::Painter& painter)
270270
painter.setPen(gui::Painter::kTransparent);
271271

272272
for (const auto& nb : nbVec_) {
273-
for (auto& bin : nb->getNins()) {
273+
for (auto& bin : nb->getBins()) {
274274
int density = bin.getDensity() * 50 + 20;
275275
gui::Painter::Color color;
276276
if (density > 255) {
@@ -510,7 +510,7 @@ bool Graphics::populateMap()
510510
double max_value = std::numeric_limits<double>::lowest();
511511

512512
if (heatmap_type_ == OverflowMinMax) {
513-
for (const Bin& bin : grid.getNins()) {
513+
for (const Bin& bin : grid.getBins()) {
514514
int64_t binArea = bin.getBinArea();
515515
const float scaledBinArea
516516
= static_cast<float>(binArea * bin.getTargetDensity());
@@ -526,7 +526,7 @@ bool Graphics::populateMap()
526526
}
527527
}
528528

529-
for (const Bin& bin : grid.getNins()) {
529+
for (const Bin& bin : grid.getBins()) {
530530
odb::Rect box(bin.lx(), bin.ly(), bin.ux(), bin.uy());
531531
double value = 0.0;
532532

@@ -559,7 +559,7 @@ bool Graphics::populateMap()
559559
void Graphics::populateXYGrid()
560560
{
561561
BinGrid& grid = nbVec_[0]->getBinGrid();
562-
std::vector<Bin>& bin = grid.getNins();
562+
std::vector<Bin>& bin = grid.getBins();
563563
int x_grid = grid.binCntX();
564564
int y_grid = grid.binCntY();
565565

src/gpl/src/nesterovBase.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,12 +2015,12 @@ int64_t NesterovBase::getOverflowAreaUnscaled() const
20152015
return bg_.getOverflowAreaUnscaled();
20162016
}
20172017

2018-
int NesterovBase::fillerDx() const
2018+
int NesterovBase::getFillerDx() const
20192019
{
20202020
return fillerDx_;
20212021
}
20222022

2023-
int NesterovBase::fillerDy() const
2023+
int NesterovBase::getFillerDy() const
20242024
{
20252025
return fillerDy_;
20262026
}
@@ -2085,7 +2085,7 @@ float NesterovBase::initTargetDensity() const
20852085
return nbVars_.targetDensity;
20862086
}
20872087

2088-
float NesterovBase::targetDensity() const
2088+
float NesterovBase::getTargetDensity() const
20892089
{
20902090
return targetDensity_;
20912091
}
@@ -2800,7 +2800,7 @@ void NesterovBase::nesterovAdjustPhi()
28002800
}
28012801
}
28022802

2803-
void NesterovBase::snapshot()
2803+
void NesterovBase::saveSnapshot()
28042804
{
28052805
if (isConverged_) {
28062806
return;

src/gpl/src/nesterovBase.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -960,8 +960,8 @@ class NesterovBase
960960

961961
// filler cells / area control
962962
// will be used in Routability-driven loop
963-
int fillerDx() const;
964-
int fillerDy() const;
963+
int getFillerDx() const;
964+
int getFillerDy() const;
965965
int getFillerCnt() const;
966966
int64_t getFillerCellArea() const;
967967
int64_t getWhiteSpaceArea() const;
@@ -997,7 +997,7 @@ class NesterovBase
997997
// would be changed dynamically in RD loop
998998
//
999999
float initTargetDensity() const;
1000-
float targetDensity() const;
1000+
float getTargetDensity() const;
10011001

10021002
void setTargetDensity(float targetDensity);
10031003

@@ -1066,12 +1066,11 @@ class NesterovBase
10661066

10671067
void updateNextIter(int iter);
10681068
void setTrueReprintIterHeader() { reprint_iter_header_ = true; }
1069-
float getPhiCoef(float scaledDiffHpwl) const;
1070-
1071-
void snapshot();
1069+
float getPhiCoef(float scaledDiffHpwl) const;
10721070

10731071
bool checkConvergence();
10741072
bool checkDivergence();
1073+
void saveSnapshot();
10751074
bool revertToSnapshot();
10761075

10771076
void updateDensityCenterCur();

src/gpl/src/nesterovPlace.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ void NesterovPlace::runTimingDriven(const int iter,
511511
log_->info(GPL,
512512
110,
513513
"Timing-driven: new target density: {}",
514-
nesterov->targetDensity());
514+
nesterov->getTargetDensity());
515515
nbc_->resetDeltaArea();
516516
nbc_->resetNewGcellsCount();
517517
nesterov->updateAreas();
@@ -557,7 +557,7 @@ bool NesterovPlace::isDiverged(float& diverge_snapshot_WlCoefX,
557557
diverge_snapshot_WlCoefX = wireLengthCoefX_;
558558
diverge_snapshot_WlCoefY = wireLengthCoefY_;
559559
for (auto& nb : nbVec_) {
560-
nb->snapshot();
560+
nb->saveSnapshot();
561561
}
562562
is_diverge_snapshot_saved = true;
563563
}
@@ -645,7 +645,7 @@ void NesterovPlace::routabilitySnapshot(
645645
is_routability_snapshot_saved = true;
646646

647647
for (auto& nb : nbVec_) {
648-
nb->snapshot();
648+
nb->saveSnapshot();
649649
}
650650

651651
log_->info(GPL, 38, "Routability snapshot saved at iter = {}", iter);

src/gpl/src/routeBase.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ std::pair<bool, bool> RouteBase::routability()
550550
curRc,
551551
minRc_);
552552
minRc_ = curRc;
553-
minRcTargetDensity_ = nbVec_[0]->targetDensity();
553+
minRcTargetDensity_ = nbVec_[0]->getTargetDensity();
554554
minRcViolatedCnt_ = 0;
555555
nbVec_[0]->clearRemovedFillers();
556556

@@ -654,7 +654,7 @@ std::pair<bool, bool> RouteBase::routability()
654654
52,
655655
format_label_float,
656656
"Placement target density:",
657-
nbVec_[0]->targetDensity());
657+
nbVec_[0]->getTargetDensity());
658658

659659
double prev_white_space_area = nbVec_[0]->getWhiteSpaceArea();
660660
double prev_movable_area = nbVec_[0]->getMovableArea();
@@ -671,16 +671,16 @@ std::pair<bool, bool> RouteBase::routability()
671671
// rc not improvement detection -- (not improved the RC values 3 times in a
672672
// row)
673673
//
674-
if (nbVec_[0]->targetDensity() > rbVars_.maxDensity
674+
if (nbVec_[0]->getTargetDensity() > rbVars_.maxDensity
675675
|| minRcViolatedCnt_ >= 3) {
676-
bool density_exceeded = nbVec_[0]->targetDensity() > rbVars_.maxDensity;
676+
bool density_exceeded = nbVec_[0]->getTargetDensity() > rbVars_.maxDensity;
677677
bool congestion_not_improving = minRcViolatedCnt_ >= 3;
678678

679679
if (density_exceeded) {
680680
log_->info(GPL,
681681
53,
682682
"Target density {:.4f} exceeds the maximum allowed {:.4f}.",
683-
nbVec_[0]->targetDensity(),
683+
nbVec_[0]->getTargetDensity(),
684684
rbVars_.maxDensity);
685685
}
686686
if (congestion_not_improving) {
@@ -766,7 +766,7 @@ std::pair<bool, bool> RouteBase::routability()
766766
63,
767767
format_label_float,
768768
"New Target Density:",
769-
nbVec_[0]->targetDensity());
769+
nbVec_[0]->getTargetDensity());
770770

771771
// update densitySizes for all gCell
772772
nbVec_[0]->updateDensitySize();

0 commit comments

Comments
 (0)