Skip to content

Commit fc60e37

Browse files
committed
gpl: code review,
include consts and use default log message for gpl progression Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
1 parent 394dd79 commit fc60e37

2 files changed

Lines changed: 18 additions & 14 deletions

File tree

src/gpl/src/nesterovBase.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,10 +2032,10 @@ void NesterovBase::checkConsistency()
20322032
if (!log_->debugCheck(GPL, "checkConsistency", 1)) {
20332033
return;
20342034
}
2035-
auto block = pb_->db()->getChip()->getBlock();
2035+
const auto block = pb_->db()->getChip()->getBlock();
20362036
const int64_t tolerance = 10000;
20372037

2038-
int64_t expected_white_space
2038+
const int64_t expected_white_space
20392039
= pb_->getDie().coreArea() - pb_->nonPlaceInstsArea();
20402040
if (std::abs(whiteSpaceArea_ - expected_white_space) > tolerance) {
20412041
log_->warn(utl::GPL, 319, "Inconsistent white space area");
@@ -2048,7 +2048,7 @@ void NesterovBase::checkConsistency()
20482048
block->dbuAreaToMicrons(pb_->nonPlaceInstsArea()));
20492049
}
20502050

2051-
int64_t expected_movable_area = whiteSpaceArea_ * targetDensity_;
2051+
const int64_t expected_movable_area = whiteSpaceArea_ * targetDensity_;
20522052
if (std::abs(movableArea_ - expected_movable_area) > tolerance) {
20532053
log_->warn(utl::GPL, 320, "Inconsistent movable area 1");
20542054
log_->report(
@@ -2060,7 +2060,7 @@ void NesterovBase::checkConsistency()
20602060
targetDensity_);
20612061
}
20622062

2063-
int64_t expected_filler_area = movableArea_ - getNesterovInstsArea();
2063+
const int64_t expected_filler_area = movableArea_ - getNesterovInstsArea();
20642064
if (std::abs(totalFillerArea_ - expected_filler_area) > tolerance) {
20652065
log_->warn(utl::GPL, 321, "Inconsistent filler area");
20662066
log_->report(
@@ -3042,8 +3042,8 @@ bool NesterovBase::checkDivergence()
30423042
float hpwl_increase = (static_cast<float>(prev_hpwl_ - prev_reported_hpwl_))
30433043
/ static_cast<float>(prev_reported_hpwl_);
30443044

3045-
float overflow_acceptance = 0.05f;
3046-
float hpwl_acceptance = 0.25f;
3045+
const float overflow_acceptance = 0.05f;
3046+
const float hpwl_acceptance = 0.25f;
30473047
if (overflow_change >= overflow_acceptance
30483048
&& hpwl_increase >= hpwl_acceptance) {
30493049
isDiverged_ = true;

src/gpl/src/nesterovPlace.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
#include "nesterovPlace.h"
77

8-
#include <spdlog/fmt/bundled/format.h>
9-
108
#include <algorithm>
119
#include <cmath>
1210
#include <cstdint>
@@ -447,13 +445,13 @@ void NesterovPlace::runTimingDriven(int iter,
447445
nbVec_[0]->setTrueReprintIterHeader();
448446
++timing_driven_count;
449447

450-
int nbc_total_gcells_delta
448+
const int nbc_total_gcells_delta
451449
= nbc_->getNewGcellsCount() - nbc_->getDeletedGcellsCount();
452450
td_accumulated_delta_area += nbc_->getDeltaArea();
453451
for (auto& nb : nbVec_) {
454452
nb_gcells_after_td += nb->getGCells().size();
455453
}
456-
int nb_total_gcells_delta = nb_gcells_after_td - nb_gcells_before_td;
454+
const int nb_total_gcells_delta = nb_gcells_after_td - nb_gcells_before_td;
457455
if (nb_total_gcells_delta != nbc_total_gcells_delta) {
458456
log_->warn(GPL,
459457
92,
@@ -666,11 +664,17 @@ void NesterovPlace::routabilitySnapshot(
666664
nb->saveSnapshot();
667665
}
668666

669-
log_->info(GPL, 38, "Routability snapshot saved at iter = {}", iter);
670-
log_->report(" Iter: {}, overflow: {:.3f}, HPWL: {}",
671-
iter + 1,
667+
log_->info(GPL, 38, "Routability snapshot saved at iter = {}", iter + 1);
668+
odb::dbBlock* block = pbc_->db()->getChip()->getBlock();
669+
int64_t hpwl = nbc_->getHpwl();
670+
double hpwl_percent_change = 0.0;
671+
log_->report("{:9d} | {:8.4f} | {:13.6e} | {:8} | {:9} | {:>5}",
672+
iter,
672673
average_overflow_unscaled_,
673-
nbc_->getHpwl());
674+
block->dbuToMicrons(hpwl),
675+
" ",
676+
" ",
677+
" ");
674678
if (graphics_ && graphics_->enabled()) {
675679
graphics_->addRoutabilitySnapshot(iter);
676680
}

0 commit comments

Comments
 (0)