Skip to content

Commit fe793d6

Browse files
committed
cts: pass the buffer list defined by the buf_list flag to RSZ
Signed-off-by: luis201420 <luisemv@precisioninno.com>
1 parent edb94a7 commit fe793d6

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/cts/src/TritonCTS.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,19 +642,33 @@ int TritonCTS::setClockNets(const char* names)
642642

643643
void TritonCTS::setBufferList(const char* buffers)
644644
{
645+
// Put the buffer list into a string vector
645646
std::stringstream ss(buffers);
646647
std::istream_iterator<std::string> begin(ss);
647648
std::istream_iterator<std::string> end;
648649
std::vector<std::string> bufferList(begin, end);
650+
// If the vector is empty, then the buffers are inferred
649651
if (bufferList.empty()) {
650652
inferBufferList(bufferList);
651653
} else {
654+
// Iterate the user-defined buffer list
655+
sta::Vector<sta::LibertyCell*> selected_buffers;
652656
for (const std::string& buffer : bufferList) {
653-
if (db_->findMaster(buffer.c_str()) == nullptr) {
657+
odb::dbMaster* buffer_master = db_->findMaster(buffer.c_str());
658+
if (buffer_master == nullptr) {
654659
logger_->error(
655660
CTS, 126, "No physical master cell found for buffer {}.", buffer);
661+
} else {
662+
// Get the buffer and add to the vector
663+
sta::Cell* master_cell = network_->dbToSta(buffer_master);
664+
if (master_cell) {
665+
sta::LibertyCell* lib_cell = network_->libertyCell(master_cell);
666+
selected_buffers.push_back(lib_cell);
667+
}
656668
}
657669
}
670+
// Add found buffer to RSZ
671+
resizer_->setClockBuffersList(selected_buffers);
658672
}
659673
options_->setBufferList(bufferList);
660674
}

0 commit comments

Comments
 (0)