-
Notifications
You must be signed in to change notification settings - Fork 894
Update OpenSTA 5/14 code comes with report path field generalization, needs OpenROAD updation for mbff orig_name #10437
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
ff4fde2
32fc69e
0912d5f
3452e8e
f97d94e
cc1e711
17c48eb
2f9fdb6
43286b9
6b36f7c
437521a
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 |
|---|---|---|
|
|
@@ -927,27 +927,26 @@ void MBFF::ModifyPinConnections(const std::vector<Flop>& flops, | |
| } | ||
|
|
||
| // Store original FF→tray pin mapping as a property on the tray | ||
| // instance so timing reports can display the original pin name. | ||
| std::string tray_port; | ||
| // pin (iterm) so the report_path "orig_name" field can display the | ||
| // original pin name. | ||
| dbITerm* tray_iterm = nullptr; | ||
| if (is_d && d_pin) { | ||
| tray_port = d_pin->name(); | ||
| tray_iterm = tray_inst[tray_idx]->findITerm(d_pin->name().c_str()); | ||
| } else if (is_q) { | ||
| if (is_qn_inv && qn_pin) { | ||
| tray_port = qn_pin->name(); | ||
| } else if (q_pin) { | ||
| tray_port = q_pin->name(); | ||
| const sta::LibertyPort* tray_port = is_qn_inv ? qn_pin : q_pin; | ||
| if (tray_port) { | ||
| tray_iterm | ||
| = tray_inst[tray_idx]->findITerm(tray_port->name().c_str()); | ||
| } | ||
| } | ||
|
Comment on lines
+932
to
941
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. The logic for selecting dbITerm* tray_iterm = nullptr;
if (is_d && d_pin) {
tray_iterm = tray_inst[tray_idx]->findITerm(d_pin->name().c_str());
} else if (is_q) {
const sta::LibertyPort* tray_port = is_qn_inv ? qn_pin : q_pin;
if (tray_port) {
tray_iterm = tray_inst[tray_idx]->findITerm(tray_port->name().c_str());
}
}References
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. I addressed this |
||
| if (!tray_port.empty()) { | ||
| const std::string key = "orig_name_" + tray_port; | ||
| if (tray_iterm) { | ||
| const std::string val = orig_inst_name + "/" + orig_port_name; | ||
| odb::dbStringProperty* prop | ||
| = odb::dbStringProperty::find(tray_inst[tray_idx], key.c_str()); | ||
| = odb::dbStringProperty::find(tray_iterm, kOrigNameProp); | ||
| if (prop) { | ||
| prop->setValue(val.c_str()); | ||
| } else { | ||
| odb::dbStringProperty::create( | ||
| tray_inst[tray_idx], key.c_str(), val.c_str()); | ||
| odb::dbStringProperty::create(tray_iterm, kOrigNameProp, val.c_str()); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ | |
| #include <utility> | ||
|
|
||
| #include "AbstractGraphics.h" | ||
| #include "db_sta/dbNetwork.hh" | ||
| #include "db_sta/dbSta.hh" | ||
| #include "graphicsNone.h" | ||
| #include "initialPlace.h" | ||
|
|
@@ -21,7 +22,10 @@ | |
| #include "placerBase.h" | ||
| #include "routeBase.h" | ||
| #include "rsz/Resizer.hh" | ||
| #include "sta/Graph.hh" | ||
| #include "sta/Path.hh" | ||
| #include "sta/StaMain.hh" | ||
| #include "sta/StaState.hh" | ||
| #include "timingBase.h" | ||
| #include "utl/Logger.h" | ||
| #include "utl/validation.h" | ||
|
|
@@ -38,6 +42,40 @@ Replace::Replace(odb::dbDatabase* odb, | |
| : db_(odb), sta_(sta), rs_(resizer), fr_(router), log_(logger) | ||
| { | ||
| graphics_ = std::make_unique<GraphicsNone>(); | ||
|
|
||
| // Register "orig_name" report_path field: original pin name before | ||
| // multi-bit clustering. Reads "orig_name" property off the path | ||
| // vertex's iterm. Registered at tool init so paths can be reported | ||
| // even when the design is loaded from an already-clustered .odb | ||
| // without re-running cluster_flops. | ||
| if (sta_->findReportPathField(kOrigNameProp) == nullptr) { | ||
| sta::dbNetwork* network = sta_->getDbNetwork(); | ||
| sta_->makeReportPathField( | ||
| kOrigNameProp, | ||
| kOrigNameProp, | ||
| "Orig Name", | ||
| 36, | ||
| true, | ||
| nullptr, | ||
| [network](const sta::Path* path, | ||
| const sta::StaState* sta) -> std::string { | ||
|
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. warning: no header providing "sta::StaState" is directly included [misc-include-cleaner] src/gpl/src/replace.cpp:27: - #include "timingBase.h"
+ #include "sta/StaState.hh"
+ #include "timingBase.h" |
||
| if (path == nullptr) { | ||
| return {}; | ||
| } | ||
| const sta::Pin* pin = path->vertex(sta)->pin(); | ||
| // staToDb requires all three out-params; only iterm is used. | ||
| odb::dbITerm* iterm = nullptr; | ||
| odb::dbBTerm* bterm = nullptr; | ||
| odb::dbModITerm* moditerm = nullptr; | ||
| network->staToDb(pin, iterm, bterm, moditerm); | ||
| if (iterm == nullptr) { | ||
| return {}; | ||
| } | ||
| odb::dbStringProperty* prop | ||
| = odb::dbStringProperty::find(iterm, kOrigNameProp); | ||
| return prop ? prop->getValue() : std::string{}; | ||
|
Comment on lines
+74
to
+76
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.
When users load an ODB written by the previous implementation after Useful? React with 👍 / 👎.
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 factually correct about behavior: old .odb files written before this PR have orig_name_ on the tray dbInst (commit 649366b). New getter reads orig_name on dbITerm --> silent blank for those legacy .odb files. But the orig name storage was a recent April 2026 commit, not a long-standing release. It will be better to rerun cluster_flops to regenerate new-format properties automatically. |
||
| }); | ||
| } | ||
| } | ||
|
|
||
| Replace::~Replace() = default; | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| module tray_test (clk1, d1, d2, d3, d4, o1, o2, o3, o4); | ||
| input clk1; | ||
| input d1; | ||
| input d2; | ||
| input d3; | ||
| input d4; | ||
| output o1; | ||
| output o2; | ||
| output o3; | ||
| output o4; | ||
|
|
||
| DFFHQNx1_ASAP7_75t_L ff1 (.CLK(clk1), .D(d1), .QN(o1)); | ||
| DFFHQNx1_ASAP7_75t_L ff2 (.CLK(clk1), .D(d2), .QN(o2)); | ||
| DFFHQNx1_ASAP7_75t_L ff3 (.CLK(clk1), .D(d3), .QN(o3)); | ||
| DFFHQNx1_ASAP7_75t_L ff4 (.CLK(clk1), .D(d4), .QN(o4)); | ||
| endmodule |
| +2 −3 | .gitignore | |
| +2 −0 | BUILD | |
| +59 −0 | include/sta/LevelizeObserver.hh | |
| +16 −9 | include/sta/Sta.hh | |
| +3 −0 | include/sta/StringUtil.hh | |
| +10 −32 | liberty/LibertyParse.yy | |
| +7 −0 | liberty/LibertyParser.cc | |
| +7 −28 | liberty/LibertyReader.cc | |
| +0 −4 | liberty/LibertyReaderPvt.hh | |
| +9 −1 | network/Network.i | |
| +1 −9 | search/Levelize.hh | |
| +117 −118 | search/ReportPath.cc | |
| +63 −53 | search/ReportPath.hh | |
| +35 −20 | search/Search.i | |
| +12 −34 | search/Search.tcl | |
| +26 −26 | search/Sta.cc | |
| +13 −0 | search/test/cpp/TestReportFields.hh | |
| +3 −2 | search/test/cpp/TestSearchStaDesign.cc | |
| +13 −9 | search/test/cpp/TestSearchStaInit.cc | |
| +6 −5 | search/test/cpp/TestSearchStaInitB.cc | |
| +0 −39 | tcl/StaTclTypes.i | |
| +4 −2 | test/regression.tcl | |
| +26 −0 | util/StringUtil.cc | |
| +35 −0 | util/Util.i |
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.
The
sta::LibertyPort::name()method returns aconst char*. Calling.c_str()on a raw pointer is a compilation error. You should pass the result ofname()directly tofindITerm.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.
Gemini you are wrong. LibertyPort inherits ConcretePort::name() which returns const std::string & . So c_str() on it is valid and necessary because dbInst::findITerm takes const char*
Current code:
tray_iterm = tray_inst[tray_idx]->findITerm(d_pin->name().c_str());
is correct,
Without .c_str() compile would fail (can't convert const std::string& to const char* implicitly).