Skip to content

Commit

Permalink
Initial version of dbNetwork commit part 2, wip. Signed-off-by: Andy …
Browse files Browse the repository at this point in the history
…Fox <[email protected]>

Signed-off-by: andyfox-rushc <[email protected]>
  • Loading branch information
andyfox-rushc committed May 20, 2024
1 parent dac8235 commit ecf5c83
Show file tree
Hide file tree
Showing 14 changed files with 555 additions and 142 deletions.
4 changes: 3 additions & 1 deletion src/Timing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ std::pair<odb::dbITerm*, odb::dbBTerm*> Timing::staToDBPin(const sta::Pin* pin)
sta::dbNetwork* db_network = openroad->getDbNetwork();
odb::dbITerm* iterm;
odb::dbBTerm* bterm;
db_network->staToDb(pin, iterm, bterm);
odb::dbModITerm* moditerm;
odb::dbModBTerm* modbterm;
db_network->staToDb(pin, iterm, bterm, moditerm, modbterm);
return std::make_pair(iterm, bterm);
}

Expand Down
4 changes: 3 additions & 1 deletion src/cts/src/TritonCTS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1522,7 +1522,9 @@ void TritonCTS::findClockRoots(sta::Clock* clk,
for (const sta::Pin* pin : clk->leafPins()) {
odb::dbITerm* instTerm;
odb::dbBTerm* port;
network_->staToDb(pin, instTerm, port);
odb::dbModITerm* moditerm;
odb::dbModBTerm* modbterm;
network_->staToDb(pin, instTerm, port, moditerm, modbterm);
odb::dbNet* net = instTerm ? instTerm->getNet() : port->getNet();
clockNets.insert(net);
}
Expand Down
35 changes: 26 additions & 9 deletions src/dbSta/include/db_sta/dbNetwork.hh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ using odb::dbIoType;
using odb::dbITerm;
using odb::dbLib;
using odb::dbMaster;
using odb::dbModBTerm;
using odb::dbModInst;
using odb::dbModITerm;
using odb::dbModNet;
using odb::dbModule;
using odb::dbMTerm;
using odb::dbNet;
Expand Down Expand Up @@ -114,39 +117,53 @@ class dbNetwork : public ConcreteNetwork

LibertyCell* libertyCell(dbInst* inst);

// Use the this if you know you are dealing with a leaf instance
dbInst* staToDb(const Instance* instance) const;
// Use the this if you might have a hierarchical instance
void staToDb(const Instance* instance,
// Return values.
dbInst*& db_inst,
dbModInst*& mod_inst) const;
dbNet* staToDb(const Net* net) const;
void staToDb(const Pin* pin,
// Return values.
dbITerm*& iterm,
dbBTerm*& bterm) const;
dbBTerm*& bterm,
dbModITerm*& moditerm,
dbModBTerm*& modbterm) const;

dbNet* staToDb(const Net* net) const;
void staToDb(const Net* net, dbNet*& dnet, dbModNet*& modnet) const;

void staToDb(const Pin* pin, dbITerm*& iterm, dbBTerm*& bterm) const;
dbBTerm* staToDb(const Term* term) const;
void staToDb(const Term* term,
dbITerm*& iterm,
dbBTerm*& bterm,
dbModITerm*& moditerm,
dbModBTerm*& modbterm) const;
dbMaster* staToDb(const Cell* cell) const;
void staToDb(const Cell* cell, dbMaster*& master, dbModule*& module) const;
dbMaster* staToDb(const LibertyCell* cell) const;
dbMTerm* staToDb(const Port* port) const;
dbMTerm* staToDb(const LibertyPort* port) const;
void staToDb(PortDirection* dir,
// Return values.
dbSigType& sig_type,
dbIoType& io_type) const;

Pin* dbToSta(dbBTerm* bterm) const;
Term* dbToStaTerm(dbBTerm* bterm) const;
Pin* dbToSta(dbITerm* iterm) const;
Instance* dbToSta(dbInst* inst) const;
Instance* dbToSta(dbModInst* inst) const;
Net* dbToSta(dbNet* net) const;
const Net* dbToSta(const dbNet* net) const;
Cell* dbToSta(dbMaster* master) const;
Cell* dbToSta(dbModule* master) const;
Port* dbToSta(dbMTerm* mterm) const;

Instance* dbToSta(dbModInst* inst) const;
Cell* dbToSta(dbModule* master) const;
Pin* dbToSta(dbModITerm* mod_iterm) const;
Pin* dbToStaPin(dbModBTerm* mod_bterm) const;
Net* dbToSta(dbModNet* net) const;
Port* dbToSta(dbModBTerm* modbterm) const;
Term* dbToStaTerm(dbModITerm* moditerm) const;
Term* dbToStaTerm(dbModBTerm* modbterm) const;

PortDirection* dbToSta(const dbSigType& sig_type,
const dbIoType& io_type) const;
// dbStaCbk::inDbBTermCreate
Expand Down
Loading

0 comments on commit ecf5c83

Please sign in to comment.