From d6fbc30cd550dbdacba40d334ae2df515ce637ef Mon Sep 17 00:00:00 2001 From: steve Date: Wed, 8 Sep 1999 04:05:30 +0000 Subject: [PATCH] Allow assign to not match rvalue width. --- elaborate.cc | 13 +++++-------- netlist.cc | 12 ++++-------- netlist.h | 9 ++++++++- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/elaborate.cc b/elaborate.cc index 970ca8ff3..dff69f91b 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) -#ident "$Id: elaborate.cc,v 1.79 1999/09/08 02:24:39 steve Exp $" +#ident "$Id: elaborate.cc,v 1.80 1999/09/08 04:05:30 steve Exp $" #endif /* @@ -1417,13 +1417,7 @@ NetProc* PAssign::elaborate(Design*des, const string&path) const if (mux == 0) { unsigned wid = msb - lsb + 1; - if (! rv->set_width(wid)) { - cerr << get_line() << ": Unable to match expression " - "width of " << rv->expr_width() << " to l-value" - " width of " << wid << "." << endl; - //XXXX delete rv; - return 0; - } + rv->set_width(wid); cur = new NetAssign(des->local_symbol(path), des, wid, rv); for (unsigned idx = 0 ; idx < wid ; idx += 1) @@ -2186,6 +2180,9 @@ Design* elaborate(const map&modules, /* * $Log: elaborate.cc,v $ + * Revision 1.80 1999/09/08 04:05:30 steve + * Allow assign to not match rvalue width. + * * Revision 1.79 1999/09/08 02:24:39 steve * Empty conditionals (pmonta@imedia.com) * diff --git a/netlist.cc b/netlist.cc index 730cd2046..d7cd18a03 100644 --- a/netlist.cc +++ b/netlist.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: netlist.cc,v 1.57 1999/09/04 01:57:15 steve Exp $" +#ident "$Id: netlist.cc,v 1.58 1999/09/08 04:05:30 steve Exp $" #endif # include @@ -370,13 +370,6 @@ NetAssign_::~NetAssign_() NetAssign::NetAssign(const string&n, Design*des, unsigned w, NetExpr*rv) : NetAssign_(n, w), rval_(rv) { - bool flag = rval_->set_width(w); - if (flag == false) { - cerr << rv->get_line() << ": Expression bit width of " << - rv->expr_width() << " conflicts with l-value bit width of " - << w << "." << endl; - des->errors += 1; - } } NetAssign::~NetAssign() @@ -1754,6 +1747,9 @@ NetNet* Design::find_signal(bool (*func)(const NetNet*)) /* * $Log: netlist.cc,v $ + * Revision 1.58 1999/09/08 04:05:30 steve + * Allow assign to not match rvalue width. + * * Revision 1.57 1999/09/04 01:57:15 steve * Generate fake adder code in vvm. * diff --git a/netlist.h b/netlist.h index 3893110e9..c99a7336c 100644 --- a/netlist.h +++ b/netlist.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: netlist.h,v 1.60 1999/09/03 04:28:38 steve Exp $" +#ident "$Id: netlist.h,v 1.61 1999/09/08 04:05:30 steve Exp $" #endif /* @@ -601,6 +601,10 @@ class NetProc { * lvalue object and represents the elaborated lvalue. Thus, this * appears as a procedural statement AND a structural node. The * LineInfo is the location of the assignment statement in the source. + * + * NOTE: The elaborator will make an effort to match the width of the + * r-value to the with of the assign node, but targets and functions + * should know that this is not a guarantee. */ class NetAssign_ : public NetProc, public NetNode, public LineInfo { @@ -1548,6 +1552,9 @@ extern ostream& operator << (ostream&, NetNet::Type); /* * $Log: netlist.h,v $ + * Revision 1.61 1999/09/08 04:05:30 steve + * Allow assign to not match rvalue width. + * * Revision 1.60 1999/09/03 04:28:38 steve * elaborate the binary plus operator. *