diff --git a/design_dump.cc b/design_dump.cc index dd960af66..f6bcbc50a 100644 --- a/design_dump.cc +++ b/design_dump.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: design_dump.cc,v 1.114 2001/07/25 03:10:48 steve Exp $" +#ident "$Id: design_dump.cc,v 1.115 2001/07/27 02:41:55 steve Exp $" #endif # include "config.h" @@ -77,6 +77,22 @@ void NetNet::dump_net(ostream&o, unsigned ind) const o << " (local)"; if (signed_) o << " signed"; + switch (port_type_) { + case NetNet::NOT_A_PORT: + break; + case NetNet::PIMPLICIT: + o << " implicit-port?"; + break; + case NetNet::PINPUT: + o << " input"; + break; + case NetNet::POUTPUT: + o << " output"; + break; + case NetNet::PINOUT: + o << " inout"; + break; + } o << " (eref=" << get_eref() << ")"; if (scope()) o << " scope=" << scope()->name(); @@ -944,6 +960,9 @@ void Design::dump(ostream&o) const /* * $Log: design_dump.cc,v $ + * Revision 1.115 2001/07/27 02:41:55 steve + * Fix binding of dangling function ports. do not elide them. + * * Revision 1.114 2001/07/25 03:10:48 steve * Create a config.h.in file to hold all the config * junk, and support gcc 3.0. (Stephan Boettcher) diff --git a/ivl_target.h b/ivl_target.h index 4f9d86c37..4e4fee0bf 100644 --- a/ivl_target.h +++ b/ivl_target.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: ivl_target.h,v 1.73 2001/07/22 00:17:49 steve Exp $" +#ident "$Id: ivl_target.h,v 1.74 2001/07/27 02:41:55 steve Exp $" #endif #ifdef __cplusplus @@ -732,7 +732,7 @@ extern unsigned ivl_scope_mems(ivl_scope_t net); extern ivl_memory_t ivl_scope_mem(ivl_scope_t net, unsigned idx); extern const char* ivl_scope_name(ivl_scope_t net); extern unsigned ivl_scope_ports(ivl_scope_t net); -extern const char* ivl_scope_port(ivl_scope_t net, unsigned idx); +extern ivl_signal_t ivl_scope_port(ivl_scope_t net, unsigned idx); extern unsigned ivl_scope_sigs(ivl_scope_t net); extern ivl_signal_t ivl_scope_sig(ivl_scope_t net, unsigned idx); extern ivl_scope_type_t ivl_scope_type(ivl_scope_t net); @@ -894,6 +894,9 @@ _END_DECL /* * $Log: ivl_target.h,v $ + * Revision 1.74 2001/07/27 02:41:55 steve + * Fix binding of dangling function ports. do not elide them. + * * Revision 1.73 2001/07/22 00:17:49 steve * Support the NetESubSignal expressions in vvp.tgt. * diff --git a/nodangle.cc b/nodangle.cc index 1c4906184..a09caf067 100644 --- a/nodangle.cc +++ b/nodangle.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: nodangle.cc,v 1.12 2001/07/25 03:10:49 steve Exp $" +#ident "$Id: nodangle.cc,v 1.13 2001/07/27 02:41:55 steve Exp $" #endif # include "config.h" @@ -60,12 +60,16 @@ void nodangle_f::signal(Design*des, NetNet*sig) if (sig->get_eref() > 0) return; - /* Cannot delete the ports of tasks. There are too many places - where they are referenced. */ + /* Cannot delete the ports of tasks or functions. There are + too many places where they are referenced. */ if ((sig->port_type() != NetNet::NOT_A_PORT) && (sig->scope()->type() == NetScope::TASK)) return; + if ((sig->port_type() != NetNet::NOT_A_PORT) + && (sig->scope()->type() == NetScope::FUNC)) + return; + /* Check to see if the signal is completely unconnected. If all the bits are unlinked, then delete it. */ unsigned unlinked = 0; @@ -126,6 +130,9 @@ void nodangle(Design*des) /* * $Log: nodangle.cc,v $ + * Revision 1.13 2001/07/27 02:41:55 steve + * Fix binding of dangling function ports. do not elide them. + * * Revision 1.12 2001/07/25 03:10:49 steve * Create a config.h.in file to hold all the config * junk, and support gcc 3.0. (Stephan Boettcher) diff --git a/t-dll-api.cc b/t-dll-api.cc index 08cfbf565..93593a1fe 100644 --- a/t-dll-api.cc +++ b/t-dll-api.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: t-dll-api.cc,v 1.58 2001/07/25 03:10:49 steve Exp $" +#ident "$Id: t-dll-api.cc,v 1.59 2001/07/27 02:41:55 steve Exp $" #endif # include "config.h" @@ -905,7 +905,7 @@ extern "C" unsigned ivl_scope_ports(ivl_scope_t net) return net->ports; } -extern "C" const char* ivl_scope_port(ivl_scope_t net, unsigned idx) +extern "C" ivl_signal_t ivl_scope_port(ivl_scope_t net, unsigned idx) { assert(net); assert(net->type_ == IVL_SCT_FUNCTION); @@ -1280,6 +1280,9 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net) /* * $Log: t-dll-api.cc,v $ + * Revision 1.59 2001/07/27 02:41:55 steve + * Fix binding of dangling function ports. do not elide them. + * * Revision 1.58 2001/07/25 03:10:49 steve * Create a config.h.in file to hold all the config * junk, and support gcc 3.0. (Stephan Boettcher) diff --git a/t-dll-proc.cc b/t-dll-proc.cc index fdabe3936..dd100e6d2 100644 --- a/t-dll-proc.cc +++ b/t-dll-proc.cc @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: t-dll-proc.cc,v 1.32 2001/07/25 03:10:49 steve Exp $" +#ident "$Id: t-dll-proc.cc,v 1.33 2001/07/27 02:41:56 steve Exp $" #endif # include "config.h" @@ -110,9 +110,9 @@ void dll_target::func_def(const NetScope*net) scope->ports = def->port_count(); if (scope->ports > 0) { - scope->port = new char*[scope->ports]; + scope->port = new ivl_signal_t[scope->ports]; for (unsigned idx = 0 ; idx < scope->ports ; idx += 1) - scope->port[idx] = strdup(def->port(idx)->name()); + scope->port[idx] = find_signal(des_.root_, def->port(idx)); } } @@ -693,6 +693,9 @@ void dll_target::proc_while(const NetWhile*net) /* * $Log: t-dll-proc.cc,v $ + * Revision 1.33 2001/07/27 02:41:56 steve + * Fix binding of dangling function ports. do not elide them. + * * Revision 1.32 2001/07/25 03:10:49 steve * Create a config.h.in file to hold all the config * junk, and support gcc 3.0. (Stephan Boettcher) diff --git a/t-dll.h b/t-dll.h index 4dc4225cd..74bbd8d36 100644 --- a/t-dll.h +++ b/t-dll.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: t-dll.h,v 1.56 2001/07/22 00:17:50 steve Exp $" +#ident "$Id: t-dll.h,v 1.57 2001/07/27 02:41:56 steve Exp $" #endif # include "target.h" @@ -448,7 +448,7 @@ struct ivl_scope_s { ivl_statement_t def; unsigned ports; - char **port; + ivl_signal_t*port; }; /* @@ -557,6 +557,9 @@ struct ivl_statement_s { /* * $Log: t-dll.h,v $ + * Revision 1.57 2001/07/27 02:41:56 steve + * Fix binding of dangling function ports. do not elide them. + * * Revision 1.56 2001/07/22 00:17:50 steve * Support the NetESubSignal expressions in vvp.tgt. * diff --git a/tgt-vvp/eval_expr.c b/tgt-vvp/eval_expr.c index 322fed33b..3628c6851 100644 --- a/tgt-vvp/eval_expr.c +++ b/tgt-vvp/eval_expr.c @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: eval_expr.c,v 1.38 2001/07/22 19:33:51 steve Exp $" +#ident "$Id: eval_expr.c,v 1.39 2001/07/27 02:41:56 steve Exp $" #endif # include "vvp_priv.h" @@ -983,7 +983,7 @@ static struct vector_info draw_ufunc_expr(ivl_expr_t exp, unsigned wid) unsigned idx; unsigned swid = ivl_expr_width(exp); ivl_scope_t def = ivl_expr_def(exp); - const char*name = ivl_scope_port(def, 0); + ivl_signal_t retval = ivl_scope_port(def, 0); struct vector_info res; /* evaluate the expressions and send the results to the @@ -991,14 +991,17 @@ static struct vector_info draw_ufunc_expr(ivl_expr_t exp, unsigned wid) assert(ivl_expr_parms(exp) == (ivl_scope_ports(def)-1)); for (idx = 0 ; idx < ivl_expr_parms(exp) ; idx += 1) { - const char*port = ivl_scope_port(def, idx+1); + ivl_signal_t port = ivl_scope_port(def, idx+1); unsigned pin, bit; - res = draw_eval_expr(ivl_expr_parm(exp, idx)); + res = draw_eval_expr_wid(ivl_expr_parm(exp, idx), + ivl_signal_pins(port)); bit = res.base; + assert(res.wid <= ivl_signal_pins(port)); for (pin = 0 ; pin < res.wid ; pin += 1) { fprintf(vvp_out, " %%set V_%s[%u], %u;\n", - vvp_mangle_id(port), pin, bit); + vvp_mangle_id(ivl_signal_name(port)), + pin, bit); if (bit >= 4) bit += 1; } @@ -1021,7 +1024,7 @@ static struct vector_info draw_ufunc_expr(ivl_expr_t exp, unsigned wid) for (idx = 0 ; idx < swid ; idx += 1) fprintf(vvp_out, " %%load %u, V_%s[%u];\n", - res.base+idx, vvp_mangle_id(name), idx); + res.base+idx, vvp_mangle_id(ivl_signal_name(retval)), idx); /* Pad the signal value with zeros. */ if (swid < wid) @@ -1156,6 +1159,9 @@ struct vector_info draw_eval_expr(ivl_expr_t exp) /* * $Log: eval_expr.c,v $ + * Revision 1.39 2001/07/27 02:41:56 steve + * Fix binding of dangling function ports. do not elide them. + * * Revision 1.38 2001/07/22 19:33:51 steve * Handle repeat for concatenation expressions. *