From 64a6906cc448b90777591006786e8bb3a85d2c49 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Thu, 17 Jul 2014 08:58:51 +0200 Subject: [PATCH] Added support for "blackbox" attribute to flatten/techmap --- passes/techmap/techmap.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/passes/techmap/techmap.cc b/passes/techmap/techmap.cc index 4c5a0febc..cb36c9e1f 100644 --- a/passes/techmap/techmap.cc +++ b/passes/techmap/techmap.cc @@ -243,6 +243,9 @@ struct TechmapWorker RTLIL::Module *tpl = map->modules[tpl_name]; std::map 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 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)); -- 2.30.2