1010#include < utility>
1111
1212#include " AbstractGraphics.h"
13+ #include " db_sta/dbNetwork.hh"
1314#include " db_sta/dbSta.hh"
1415#include " graphicsNone.h"
1516#include " initialPlace.h"
2122#include " placerBase.h"
2223#include " routeBase.h"
2324#include " rsz/Resizer.hh"
25+ #include " sta/Graph.hh"
26+ #include " sta/Path.hh"
2427#include " sta/StaMain.hh"
28+ #include " sta/StaState.hh"
2529#include " timingBase.h"
2630#include " utl/Logger.h"
2731#include " utl/validation.h"
@@ -38,6 +42,40 @@ Replace::Replace(odb::dbDatabase* odb,
3842 : db_(odb), sta_(sta), rs_(resizer), fr_(router), log_(logger)
3943{
4044 graphics_ = std::make_unique<GraphicsNone>();
45+
46+ // Register "orig_name" report_path field: original pin name before
47+ // multi-bit clustering. Reads "orig_name" property off the path
48+ // vertex's iterm. Registered at tool init so paths can be reported
49+ // even when the design is loaded from an already-clustered .odb
50+ // without re-running cluster_flops.
51+ if (sta_->findReportPathField (kOrigNameProp ) == nullptr ) {
52+ sta::dbNetwork* network = sta_->getDbNetwork ();
53+ sta_->makeReportPathField (
54+ kOrigNameProp ,
55+ kOrigNameProp ,
56+ " Orig Name" ,
57+ 36 ,
58+ true ,
59+ nullptr ,
60+ [network](const sta::Path* path,
61+ const sta::StaState* sta) -> std::string {
62+ if (path == nullptr ) {
63+ return {};
64+ }
65+ const sta::Pin* pin = path->vertex (sta)->pin ();
66+ // staToDb requires all three out-params; only iterm is used.
67+ odb::dbITerm* iterm = nullptr ;
68+ odb::dbBTerm* bterm = nullptr ;
69+ odb::dbModITerm* moditerm = nullptr ;
70+ network->staToDb (pin, iterm, bterm, moditerm);
71+ if (iterm == nullptr ) {
72+ return {};
73+ }
74+ odb::dbStringProperty* prop
75+ = odb::dbStringProperty::find (iterm, kOrigNameProp );
76+ return prop ? prop->getValue () : std::string{};
77+ });
78+ }
4179}
4280
4381Replace::~Replace () = default ;
0 commit comments