Skip to content

Commit c645922

Browse files
authored
Merge pull request The-OpenROAD-Project#8659 from hzeller/feature-20251015-using-odb
Fix remaining `using odb::<sometype>` in header files that were polluting the namespace
2 parents 3106c9b + 324c79f commit c645922

40 files changed

+154
-119
lines changed

src/drt/src/TritonRoute.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include "odb/db.h"
4545
#include "odb/dbId.h"
4646
#include "odb/dbShape.h"
47+
#include "odb/dbTypes.h"
4748
#include "pa/AbstractPAGraphics.h"
4849
#include "pa/FlexPA.h"
4950
#include "rp/FlexRP.h"
@@ -55,6 +56,8 @@
5556
#include "utl/Logger.h"
5657
#include "utl/ScopedTemporaryFile.h"
5758

59+
using odb::dbTechLayerType;
60+
5861
namespace drt {
5962

6063
TritonRoute::TritonRoute(odb::dbDatabase* db,

src/drt/src/db/obj/frNet.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "db/obj/frVia.h"
2121
#include "frBaseTypes.h"
2222
#include "global.h"
23+
#include "odb/dbTypes.h"
2324

2425
namespace drt {
2526
class frInstTerm;
@@ -188,8 +189,8 @@ class frNet : public frBlockObject
188189
vias_.clear();
189190
pwires_.clear();
190191
}
191-
dbSigType getType() const { return type_; }
192-
void setType(const dbSigType& in) { type_ = in; }
192+
odb::dbSigType getType() const { return type_; }
193+
void setType(const odb::dbSigType& in) { type_ = in; }
193194
frBlockObjectEnum typeId() const override { return frcNet; }
194195
void updateNondefaultRule(frNonDefaultRule* n)
195196
{
@@ -251,7 +252,7 @@ class frNet : public frBlockObject
251252
std::vector<std::unique_ptr<frRPin>> rpins_;
252253
std::vector<std::unique_ptr<frGuide>> guides_;
253254
std::vector<frRect> orig_guides_;
254-
dbSigType type_{dbSigType::SIGNAL};
255+
odb::dbSigType type_{odb::dbSigType::SIGNAL};
255256
bool modified_{false};
256257
bool isFakeNet_{false}; // indicate floating PG nets
257258
frNonDefaultRule* ndr_{nullptr};

src/drt/src/db/obj/frTerm.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "db/obj/frBlockObject.h"
1111
#include "db/obj/frNet.h"
1212
#include "frBaseTypes.h"
13+
#include "odb/dbTypes.h"
1314
#include "odb/geom.h"
1415

1516
namespace drt {
@@ -21,10 +22,10 @@ class frTerm : public frBlockObject
2122
virtual frNet* getNet() const = 0;
2223
const frString& getName() const { return name_; }
2324
// setters
24-
void setType(const dbSigType& in) { type_ = in; }
25-
dbSigType getType() const { return type_; }
26-
void setDirection(const dbIoType& in) { direction_ = in; }
27-
dbIoType getDirection() const { return direction_; }
25+
void setType(const odb::dbSigType& in) { type_ = in; }
26+
odb::dbSigType getType() const { return type_; }
27+
void setDirection(const odb::dbIoType& in) { direction_ = in; }
28+
odb::dbIoType getDirection() const { return direction_; }
2829
// others
2930
void setIndexInOwner(int value) { index_in_owner_ = value; }
3031
int getIndexInOwner() { return index_in_owner_; }
@@ -47,8 +48,8 @@ class frTerm : public frBlockObject
4748

4849
frString name_; // A, B, Z, VSS, VDD
4950
frNet* net_{nullptr}; // set later, term in instTerm does not have net
50-
dbSigType type_{dbSigType::SIGNAL};
51-
dbIoType direction_{dbIoType::INPUT};
51+
odb::dbSigType type_{odb::dbSigType::SIGNAL};
52+
odb::dbIoType direction_{odb::dbIoType::INPUT};
5253
int index_in_owner_{0};
5354
odb::Rect bbox_;
5455
};

src/drt/src/db/tech/frLayer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class frLayer
109109
{
110110
return (fakeCut_ || fakeMasterslice_)
111111
? false
112-
: db_layer_->getType() == dbTechLayerType::ROUTING;
112+
: db_layer_->getType() == odb::dbTechLayerType::ROUTING;
113113
}
114114
bool isUnidirectional() const
115115
{
@@ -137,14 +137,14 @@ class frLayer
137137
{
138138
return viaDefs_;
139139
}
140-
dbTechLayerType getType() const
140+
odb::dbTechLayerType getType() const
141141
{
142142
if (fakeCut_) {
143-
return dbTechLayerType::CUT;
143+
return odb::dbTechLayerType::CUT;
144144
}
145145

146146
if (fakeMasterslice_) {
147-
return dbTechLayerType::MASTERSLICE;
147+
return odb::dbTechLayerType::MASTERSLICE;
148148
}
149149

150150
return db_layer_->getType();

src/drt/src/db/tech/frTechObject.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,9 @@ class frTechObject
244244
logger->report("Reporting layer properties.");
245245
for (auto& layer : layers_) {
246246
auto type = layer->getType();
247-
if (type == dbTechLayerType::CUT) {
247+
if (type == odb::dbTechLayerType::CUT) {
248248
logger->report("Cut layer {}.", layer->getName());
249-
} else if (type == dbTechLayerType::ROUTING) {
249+
} else if (type == odb::dbTechLayerType::ROUTING) {
250250
logger->report("Routing layer {}.", layer->getName());
251251
}
252252
layer->printAllConstraints(logger);
@@ -257,7 +257,7 @@ class frTechObject
257257
{
258258
logger->info(DRT, 167, "List of default vias:");
259259
for (auto& layer : layers_) {
260-
if (layer->getType() == dbTechLayerType::CUT
260+
if (layer->getType() == odb::dbTechLayerType::CUT
261261
&& layer->getLayerNum() >= router_cfg->BOTTOM_ROUTING_LAYER) {
262262
logger->report(" Layer {}", layer->getName());
263263
if (layer->getDefaultViaDef() != nullptr) {

src/drt/src/dr/FlexDR.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
#include "utl/ScopedTemporaryFile.h"
5656
#include "utl/exception.h"
5757

58+
using odb::dbTechLayerType;
59+
5860
BOOST_CLASS_EXPORT(drt::RoutingJobDescription)
5961

6062
namespace drt {

src/drt/src/dr/FlexDR_init.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "utl/Logger.h"
3838

3939
using odb::dbTechLayerDir;
40+
using odb::dbTechLayerType;
4041

4142
namespace drt {
4243

src/drt/src/dr/FlexDR_maze.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include "utl/Logger.h"
4343

4444
using odb::dbTechLayerDir;
45+
using odb::dbTechLayerType;
4546

4647
namespace drt {
4748

src/drt/src/dr/FlexGridGraph.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "odb/geom.h"
2121

2222
using odb::dbTechLayerDir;
23+
using odb::dbTechLayerType;
2324

2425
namespace drt {
2526
void FlexGridGraph::addAccessPointLocation(frLayerNum layer_num,

src/drt/src/frBaseTypes.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ template <typename T>
4444
using frList = std::list<T>;
4545
template <typename T>
4646
using frListIter = typename std::list<T>::iterator;
47-
using odb::dbIoType;
48-
using odb::dbSigType;
49-
using odb::dbTechLayerType;
5047

5148
enum frEndStyleEnum
5249
{

0 commit comments

Comments
 (0)