Skip to content

Commit 43df049

Browse files
authored
Merge pull request #8623 from hzeller/feature-20251012-using-dbblock
Don't use `using odb::dbBlock;` in header files to not pollute namespace
2 parents 59ac8b6 + f15d98c commit 43df049

20 files changed

Lines changed: 72 additions & 67 deletions

src/dpl/include/dpl/Opendp.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ namespace dpl {
2929

3030
using utl::Logger;
3131

32-
using odb::dbBlock;
3332
using odb::dbDatabase;
3433
using odb::dbMaster;
3534
using odb::dbMasterType;
@@ -311,7 +310,7 @@ class Opendp
311310

312311
Logger* logger_ = nullptr;
313312
dbDatabase* db_ = nullptr;
314-
dbBlock* block_ = nullptr;
313+
odb::dbBlock* block_ = nullptr;
315314
odb::Rect core_;
316315

317316
std::unique_ptr<Architecture> arch_; // Information about rows, etc.

src/dpl/src/dbToOpendp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Rect Opendp::getBbox(odb::dbInst* inst)
101101
}
102102
void Opendp::createNetwork()
103103
{
104-
dbBlock* block = db_->getChip()->getBlock();
104+
odb::dbBlock* block = db_->getChip()->getBlock();
105105
network_->setCore(core_);
106106
///////////////////////////////////
107107
auto min_row_height = std::numeric_limits<int>::max();
@@ -165,7 +165,7 @@ void Opendp::createNetwork()
165165
////////////////////////////////////////////////////////////////
166166
void Opendp::createArchitecture()
167167
{
168-
dbBlock* block = db_->getChip()->getBlock();
168+
odb::dbBlock* block = db_->getChip()->getBlock();
169169

170170
auto min_row_height = std::numeric_limits<int>::max();
171171
for (odb::dbRow* row : block->getRows()) {
@@ -268,7 +268,7 @@ void Opendp::createArchitecture()
268268
void Opendp::setUpPlacementGroups()
269269
{
270270
regions_rtree_.clear();
271-
dbBlock* block = db_->getChip()->getBlock();
271+
odb::dbBlock* block = db_->getChip()->getBlock();
272272
int count = 0;
273273
auto db_groups = block->getGroups();
274274
for (auto db_group : db_groups) {

src/dpl/src/graphics/Graphics.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "infrastructure/Grid.h"
99
#include "infrastructure/Objects.h"
1010
#include "infrastructure/network.h"
11+
#include "odb/db.h"
1112
#include "odb/geom.h"
1213

1314
namespace dpl {
@@ -24,7 +25,7 @@ Graphics::Graphics(Opendp* dp,
2425
gui::Gui::get()->registerRenderer(this);
2526
}
2627

27-
void Graphics::startPlacement(dbBlock* block)
28+
void Graphics::startPlacement(odb::dbBlock* block)
2829
{
2930
block_ = block;
3031
}

src/dpl/src/graphics/Graphics.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
namespace dpl {
1414

15-
using odb::dbBlock;
16-
1715
class Opendp;
1816
class Node;
1917

@@ -24,7 +22,7 @@ class Graphics : public gui::Renderer, public DplObserver
2422
float min_displacement,
2523
const odb::dbInst* debug_instance);
2624
~Graphics() override = default;
27-
void startPlacement(dbBlock* block) override;
25+
void startPlacement(odb::dbBlock* block) override;
2826
void placeInstance(odb::dbInst* instance) override;
2927
void binSearch(const Node* cell,
3028
GridX xl,
@@ -41,7 +39,7 @@ class Graphics : public gui::Renderer, public DplObserver
4139
private:
4240
Opendp* dp_;
4341
const odb::dbInst* debug_instance_;
44-
dbBlock* block_ = nullptr;
42+
odb::dbBlock* block_ = nullptr;
4543
float min_displacement_; // in row height
4644
std::vector<odb::Rect> searched_;
4745
};

src/dpl/src/infrastructure/Grid.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void Grid::clear()
5151
row_index_to_y_dbu_.clear();
5252
}
5353

54-
void Grid::visitDbRows(dbBlock* block,
54+
void Grid::visitDbRows(odb::dbBlock* block,
5555
const std::function<void(dbRow*)>& func) const
5656
{
5757
for (auto row : block->getRows()) {
@@ -88,7 +88,7 @@ void Grid::allocateGrid()
8888
row_sites_.resize(row_count_.v);
8989
}
9090

91-
void Grid::markHopeless(dbBlock* block,
91+
void Grid::markHopeless(odb::dbBlock* block,
9292
const int max_displacement_x,
9393
const int max_displacement_y)
9494
{
@@ -137,7 +137,7 @@ void Grid::markHopeless(dbBlock* block,
137137
}
138138
}
139139

140-
void Grid::markBlocked(dbBlock* block)
140+
void Grid::markBlocked(odb::dbBlock* block)
141141
{
142142
const odb::Rect core = getCore();
143143
auto addBlockedLayers
@@ -214,7 +214,7 @@ void Grid::markBlocked(dbBlock* block)
214214
}
215215

216216
void Grid::initGrid(dbDatabase* db,
217-
dbBlock* block,
217+
odb::dbBlock* block,
218218
std::shared_ptr<Padding> padding,
219219
int max_displacement_x,
220220
int max_displacement_y)
@@ -685,7 +685,7 @@ bool Grid::cellFitsInCore(Node* cell) const
685685
&& cell->getHeight().v <= core_.dy();
686686
}
687687

688-
void Grid::examineRows(dbBlock* block)
688+
void Grid::examineRows(odb::dbBlock* block)
689689
{
690690
block_ = block;
691691
has_hybrid_rows_ = false;

src/dpl/src/infrastructure/Grid.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ class Grid
7070
void init(Logger* logger) { logger_ = logger; }
7171
void setCore(const odb::Rect& core) { core_ = core; }
7272
void initGrid(dbDatabase* db,
73-
dbBlock* block,
73+
odb::dbBlock* block,
7474
std::shared_ptr<Padding> padding,
7575
int max_displacement_x,
7676
int max_displacement_y);
7777
void allocateGrid();
78-
void examineRows(dbBlock* block);
78+
void examineRows(odb::dbBlock* block);
7979
std::unordered_set<int> getRowCoordinates() const;
8080

8181
GridX gridX(DbuX x) const;
@@ -185,15 +185,15 @@ class Grid
185185

186186
using Pixels = std::vector<std::vector<Pixel>>;
187187

188-
void markHopeless(dbBlock* block,
188+
void markHopeless(odb::dbBlock* block,
189189
int max_displacement_x,
190190
int max_displacement_y);
191-
void markBlocked(dbBlock* block);
192-
void visitDbRows(dbBlock* block,
191+
void markBlocked(odb::dbBlock* block);
192+
void visitDbRows(odb::dbBlock* block,
193193
const std::function<void(odb::dbRow*)>& func) const;
194194

195195
Logger* logger_ = nullptr;
196-
dbBlock* block_ = nullptr;
196+
odb::dbBlock* block_ = nullptr;
197197
std::shared_ptr<Padding> padding_;
198198
Pixels pixels_;
199199
// Contains all the rows' yLo plus the yHi of the last row. The extra

src/dpl/src/infrastructure/Objects.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <vector>
1010

1111
#include "dpl/Opendp.h"
12+
#include "odb/db.h"
1213
#include "odb/dbTypes.h"
1314
#include "odb/geom.h"
1415

src/dpl/src/infrastructure/Objects.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include "Coordinates.h"
1111
#include "dpl/Opendp.h"
12+
#include "odb/db.h"
1213
#include "odb/dbTypes.h"
1314
#include "odb/geom.h"
1415

src/dpl/src/infrastructure/Padding.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include "Objects.h"
77
#include "dpl/Opendp.h"
8+
#include "odb/db.h"
89

910
namespace dpl {
1011

src/est/include/est/EstimateParasitics.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ namespace est {
4343

4444
using utl::Logger;
4545

46-
using odb::dbBlock;
4746
using odb::dbDatabase;
4847
using odb::dbNet;
4948
using odb::dbTechLayer;
@@ -228,14 +227,14 @@ class EstimateParasitics : public dbStaState
228227
void highlightSteiner(const Pin* drvr);
229228

230229
dbNetwork* getDbNetwork() { return db_network_; }
231-
dbBlock* getBlock() { return block_; }
230+
odb::dbBlock* getBlock() { return block_; }
232231
GlobalRouter* getGlobalRouter() { return global_router_; }
233232
IncrementalGRoute* getIncrementalGRT() { return incr_groute_; }
234233
void setIncrementalGRT(IncrementalGRoute* incr_groute)
235234
{
236235
incr_groute_ = incr_groute;
237236
}
238-
void setDbCbkOwner(dbBlock* block);
237+
void setDbCbkOwner(odb::dbBlock* block);
239238
void removeDbCbkOwner();
240239

241240
void initBlock();
@@ -276,7 +275,7 @@ class EstimateParasitics : public dbStaState
276275
IncrementalGRoute* incr_groute_ = nullptr;
277276
dbNetwork* db_network_ = nullptr;
278277
dbDatabase* db_ = nullptr;
279-
dbBlock* block_ = nullptr;
278+
odb::dbBlock* block_ = nullptr;
280279
std::unique_ptr<OdbCallBack> db_cbk_;
281280

282281
std::vector<odb::dbTechLayer*> signal_layers_;

0 commit comments

Comments
 (0)