Skip to content

Commit c5bcc7f

Browse files
committed
gpl: clang-format
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
1 parent 5b636b9 commit c5bcc7f

File tree

4 files changed

+46
-30
lines changed

4 files changed

+46
-30
lines changed

src/gpl/src/graphics.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@ void Graphics::drawNesterov(gui::Painter& painter)
341341
painter.setBrush(color);
342342

343343
for (auto& pb_inst : pb->nonPlaceInsts()) {
344-
painter.drawRect({pb_inst->lx(), pb_inst->ly(), pb_inst->ux(), pb_inst->uy()});
344+
painter.drawRect(
345+
{pb_inst->lx(), pb_inst->ly(), pb_inst->ux(), pb_inst->uy()});
345346
}
346347
}
347348

@@ -393,7 +394,8 @@ void Graphics::drawNesterov(gui::Painter& painter)
393394
const float overall_x = wlGrad.x + densityPenalty * densityGrad.x;
394395
const float overall_y = wlGrad.y + densityPenalty * densityGrad.y;
395396
const float overall_magnitude = std::hypot(overall_x, overall_y);
396-
const float max_magnitude = std::max({wl_magnitude, density_magnitude, overall_magnitude});
397+
const float max_magnitude
398+
= std::max({wl_magnitude, density_magnitude, overall_magnitude});
397399

398400
auto scaleVector = [&](float vx, float vy) -> std::pair<float, float> {
399401
const float magnitude = std::hypot(vx, vy);
@@ -425,7 +427,8 @@ void Graphics::drawNesterov(gui::Painter& painter)
425427
// Draw Overall gradient line
426428
{
427429
auto [dx, dy] = scaleVector(overall_x, overall_y);
428-
painter.setPen(gui::Painter::kBlack, true); // Use black for Overall gradient
430+
painter.setPen(gui::Painter::kBlack,
431+
true); // Use black for Overall gradient
429432
painter.drawLine(
430433
cx, cy, cx + static_cast<int>(dx), cy + static_cast<int>(dy));
431434
}

src/gpl/src/initialPlace.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -427,14 +427,14 @@ void InitialPlace::updateCoordi()
427427
if (!inst->isLocked()) {
428428
int new_x = instLocVecX_(idx);
429429
int new_y = instLocVecY_(idx);
430-
430+
431431
// Constrain to core area
432432
const auto& die = pbc_->getDie();
433433
new_x = std::max(new_x, die.coreLx());
434434
new_x = std::min(new_x, die.coreUx());
435435
new_y = std::max(new_y, die.coreLy());
436436
new_y = std::min(new_y, die.coreUy());
437-
437+
438438
// If instance has a region constraint, use that instead
439439
const auto db_inst = inst->dbInst();
440440
const auto group = db_inst->getGroup();
@@ -451,13 +451,13 @@ void InitialPlace::updateCoordi()
451451
region_x_max = std::max(region_x_max, boundary->xMax());
452452
region_y_max = std::max(region_y_max, boundary->yMax());
453453
}
454-
454+
455455
new_x = std::max(new_x, region_x_min);
456456
new_x = std::min(new_x, region_x_max);
457457
new_y = std::max(new_y, region_y_min);
458458
new_y = std::min(new_y, region_y_max);
459459
}
460-
460+
461461
inst->dbSetCenterLocation(new_x, new_y);
462462
inst->dbSetPlaced();
463463
}

src/gpl/src/nesterovBase.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1757,7 +1757,10 @@ NesterovBase::NesterovBase(NesterovBaseVars nbVars,
17571757
bg_.setPlacerBase(pb_);
17581758
bg_.setLogger(log_);
17591759
const odb::Rect& region_bbox = pb_->getRegionBBox();
1760-
bg_.setRegionPoints(region_bbox.xMin(), region_bbox.yMin(), region_bbox.xMax(), region_bbox.yMax());
1760+
bg_.setRegionPoints(region_bbox.xMin(),
1761+
region_bbox.yMin(),
1762+
region_bbox.xMax(),
1763+
region_bbox.yMax());
17611764
bg_.setTargetDensity(targetDensity_);
17621765

17631766
// update binGrid info
@@ -1824,8 +1827,7 @@ void NesterovBase::initFillerGCells()
18241827
fillerDy_ = static_cast<int>(dySum / (maxIdx - minIdx));
18251828

18261829
int64_t region_area = pb_->getRegionArea();
1827-
whiteSpaceArea_
1828-
= region_area - pb_->nonPlaceInstsArea();
1830+
whiteSpaceArea_ = region_area - pb_->nonPlaceInstsArea();
18291831

18301832
// if(pb_->group() == nullptr) {
18311833
// // nonPlaceInstsArea should not have density downscaling!!!
@@ -1980,9 +1982,9 @@ void NesterovBase::initFillerGCells()
19801982
// place filler cells on random coordi and
19811983
// set size as avgDx and avgDy
19821984
GCell filler_gcell(randX % region_dx + region_lx,
1983-
randY % region_dy + region_ly,
1984-
fillerDx_,
1985-
fillerDy_);
1985+
randY % region_dy + region_ly,
1986+
fillerDx_,
1987+
fillerDy_);
19861988

