@@ -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+
18281836bool 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);
0 commit comments