Skip to content

Commit ff90ff8

Browse files
authored
Merge pull request #7772 from gudeh/gpl-extend-max-iter-by-routability
gpl: extend max iter cap by routability internal iterations
2 parents c806614 + fa9fbf0 commit ff90ff8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+2104
-1932
lines changed

src/cts/test/hier_insertion_delay.ok

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
22
[INFO ODB-0227] LEF file: array_tile_ins_delay.lef, created 1 library cells
33
[INFO IFP-0001] Added 857 rows of 210 site FreePDK45_38x28_10R_NP_162NW_34O.
4+
[INFO GPL-0005] Execute conjugate gradient initial placement.
45
[INFO GPL-0002] DBU: 2000
56
[INFO GPL-0003] SiteSize: ( 0.190 1.400 ) um
67
[INFO GPL-0004] CoreBBox: ( 0.000 0.000 ) ( 39.900 1199.800 ) um

src/cts/test/simple_test_hier.ok

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
22
[INFO IFP-0001] Added 857 rows of 210 site FreePDK45_38x28_10R_NP_162NW_34O.
3+
[INFO GPL-0005] Execute conjugate gradient initial placement.
34
[INFO GPL-0002] DBU: 2000
45
[INFO GPL-0003] SiteSize: ( 0.190 1.400 ) um
56
[INFO GPL-0004] CoreBBox: ( 0.000 0.000 ) ( 39.900 1199.800 ) um

src/gpl/src/nesterovBase.cpp

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2680,17 +2680,17 @@ void NesterovBase::updateNextIter(const int iter)
26802680
/ npVars_->referenceHpwl);
26812681

26822682
float percentageChange = 0.0;
2683-
if (iter == 0 || (iter + 1) % 10 == 0) {
2683+
if (iter == 0 || (iter) % 10 == 0) {
26842684
if (prevReportedHpwl_ != 0) {
26852685
percentageChange = (static_cast<double>(hpwl - prevReportedHpwl_)
26862686
/ static_cast<double>(prevReportedHpwl_))
26872687
* 100.0;
26882688
}
26892689
prevReportedHpwl_ = hpwl;
26902690

2691-
std::string group;
2691+
std::string group_name;
26922692
if (pb_->group()) {
2693-
group = fmt::format(" ({})", pb_->group()->getName());
2693+
group_name = fmt::format(" ({})", pb_->group()->getName());
26942694
}
26952695

26962696
if ((iter == 0 || reprint_iter_header_) && !pb_->group()) {
@@ -2715,12 +2715,12 @@ void NesterovBase::updateNextIter(const int iter)
27152715
}
27162716

27172717
log_->report("{:9d} | {:8.4f} | {:13.6e} | {:+7.2f}% | {:9.2e} | {:>5}",
2718-
iter + 1,
2718+
iter,
27192719
sumOverflowUnscaled_,
27202720
static_cast<double>(hpwl),
27212721
percentageChange,
27222722
densityPenalty_,
2723-
group);
2723+
group_name);
27242724
}
27252725

27262726
debugPrint(log_, GPL, "updateNextIter", 1, "PreviousHPWL: {}", prevHpwl_);
@@ -2835,22 +2835,53 @@ void NesterovBase::saveSnapshot()
28352835
snapshotStepLength_ = stepLength_;
28362836
}
28372837

2838-
bool NesterovBase::checkConvergence()
2838+
bool NesterovBase::checkConvergence(int gpl_iter_count,
2839+
int routability_gpl_iter_count,
2840+
RouteBase* rb)
28392841
{
28402842
assert(omp_get_thread_num() == 0);
28412843
if (isConverged_) {
28422844
return true;
28432845
}
28442846
if (sumOverflowUnscaled_ <= npVars_->targetOverflow) {
2845-
if (pb_->group()) {
2847+
const bool is_power_domain = pb_->group();
2848+
const std::string group_name
2849+
= is_power_domain ? pb_->group()->getName() : "";
2850+
const int final_iter = gpl_iter_count;
2851+
2852+
log_->report("{:9d} | {:8.4f} | {:13.6e} | {:>8} | {:9.2e} | {:>5}",
2853+
final_iter,
2854+
sumOverflowUnscaled_,
2855+
static_cast<double>(nbc_->getHpwl()),
2856+
"", // No % delta
2857+
densityPenalty_,
2858+
group_name);
2859+
log_->report(
2860+
"---------------------------------------------------------------");
2861+
2862+
if (is_power_domain) {
28462863
log_->info(GPL,
2847-
1000,
2848-
"PowerDomain {} finished with Overflow: {:.6f}",
2849-
pb_->group()->getName(),
2850-
sumOverflowUnscaled_);
2864+
1016,
2865+
"Power domain '{}' placement finished at iteration {}",
2866+
group_name,
2867+
final_iter);
28512868
} else {
28522869
log_->info(
2853-
GPL, 1001, "Finished with Overflow: {:.6f}", sumOverflowUnscaled_);
2870+
GPL, 1001, "Global placement finished at iteration {}", final_iter);
2871+
if (npVars_->routability_driven_mode) {
2872+
log_->info(GPL,
2873+
1003,
2874+
"Routability mode iteration count: {}",
2875+
routability_gpl_iter_count);
2876+
}
2877+
}
2878+
2879+
if (npVars_->routability_driven_mode) {
2880+
rb->getRudyResult();
2881+
log_->info(GPL,
2882+
1005,
2883+
"Routability final weighted congestion: {:.4f}",
2884+
rb->getRudyRC(false));
28542885
}
28552886

28562887
dbBlock* block = pb_->db()->getChip()->getBlock();

src/gpl/src/nesterovBase.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,9 @@ class NesterovBase
10541054
void setTrueReprintIterHeader() { reprint_iter_header_ = true; }
10551055
float getPhiCoef(float scaledDiffHpwl) const;
10561056

1057-
bool checkConvergence();
1057+
bool checkConvergence(int gpl_iter_count,
1058+
int routability_gpl_iter_count,
1059+
RouteBase* rb);
10581060
bool checkDivergence();
10591061
void saveSnapshot();
10601062
bool revertToSnapshot();

0 commit comments

Comments
 (0)