Skip to content

Commit 6be2024

Browse files
committed
[CTS] Move occupiedPositions seeding to populateTritonCTS
Avoid re-iterating all block instances per clock net by seeding the occupiedPositions set once in populateTritonCTS() before the clock net loop, instead of inside the per-net wrapper. Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
1 parent f1a21d4 commit 6be2024

2 files changed

Lines changed: 11 additions & 16 deletions

File tree

src/cts/include/cts/TritonCTS.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ class TritonCTS
120120
void incrementNumClocks() { ++numberOfClocks_; }
121121
void clearNumClocks() { numberOfClocks_ = 0; }
122122
unsigned getNumClocks() const { return numberOfClocks_; }
123-
void cloneClockGaters(odb::dbNet* clkNet);
124123
void cloneClockGaters(odb::dbNet* clkNet,
125124
std::set<odb::Point>& occupiedPositions);
126125
void findLongEdges(

src/cts/src/TritonCTS.cpp

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -855,20 +855,6 @@ std::string TritonCTS::selectBestMaxCapBuffer(
855855

856856
// db functions
857857

858-
void TritonCTS::cloneClockGaters(odb::dbNet* clkNet)
859-
{
860-
// Seed with all existing instance positions to prevent clones from
861-
// landing on a pre-existing cell and causing mapLocationToSink_
862-
// key collision in HTreeBuilder.
863-
std::set<odb::Point> occupiedPositions;
864-
for (odb::dbInst* inst : block_->getInsts()) {
865-
int x, y;
866-
inst->getLocation(x, y);
867-
occupiedPositions.emplace(x, y);
868-
}
869-
cloneClockGaters(clkNet, occupiedPositions);
870-
}
871-
872858
void TritonCTS::cloneClockGaters(odb::dbNet* clkNet,
873859
std::set<odb::Point>& occupiedPositions)
874860
{
@@ -1243,13 +1229,23 @@ void TritonCTS::populateTritonCTS()
12431229
allClkNets.insert(clkNets.begin(), clkNets.end());
12441230
}
12451231
}
1232+
// Seed with all existing instance positions to prevent clones from
1233+
// landing on a pre-existing cell and causing mapLocationToSink_
1234+
// key collision in HTreeBuilder.
1235+
std::set<odb::Point> occupiedPositions;
1236+
for (odb::dbInst* inst : block_->getInsts()) {
1237+
int x, y;
1238+
inst->getLocation(x, y);
1239+
occupiedPositions.emplace(x, y);
1240+
}
1241+
12461242
// Iterate over all the nets found by the user-input and dbSta
12471243
for (const auto& clockInfo : clockNetsInfo) {
12481244
std::set<odb::dbNet*> clockNets = clockInfo.first;
12491245
std::string clkName = clockInfo.second;
12501246
for (odb::dbNet* net : clockNets) {
12511247
if (net != nullptr) {
1252-
cloneClockGaters(net);
1248+
cloneClockGaters(net, occupiedPositions);
12531249
if (clkName.empty()) {
12541250
logger_->info(CTS, 95, "Net \"{}\" found.", net->getName());
12551251
} else {

0 commit comments

Comments
 (0)