From 0976fd393b32fa5a0fc2a3507fe0f552cfae96ac Mon Sep 17 00:00:00 2001 From: steve Date: Mon, 22 Apr 2002 00:53:39 +0000 Subject: [PATCH] Do not allow implicit wires in sensitivity lists. --- compiler.h | 6 +++++- elab_net.cc | 16 +++++++++++++--- elaborate.cc | 13 ++++++++++++- main.cc | 8 +++++++- 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/compiler.h b/compiler.h index 0567b1edc..f7eb5f65f 100644 --- a/compiler.h +++ b/compiler.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: compiler.h,v 1.8 2002/04/15 00:04:22 steve Exp $" +#ident "$Id: compiler.h,v 1.9 2002/04/22 00:53:39 steve Exp $" #endif # include @@ -67,6 +67,7 @@ /* Implicit definitions of wires. */ extern bool warn_implicit; +extern bool error_implicit; /* inherit timescales accross files. */ extern bool warn_timescale; @@ -80,6 +81,9 @@ extern listlibrary_suff; /* * $Log: compiler.h,v $ + * Revision 1.9 2002/04/22 00:53:39 steve + * Do not allow implicit wires in sensitivity lists. + * * Revision 1.8 2002/04/15 00:04:22 steve * Timescale warnings. * diff --git a/elab_net.cc b/elab_net.cc index 9b19c86f1..dd9da65df 100644 --- a/elab_net.cc +++ b/elab_net.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: elab_net.cc,v 1.87 2002/03/09 02:10:22 steve Exp $" +#ident "$Id: elab_net.cc,v 1.88 2002/04/22 00:53:39 steve Exp $" #endif # include "config.h" @@ -1200,10 +1200,17 @@ NetNet* PEIdent::elaborate_net(Design*des, NetScope*scope, sig = new NetNet(scope, scope->name()+"."+path_.peek_name(0), NetNet::IMPLICIT, 1); - if (warn_implicit) + if (error_implicit) { + cerr << get_line() << ": error: " + << scope->name() << "." << path_.peek_name(0) + << " not defined in this scope." << endl; + des->errors += 1; + + } else if (warn_implicit) { cerr << get_line() << ": warning: implicit " "definition of wire " << scope->name() - << "." << path_ << "." << endl; + << "." << path_.peek_name(0) << "." << endl; + } } } @@ -2062,6 +2069,9 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope, /* * $Log: elab_net.cc,v $ + * Revision 1.88 2002/04/22 00:53:39 steve + * Do not allow implicit wires in sensitivity lists. + * * Revision 1.87 2002/03/09 02:10:22 steve * Add the NetUserFunc netlist node. * diff --git a/elaborate.cc b/elaborate.cc index 9e00271e4..f5e80e4db 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: elaborate.cc,v 1.244 2002/04/21 22:31:02 steve Exp $" +#ident "$Id: elaborate.cc,v 1.245 2002/04/22 00:53:39 steve Exp $" #endif # include "config.h" @@ -38,6 +38,7 @@ # include "netmisc.h" # include "util.h" # include "parse_api.h" +# include "compiler.h" static Link::strength_t drive_type(PGate::strength_t drv) { @@ -1817,8 +1818,12 @@ NetProc* PEventStatement::elaborate_st(Design*des, NetScope*scope, if ((expr_.count() == 1) && (expr_[0]->type() == PEEvent::POSITIVE)) { + bool save_flag = error_implicit; + error_implicit = true; NetNet*ex = expr_[0]->expr()->elaborate_net(des, scope, 1, 0, 0, 0); + error_implicit = save_flag; + if (ex == 0) { expr_[0]->dump(cerr); cerr << endl; @@ -1944,8 +1949,11 @@ NetProc* PEventStatement::elaborate_st(Design*des, NetScope*scope, the sub-expression as a net and decide how to handle the edge. */ + bool save_flag = error_implicit; + error_implicit = true; NetNet*expr = expr_[idx]->expr()->elaborate_net(des, scope, 0, 0, 0, 0); + error_implicit = save_flag; if (expr == 0) { expr_[idx]->dump(cerr); cerr << endl; @@ -2504,6 +2512,9 @@ Design* elaborate(listroots) /* * $Log: elaborate.cc,v $ + * Revision 1.245 2002/04/22 00:53:39 steve + * Do not allow implicit wires in sensitivity lists. + * * Revision 1.244 2002/04/21 22:31:02 steve * Redo handling of assignment internal delays. * Leave it possible for them to be calculated diff --git a/main.cc b/main.cc index 81745d151..ecf871071 100644 --- a/main.cc +++ b/main.cc @@ -19,7 +19,7 @@ const char COPYRIGHT[] = * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: main.cc,v 1.53 2002/04/15 00:04:22 steve Exp $" +#ident "$Id: main.cc,v 1.54 2002/04/22 00:53:39 steve Exp $" #endif # include "config.h" @@ -87,6 +87,9 @@ FILE *depend_file = NULL; */ bool warn_implicit = false; bool warn_timescale = false; + +bool error_implicit = false; + /* * Verbose messages enabled. */ @@ -493,6 +496,9 @@ int main(int argc, char*argv[]) /* * $Log: main.cc,v $ + * Revision 1.54 2002/04/22 00:53:39 steve + * Do not allow implicit wires in sensitivity lists. + * * Revision 1.53 2002/04/15 00:04:22 steve * Timescale warnings. *