Skip to content

Commit d855973

Browse files
committed
Don't use using odb::Point; in header files to not pollute namespace.
Signed-off-by: Henner Zeller <[email protected]>
1 parent 3e6b7ea commit d855973

File tree

16 files changed

+79
-90
lines changed

16 files changed

+79
-90
lines changed

src/dpl/include/dpl/Opendp.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ using odb::dbInst;
3535
using odb::dbMaster;
3636
using odb::dbMasterType;
3737
using odb::dbTechLayer;
38-
using odb::Point;
3938

4039
class Node;
4140
class Group;

src/dpl/src/PlacementDRC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ odb::Rect transformEdgeRect(const odb::Rect& edge_rect,
2626
cell->getDbInst()->getMaster()->getPlacementBoundary(bbox);
2727
odb::dbTransform transform(orient);
2828
transform.apply(bbox);
29-
Point offset(x.v - bbox.xMin(), y.v - bbox.yMin());
29+
odb::Point offset(x.v - bbox.xMin(), y.v - bbox.yMin());
3030
transform.setOffset(offset);
3131
odb::Rect result(edge_rect);
3232
transform.apply(result);

src/dpl/src/graphics/Graphics.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ void Graphics::drawObjects(gui::Painter& painter)
9696
}
9797

9898
dbBox* bbox = cell->getDbInst()->getBBox();
99-
Point initial_location(bbox->xMin(), bbox->yMin());
100-
Point final_location(lx.v, ly.v);
101-
float len = Point::squaredDistance(initial_location, final_location);
99+
odb::Point initial_location(bbox->xMin(), bbox->yMin());
100+
odb::Point final_location(lx.v, ly.v);
101+
float len = odb::Point::squaredDistance(initial_location, final_location);
102102
if (len < min_length) {
103103
continue;
104104
}

