Allow "hierarchy -generate" for $__ cells
authorClifford Wolf <clifford@clifford.at>
Tue, 29 Jul 2014 14:33:56 +0000 (16:33 +0200)
committerClifford Wolf <clifford@clifford.at>
Tue, 29 Jul 2014 14:35:13 +0000 (16:35 +0200)
passes/hierarchy/hierarchy.cc

index c869ec729525da25081c10d8d734fe7a0d69c672..a1361c680d25cf75a9ac8f57144f50178745bb08 100644 (file)
@@ -41,7 +41,9 @@ static void generate(RTLIL::Design *design, const std::vector<std::string> &cell
        for (auto i2 : i1.second->cells_)
        {
                RTLIL::Cell *cell = i2.second;
-               if (cell->type[0] == '$' || design->modules_.count(cell->type) > 0)
+               if (design->has(cell->type))
+                       continue;
+               if (cell->type.substr(0, 1) == "$" && cell->type.substr(0, 3) != "$__")
                        continue;
                for (auto &pattern : celltypes)
                        if (!fnmatch(pattern.c_str(), RTLIL::unescape_id(cell->type).c_str(), FNM_NOESCAPE))