Skip to content

Commit f509e0f

Browse files
authored
Merge pull request #10548 from mikesinouye/mbff
mbff: expose visibility of some idempotent helper functions
2 parents f2f20fa + d5f7769 commit f509e0f

13 files changed

Lines changed: 564 additions & 546 deletions

File tree

src/dbSta/include/db_sta/dbNetwork.hh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,44 @@ class dbNetwork : public ConcreteNetwork
405405
double dbuToMeters(int dist) const;
406406
int metersToDbu(double dist) const;
407407

408+
////////////////////////////////////////////////////////////////
409+
// Sequential / Flop / Scan flop utility functions
410+
// clock pin functions
411+
bool isClockPin(odb::dbITerm* iterm) const;
412+
bool clockOn(odb::dbInst* inst) const;
413+
414+
// d pin functions
415+
bool isDPin(odb::dbITerm* iterm) const;
416+
int getNumD(odb::dbInst* inst) const;
417+
418+
// q(n) pin functions
419+
bool isQPin(odb::dbITerm* iterm) const;
420+
bool isInvertingQPin(odb::dbITerm* iterm) const;
421+
int getNumQ(odb::dbInst* inst) const;
422+
423+
// clear/preset pin functions
424+
bool hasClear(odb::dbInst* inst) const;
425+
bool isClearPin(odb::dbITerm* iterm) const;
426+
bool hasPreset(odb::dbInst* inst) const;
427+
bool isPresetPin(odb::dbITerm* iterm) const;
428+
429+
// scan cell/pin functions
430+
bool isScanCell(odb::dbInst* inst) const;
431+
bool isScanIn(odb::dbITerm* iterm) const;
432+
odb::dbITerm* getScanIn(odb::dbInst* inst) const;
433+
bool isScanEnable(odb::dbITerm* iterm) const;
434+
odb::dbITerm* getScanEnable(odb::dbInst* inst) const;
435+
LibertyPort* getLibertyScanEnable(const LibertyCell* lib_cell) const;
436+
LibertyPort* getLibertyScanIn(const LibertyCell* lib_cell) const;
437+
LibertyPort* getLibertyScanOut(const LibertyCell* lib_cell) const;
438+
439+
// supply pin functions
440+
bool isSupplyPin(odb::dbITerm* iterm) const;
441+
bool isValidFlop(odb::dbInst* FF) const;
442+
bool isValidTray(odb::dbInst* tray) const;
443+
444+
////////////////////////////////////////////////////////////////
445+
408446
// hierarchy handler, set in openroad tested in network child traverserser
409447

410448
void setHierarchy() { db_->setHierarchy(true); }
@@ -483,6 +521,7 @@ class dbNetwork : public ConcreteNetwork
483521
static constexpr unsigned DBIDTAG_WIDTH = 0x4;
484522

485523
private:
524+
const LibertyCell* getLibertyCell(const Cell* cell) const;
486525
void addDriverToCacheIfPresent(const Net* net, const Pin* drvr);
487526
void removeDriverFromCache(const Net* net);
488527
void removeDriverFromCache(const Net* net, const Pin* drvr);

src/dbSta/include/db_sta/dbSta.hh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <vector>
1212

1313
#include "db_sta/DelayFmt.hh" // IWYU pragma: keep
14+
#include "db_sta/dbNetwork.hh"
1415
#include "odb/PtrSetMap.h"
1516
#include "odb/db.h"
1617
#include "odb/dbBlockCallBackObj.h"
@@ -258,10 +259,4 @@ class dbSta : public Sta, public odb::dbDatabaseObserver
258259
bool drvr_vertices_level_valid_ = false;
259260
};
260261

261-
// Utilities for TestCell
262-
263-
sta::LibertyPort* getLibertyScanEnable(const LibertyCell* lib_cell);
264-
sta::LibertyPort* getLibertyScanIn(const LibertyCell* lib_cell);
265-
sta::LibertyPort* getLibertyScanOut(const LibertyCell* lib_cell);
266-
267262
} // namespace sta

0 commit comments

Comments
 (0)