src/dpl/src/graphics/Graphics.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ namespace dpl {
1414

1515
using odb::dbBlock;
1616
using odb::dbInst;
17-
using odb::Point;
1817

1918
class Opendp;
2019
class Node;

src/est/include/est/EstimateParasitics.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ using odb::dbBlock;
4747
using odb::dbDatabase;
4848
using odb::dbNet;
4949
using odb::dbTechLayer;
50-
using odb::Point;
5150

5251
using stt::SteinerTreeBuilder;
5352

@@ -220,8 +219,8 @@ class EstimateParasitics : public dbStaState
220219

221220
////////////////////////////////////////////////////////////////
222221
// Returns nullptr if net has less than 2 pins or any pin is not placed.
223-
SteinerTree* makeSteinerTree(Point drvr_location,
224-
const std::vector<Point>& sink_locations);
222+
SteinerTree* makeSteinerTree(odb::Point drvr_location,
223+
const std::vector<odb::Point>& sink_locations);
225224
SteinerTree* makeSteinerTree(const Pin* drvr_pin);
226225
void updateParasitics(bool save_guides = false);
227226
void ensureWireParasitic(const Pin* drvr_pin);

src/est/include/est/SteinerTree.h

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ namespace est {
2424

2525
using utl::Logger;
2626

27-
using odb::Point;
28-
2927
using sta::dbNetwork;
3028
using sta::hashIncr;
3129
using sta::Net;
@@ -38,23 +36,23 @@ using stt::SteinerTreeBuilder;
3836
class PointHash
3937
{
4038
public:
41-
size_t operator()(const Point& pt) const;
39+
size_t operator()(const odb::Point& pt) const;
4240
};
4341

4442
class PointEqual
4543
{
4644
public:
47-
bool operator()(const Point& pt1, const Point& pt2) const;
45+
bool operator()(const odb::Point& pt1, const odb::Point& pt2) const;
4846
};
4947

5048
class PinLoc
5149
{
5250
public:
5351
const Pin* pin;
54-
Point loc;
52+
odb::Point loc;
5553
};
5654

57-
using LocPinMap = std::unordered_map<Point, PinSeq, PointHash, PointEqual>;
55+
using LocPinMap = std::unordered_map<odb::Point, PinSeq, PointHash, PointEqual>;
5856
using SteinerPt = int;
5957

6058
class SteinerTree;
@@ -72,15 +70,15 @@ class SteinerTree
7270
{
7371
public:
7472
SteinerTree(const Pin* drvr_pin, sta::dbNetwork* db_network, Logger* logger);
75-
SteinerTree(Point drvr_location, Logger* logger);
73+
SteinerTree(odb::Point drvr_location, Logger* logger);
7674
sta::Vector<PinLoc>& pinlocs() { return pinlocs_; }
7775
int pinCount() const { return pinlocs_.size(); }
7876
int branchCount() const;
7977
void branch(int index,
8078
// Return values.
81-
Point& pt1,
79+
odb::Point& pt1,
8280
int& steiner_pt1,
83-
Point& pt2,
81+
odb::Point& pt2,
8482
int& steiner_pt2,
8583
int& wire_length);
8684
stt::Branch& branch(int index) { return tree_.branch[index]; }
@@ -111,18 +109,18 @@ class SteinerTree
111109
const char* name(SteinerPt pt, const Network* network);
112110
const PinSeq* pins(SteinerPt pt) const;
113111
const Pin* pin(SteinerPt pt) const;
114-
Point location(SteinerPt pt) const;
112+
odb::Point location(SteinerPt pt) const;
115113
void setTree(const stt::Tree& tree);
116114
void setHasInputPort(bool input_port);
117115
stt::Tree& fluteTree() { return tree_; }
118116
void createSteinerPtToPinMap();
119-
void locAddPin(const Point& loc, const Pin* pin);
117+
void locAddPin(const odb::Point& loc, const Pin* pin);
120118

121119
static constexpr SteinerPt null_pt = -1;
122120

123121
private:
124122
stt::Tree tree_;
125-
const Point drvr_location_;
123+
const odb::Point drvr_location_;
126124
int drvr_steiner_pt_ = 0; // index into tree_.branch
127125
sta::Vector<PinLoc> pinlocs_; // Initial input
128126
LocPinMap loc_pin_map_; // location -> pins map

src/est/src/EstimateParasitics.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ void EstimateParasitics::estimateWireParasiticSteiner(const Pin* drvr_pin,
681681
int branch_count = tree->branchCount();
682682
size_t resistor_id = 1;
683683
for (int i = 0; i < branch_count; i++) {
684-
Point pt1, pt2;
684+
odb::Point pt1, pt2;
685685
SteinerPt steiner_pt1, steiner_pt2;
686686
int wire_length_dbu;
687687
tree->branch(i, pt1, steiner_pt1, pt2, steiner_pt2, wire_length_dbu);
@@ -1099,16 +1099,16 @@ static void connectedPins(const Net* net,
10991099
// hit moditerms/modbterms).
11001100
//
11011101
if (iterm || bterm) {
1102-
Point loc = db_network->location(pin);
1102+
odb::Point loc = db_network->location(pin);
11031103
pins.push_back({pin, loc});
11041104
}
11051105
}
11061106
delete pin_iter;
11071107
}
11081108

11091109
SteinerTree* EstimateParasitics::makeSteinerTree(
1110-
Point drvr_location,
1111-
const std::vector<Point>& sink_locations)
1110+
odb::Point drvr_location,
1111+
const std::vector<odb::Point>& sink_locations)
11121112
{
11131113
SteinerTree* tree = new SteinerTree(drvr_location, logger_);
11141114
sta::Vector<PinLoc>& pinlocs = tree->pinlocs();

src/est/src/SteinerRenderer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include "est/SteinerTree.h"
77
#include "gui/gui.h"
8+
#include "odb/geom.h"
89

910
namespace est {
1011

@@ -23,7 +24,7 @@ void SteinerRenderer::drawObjects(gui::Painter& painter)
2324
if (tree_) {
2425
painter.setPen(gui::Painter::kRed, true);
2526
for (int i = 0; i < tree_->branchCount(); ++i) {
26-
Point pt1, pt2;
27+
odb::Point pt1, pt2;
2728
int steiner_pt1, steiner_pt2;
2829
int wire_length;
2930
tree_->branch(i, pt1, steiner_pt1, pt2, steiner_pt2, wire_length);

src/est/src/SteinerTree.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void SteinerTree::setTree(const stt::Tree& tree)
3131

3232
// Find driver steiner point.
3333
drvr_steiner_pt_ = null_pt;
34-
const Point drvr_loc = drvr_location_;
34+
const odb::Point drvr_loc = drvr_location_;
3535
const int drvr_x = drvr_loc.getX();
3636
const int drvr_y = drvr_loc.getY();
3737
const int branch_count = tree_.branchCount();
@@ -51,7 +51,7 @@ SteinerTree::SteinerTree(const Pin* drvr_pin,
5151
{
5252
}
5353

54-
SteinerTree::SteinerTree(Point drvr_location, Logger* logger)
54+
SteinerTree::SteinerTree(odb::Point drvr_location, Logger* logger)
5555
: drvr_location_(drvr_location), logger_(logger)
5656
{
5757
}
@@ -75,25 +75,25 @@ int SteinerTree::branchCount() const
7575
return tree_.branchCount();
7676
}
7777

78-
void SteinerTree::locAddPin(const Point& loc, const Pin* pin)
78+
void SteinerTree::locAddPin(const odb::Point& loc, const Pin* pin)
7979
{
8080
loc_pin_map_[loc].push_back(pin);
8181
}
8282

8383
void SteinerTree::branch(int index,
8484
// Return values.
85-
Point& pt1,
85+
odb::Point& pt1,
8686
int& steiner_pt1,
87-
Point& pt2,
87+
odb::Point& pt2,
8888
int& steiner_pt2,
8989
int& wire_length)
9090
{
9191
stt::Branch& branch_pt1 = tree_.branch[index];
9292
steiner_pt1 = index;
9393
steiner_pt2 = branch_pt1.n;
9494
stt::Branch& branch_pt2 = tree_.branch[steiner_pt2];
95-
pt1 = Point(branch_pt1.x, branch_pt1.y);
96-
pt2 = Point(branch_pt2.x, branch_pt2.y);
95+
pt1 = odb::Point(branch_pt1.x, branch_pt1.y);
96+
pt2 = odb::Point(branch_pt2.x, branch_pt2.y);
9797
wire_length
9898
= abs(branch_pt1.x - branch_pt2.x) + abs(branch_pt1.y - branch_pt2.y);
9999
}
@@ -153,10 +153,10 @@ SteinerPt SteinerTree::drvrPt() const
153153
return drvr_steiner_pt_;
154154
}
155155

156-
Point SteinerTree::location(const SteinerPt pt) const
156+
odb::Point SteinerTree::location(const SteinerPt pt) const
157157
{
158158
const stt::Branch branch_pt = tree_.branch[pt];
159-
return Point(branch_pt.x, branch_pt.y);
159+
return odb::Point(branch_pt.x, branch_pt.y);
160160
}
161161

162162
SteinerPt SteinerTree::top() const
@@ -279,8 +279,8 @@ int SteinerTree::distance(const SteinerPt from, const SteinerPt to) const
279279
if (from == to) {
280280
return 0;
281281
}
282-
const Point from_pt = location(from);
283-
const Point to_pt = location(to);
282+
const odb::Point from_pt = location(from);
283+
const odb::Point to_pt = location(to);
284284
const SteinerPt left_from = left(from);
285285
const SteinerPt right_from = right(from);
286286
if (left_from == to || right_from == to) {
@@ -315,15 +315,15 @@ const Pin* SteinerTree::pin(const SteinerPt pt) const
315315

316316
////////////////////////////////////////////////////////////////
317317

318-
size_t PointHash::operator()(const Point& pt) const
318+
size_t PointHash::operator()(const odb::Point& pt) const
319319
{
320320
size_t hash = sta::hash_init_value;
321321
hashIncr(hash, pt.x());
322322
hashIncr(hash, pt.y());
323323
return hash;
324324
}
325325

326-
bool PointEqual::operator()(const Point& pt1, const Point& pt2) const
326+
bool PointEqual::operator()(const odb::Point& pt1, const odb::Point& pt2) const
327327
{
328328
return pt1.x() == pt2.x() && pt1.y() == pt2.y();
329329
}

src/ppl/include/ppl/IOPlacer.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ struct Constraint;
3939
struct Section;
4040
struct Slot;
4141

42-
using odb::Point;
43-
4442
using utl::Logger;
4543

4644
// A list of pins that will be placed together in the die boundary
@@ -150,10 +148,10 @@ class IOPlacer
150148
Edge edge,
151149
odb::Line line,
152150
bool is_die_polygon);
153-
std::vector<Point> findLayerSlots(int layer,
154-
Edge edge,
155-
odb::Line line,
156-
bool is_die_polygon);
151+
std::vector<odb::Point> findLayerSlots(int layer,
152+
Edge edge,
153+
odb::Line line,
154+
bool is_die_polygon);
157155
void initTopLayerGrid();
158156
void findSlotsForTopLayer();
159157
void filterObstructedSlotsForTopLayer();

0 commit comments

Comments
 (0)