Skip to content

Commit b953cc8

Browse files
committed
Merge branch 'master' into mpl-new-blockages
2 parents 2b24960 + 771bf8e commit b953cc8

57 files changed

Lines changed: 1329 additions & 248 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

etc/DependencyInstaller.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ _versionCompare() {
1212
}
1313

1414
_equivalenceDeps() {
15-
yosysVersion=v0.57
15+
yosysVersion=v0.58
1616

1717
# yosys
1818
yosysPrefix=${PREFIX:-"/usr/local"}

src/OpenRoad.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,13 +485,13 @@ void OpenRoad::writeCdl(const char* out_filename,
485485

486486
void OpenRoad::read3Dbv(const std::string& filename)
487487
{
488-
odb::ThreeDBlox parser(logger_, db_);
488+
odb::ThreeDBlox parser(logger_, db_, sta_);
489489
parser.readDbv(filename);
490490
}
491491

492492
void OpenRoad::read3Dbx(const std::string& filename)
493493
{
494-
odb::ThreeDBlox parser(logger_, db_);
494+
odb::ThreeDBlox parser(logger_, db_, sta_);
495495
parser.readDbx(filename);
496496
}
497497

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/grt/src/GlobalRouter.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,8 +934,14 @@ bool GlobalRouter::findPinAccessPointPositions(
934934
access_points.insert(
935935
access_points.begin(), bpin_pas.begin(), bpin_pas.end());
936936
}
937-
} else {
937+
} else if (pin.isCorePin()) {
938938
access_points = pin.getITerm()->getPrefAccessPoints();
939+
} else {
940+
// For non-core cells, DRT does not assign preferred APs.
941+
// Use all APs to ensure the guides covering at least one AP.
942+
for (const auto& [pin, aps] : pin.getITerm()->getAccessPoints()) {
943+
access_points.insert(access_points.end(), aps.begin(), aps.end());
944+
}
939945
}
940946

941947
if (access_points.empty()) {

src/grt/src/Pin.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,15 @@ odb::Point Pin::getPositionNearInstEdge(const odb::Rect& pin_box,
185185
return pin_pos;
186186
}
187187

188+
bool Pin::isCorePin() const
189+
{
190+
if (iterm == nullptr) {
191+
return false;
192+
}
193+
194+
odb::dbInst* inst = iterm->getInst();
195+
return inst->isCore();
196+
;
197+
}
198+
188199
} // namespace grt

0 commit comments

Comments
 (0)