Skip to content

Cts add user clock buffer prefix for list inferring #7231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

arthurjolo
Copy link
Contributor

Add the option for user to define the clock buffer name that CTS will look for when inferring the buffer list (e.g. "CLKBUF"). If no cells are found using the user's name it will proceed with the normal inferring procedure. This helps users which PDKs don't follow the default clock buffer name defined in CTS.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@@ -249,6 +251,7 @@ class CtsOptions : public odb::dbBlockCallBackObj
std::string sinkBuffer_ = "";
std::string treeBuffer_ = "";
std::string metricFile_ = "";
std::string bufferListPrefix_ = "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: redundant string initialization [readability-redundant-string-init]

Suggested change
std::string bufferListPrefix_ = "";
std::string bufferListPrefix_;

@@ -667,7 +667,30 @@ void TritonCTS::inferBufferList(std::vector<std::string>& buffers)
}
delete lib_iter;

// second, look for all buffers with name CLKBUF or clkbuf
// second, look for buffers with name especified by the user
if (options_->getBufferListPrefix() != "") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: the 'empty' method should be used to check for emptiness instead of comparing to an empty object [readability-container-size-empty]

Suggested change
if (options_->getBufferListPrefix() != "") {
if (!options_->getBufferListPrefix().empty()) {
Additional context

/usr/include/c++/11/bits/basic_string.h:1022: method 'basic_string'::empty() defined here

      empty() const _GLIBCXX_NOEXCEPT
      ^

@gadfort
Copy link
Collaborator

gadfort commented Apr 28, 2025

Why not use [get_lib_cells CLKBUF*] as the input to the buf_list?

@arthurjolo
Copy link
Contributor Author

Why not use [get_lib_cells CLKBUF*] as the input to the buf_list?

The main reason to add this command is that when CTS does the buffer list inference it sometimes will fail to identify the clock specific buffers. And if you use -buf_list CTS can be slowed down if the list is too big. So this command would help guide the buffer inference and it would take advantage of the buffer list trimming. But i believe this will not be added to production, we need to improve how the buffer inference works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants