Skip to content

Commit 11ea2ca

Browse files
committed
cts: add sink region threshold to register tree
Signed-off-by: arthurjolo <arthurjl@precisioninno.com>
1 parent 5b6563e commit 11ea2ca

2 files changed

Lines changed: 11 additions & 13 deletions

File tree

src/cts/src/HTreeBuilder.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,17 +1267,17 @@ void HTreeBuilder::run()
12671267

12681268
computeLevelTopology(level, regionWidth, regionHeight);
12691269

1270-
if (type_ == TreeType::MacroTree && options_->getMaxWl()) {
1271-
const auto [branchIdx, maxDim]
1272-
= topologyForEachLevel_.back().getLargestSinkRegion(wireSegmentUnit_);
1273-
logger_->report("maxDim {}, thresh {}", maxDim, options_->getMaxWl());
1274-
if (maxDim < options_->getMaxWl()) {
1270+
if (options_->getMaxWl()) {
1271+
double maxHPWL
1272+
= topologyForEachLevel_.back().getLargestSinkRegionHPWL(wireSegmentUnit_);
1273+
if (maxHPWL < options_->getMaxWl() && isNumberOfSinksTooSmall(numSinksPerSubRegion)) {
12751274
logger_->info(CTS,
12761275
38,
1277-
" Stop criterion found. Largest sink region dimension "
1278-
"({}) is smaller than max wirelength ({}).",
1279-
maxDim,
1280-
options_->getMaxWl());
1276+
" Stop criterion found. Sink region hpwl "
1277+
"is smaller than max wirelength ({}) and max number of sinks is {}.",
1278+
options_->getMaxWl() / options_->getWireSegmentUnit(),
1279+
options_->getMaxFanout() ? options_->getMaxFanout()
1280+
: numMaxLeafSinks_);
12811281
break;
12821282
}
12831283
} else if(isNumberOfSinksTooSmall(numSinksPerSubRegion)) {

src/cts/src/HTreeBuilder.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,9 @@ class HTreeBuilder : public TreeBuilder
129129
return branchSinkLocs_[branchIdx];
130130
}
131131

132-
std::pair<unsigned, double> getLargestSinkRegion(
132+
double getLargestSinkRegionHPWL(
133133
unsigned wireSegmentUnit) const
134134
{
135-
unsigned bestIdx = 0;
136135
double bestHpwl = 0.0;
137136
for (unsigned i = 0; i < branchSinkLocs_.size(); ++i) {
138137
const auto& sinks = branchSinkLocs_[i];
@@ -152,10 +151,9 @@ class HTreeBuilder : public TreeBuilder
152151
const double hpwl = ((maxX - minX) + (maxY - minY)) * wireSegmentUnit;
153152
if (hpwl > bestHpwl) {
154153
bestHpwl = hpwl;
155-
bestIdx = i;
156154
}
157155
}
158-
return {bestIdx, bestHpwl};
156+
return bestHpwl;
159157
}
160158

161159
void setOutputSlew(unsigned slew) { outputSlew_ = slew; }

0 commit comments

Comments
 (0)