Skip to content

Commit 18c9a0c

Browse files
committed
Merge remote-tracking branch 'private/master' into gpl-extend-max-iter-by-routability
2 parents 6c5992d + 44bc564 commit 18c9a0c

File tree

12 files changed

+66
-66
lines changed

12 files changed

+66
-66
lines changed

src/cts/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ clock_tree_synthesis
8383
| `-clustering_exponent` | Value that determines the power used on the difference between sink and means on the CKMeans clustering algorithm. The default value is `4`, and the allowed values are integers `[0, MAX_INT]`. |
8484
| `-clustering_unbalance_ratio` | Value determines each cluster's maximum capacity during CKMeans. A value of `0.5` (i.e., 50%) means that each cluster will have exactly half of all sinks for a specific region (half for each branch). The default value is `0.6`, and the allowed values are floats `[0, 1.0]`. |
8585
| `-sink_clustering_enable` | Enables pre-clustering of sinks to create one level of sub-tree before building H-tree. Each cluster is driven by buffer which becomes end point of H-tree structure. |
86-
| `-sink_clustering_size` | Specifies the maximum number of sinks per cluster for the register tree. The default value is `20`, and the allowed values are integers `[0, MAX_INT]`. |
87-
| `-sink_clustering_max_diameter` | Specifies maximum diameter (in microns) of sink cluster for the register tree. The default value is `50`, and the allowed values are integers `[0, MAX_INT]`. |
86+
| `-sink_clustering_size` | Specifies the maximum number of sinks per cluster for the register tree. The allowed values are integers `[0, MAX_INT]`. If this is not specified the size will be automatically chosen between `10, 20 or 30` based on the tree buffer max cap. |
87+
| `-sink_clustering_max_diameter` | Specifies maximum diameter (in microns) of sink cluster for the register tree. The allowed values are integers `[0, MAX_INT]`. If this is not specified the diameter will be automatically chosen between `50, 100 or 200`, based on the tree buffer max cap. |
8888
| `-macro_clustering_size` | Specifies the maximum number of sinks per cluster for the macro tree. The default value is `4`, and the allowed values are integers `[0, MAX_INT]`. |
8989
| `-macro_clustering_max_diameter` | Specifies maximum diameter (in microns) of sink cluster for the macro tree. The default value is `50`, and the allowed values are integers `[0, MAX_INT]`. |
9090
| `-balance_levels` | Attempt to keep a similar number of levels in the clock tree across non-register cells (e.g., clock-gate or inverter). The default value is `False`, and the allowed values are bool. |

src/gpl/src/initialPlace.cpp

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,6 @@ void InitialPlace::doBicgstabPlace(int threads)
7171
instLocVecY_,
7272
log_,
7373
threads);
74-
float error_max = std::max(error.x, error.y);
75-
log_->report(
76-
"[InitialPlace] Iter: {} conjugate gradient residual: {:0.8f} HPWL: "
77-
"{}",
78-
iter,
79-
error_max,
80-
pbc_->hpwl());
81-
updateCoordi();
8274

8375
if (graphics) {
8476
graphics->cellPlot(true);
@@ -91,6 +83,24 @@ void InitialPlace::doBicgstabPlace(int threads)
9183
gui->gifAddFrame(region, 500, dbu_per_pixel, 20);
9284
}
9385

86+
if (std::isnan(error.x) || std::isnan(error.y)) {
87+
log_->warn(GPL,
88+
154,
89+
"Conjugate gradient initial placement solver failed at "
90+
"iteration {}. ",
91+
iter);
92+
break;
93+
}
94+
95+
float error_max = std::max(error.x, error.y);
96+
log_->report(
97+
"[InitialPlace] Iter: {} conjugate gradient residual: {:0.8f} HPWL: "
98+
"{}",
99+
iter,
100+
error_max,
101+
pbc_->hpwl());
102+
updateCoordi();
103+
94104
if (error_max <= 1e-5 && iter >= 5) {
95105
break;
96106
}

src/gpl/src/mbff.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -637,9 +637,9 @@ MBFF::Mask MBFF::GetArrayMask(dbInst* inst, const bool isTray)
637637

638638
const sta::Cell* cell = network_->dbToSta(inst->getMaster());
639639
const sta::LibertyCell* lib_cell = getLibertyCell(cell);
640-
for (const sta::Sequential* seq : lib_cell->sequentials()) {
641-
ret.func_idx = GetMatchingFunc(seq->data(), inst, isTray);
642-
break;
640+
const auto& seqs = lib_cell->sequentials();
641+
if (!seqs.empty()) {
642+
ret.func_idx = GetMatchingFunc(seqs.front()->data(), inst, isTray);
643643
}
644644

645645
ret.is_scan_cell = IsScanCell(inst);
@@ -828,9 +828,13 @@ void MBFF::ModifyPinConnections(const std::vector<Flop>& flops,
828828
}
829829
if (IsSupplyPin(iterm)) {
830830
if (iterm->getSigType() == odb::dbSigType::GROUND) {
831-
ground->connect(net);
831+
if (ground) {
832+
ground->connect(net);
833+
}
832834
} else {
833-
power->connect(net);
835+
if (power) {
836+
power->connect(net);
837+
}
834838
}
835839
}
836840
if (IsClockPin(iterm)) {
@@ -1773,6 +1777,10 @@ float MBFF::GetKSilh(const std::vector<std::vector<Flop>>& clusters,
17731777
tot += ((b_j - a_j) / std::max(a_j, b_j));
17741778
}
17751779
}
1780+
1781+
if (num_flops == 0) {
1782+
return 0.0f;
1783+
}
17761784
return tot / num_flops;
17771785
}
17781786

