Added support for "blackbox" attribute to flatten/techmap
authorClifford Wolf <clifford@clifford.at>
Thu, 17 Jul 2014 06:58:51 +0000 (08:58 +0200)
committerClifford Wolf <clifford@clifford.at>
Thu, 17 Jul 2014 06:58:51 +0000 (08:58 +0200)
passes/techmap/techmap.cc

index 4c5a0febcbfcadc4327e0bfeda8e10e4d7e2a57e..cb36c9e1f2ab5dc84ffd138ba6d2e3d06d83843c 100644 (file)
@@ -243,6 +243,9 @@ struct TechmapWorker
                                RTLIL::Module *tpl = map->modules[tpl_name];
                                std::map<RTLIL::IdString, RTLIL::Const> parameters = cell->parameters;
 
+                               if (tpl->get_bool_attribute("\\blackbox"))
+                                       continue;
+
                                if (!flatten_mode)
                                {
                                        if (tpl->get_bool_attribute("\\techmap_simplemap")) {
@@ -686,7 +689,7 @@ struct FlattenPass : public Pass {
                if (top_mod != NULL) {
                        std::map<RTLIL::IdString, RTLIL::Module*> new_modules;
                        for (auto &mod_it : design->modules)
-                               if (mod_it.second == top_mod) {
+                               if (mod_it.second == top_mod || mod_it.second->get_bool_attribute("\\blackbox")) {
                                        new_modules[mod_it.first] = mod_it.second;
                                } else {
                                        log("Deleting now unused module %s.\n", RTLIL::id2cstr(mod_it.first));