Postpone parameter width check to evaluation.

This commit is contained in:
steve 2002-11-09 01:40:19 +00:00
parent 588931fcf2
commit aa8869a3c7
4 changed files with 28 additions and 9 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
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: elab_pexpr.cc,v 1.16 2002/08/12 01:34:59 steve Exp $" #ident "$Id: elab_pexpr.cc,v 1.17 2002/11/09 01:40:19 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -108,11 +108,6 @@ NetEConcat* PEConcat::elaborate_pexpr(Design*des, NetScope*scope) const
<< *ex << endl; << *ex << endl;
des->errors += 1; des->errors += 1;
} else if (ex->expr_width() == 0) {
cerr << ex->get_line() << ": internal error: "
<< "Operand of concatenation has no width: "
<< *ex << endl;
des->errors += 1;
} }
tmp->set(idx, ex); tmp->set(idx, ex);
@ -222,6 +217,9 @@ NetExpr*PEUnary::elaborate_pexpr (Design*des, NetScope*scope) const
/* /*
* $Log: elab_pexpr.cc,v $ * $Log: elab_pexpr.cc,v $
* Revision 1.17 2002/11/09 01:40:19 steve
* Postpone parameter width check to evaluation.
*
* Revision 1.16 2002/08/12 01:34:59 steve * Revision 1.16 2002/08/12 01:34:59 steve
* conditional ident string using autoconfig. * conditional ident string using autoconfig.
* *

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
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: eval_tree.cc,v 1.42 2002/10/19 22:59:49 steve Exp $" #ident "$Id: eval_tree.cc,v 1.43 2002/11/09 01:40:19 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -752,7 +752,13 @@ NetEConst* NetEConcat::eval_tree()
<< "operand has indefinite width: " << "operand has indefinite width: "
<< *parms_[idx] << endl; << *parms_[idx] << endl;
local_errors += 1; local_errors += 1;
} else if (expr->expr_width() == 0) {
cerr << expr->get_line() << ": internal error: "
<< "Operand of concatenation has no width: "
<< *expr << endl;
local_errors += 1;
} }
gap += expr->expr_width(); gap += expr->expr_width();
} }
@ -1134,6 +1140,9 @@ NetEConst* NetEUReduce::eval_tree()
/* /*
* $Log: eval_tree.cc,v $ * $Log: eval_tree.cc,v $
* Revision 1.43 2002/11/09 01:40:19 steve
* Postpone parameter width check to evaluation.
*
* Revision 1.42 2002/10/19 22:59:49 steve * Revision 1.42 2002/10/19 22:59:49 steve
* Redo the parameter vector support to allow * Redo the parameter vector support to allow
* parameter names in range expressions. * parameter names in range expressions.

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
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: net_expr.cc,v 1.9 2002/11/06 02:25:13 steve Exp $" #ident "$Id: net_expr.cc,v 1.10 2002/11/09 01:40:19 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -109,6 +109,11 @@ NetEConcat::~NetEConcat()
delete parms_[idx]; delete parms_[idx];
} }
bool NetEConcat::has_width() const
{
return true;
}
void NetEConcat::set(unsigned idx, NetExpr*e) void NetEConcat::set(unsigned idx, NetExpr*e)
{ {
assert(idx < parms_.count()); assert(idx < parms_.count());
@ -237,6 +242,9 @@ bool NetESelect::set_width(unsigned w)
/* /*
* $Log: net_expr.cc,v $ * $Log: net_expr.cc,v $
* Revision 1.10 2002/11/09 01:40:19 steve
* Postpone parameter width check to evaluation.
*
* Revision 1.9 2002/11/06 02:25:13 steve * Revision 1.9 2002/11/06 02:25:13 steve
* No need to keep excess width from an * No need to keep excess width from an
* unsigned constant value, if it can * unsigned constant value, if it can

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
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: netlist.h,v 1.268 2002/11/02 03:27:52 steve Exp $" #ident "$Id: netlist.h,v 1.269 2002/11/09 01:40:19 steve Exp $"
#endif #endif
/* /*
@ -2428,6 +2428,7 @@ class NetEConcat : public NetExpr {
NetExpr* parm(unsigned idx) const { return parms_[idx]; } NetExpr* parm(unsigned idx) const { return parms_[idx]; }
virtual NexusSet* nex_input(); virtual NexusSet* nex_input();
virtual bool has_width() const;
virtual bool set_width(unsigned w); virtual bool set_width(unsigned w);
virtual NetEConcat* dup_expr() const; virtual NetEConcat* dup_expr() const;
virtual NetEConst* eval_tree(); virtual NetEConst* eval_tree();
@ -3083,6 +3084,9 @@ extern ostream& operator << (ostream&, NetNet::Type);
/* /*
* $Log: netlist.h,v $ * $Log: netlist.h,v $
* Revision 1.269 2002/11/09 01:40:19 steve
* Postpone parameter width check to evaluation.
*
* Revision 1.268 2002/11/02 03:27:52 steve * Revision 1.268 2002/11/02 03:27:52 steve
* Allow named events to be referenced by * Allow named events to be referenced by
* hierarchical names. * hierarchical names.