Skip to content

Commit 656983a

Browse files
committed
cts: fix dummy load count reported by each builder
Signed-off-by: arthurjolo <[email protected]>
1 parent 369e8f0 commit 656983a

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

src/cts/include/cts/TritonCTS.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class TritonCTS
188188
double computeInsertionDelay(const std::string& name,
189189
odb::dbInst* inst,
190190
odb::dbMTerm* mterm);
191-
void writeDummyLoadsToDb(Clock& clockNet,
191+
int writeDummyLoadsToDb(Clock& clockNet,
192192
std::unordered_set<odb::dbInst*>& dummies);
193193
bool computeIdealOutputCaps(Clock& clockNet);
194194
void findCandidateDummyCells(std::vector<sta::LibertyCell*>& dummyCandidates);

src/cts/src/TreeBuilder.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ class TreeBuilder
221221

222222
float getAveSinkArrival() const { return aveArrival_; }
223223
void setAveSinkArrival(float arrival) { aveArrival_ = arrival; }
224+
float getNDummies() const { return nDummies_; }
225+
void setNDummies(float nDummies) { nDummies_ = nDummies; }
224226
odb::dbInst* getTopBuffer() const { return topBuffer_; }
225227
void setTopBuffer(odb::dbInst* inst) { topBuffer_ = inst; }
226228
std::string getTopBufferName() const { return topBufferName_; }
@@ -256,6 +258,7 @@ class TreeBuilder
256258
insertionDelays_;
257259
TreeType type_ = TreeType::RegularTree;
258260
float aveArrival_ = 0.0;
261+
int nDummies_ = 0;
259262
odb::dbInst* topBuffer_ = nullptr;
260263
std::string topBufferName_;
261264
odb::dbNet* drivingNet_ = nullptr;

src/cts/src/TritonCTS.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,8 @@ void TritonCTS::writeDataToDb()
494494
writeClockNDRsToDb(builder.get());
495495
}
496496
if (options_->dummyLoadEnabled()) {
497-
writeDummyLoadsToDb(builder->getClock(), clkDummies);
497+
int nDummies = writeDummyLoadsToDb(builder->getClock(), clkDummies);
498+
builder->setNDummies(nDummies);
498499
}
499500
}
500501

@@ -538,7 +539,7 @@ void TritonCTS::writeDataToDb()
538539
}
539540
logger_->info(CTS, 102, " Path depth {} - {}", minDepth, maxDepth);
540541
if (options_->dummyLoadEnabled()) {
541-
logger_->info(CTS, 207, " Leaf load cells {}", dummyLoadIndex_);
542+
logger_->info(CTS, 207, " Dummy loads inserted {}", builder->getNDummies());
542543
}
543544
}
544545
}
@@ -2122,20 +2123,21 @@ sta::LibertyCell* findBestDummyCell(
21222123
return bestCell;
21232124
}
21242125

2125-
void TritonCTS::writeDummyLoadsToDb(Clock& clockNet,
2126+
int TritonCTS::writeDummyLoadsToDb(Clock& clockNet,
21262127
std::unordered_set<odb::dbInst*>& dummies)
21272128
{
21282129
// Traverse clock tree and compute ideal output caps for clock
21292130
// buffers in the same level
21302131
if (!computeIdealOutputCaps(clockNet)) {
21312132
// No cap adjustment is needed
2132-
return;
2133+
return 0;
21332134
}
21342135

21352136
// Find suitable candidate cells for dummy loads
21362137
std::vector<sta::LibertyCell*> dummyCandidates;
21372138
findCandidateDummyCells(dummyCandidates);
21382139

2140+
int nDummies = 0;
21392141
clockNet.forEachSubNet([&](ClockSubNet& subNet) {
21402142
subNet.forEachSink([&](ClockInst* inst) {
21412143
if (inst->isClockBuffer()
@@ -2145,6 +2147,7 @@ void TritonCTS::writeDummyLoadsToDb(Clock& clockNet,
21452147
= insertDummyCell(clockNet, inst, dummyCandidates);
21462148
if (dummyInst != nullptr) {
21472149
dummies.insert(dummyInst);
2150+
nDummies++;
21482151
}
21492152
}
21502153
});
@@ -2153,6 +2156,7 @@ void TritonCTS::writeDummyLoadsToDb(Clock& clockNet,
21532156
if (logger_->debugCheck(utl::CTS, "dummy load", 1)) {
21542157
printClockNetwork(clockNet);
21552158
}
2159+
return nDummies;
21562160
}
21572161

21582162
// Return true if any clock buffers need cap adjustment; false otherwise

0 commit comments

Comments
 (0)