19871989
fillerStor_.push_back(filler_gcell);
19881990
}

src/gpl/src/placerBase.cpp

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -996,19 +996,21 @@ void PlacerBase::init()
996996
die_ = pbCommon_->getDie();
997997
if (group_ != nullptr) {
998998
auto boundaries = group_->getRegion()->getBoundaries();
999-
999+
10001000
if (!boundaries.empty()) {
10011001
region_bbox_.mergeInit();
10021002
for (auto boundary : boundaries) {
10031003
region_bbox_.merge(boundary->getBox());
10041004
}
10051005
region_area_ = region_bbox_.area();
10061006
} else {
1007-
region_bbox_ = odb::Rect(die_.coreLx(), die_.coreLy(), die_.coreUx(), die_.coreUy());
1007+
region_bbox_ = odb::Rect(
1008+
die_.coreLx(), die_.coreLy(), die_.coreUx(), die_.coreUy());
10081009
region_area_ = die_.coreArea();
10091010
}
10101011
} else {
1011-
region_bbox_ = odb::Rect(die_.coreLx(), die_.coreLy(), die_.coreUx(), die_.coreUy());
1012+
region_bbox_
1013+
= odb::Rect(die_.coreLx(), die_.coreLy(), die_.coreUx(), die_.coreUy());
10121014
region_area_ = die_.coreArea();
10131015
}
10141016

@@ -1101,16 +1103,17 @@ void PlacerBase::initInstsForUnusableSites()
11011103
};
11021104

11031105
//
1104-
// Initialize siteGrid as Row.
1106+
// Initialize siteGrid as Row.
11051107
// All sites placeable so we avoid dummies creation due to regions
11061108
//
11071109
std::vector<SiteInfo> siteGrid(siteCountX * siteCountY, SiteInfo::Row);
11081110

1109-
// If we have no group (top-level), check which sites are NOT covered by actual rows
1110-
// Create dummy instances for unusable sites (test simple02.tcl has an example on bottom right)
1111+
// If we have no group (top-level), check which sites are NOT covered by
1112+
// actual rows Create dummy instances for unusable sites (test simple02.tcl
1113+
// has an example on bottom right)
11111114
if (group_ == nullptr) {
11121115
std::fill(siteGrid.begin(), siteGrid.end(), SiteInfo::Blocked);
1113-
1116+
11141117
// Mark only sites covered by actual rows as Row
11151118
for (dbRow* row : rows) {
11161119
Rect rect = row->getBBox();
@@ -1155,9 +1158,13 @@ void PlacerBase::initInstsForUnusableSites()
11551158
for (int i = pairX.first; i < pairX.second; i++) {
11561159
if (cells == 0 || filled / (float) cells <= filler_density) {
11571160
siteGrid[j * siteCountX + i] = Blocked;
1158-
debugPrint(log_, GPL, "dummies", 1, "Blocking site at ({}, {}) due to blockage.",
1159-
i,
1160-
j);
1161+
debugPrint(log_,
1162+
GPL,
1163+
"dummies",
1164+
1,
1165+
"Blocking site at ({}, {}) due to blockage.",
1166+
i,
1167+
j);
11611168
++filled;
11621169
}
11631170
++cells;
@@ -1195,10 +1202,14 @@ void PlacerBase::initInstsForUnusableSites()
11951202
for (int i = pairX.first; i < pairX.second; i++) {
11961203
for (int j = pairY.first; j < pairY.second; j++) {
11971204
siteGrid[j * siteCountX + i] = FixedInst;
1198-
debugPrint(log_, GPL, "dummies", 1,"Blocking site at ({}, {}) due to fixed instance {}.",
1199-
i,
1200-
j,
1201-
db_inst->getName());
1205+
debugPrint(log_,
1206+
GPL,
1207+
"dummies",
1208+
1,
1209+
"Blocking site at ({}, {}) due to fixed instance {}.",
1210+
i,
1211+
j,
1212+
db_inst->getName());
12021213
}
12031214
}
12041215
}
@@ -1217,9 +1228,9 @@ void PlacerBase::initInstsForUnusableSites()
12171228
}
12181229
int endX = i;
12191230
Instance dummy_gcell(die_.coreLx() + siteSizeX_ * startX,
1220-
die_.coreLy() + siteSizeY_ * j,
1221-
die_.coreLx() + siteSizeX_ * endX,
1222-
die_.coreLy() + siteSizeY_ * (j + 1));
1231+
die_.coreLy() + siteSizeY_ * j,
1232+
die_.coreLx() + siteSizeX_ * endX,
1233+
die_.coreLy() + siteSizeY_ * (j + 1));
12231234
instStor_.push_back(dummy_gcell);
12241235
}
12251236
}

0 commit comments

Comments
 (0)