Handle implicit nets in the named arguments of module instances.

This commit is contained in:
Stephen Williams 2008-03-18 21:40:31 -07:00
parent 13d4a7352c
commit bbb488f730
1 changed files with 17 additions and 8 deletions

View File

@ -300,14 +300,23 @@ bool PGModule::elaborate_sig_mod_(Design*des, NetScope*scope,
bool flag = true;
// First, elaborate the signals that may be created implicitly
// by ports to this module instantiation.
for (unsigned idx = 0 ; idx < pin_count() ; idx += 1) {
const PExpr*tmp = pin(idx);
if (tmp == 0)
continue;
flag = tmp->elaborate_sig(des, scope) && flag;
}
// by ports to this module instantiation. Handle the case that
// the ports are passed by name (pins_ != 0) or position.
if (pins_)
for (unsigned idx = 0 ; idx < npins_ ; idx += 1) {
const PExpr*tmp = pins_[idx].parm;
if (tmp == 0)
continue;
flag = tmp->elaborate_sig(des, scope) && flag;
}
else
for (unsigned idx = 0 ; idx < pin_count() ; idx += 1) {
const PExpr*tmp = pin(idx);
if (tmp == 0)
continue;
flag = tmp->elaborate_sig(des, scope) && flag;
}
NetScope::scope_vec_t instance = scope->instance_arrays[get_name()];