Skip to content

Commit cf83490

Browse files
authored
Merge pull request #9259 from luis201420/cts_fix_defined_fanout
CTS: fix the correct value of max fanout
2 parents 0f99689 + 23ace1f commit cf83490

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/cts/src/TritonCTS.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,15 @@ int TritonCTS::getBufferFanoutLimit(const std::string& bufferName)
143143
int fanout = std::numeric_limits<int>::max();
144144
float tempFanout;
145145
bool existMaxFanout;
146+
147+
// Check if top instance has fanout limit
148+
sta::Cell* top_cell = network_->cell(network_->topInstance());
149+
openSta_->sdc()->fanoutLimit(
150+
top_cell, sta::MinMax::max(), tempFanout, existMaxFanout);
151+
if (existMaxFanout) {
152+
fanout = std::min(fanout, (int) tempFanout);
153+
}
154+
146155
odb::dbMaster* bufferMaster = db_->findMaster(bufferName.c_str());
147156
sta::Cell* bufferCell = network_->dbToSta(bufferMaster);
148157
sta::Port* buffer_port = nullptr;
@@ -159,7 +168,7 @@ int TritonCTS::getBufferFanoutLimit(const std::string& bufferName)
159168
}
160169
}
161170
if (buffer_port == nullptr) {
162-
return 0;
171+
return (existMaxFanout) ? fanout : 0;
163172
}
164173

165174
openSta_->sdc()->fanoutLimit(

0 commit comments

Comments
 (0)