-
Notifications
You must be signed in to change notification settings - Fork 908
ram: auto-detect power and ground pin names #10580
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
base: master
Are you sure you want to change the base?
Changes from all commits
0ce5bee
cc69d97
382d8c7
1ee8a78
baf136e
e3a207b
93f02ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -582,6 +582,42 @@ std::map<PortRole, std::string> RamGen::buildPortMap(dbMaster* master) | |||||||||||||||||||||||||||||||||||||||||||
| ground_count); | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| for (auto& [role, name] : pin_map) { | ||||||||||||||||||||||||||||||||||||||||||||
| if (role.type == PortRoleType::Power) { | ||||||||||||||||||||||||||||||||||||||||||||
| power_pin_names_.insert(name); | ||||||||||||||||||||||||||||||||||||||||||||
| } else if (role.type == PortRoleType::Ground) { | ||||||||||||||||||||||||||||||||||||||||||||
| ground_pin_names_.insert(name); | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| if (power_pin_names_.size() > 1) { | ||||||||||||||||||||||||||||||||||||||||||||
| std::string names; | ||||||||||||||||||||||||||||||||||||||||||||
| for (const auto& name : power_pin_names_) { | ||||||||||||||||||||||||||||||||||||||||||||
| if (!names.empty()) { | ||||||||||||||||||||||||||||||||||||||||||||
| names += ", "; | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| names += name; | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| logger_->error(RAM, | ||||||||||||||||||||||||||||||||||||||||||||
| 42, | ||||||||||||||||||||||||||||||||||||||||||||
| "Multiple primary power pin names detected across cells: {}", | ||||||||||||||||||||||||||||||||||||||||||||
| names); | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| if (ground_pin_names_.size() > 1) { | ||||||||||||||||||||||||||||||||||||||||||||
| std::string names; | ||||||||||||||||||||||||||||||||||||||||||||
| for (const auto& name : ground_pin_names_) { | ||||||||||||||||||||||||||||||||||||||||||||
| if (!names.empty()) { | ||||||||||||||||||||||||||||||||||||||||||||
| names += ", "; | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| names += name; | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| logger_->error( | ||||||||||||||||||||||||||||||||||||||||||||
| RAM, | ||||||||||||||||||||||||||||||||||||||||||||
| 43, | ||||||||||||||||||||||||||||||||||||||||||||
| "Multiple primary ground pin names detected across cells: {}", | ||||||||||||||||||||||||||||||||||||||||||||
| names); | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+593
to
+620
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you misunderstand, you want to error if there are multiple power pins within the same cell, not across cells. Supporting different pin names across cells is exactly the reason to use a set. |
||||||||||||||||||||||||||||||||||||||||||||
| return pin_map; | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -846,9 +882,7 @@ void RamGen::findMasters() | |||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| void RamGen::ramPdngen(const char* power_pin, | ||||||||||||||||||||||||||||||||||||||||||||
| const char* ground_pin, | ||||||||||||||||||||||||||||||||||||||||||||
| const char* power_net_name, | ||||||||||||||||||||||||||||||||||||||||||||
| void RamGen::ramPdngen(const char* power_net_name, | ||||||||||||||||||||||||||||||||||||||||||||
| const char* ground_net_name, | ||||||||||||||||||||||||||||||||||||||||||||
| const char* route_name, | ||||||||||||||||||||||||||||||||||||||||||||
| int route_width, | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -913,8 +947,13 @@ void RamGen::ramPdngen(const char* power_pin, | |||||||||||||||||||||||||||||||||||||||||||
| ground_net->setSpecial(); | ||||||||||||||||||||||||||||||||||||||||||||
| ground_net->setSigType(odb::dbSigType::GROUND); | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| block_->addGlobalConnect(nullptr, ".*", power_pin, power_net, true); | ||||||||||||||||||||||||||||||||||||||||||||
| block_->addGlobalConnect(nullptr, ".*", ground_pin, ground_net, true); | ||||||||||||||||||||||||||||||||||||||||||||
| for (const auto& pin_name : power_pin_names_) { | ||||||||||||||||||||||||||||||||||||||||||||
| block_->addGlobalConnect(nullptr, ".*", pin_name.c_str(), power_net, true); | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| for (const auto& pin_name : ground_pin_names_) { | ||||||||||||||||||||||||||||||||||||||||||||
| block_->addGlobalConnect(nullptr, ".*", pin_name.c_str(), ground_net, true); | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| block_->globalConnect(false, false); | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+950
to
958
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since To prevent this state leakage, clear both sets at the end of
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is added in 382d8c7
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's unnecessary because you would not be creating more than one RAM per session. OpenROAD doesn't support operating on more than one design and likely won't in the future. |
||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this guarantee that only one primary power is used? What if there are two different power pins found? We would want to error in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a error check in baf136e, ready for review