2323#include " dpl/PlacementDRC.h"
2424#include " journal.h"
2525#include " odb/dbTransform.h"
26- #include " router.h"
2726#include " utility.h"
2827#include " utl/Logger.h"
2928
@@ -33,14 +32,9 @@ namespace dpo {
3332
3433DetailedMgr::DetailedMgr (Architecture* arch,
3534 Network* network,
36- RoutingParams* rt,
3735 Grid* grid,
3836 PlacementDRC* drc_engine)
39- : arch_(arch),
40- network_ (network),
41- rt_(rt),
42- grid_(grid),
43- drc_engine_(drc_engine)
37+ : arch_(arch), network_(network), grid_(grid), drc_engine_(drc_engine)
4438{
4539 singleRowHeight_ = arch_->getRow (0 )->getHeight ();
4640 numSingleHeightRows_ = arch_->getNumRows ();
@@ -192,50 +186,6 @@ void DetailedMgr::findBlockages(const bool includeRouteBlockages)
192186 }
193187 }
194188
195- if (includeRouteBlockages && rt_ != nullptr ) {
196- // Turn M1 and M2 routing blockages into placement blockages. The idea
197- // here is to be quite conservative and prevent the possibility of pin
198- // access problems. We *ONLY* consider routing obstacles to be placement
199- // obstacles if they overlap with an *ENTIRE* site.
200-
201- for (int layer = 0 ; layer <= 1 && layer < rt_->num_layers_ ; layer++) {
202- const std::vector<Rectangle>& rects = rt_->layerBlockages_ [layer];
203- for (const auto & rect : rects) {
204- const double xmin = rect.xmin ();
205- const double xmax = rect.xmax ();
206- const double ymin = rect.ymin ();
207- const double ymax = rect.ymax ();
208-
209- for (int r = 0 ; r < numSingleHeightRows_; r++) {
210- const double lb = arch_->getMinY () + r * singleRowHeight_;
211- const double ub = lb + singleRowHeight_;
212-
213- if (ymax >= ub && ymin <= lb) {
214- // Blockage overlaps with the entire row span in the Y-dir...
215- // Sites are possibly completely covered!
216-
217- const double originX = arch_->getRow (r)->getLeft ();
218- const double siteSpacing = arch_->getRow (r)->getSiteSpacing ();
219-
220- const int i0 = (int ) std::floor ((xmin - originX) / siteSpacing);
221- int i1 = (int ) std::floor ((xmax - originX) / siteSpacing);
222- if (originX + i1 * siteSpacing != xmax) {
223- ++i1;
224- }
225-
226- if (i1 > i0) {
227- blockages_[r].emplace_back (originX + i0 * siteSpacing,
228- originX + i1 * siteSpacing,
229- 0 ,
230- 0 ,
231- BlockageType::Routing);
232- }
233- }
234- }
235- }
236- }
237- }
238-
239189 // Sort blockages and merge.
240190 for (int r = 0 ; r < numSingleHeightRows_; r++) {
241191 auto & blockages = blockages_[r];
@@ -1093,53 +1043,6 @@ double DetailedMgr::measureMaximumDisplacement(u_int64_t& maxX,
10931043 return maxL1;
10941044}
10951045
1096- // //////////////////////////////////////////////////////////////////////////////
1097- // //////////////////////////////////////////////////////////////////////////////
1098- void DetailedMgr::setupObstaclesForDrc ()
1099- {
1100- // Setup rectangular obstacles for short and pin access checks. Do only as
1101- // rectangles per row and per layer. I had used rtrees, but it wasn't working
1102- // any better.
1103- obstacles_.resize (arch_->getRows ().size ());
1104-
1105- for (int row_id = 0 ; row_id < arch_->getRows ().size (); row_id++) {
1106- obstacles_[row_id].resize (rt_->num_layers_ );
1107-
1108- const double originX = arch_->getRow (row_id)->getLeft ();
1109- const double siteSpacing = arch_->getRow (row_id)->getSiteSpacing ();
1110- const int numSites = arch_->getRow (row_id)->getNumSites ();
1111-
1112- // Blockages relevant to this row...
1113- for (int layer_id = 0 ; layer_id < rt_->num_layers_ ; layer_id++) {
1114- obstacles_[row_id][layer_id].clear ();
1115-
1116- const std::vector<Rectangle>& rects = rt_->layerBlockages_ [layer_id];
1117- for (const auto & rect : rects) {
1118- // Extract obstacles which interfere with this row only.
1119- const double xmin = originX;
1120- const double xmax = originX + numSites * siteSpacing;
1121- const double ymin = arch_->getRow (row_id)->getBottom ();
1122- const double ymax = arch_->getRow (row_id)->getTop ();
1123-
1124- if (rect.xmax () <= xmin) {
1125- continue ;
1126- }
1127- if (rect.xmin () >= xmax) {
1128- continue ;
1129- }
1130- if (rect.ymax () <= ymin) {
1131- continue ;
1132- }
1133- if (rect.ymin () >= ymax) {
1134- continue ;
1135- }
1136-
1137- obstacles_[row_id][layer_id].push_back (rect);
1138- }
1139- }
1140- }
1141- }
1142-
11431046// //////////////////////////////////////////////////////////////////////////////
11441047// //////////////////////////////////////////////////////////////////////////////
11451048void DetailedMgr::collectSingleHeightCells ()
@@ -1652,76 +1555,12 @@ int DetailedMgr::checkRowAlignment()
16521555
16531556// //////////////////////////////////////////////////////////////////////////////
16541557// //////////////////////////////////////////////////////////////////////////////
1655- double DetailedMgr::getCellSpacing (const Node* ndl,
1656- const Node* ndr,
1657- const bool checkPinsOnCells)
1558+ double DetailedMgr::getCellSpacing (const Node* ndl, const Node* ndr)
16581559{
1659- // Compute any required spacing between cells. This could be from an edge
1660- // type rule, or due to adjacent pins on the cells. Checking pins on cells is
1661- // more time consuming.
1662-
16631560 if (ndl == nullptr || ndr == nullptr ) {
16641561 return 0.0 ;
16651562 }
1666- const double spacing1 = arch_->getCellSpacing (ndl, ndl);
1667- if (!checkPinsOnCells) {
1668- return spacing1;
1669- }
1670- double spacing2 = 0.0 ;
1671- {
1672- const Pin* pinl = nullptr ;
1673- const Pin* pinr = nullptr ;
1674-
1675- // Right-most pin on the left cell.
1676- for (const Pin* pin : ndl->getPins ()) {
1677- if (pinl == nullptr || pin->getOffsetX () > pinl->getOffsetX ()) {
1678- pinl = pin;
1679- }
1680- }
1681-
1682- // Left-most pin on the right cell.
1683- for (const Pin* pin : ndr->getPins ()) {
1684- if (pinr == nullptr || pin->getOffsetX () < pinr->getOffsetX ()) {
1685- pinr = pin;
1686- }
1687- }
1688- // If pins on the same layer, do something.
1689- if (pinl != nullptr && pinr != nullptr
1690- && pinl->getPinLayer () == pinr->getPinLayer ()) {
1691- // Determine the spacing requirements between these two pins. Then,
1692- // translate this into a spacing requirement between the two cells. XXX:
1693- // Since it is implicit that the cells are in the same row, we can
1694- // determine the widest pin and the parallel run length without knowing
1695- // the actual location of the cells... At least I think so...
1696-
1697- const double xmin1 = pinl->getOffsetX ().v - 0.5 * pinl->getPinWidth ().v ;
1698- const double xmax1 = pinl->getOffsetX ().v + 0.5 * pinl->getPinWidth ().v ;
1699- const double ymin1 = pinl->getOffsetY ().v - 0.5 * pinl->getPinHeight ().v ;
1700- const double ymax1 = pinl->getOffsetY ().v + 0.5 * pinl->getPinHeight ().v ;
1701-
1702- const double xmin2 = pinr->getOffsetX ().v - 0.5 * pinr->getPinWidth ().v ;
1703- const double xmax2 = pinr->getOffsetX ().v + 0.5 * pinr->getPinWidth ().v ;
1704- const double ymin2 = pinr->getOffsetY ().v - 0.5 * pinr->getPinHeight ().v ;
1705- const double ymax2 = pinr->getOffsetY ().v + 0.5 * pinr->getPinHeight ().v ;
1706-
1707- const double ww = std::max (std::min (ymax1 - ymin1, xmax1 - xmin1),
1708- std::min (ymax2 - ymin2, xmax2 - xmin2));
1709- const double py
1710- = std::max (0.0 , std::min (ymax1, ymax2) - std::max (ymin1, ymin2));
1711-
1712- spacing2 = rt_->get_spacing (pinl->getPinLayer (), ww, py);
1713- const double gapl = (0.5 * ndl->getWidth ().v ) - xmax1;
1714- const double gapr = xmin2 - (-0.5 * ndr->getWidth ().v );
1715- spacing2 = std::max (0.0 , spacing2 - gapl - gapr);
1716-
1717- if (spacing2 > spacing1) {
1718- // The spacing requirement due to the routing layer is larger than the
1719- // spacing requirement due to the edge constraint. Interesting.
1720- ;
1721- }
1722- }
1723- }
1724- return std::max (spacing1, spacing2);
1563+ return arch_->getCellSpacing (ndl, ndl);
17251564}
17261565
17271566// //////////////////////////////////////////////////////////////////////////////
0 commit comments