From bbb488f730610182859e8b361bb213803d68e383 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Tue, 18 Mar 2008 21:40:31 -0700 Subject: [PATCH] Handle implicit nets in the named arguments of module instances. --- elab_sig.cc | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/elab_sig.cc b/elab_sig.cc index a81f83622..e84778224 100644 --- a/elab_sig.cc +++ b/elab_sig.cc @@ -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()];