Real constants have no defined vector width

This commit is contained in:
steve 2003-02-06 17:50:23 +00:00
parent dd56d9a17c
commit 589422b505
3 changed files with 38 additions and 5 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: net_expr.cc,v 1.12 2003/01/27 00:14:37 steve Exp $"
#ident "$Id: net_expr.cc,v 1.13 2003/02/06 17:50:23 steve Exp $"
#endif
# include "config.h"
@ -273,6 +273,11 @@ const verireal& NetECReal::value() const
return value_;
}
bool NetECReal::has_width() const
{
return false;
}
NetECReal* NetECReal::dup_expr() const
{
NetECReal*tmp = new NetECReal(value_);
@ -405,6 +410,9 @@ NetExpr::TYPE NetESFunc::expr_type() const
/*
* $Log: net_expr.cc,v $
* Revision 1.13 2003/02/06 17:50:23 steve
* Real constants have no defined vector width
*
* Revision 1.12 2003/01/27 00:14:37 steve
* Support in various contexts the $realtime
* system task.

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: netlist.h,v 1.274 2003/01/30 16:23:08 steve Exp $"
#ident "$Id: netlist.h,v 1.275 2003/02/06 17:50:23 steve Exp $"
#endif
/*
@ -1029,6 +1029,13 @@ class NetECReal : public NetExpr {
const verireal&value() const;
// Reals can be used in vector expressions. Conversions will
// be done at the right time.
virtual bool set_width(unsigned w);
// This type has no self-determined width. This is false.
virtual bool has_width() const;
// The type of this expression is ET_REAL
TYPE expr_type() const;
@ -3191,6 +3198,9 @@ extern ostream& operator << (ostream&, NetNet::Type);
/*
* $Log: netlist.h,v $
* Revision 1.275 2003/02/06 17:50:23 steve
* Real constants have no defined vector width
*
* Revision 1.274 2003/01/30 16:23:08 steve
* Spelling fixes.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: set_width.cc,v 1.26 2003/01/26 21:02:21 steve Exp $"
#ident "$Id: set_width.cc,v 1.27 2003/02/06 17:50:23 steve Exp $"
#endif
# include "config.h"
@ -38,8 +38,9 @@
bool NetExpr::set_width(unsigned w)
{
cerr << typeid(*this).name() << ": set_width(unsigned) "
"not implemented." << endl;
cerr << get_line() << ": internal warning: "
<<typeid(*this).name() << ": set_width(unsigned) "
<< "not implemented." << endl;
expr_width(w);
return false;
}
@ -283,6 +284,17 @@ bool NetEConst::set_width(unsigned w)
}
}
/*
* Real constants can have whatever width the environment wants,
* because it isn't really a vector. The environment will convert this
* to a vector at the right time.
*/
bool NetECReal::set_width(unsigned w)
{
expr_width(w);
return true;
}
bool NetEMemory::set_width(unsigned w)
{
if (w != mem_->width())
@ -371,6 +383,9 @@ bool NetEUReduce::set_width(unsigned w)
/*
* $Log: set_width.cc,v $
* Revision 1.27 2003/02/06 17:50:23 steve
* Real constants have no defined vector width
*
* Revision 1.26 2003/01/26 21:02:21 steve
* Remember to save signedness of number.
*