Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Real constants have no defined vector width

  • Loading branch information...
commit 589422b505ffe1bcf44d592e81fb9057a9efe651 1 parent dd56d9a
steve authored
Showing with 38 additions and 5 deletions.
  1. +9 −1 net_expr.cc
  2. +11 −1 netlist.h
  3. +18 −3 set_width.cc
View
10 net_expr.cc
@@ -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
12 netlist.h
@@ -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
21 set_width.cc
@@ -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.
*
Please sign in to comment.
Something went wrong with that request. Please try again.