diff --git a/cpp_to_py/common/db/Layer.h b/cpp_to_py/common/db/Layer.h index 22bcad4..564a78c 100644 --- a/cpp_to_py/common/db/Layer.h +++ b/cpp_to_py/common/db/Layer.h @@ -39,7 +39,7 @@ class Layer { private: string _name = ""; - //'r' for route or 'c' for cut + //'r' for route, 'c' for cut, 's' for MasterSlice(pwell, nwell) char _type = 'x'; Layer* _below = nullptr; @@ -79,6 +79,7 @@ public: bool isRouteLayer() const { return _type == 'r'; } bool isCutLayer() const { return _type == 'c'; } + bool isMasterSliceLayer() const { return _type == 's'; } Layer* getLayerBelow() const { return _below; } Layer* getLayerAbove() const { return _above; } diff --git a/cpp_to_py/common/io/file_lefdef_db.cpp b/cpp_to_py/common/io/file_lefdef_db.cpp index 8475b93..114e069 100644 --- a/cpp_to_py/common/io/file_lefdef_db.cpp +++ b/cpp_to_py/common/io/file_lefdef_db.cpp @@ -748,6 +748,9 @@ int readLefLayer(lefrCallbackType_e c, lefiLayer* leflayer, lefiUserData ud) { return 0; } type = 'c'; + } else if (!strcmp(leflayer->type(), "MASTERSLICE")) { + logger.warning("Find MASTERSLICE layer %s.", name.c_str()); + type = 's'; } else { return 0; } @@ -888,6 +891,8 @@ int readLefLayer(lefrCallbackType_e c, lefiLayer* leflayer, lefiUserData ud) { } } return 0; + case 's': + return 0; default: return 0; } diff --git a/cpp_to_py/gpugr/db/GRDatabase.cpp b/cpp_to_py/gpugr/db/GRDatabase.cpp index 3bf178b..ae62631 100644 --- a/cpp_to_py/gpugr/db/GRDatabase.cpp +++ b/cpp_to_py/gpugr/db/GRDatabase.cpp @@ -330,7 +330,7 @@ void GRDatabase::addCellObs(std::vector& allObs, db::Cell* cell) { int dy = ctype->originY() + cell->ly(); // Macro Obs for (auto& e : ctype->obs()) { - if (e.layer.rIndex == 0) continue; // ignore M1 OBS + if (e.layer.rIndex <= 0) continue; // ignore M1 OBS and non-routing layer int lx = e.lx, ly = e.ly, hx = e.hx, hy = e.hy; switch (cellOrient) { case 2: // S @@ -355,7 +355,7 @@ void GRDatabase::addCellObs(std::vector& allObs, db::Cell* cell) { // Pin Box for (auto pintype : ctype->pins) { for (auto& e : pintype->shapes) { - if (e.layer.rIndex == 0) continue; // ignore M1 OBS + if (e.layer.rIndex <= 0) continue; // ignore M1 OBS and non-routing layer int lx = e.lx, ly = e.ly, hx = e.hx, hy = e.hy; switch (cellOrient) { case 2: // S