Temporarily derive blackbox modules in hierarchy to evaluate port widths

Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
Clifford Wolf 2018-01-04 13:23:29 +01:00
parent 9804ebedbf
commit 2d140a44eb
1 changed files with 14 additions and 1 deletions

View File

@ -620,6 +620,8 @@ struct HierarchyPass : public Pass {
} }
} }
std::set<Module*> blackbox_derivatives;
for (auto module : design->modules()) for (auto module : design->modules())
for (auto cell : module->cells()) for (auto cell : module->cells())
{ {
@ -628,9 +630,17 @@ struct HierarchyPass : public Pass {
Module *m = design->module(cell->type); Module *m = design->module(cell->type);
if (m == nullptr || m->get_bool_attribute("\\blackbox")) if (m == nullptr)
continue; 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()) for (auto &conn : cell->connections())
{ {
Wire *w = m->wire(conn.first); Wire *w = m->wire(conn.first);
@ -673,6 +683,9 @@ struct HierarchyPass : public Pass {
} }
} }
for (auto module : blackbox_derivatives)
design->remove(module);
log_pop(); log_pop();
} }
} HierarchyPass; } HierarchyPass;