Skip to content

Commit ab27d75

Browse files
authored
Merge pull request #7892 from gudeh/gpl-include-get-prefix-nesterovbase
gpl: include get prefix for nesterovbase member functions
2 parents 22cf9d1 + 719d85c commit ab27d75

File tree

7 files changed

+325
-409
lines changed

7 files changed

+325
-409
lines changed

src/gpl/src/graphics.cpp

Lines changed: 30 additions & 28 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->bins();
147+
const auto& bins = nb->getBins();
148148
if (bins.empty()) {
149149
continue;
150150
}
@@ -270,8 +270,8 @@ void Graphics::drawNesterov(gui::Painter& painter)
270270
painter.setPen(gui::Painter::kTransparent);
271271

272272
for (const auto& nb : nbVec_) {
273-
for (auto& bin : nb->bins()) {
274-
int density = bin.density() * 50 + 20;
273+
for (auto& bin : nb->getBins()) {
274+
int density = bin.getDensity() * 50 + 20;
275275
gui::Painter::Color color;
276276
if (density > 255) {
277277
color = {255, 165, 0, 180}; // orange = out of the range
@@ -304,12 +304,12 @@ void Graphics::drawNesterov(gui::Painter& painter)
304304
if (selected_ != kInvalidIndex && nbc_->getGCellByIndex(selected_)) {
305305
painter.setPen(gui::Painter::kYellow, true);
306306
for (GPin* pin : nbc_->getGCellByIndex(selected_)->gPins()) {
307-
GNet* net = pin->gNet();
307+
GNet* net = pin->getGNet();
308308
if (!net) {
309309
continue;
310310
}
311-
for (GPin* other_pin : net->gPins()) {
312-
GCell* neighbor = other_pin->gCell();
311+
for (GPin* other_pin : net->getGPins()) {
312+
GCell* neighbor = other_pin->getGCell();
313313
if (neighbor == nbc_->getGCellByIndex(selected_)) {
314314
continue;
315315
}
@@ -368,12 +368,12 @@ void Graphics::reportSelected()
368368
for (auto& gPin : nbc_->getGCellByIndex(selected_)->gPins()) {
369369
FloatPoint wlGrad
370370
= nbc_->getWireLengthGradientPinWA(gPin, wlCoeffX, wlCoeffY);
371-
const float weight = gPin->gNet()->totalWeight();
371+
const float weight = gPin->getGNet()->getTotalWeight();
372372
logger_->report(" ({:+.2e}, {:+.2e}) (weight = {}) pin {}",
373373
wlGrad.x,
374374
wlGrad.y,
375375
weight,
376-
gPin->pin()->getName());
376+
gPin->getPbPin()->getName());
377377
}
378378

379379
FloatPoint wlGrad = nbc_->getWireLengthGradientWA(
@@ -487,13 +487,13 @@ void Graphics::status(const std::string& message)
487487
double Graphics::getGridXSize() const
488488
{
489489
const BinGrid& grid = nbVec_[0]->getBinGrid();
490-
return grid.binSizeX() / (double) getBlock()->getDbUnitsPerMicron();
490+
return grid.getBinSizeX() / (double) getBlock()->getDbUnitsPerMicron();
491491
}
492492

493493
double Graphics::getGridYSize() const
494494
{
495495
const BinGrid& grid = nbVec_[0]->getBinGrid();
496-
return grid.binSizeY() / (double) getBlock()->getDbUnitsPerMicron();
496+
return grid.getBinSizeY() / (double) getBlock()->getDbUnitsPerMicron();
497497
}
498498

499499
odb::Rect Graphics::getBounds() const
@@ -510,37 +510,39 @@ bool Graphics::populateMap()
510510
double max_value = std::numeric_limits<double>::lowest();
511511

512512
if (heatmap_type_ == OverflowMinMax) {
513-
for (const Bin& bin : grid.bins()) {
514-
int64_t binArea = bin.binArea();
513+
for (const Bin& bin : grid.getBins()) {
514+
int64_t binArea = bin.getBinArea();
515515
const float scaledBinArea
516-
= static_cast<float>(binArea * bin.targetDensity());
516+
= static_cast<float>(binArea * bin.getTargetDensity());
517517

518-
double value = std::max(
519-
0.0f,
520-
static_cast<float>(bin.instPlacedAreaUnscaled())
521-
+ static_cast<float>(bin.nonPlaceAreaUnscaled()) - scaledBinArea);
518+
double value
519+
= std::max(0.0f,
520+
static_cast<float>(bin.getInstPlacedAreaUnscaled())
521+
+ static_cast<float>(bin.getNonPlaceAreaUnscaled())
522+
- scaledBinArea);
522523
value = block->dbuAreaToMicrons(value);
523524

524525
min_value = std::min(min_value, value);
525526
max_value = std::max(max_value, value);
526527
}
527528
}
528529

529-
for (const Bin& bin : grid.bins()) {
530+
for (const Bin& bin : grid.getBins()) {
530531
odb::Rect box(bin.lx(), bin.ly(), bin.ux(), bin.uy());
531532
double value = 0.0;
532533

533534
if (heatmap_type_ == Density) {
534-
value = bin.density() * 100.0;
535+
value = bin.getDensity() * 100.0;
535536
} else if (heatmap_type_ == Overflow || heatmap_type_ == OverflowMinMax) {
536-
int64_t binArea = bin.binArea();
537+
int64_t binArea = bin.getBinArea();
537538
const float scaledBinArea
538-
= static_cast<float>(binArea * bin.targetDensity());
539+
= static_cast<float>(binArea * bin.getTargetDensity());
539540

540-
double raw_value = std::max(
541-
0.0f,
542-
static_cast<float>(bin.instPlacedAreaUnscaled())
543-
+ static_cast<float>(bin.nonPlaceAreaUnscaled()) - scaledBinArea);
541+
double raw_value
542+
= std::max(0.0f,
543+
static_cast<float>(bin.getInstPlacedAreaUnscaled())
544+
+ static_cast<float>(bin.getNonPlaceAreaUnscaled())
545+
- scaledBinArea);
544546
raw_value = block->dbuAreaToMicrons(raw_value);
545547

546548
if (heatmap_type_ == OverflowMinMax && max_value > min_value) {
@@ -559,9 +561,9 @@ bool Graphics::populateMap()
559561
void Graphics::populateXYGrid()
560562
{
561563
BinGrid& grid = nbVec_[0]->getBinGrid();
562-
std::vector<Bin>& bin = grid.bins();
563-
int x_grid = grid.binCntX();
564-
int y_grid = grid.binCntY();
564+
std::vector<Bin>& bin = grid.getBins();
565+
int x_grid = grid.getBinCntX();
566+
int y_grid = grid.getBinCntY();
565567

566568
std::vector<int> x_grid_set, y_grid_set;
567569
x_grid_set.reserve(x_grid + 1);

0 commit comments

Comments
 (0)