Skip to content

Commit 6ce5a35

Browse files
committed
Merge remote-tracking branch 'private/master' into gpl-area-weight-by-pin
2 parents d3f3fd7 + d4e1785 commit 6ce5a35

File tree

399 files changed

+69220
-67441
lines changed

Some content is hidden

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

399 files changed

+69220
-67441
lines changed

src/dpl/src/optimization/detailed_manager.cxx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,6 +1825,14 @@ bool DetailedMgr::alignPos(const Node* ndi, DbuX& xi, const DbuX xl, DbuX xr)
18251825

18261826
////////////////////////////////////////////////////////////////////////////////
18271827
////////////////////////////////////////////////////////////////////////////////
1828+
bool DetailedMgr::checkSiteOrientation(Node* node, DbuX x, DbuY y)
1829+
{
1830+
odb::dbSite* site = node->getDbInst()->getMaster()->getSite();
1831+
const auto grid_x = grid_->gridX(x);
1832+
const auto grid_y = grid_->gridSnapDownY(y);
1833+
return grid_->getSiteOrientation(grid_x, grid_y, site).has_value();
1834+
}
1835+
18281836
bool DetailedMgr::shift(std::vector<Node*>& cells,
18291837
std::vector<DbuX>& targetLeft,
18301838
std::vector<DbuX>& posLeft,
@@ -2468,6 +2476,7 @@ bool DetailedMgr::tryMove2(Node* ndi,
24682476
if (!alignPos(ndi, xj, lx, rx)) {
24692477
return false;
24702478
}
2479+
24712480
if (!addToMoveList(ndi, ndi->getLeft(), ndi->getBottom(), si, xj, yj, sj)) {
24722481
return false;
24732482
}
@@ -2486,6 +2495,7 @@ bool DetailedMgr::tryMove2(Node* ndi,
24862495
if (!alignPos(ndi, xj, lx, rx)) {
24872496
return false;
24882497
}
2498+
24892499
if (!addToMoveList(ndi, ndi->getLeft(), ndi->getBottom(), si, xj, yj, sj)) {
24902500
return false;
24912501
}
@@ -2873,6 +2883,7 @@ bool DetailedMgr::trySwap1(Node* ndi,
28732883
const DbuX x2 = ndj->getLeft();
28742884
const DbuY y2 = ndj->getBottom();
28752885
// Build move list.
2886+
28762887
if (!addToMoveList(ndi, x1, y1, si, xj, y2, sj)) {
28772888
return false;
28782889
}
@@ -2905,6 +2916,10 @@ bool DetailedMgr::addToMoveList(Node* ndi,
29052916
return false;
29062917
}
29072918

2919+
if (!checkSiteOrientation(ndi, newLeft, newBottom)) {
2920+
return false;
2921+
}
2922+
29082923
// Easy to observe displacement limit if using the
29092924
// manager to compose a move list. We can check
29102925
// only here whether or not a cell will violate its
@@ -2946,6 +2961,11 @@ bool DetailedMgr::addToMoveList(Node* ndi,
29462961
if (journal_.size() >= moveLimit_) {
29472962
return false;
29482963
}
2964+
2965+
if (!checkSiteOrientation(ndi, newLeft, newBottom)) {
2966+
return false;
2967+
}
2968+
29492969
// commit move and add to journal
29502970
eraseFromGrid(ndi);
29512971
for (const auto& curSeg : curSegs) {
@@ -2989,6 +3009,7 @@ void DetailedMgr::paintInGrid(Node* node)
29893009
const auto grid_x = grid_->gridX(node);
29903010
const auto grid_y = grid_->gridSnapDownY(node);
29913011
odb::dbSite* site = node->getDbInst()->getMaster()->getSite();
3012+
29923013
const auto orientation
29933014
= grid_->getSiteOrientation(grid_x, grid_y, site).value();
29943015
grid_->paintPixel(node, grid_x, grid_y);

src/dpl/src/optimization/detailed_manager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ class DetailedMgr
298298
bool trySwap1(Node* ndi, DbuX xi, DbuY yi, int si, DbuX xj, DbuY yj, int sj);
299299

300300
// Helper routines for making moves and swaps.
301+
bool checkSiteOrientation(Node* node, DbuX x, DbuY y);
301302
bool shift(std::vector<Node*>& cells,
302303
std::vector<DbuX>& targetLeft,
303304
std::vector<DbuX>& posLeft,

src/gpl/src/graphicsImpl.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,10 @@ void GraphicsImpl::debugForNesterovPlace(
9191
region_names.reserve(nbVec_.size());
9292
for (size_t i = 0; i < nbVec_.size(); ++i) {
9393
std::string name;
94-
if (nbVec_[i] && nbVec_[i]->getPb() && nbVec_[i]->getPb()->group()) {
94+
if (nbVec_[i] && nbVec_[i]->getPb()
95+
&& nbVec_[i]->getPb()->getGroup()) {
9596
name = fmt::format(
96-
"nb[{}] {}", i, nbVec_[i]->getPb()->group()->getName());
97+
"nb[{}] {}", i, nbVec_[i]->getPb()->getGroup()->getName());
9798
} else {
9899
name = fmt::format("nb[{}]", i);
99100
}

src/gpl/src/nesterovBase.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1876,7 +1876,7 @@ NesterovBase::NesterovBase(NesterovBaseVars nbVars,
18761876
log_->info(GPL,
18771877
33,
18781878
"Initializing Nesterov region: {}",
1879-
pb_->group() ? pb_->group()->getName() : "Top-level");
1879+
pb_->getGroup() ? pb_->getGroup()->getName() : "Top-level");
18801880

18811881
// Set a fixed seed
18821882
srand(42);
@@ -2943,11 +2943,11 @@ void NesterovBase::updateNextIter(const int iter)
29432943
prev_reported_overflow_unscaled_ = sum_overflow_unscaled_;
29442944

29452945
std::string group_name;
2946-
if (pb_->group()) {
2947-
group_name = fmt::format(" ({})", pb_->group()->getName());
2946+
if (pb_->getGroup()) {
2947+
group_name = fmt::format(" ({})", pb_->getGroup()->getName());
29482948
}
29492949

2950-
if ((iter == 0 || reprint_iter_header_) && !pb_->group()) {
2950+
if ((iter == 0 || reprint_iter_header_) && !pb_->getGroup()) {
29512951
if (iter == 0) {
29522952
log_->info(GPL, 31, "HPWL: Half-Perimeter Wirelength");
29532953
}
@@ -3106,8 +3106,8 @@ bool NesterovBase::checkConvergence(int gpl_iter_count,
31063106
return true;
31073107
}
31083108
if (sum_overflow_unscaled_ <= npVars_->targetOverflow) {
3109-
const bool has_group = pb_->group();
3110-
const std::string group_name = has_group ? pb_->group()->getName() : "";
3109+
const bool has_group = pb_->getGroup();
3110+
const std::string group_name = has_group ? pb_->getGroup()->getName() : "";
31113111
const int final_iter = gpl_iter_count;
31123112
dbBlock* block = pb_->db()->getChip()->getBlock();
31133113

src/gpl/src/nesterovBase.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,8 @@ class NesterovBase
11321132

11331133
std::shared_ptr<PlacerBase> getPb() const { return pb_; }
11341134

1135+
odb::dbGroup* getGroup() const { return pb_->getGroup(); }
1136+
11351137
private:
11361138
NesterovBaseVars nbVars_;
11371139
std::shared_ptr<PlacerBase> pb_;

src/gpl/src/placerBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ class PlacerBase
389389
int64_t stdInstsArea() const { return stdInstsArea_; }
390390

391391
odb::dbDatabase* db() const { return db_; }
392-
odb::dbGroup* group() const { return group_; }
392+
odb::dbGroup* getGroup() const { return group_; }
393393

394394
void unlockAll();
395395

0 commit comments

Comments
 (0)