Fix binding of dangling function ports. do not elide them.

This commit is contained in:
steve 2001-07-27 02:41:55 +00:00
parent f28b97ebfd
commit 629a02cccf
7 changed files with 63 additions and 19 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #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 #endif
# include "config.h" # include "config.h"
@ -77,6 +77,22 @@ void NetNet::dump_net(ostream&o, unsigned ind) const
o << " (local)"; o << " (local)";
if (signed_) if (signed_)
o << " 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() << ")"; o << " (eref=" << get_eref() << ")";
if (scope()) if (scope())
o << " scope=" << scope()->name(); o << " scope=" << scope()->name();
@ -944,6 +960,9 @@ void Design::dump(ostream&o) const
/* /*
* $Log: design_dump.cc,v $ * $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 * Revision 1.114 2001/07/25 03:10:48 steve
* Create a config.h.in file to hold all the config * Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher) * junk, and support gcc 3.0. (Stephan Boettcher)

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #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 #endif
#ifdef __cplusplus #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 ivl_memory_t ivl_scope_mem(ivl_scope_t net, unsigned idx);
extern const char* ivl_scope_name(ivl_scope_t net); extern const char* ivl_scope_name(ivl_scope_t net);
extern unsigned ivl_scope_ports(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 unsigned ivl_scope_sigs(ivl_scope_t net);
extern ivl_signal_t ivl_scope_sig(ivl_scope_t net, unsigned idx); 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); extern ivl_scope_type_t ivl_scope_type(ivl_scope_t net);
@ -894,6 +894,9 @@ _END_DECL
/* /*
* $Log: ivl_target.h,v $ * $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 * Revision 1.73 2001/07/22 00:17:49 steve
* Support the NetESubSignal expressions in vvp.tgt. * Support the NetESubSignal expressions in vvp.tgt.
* *

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #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 #endif
# include "config.h" # include "config.h"
@ -60,12 +60,16 @@ void nodangle_f::signal(Design*des, NetNet*sig)
if (sig->get_eref() > 0) if (sig->get_eref() > 0)
return; return;
/* Cannot delete the ports of tasks. There are too many places /* Cannot delete the ports of tasks or functions. There are
where they are referenced. */ too many places where they are referenced. */
if ((sig->port_type() != NetNet::NOT_A_PORT) if ((sig->port_type() != NetNet::NOT_A_PORT)
&& (sig->scope()->type() == NetScope::TASK)) && (sig->scope()->type() == NetScope::TASK))
return; 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 /* Check to see if the signal is completely unconnected. If
all the bits are unlinked, then delete it. */ all the bits are unlinked, then delete it. */
unsigned unlinked = 0; unsigned unlinked = 0;
@ -126,6 +130,9 @@ void nodangle(Design*des)
/* /*
* $Log: nodangle.cc,v $ * $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 * Revision 1.12 2001/07/25 03:10:49 steve
* Create a config.h.in file to hold all the config * Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher) * junk, and support gcc 3.0. (Stephan Boettcher)

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #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 #endif
# include "config.h" # include "config.h"
@ -905,7 +905,7 @@ extern "C" unsigned ivl_scope_ports(ivl_scope_t net)
return net->ports; 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);
assert(net->type_ == IVL_SCT_FUNCTION); 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 $ * $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 * Revision 1.58 2001/07/25 03:10:49 steve
* Create a config.h.in file to hold all the config * Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher) * junk, and support gcc 3.0. (Stephan Boettcher)

View File

@ -18,7 +18,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #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 #endif
# include "config.h" # include "config.h"
@ -110,9 +110,9 @@ void dll_target::func_def(const NetScope*net)
scope->ports = def->port_count(); scope->ports = def->port_count();
if (scope->ports > 0) { 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) 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 $ * $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 * Revision 1.32 2001/07/25 03:10:49 steve
* Create a config.h.in file to hold all the config * Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher) * junk, and support gcc 3.0. (Stephan Boettcher)

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #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 #endif
# include "target.h" # include "target.h"
@ -448,7 +448,7 @@ struct ivl_scope_s {
ivl_statement_t def; ivl_statement_t def;
unsigned ports; unsigned ports;
char **port; ivl_signal_t*port;
}; };
/* /*
@ -557,6 +557,9 @@ struct ivl_statement_s {
/* /*
* $Log: t-dll.h,v $ * $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 * Revision 1.56 2001/07/22 00:17:50 steve
* Support the NetESubSignal expressions in vvp.tgt. * Support the NetESubSignal expressions in vvp.tgt.
* *

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) #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 #endif
# include "vvp_priv.h" # include "vvp_priv.h"
@ -983,7 +983,7 @@ static struct vector_info draw_ufunc_expr(ivl_expr_t exp, unsigned wid)
unsigned idx; unsigned idx;
unsigned swid = ivl_expr_width(exp); unsigned swid = ivl_expr_width(exp);
ivl_scope_t def = ivl_expr_def(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; struct vector_info res;
/* evaluate the expressions and send the results to the /* 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)); assert(ivl_expr_parms(exp) == (ivl_scope_ports(def)-1));
for (idx = 0 ; idx < ivl_expr_parms(exp) ; idx += 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; 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; bit = res.base;
assert(res.wid <= ivl_signal_pins(port));
for (pin = 0 ; pin < res.wid ; pin += 1) { for (pin = 0 ; pin < res.wid ; pin += 1) {
fprintf(vvp_out, " %%set V_%s[%u], %u;\n", 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) if (bit >= 4)
bit += 1; 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) for (idx = 0 ; idx < swid ; idx += 1)
fprintf(vvp_out, " %%load %u, V_%s[%u];\n", 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. */ /* Pad the signal value with zeros. */
if (swid < wid) if (swid < wid)
@ -1156,6 +1159,9 @@ struct vector_info draw_eval_expr(ivl_expr_t exp)
/* /*
* $Log: eval_expr.c,v $ * $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 * Revision 1.38 2001/07/22 19:33:51 steve
* Handle repeat for concatenation expressions. * Handle repeat for concatenation expressions.
* *