src/gpl/src/nesterovBase.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <algorithm>
99
#include <cmath>
1010
#include <cstddef>
11-
#include <fstream>
1211
#include <iostream>
1312
#include <memory>
1413
#include <random>

src/gpl/src/nesterovBase.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#pragma once
55

66
#include <cstddef>
7+
#include <fstream>
78
#include <memory>
89
#include <string>
910
#include <unordered_map>
@@ -1267,15 +1268,15 @@ class NesterovBase
12671268

12681269
bool isDiverged_ = false;
12691270

1270-
NesterovPlaceVars* npVars_;
1271+
NesterovPlaceVars* npVars_ = nullptr;
12711272

12721273
bool isMaxPhiCoefChanged_ = false;
12731274

12741275
float minSumOverflow_ = 1e30;
12751276
float hpwlWithMinSumOverflow_ = 1e30;
12761277
int iter_ = 0;
12771278
bool isConverged_ = false;
1278-
bool reprint_iter_header_;
1279+
bool reprint_iter_header_ = false;
12791280

12801281
void initFillerGCells();
12811282
};

src/gpl/src/nesterovPlace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class NesterovPlace
110110
float wireLengthCoefY_ = 0;
111111

112112
// observability metrics
113-
utl::Gauge<double>* hpwl_gauge_;
113+
utl::Gauge<double>* hpwl_gauge_ = nullptr;
114114

115115
// half-parameter-wire-length
116116
int64_t prevHpwl_ = 0;

src/gpl/src/routeBase.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -253,26 +253,6 @@ RouteBase::RouteBase(RouteBaseVars rbVars,
253253

254254
RouteBase::~RouteBase() = default;
255255

256-
void RouteBase::reset()
257-
{
258-
rbVars_.reset();
259-
db_ = nullptr;
260-
nbc_ = nullptr;
261-
log_ = nullptr;
262-
263-
numCall_ = 0;
264-
265-
minRc_ = 1e30;
266-
minRcTargetDensity_ = 0;
267-
min_RC_violated_cnt_ = 0;
268-
max_routability_no_improvement_ = 0;
269-
max_routability_revert_ = 50;
270-
271-
nbc_->resetMinRcCellSize();
272-
273-
resetRoutabilityResources();
274-
}
275-
276256
void RouteBase::resetRoutabilityResources()
277257
{
278258
inflatedAreaDelta_ = 0;

src/gpl/src/routeBase.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ class RouteBase
198198
int max_routability_revert_ = 50;
199199

200200
void init();
201-
void reset();
202201
void resetRoutabilityResources();
203202

204203
// update numCall_

src/gpl/src/solver.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,28 @@ ResidualError cpuSparseSolve(int maxSolverIter,
2020
{
2121
omp_set_num_threads(threads);
2222

23-
ResidualError error;
23+
ResidualError residual_error;
2424
BiCGSTAB<SMatrix, IdentityPreconditioner> solver;
2525
solver.setMaxIterations(maxSolverIter);
26+
2627
solver.compute(placeInstForceMatrixX);
2728
instLocVecX = solver.solveWithGuess(fixedInstForceVecX, instLocVecX);
28-
error.x = solver.error();
29+
if (solver.info() == Eigen::NoConvergence
30+
|| solver.info() == Eigen::Success) {
31+
residual_error.x = solver.error();
32+
} else {
33+
residual_error.x = std::numeric_limits<float>::quiet_NaN();
34+
}
2935

3036
solver.compute(placeInstForceMatrixY);
3137
instLocVecY = solver.solveWithGuess(fixedInstForceVecY, instLocVecY);
32-
error.y = solver.error();
33-
return error;
38+
if (solver.info() == Eigen::NoConvergence
39+
|| solver.info() == Eigen::Success) {
40+
residual_error.y = solver.error();
41+
} else {
42+
residual_error.y = std::numeric_limits<float>::quiet_NaN();
43+
}
44+
45+
return residual_error;
3446
}
3547
} // namespace gpl

src/odb/src/db/dbNet.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ class _dbNet : public _dbObject
107107
bool operator!=(const _dbNet& rhs) const { return !operator==(rhs); }
108108
bool operator<(const _dbNet& rhs) const;
109109
void collectMemInfo(MemInfo& info);
110-
dbObjectTable* getObjectTable(dbObjectType type);
111110
};
112111

113112
dbOStream& operator<<(dbOStream& stream, const _dbNet& net);

0 commit comments

Comments
 (0)