Skip to content

Commit a1592f6

Browse files
authored
Merge pull request #8625 from hzeller/feature-20251012-using-dbnet
Don't use `using odb::dbNet;` to avoid polluting namespace.
2 parents dd2d7f7 + c121e8b commit a1592f6

15 files changed

Lines changed: 139 additions & 143 deletions

File tree

src/dpl/include/dpl/OptMirror.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,30 @@ class Logger;
1616

1717
namespace dpl {
1818

19-
using odb::dbNet;
20-
2119
using utl::Logger;
2220

2321
class NetBox
2422
{
2523
public:
2624
NetBox() = default;
27-
NetBox(dbNet* net, const odb::Rect& box, bool ignore);
25+
NetBox(odb::dbNet* net, const odb::Rect& box, bool ignore);
2826
int64_t hpwl();
2927
void saveBox();
3028
void restoreBox();
3129
bool isIgnore() const { return ignore_; }
32-
dbNet* getNet() const { return net_; }
30+
odb::dbNet* getNet() const { return net_; }
3331
const odb::Rect& getBox() const { return box_; }
3432

3533
void setBox(const odb::Rect& box) { box_ = box; }
3634

3735
private:
38-
dbNet* net_ = nullptr;
36+
odb::dbNet* net_ = nullptr;
3937
odb::Rect box_;
4038
odb::Rect box_saved_;
4139
bool ignore_ = false;
4240
};
4341

44-
using NetBoxMap = std::unordered_map<dbNet*, NetBox>;
42+
using NetBoxMap = std::unordered_map<odb::dbNet*, NetBox>;
4543
using NetBoxes = std::vector<NetBox*>;
4644

4745
class OptimizeMirroring

src/dpl/src/OptMirror.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ using odb::dbOrientType;
2626

2727
static dbOrientType orientMirrorY(const dbOrientType& orient);
2828

29-
NetBox::NetBox(dbNet* net, const odb::Rect& box, bool ignore)
29+
NetBox::NetBox(odb::dbNet* net, const odb::Rect& box, bool ignore)
3030
: net_(net), box_(box), ignore_(ignore)
3131
{
3232
}
@@ -97,7 +97,7 @@ void OptimizeMirroring::findNetBoxes()
9797
{
9898
net_box_map_.clear();
9999
auto nets = block_->getNets();
100-
for (dbNet* net : nets) {
100+
for (odb::dbNet* net : nets) {
101101
bool ignore = net->getSigType().isSupply()
102102
|| net->isSpecial()
103103
// Reducing HPWL on large nets (like clocks) is irrelevant
@@ -122,7 +122,7 @@ std::vector<odb::dbInst*> OptimizeMirroring::findMirrorCandidates(
122122
// Find inst terms on the boundary of the net boxes.
123123
for (NetBox* net_box : net_boxes) {
124124
if (!net_box->isIgnore()) {
125-
dbNet* net = net_box->getNet();
125+
odb::dbNet* net = net_box->getNet();
126126
const odb::Rect& box = net_box->getBox();
127127
for (dbITerm* iterm : net->getITerms()) {
128128
odb::dbInst* inst = iterm->getInst();
@@ -205,7 +205,7 @@ int64_t OptimizeMirroring::hpwl(odb::dbInst* inst)
205205
{
206206
int64_t inst_hpwl = 0;
207207
for (dbITerm* iterm : inst->getITerms()) {
208-
dbNet* net = iterm->getNet();
208+
odb::dbNet* net = iterm->getNet();
209209
if (net) {
210210
NetBox& net_box = net_box_map_[net];
211211
if (!net_box.isIgnore()) {
@@ -219,7 +219,7 @@ int64_t OptimizeMirroring::hpwl(odb::dbInst* inst)
219219
void OptimizeMirroring::updateNetBoxes(odb::dbInst* inst)
220220
{
221221
for (dbITerm* iterm : inst->getITerms()) {
222-
dbNet* net = iterm->getNet();
222+
odb::dbNet* net = iterm->getNet();
223223
if (net) {
224224
NetBox& net_box = net_box_map_[net];
225225
if (!net_box.isIgnore()) {
@@ -232,7 +232,7 @@ void OptimizeMirroring::updateNetBoxes(odb::dbInst* inst)
232232
void OptimizeMirroring::saveNetBoxes(odb::dbInst* inst)
233233
{
234234
for (dbITerm* iterm : inst->getITerms()) {
235-
dbNet* net = iterm->getNet();
235+
odb::dbNet* net = iterm->getNet();
236236
if (net) {
237237
net_box_map_[net].saveBox();
238238
}
@@ -242,7 +242,7 @@ void OptimizeMirroring::saveNetBoxes(odb::dbInst* inst)
242242
void OptimizeMirroring::restoreNetBoxes(odb::dbInst* inst)
243243
{
244244
for (dbITerm* iterm : inst->getITerms()) {
245-
dbNet* net = iterm->getNet();
245+
odb::dbNet* net = iterm->getNet();
246246
if (net) {
247247
net_box_map_[net].restoreBox();
248248
}

src/est/include/est/EstimateParasitics.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ namespace est {
4444
using utl::Logger;
4545

4646
using odb::dbDatabase;
47-
using odb::dbNet;
4847
using odb::dbTechLayer;
4948

5049
using stt::SteinerTreeBuilder;
@@ -187,7 +186,7 @@ class EstimateParasitics : public dbStaState
187186
Parasitics* parasitics);
188187
bool haveEstimatedParasitics() const;
189188
void parasiticsInvalid(const Net* net);
190-
void parasiticsInvalid(const dbNet* net);
189+
void parasiticsInvalid(const odb::dbNet* net);
191190
void eraseParasitics(const Net* net);
192191
bool parasiticsValid() const;
193192

src/est/src/EstimateParasitics.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ bool EstimateParasitics::isPad(const Instance* inst) const
10411041

10421042
void EstimateParasitics::parasiticsInvalid(const Net* net)
10431043
{
1044-
dbNet* db_net = db_network_->flatNet(net);
1044+
odb::dbNet* db_net = db_network_->flatNet(net);
10451045
if (haveEstimatedParasitics()) {
10461046
debugPrint(logger_,
10471047
EST,
@@ -1053,7 +1053,7 @@ void EstimateParasitics::parasiticsInvalid(const Net* net)
10531053
}
10541054
}
10551055

1056-
void EstimateParasitics::parasiticsInvalid(const dbNet* net)
1056+
void EstimateParasitics::parasiticsInvalid(const odb::dbNet* net)
10571057
{
10581058
parasiticsInvalid(db_network_->dbToSta(net));
10591059
}

src/est/src/OdbCallBack.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void OdbCallBack::inDbInstCreate(odb::dbInst* inst)
6363
}
6464
}
6565

66-
void OdbCallBack::inDbNetCreate(dbNet* net)
66+
void OdbCallBack::inDbNetCreate(odb::dbNet* net)
6767
{
6868
debugPrint(estimate_parasitics_->getLogger(),
6969
utl::EST,
@@ -74,7 +74,7 @@ void OdbCallBack::inDbNetCreate(dbNet* net)
7474
estimate_parasitics_->parasiticsInvalid(net);
7575
}
7676

77-
void OdbCallBack::inDbNetDestroy(dbNet* net)
77+
void OdbCallBack::inDbNetDestroy(odb::dbNet* net)
7878
{
7979
debugPrint(estimate_parasitics_->getLogger(),
8080
utl::EST,
@@ -96,13 +96,13 @@ void OdbCallBack::inDbITermPostConnect(dbITerm* iterm)
9696
1,
9797
"inDbITermPostConnect iterm {}",
9898
iterm->getName());
99-
dbNet* db_net = iterm->getNet();
99+
odb::dbNet* db_net = iterm->getNet();
100100
if (db_net) {
101101
estimate_parasitics_->parasiticsInvalid(db_net);
102102
}
103103
}
104104

105-
void OdbCallBack::inDbITermPostDisconnect(dbITerm* iterm, dbNet* net)
105+
void OdbCallBack::inDbITermPostDisconnect(dbITerm* iterm, odb::dbNet* net)
106106
{
107107
debugPrint(estimate_parasitics_->getLogger(),
108108
utl::EST,

src/est/src/OdbCallBack.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class EstimateParasitics;
1313

1414
using odb::dbBlockCallBackObj;
1515
using odb::dbITerm;
16-
using odb::dbNet;
1716
using sta::dbNetwork;
1817
using sta::Network;
1918

@@ -25,10 +24,10 @@ class OdbCallBack : public dbBlockCallBackObj
2524
dbNetwork* db_network);
2625

2726
void inDbInstCreate(odb::dbInst* inst) override;
28-
void inDbNetCreate(dbNet* net) override;
29-
void inDbNetDestroy(dbNet* net) override;
27+
void inDbNetCreate(odb::dbNet* net) override;
28+
void inDbNetDestroy(odb::dbNet* net) override;
3029
void inDbITermPostConnect(dbITerm* iterm) override;
31-
void inDbITermPostDisconnect(dbITerm* iterm, dbNet* net) override;
30+
void inDbITermPostDisconnect(dbITerm* iterm, odb::dbNet* net) override;
3231
void inDbInstSwapMasterAfter(odb::dbInst* inst) override;
3332

3433
private:

src/rcx/include/rcx/dbUtil.h

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ using odb::dbBox;
2424
using odb::dbBTerm;
2525
using odb::dbITerm;
2626
using odb::dbMatrix;
27-
using odb::dbNet;
2827
using odb::dbObject;
2928
using odb::dbSBox;
3029
using odb::dbShape;
@@ -46,42 +45,42 @@ class dbCreateNetUtil
4645

4746
void setBlock(odb::dbBlock* block, bool skipInit = false);
4847
odb::dbBlock* getBlock() const { return _block; }
49-
dbNet* createNetSingleWire(const char* name,
50-
int x1,
51-
int y1,
52-
int x2,
53-
int y2,
54-
int rlevel,
55-
bool skipBterms = false,
56-
bool skipNetExists = false,
57-
uint8_t color = 0);
58-
dbNet* createNetSingleWire(const char* name,
59-
int x1,
60-
int y1,
61-
int x2,
62-
int y2,
63-
int rlevel,
64-
dbTechLayerDir dir,
65-
bool skipBterms = false);
48+
odb::dbNet* createNetSingleWire(const char* netName,
49+
int x1,
50+
int y1,
51+
int x2,
52+
int y2,
53+
int routingLayer,
54+
bool skipBterms = false,
55+
bool skipExistsNet = false,
56+
uint8_t color = 0);
57+
odb::dbNet* createNetSingleWire(const char* name,
58+
int x1,
59+
int y1,
60+
int x2,
61+
int y2,
62+
int routingLayer,
63+
dbTechLayerDir dir,
64+
bool skipBterms = false);
6665

67-
dbNet* createNetSingleWire(odb::Rect& r,
68-
uint level,
69-
uint netId,
70-
uint shapeId);
71-
dbSBox* createSpecialWire(dbNet* mainNet,
66+
odb::dbNet* createNetSingleWire(odb::Rect& r,
67+
uint level,
68+
uint netId,
69+
uint shapeId);
70+
dbSBox* createSpecialWire(odb::dbNet* mainNet,
7271
odb::Rect& r,
7372
dbTechLayer* layer,
7473
uint sboxId);
75-
void setCurrentNet(dbNet* net);
74+
void setCurrentNet(odb::dbNet* net);
7675
odb::dbInst* createInst(odb::dbInst* inst0);
7776
std::vector<dbTechLayer*> getRoutingLayer() { return _routingLayers; };
7877

7978
private:
80-
uint getFirstShape(dbNet* net, dbShape& s);
81-
bool setFirstShapeProperty(dbNet* net, uint prop);
79+
uint getFirstShape(odb::dbNet* net, dbShape& s);
80+
bool setFirstShapeProperty(odb::dbNet* net, uint prop);
8281
dbTechLayerRule* getRule(int routingLayer, int width);
8382
dbTechVia* getVia(int l1, int l2, odb::Rect& bbox);
84-
std::pair<dbBTerm*, dbBTerm*> createTerms4SingleNet(dbNet* net,
83+
std::pair<dbBTerm*, dbBTerm*> createTerms4SingleNet(odb::dbNet* net,
8584
int x1,
8685
int y1,
8786
int x2,
@@ -96,8 +95,8 @@ class dbCreateNetUtil
9695
int _ruleNameHint;
9796
dbMatrix<std::vector<dbTechVia*>> _vias;
9897
bool _milosFormat;
99-
dbNet* _currentNet;
100-
dbNet** _mapArray;
98+
odb::dbNet* _currentNet;
99+
odb::dbNet** _mapArray;
101100
uint _mapCnt;
102101
uint _ecoCnt;
103102
utl::Logger* logger_;

src/rcx/include/rcx/extPattern.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ class extPattern
157157
static float GetRoundedInt(float v, float mult, int);
158158
static int GetRoundedInt(int v, float mult, int);
159159
uint createNetSingleWire(char* netName, int ll[2], int ur[2], int level);
160-
bool RenameBterm1stInput(dbNet* net);
161-
bool RenameAllBterms(dbNet* net);
160+
bool RenameBterm1stInput(odb::dbNet* net);
161+
bool RenameAllBterms(odb::dbNet* net);
162162

163163
void PatternEnd(extWirePattern* mainp, int max_ur[2], uint spacingMult);
164164
static void PrintStats(uint cnt,

src/rcx/include/rcx/extRCap.h

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ class extMetRCTable
378378
extDistWidthRCTable* table,
379379
const char* keyword);
380380
// dkf 12272023
381-
bool GetViaRes(Ath__parser* p, Ath__parser* w, dbNet* net, FILE* logFP);
381+
bool GetViaRes(Ath__parser* p, Ath__parser* w, odb::dbNet* net, FILE* logFP);
382382
extViaModel* addViaModel(char* name,
383383
double R,
384384
uint cCnt,
@@ -392,7 +392,7 @@ class extMetRCTable
392392
void writeViaRes(FILE* fp);
393393
bool ReadRules(Ath__parser* p);
394394
// dkf 12302023
395-
bool SkipPattern(Ath__parser* p, dbNet* net, FILE* logFP);
395+
bool SkipPattern(Ath__parser* p, odb::dbNet* net, FILE* logFP);
396396
// dkf 01022024
397397
uint SetDefaultTechViaRes(dbTech* tech, bool dbg);
398398
// ----------------------------------------------------------------------------------------
@@ -1749,11 +1749,12 @@ class extMain
17491749

17501750
// CLEANUP dkf 10242024 ----------------------------------
17511751
void makeBlockRCsegs_v2(const char* netNames, const char* extRules);
1752-
bool markNetsToExtract_v2(const char* netNames, std::vector<dbNet*>& inets);
1752+
bool markNetsToExtract_v2(const char* netNames,
1753+
std::vector<odb::dbNet*>& inets);
17531754

17541755
bool makeRCNetwork_v2();
17551756
bool couplingExtEnd_v2();
1756-
void update_wireAltered_v2(std::vector<dbNet*>& inets);
1757+
void update_wireAltered_v2(std::vector<odb::dbNet*>& inets);
17571758
void initSomeValues_v2();
17581759
bool SetCornersAndReadModels_v2(const char* extRules);
17591760
double getDbFactor_v2();
@@ -1763,27 +1764,27 @@ class extMain
17631764
uint* cornerTable);
17641765

17651766
void setExtractionOptions_v2(ExtractOptions options);
1766-
uint makeNetRCsegs_v2(dbNet* net, bool skipStartWarning = false);
1767+
uint makeNetRCsegs_v2(odb::dbNet* net, bool skipStartWarning = false);
17671768
uint resetMapNodes_v2(odb::dbWire* wire);
17681769

17691770
uint getCapNodeId_v2(dbITerm* iterm, const uint junction);
17701771
uint getCapNodeId_v2(dbBTerm* bterm, const uint junction);
1771-
uint getCapNodeId_v2(dbNet* net, const int junction, const bool branch);
1772-
uint getCapNodeId_v2(dbNet* net,
1772+
uint getCapNodeId_v2(odb::dbNet* net, const int junction, const bool branch);
1773+
uint getCapNodeId_v2(odb::dbNet* net,
17731774
odb::dbWirePath& path,
17741775
const uint junction,
17751776
bool branch);
1776-
uint getCapNodeId_v2(dbNet* net,
1777+
uint getCapNodeId_v2(odb::dbNet* net,
17771778
const odb::dbWirePathShape& pshape,
17781779
int junct_id,
17791780
bool branch);
1780-
void initJunctionIdMaps(dbNet* net);
1781+
void initJunctionIdMaps(odb::dbNet* net);
17811782

17821783
void print_debug(const bool branch,
17831784
const uint junction,
17841785
uint capId,
17851786
const char* old_new);
1786-
odb::dbRSeg* addRSeg_v2(dbNet* net,
1787+
odb::dbRSeg* addRSeg_v2(odb::dbNet* net,
17871788
uint& srcId,
17881789
odb::Point& prevPoint,
17891790
const odb::dbWirePath& path,
@@ -1792,18 +1793,18 @@ class extMain
17921793
const double* restbl = nullptr,
17931794
const double* captbl = nullptr);
17941795

1795-
void loopWarning(dbNet* net, const odb::dbWirePathShape& pshape);
1796-
void getShapeRC_v2(dbNet* net,
1796+
void loopWarning(odb::dbNet* net, const odb::dbWirePathShape& pshape);
1797+
void getShapeRC_v2(odb::dbNet* net,
17971798
const dbShape& s,
17981799
odb::Point& prevPoint,
17991800
const odb::dbWirePathShape& pshape);
1800-
void getShapeRC_v3(dbNet* net,
1801+
void getShapeRC_v3(odb::dbNet* net,
18011802
const dbShape& s,
18021803
odb::Point& prevPoint,
18031804
const odb::dbWirePathShape& pshape);
1804-
double getViaRes_v2(dbNet* net, dbTechVia* tvia);
1805-
double getDbViaRes_v2(dbNet* net, const dbShape& s);
1806-
double getMetalRes_v2(dbNet* net,
1805+
double getViaRes_v2(odb::dbNet* net, dbTechVia* tvia);
1806+
double getDbViaRes_v2(odb::dbNet* net, const dbShape& s);
1807+
double getMetalRes_v2(odb::dbNet* net,
18071808
const dbShape& s,
18081809
const odb::dbWirePathShape& pshape);
18091810
void setResAndCap_v2(odb::dbRSeg* rc,
@@ -1876,7 +1877,7 @@ class extMain
18761877

18771878
uint couplingFlow_v2_opt(odb::Rect& extRect, uint ccFlag, extMeasure* m);
18781879
uint couplingFlow_v2(odb::Rect& extRect, uint ccFlag, extMeasure* m);
1879-
void setBranchCapNodeId(dbNet* net, uint junction);
1880+
void setBranchCapNodeId(odb::dbNet* net, uint junction);
18801881
void markPathHeadTerm(odb::dbWirePath& path);
18811882

18821883
extSolverGen* getCurrentSolverGen() { return _currentSolverGen; }

0 commit comments

Comments
 (0)