}
}
+ std::set<Module*> blackbox_derivatives;
+
for (auto module : design->modules())
for (auto cell : module->cells())
{
Module *m = design->module(cell->type);
- if (m == nullptr || m->get_bool_attribute("\\blackbox"))
+ if (m == nullptr)
continue;
+ if (m->get_bool_attribute("\\blackbox") && cell->parameters.size()) {
+ IdString new_m_name = m->derive(design, cell->parameters);
+ if (new_m_name != m->name) {
+ m = design->module(new_m_name);
+ blackbox_derivatives.insert(m);
+ }
+ }
+
for (auto &conn : cell->connections())
{
Wire *w = m->wire(conn.first);
}
}
+ for (auto module : blackbox_derivatives)
+ design->remove(module);
+
log_pop();
}
} HierarchyPass;