Permalink
Browse files

Import MCD support from Stephen Tell, and add

 system function parameter support to the IVL core.
  • Loading branch information...
1 parent b90cda1 commit b28f258463143bee0ed058297401a821cb9c24b1 steve committed May 7, 2000
Showing with 572 additions and 139 deletions.
  1. +11 −2 design_dump.cc
  2. +10 −2 dup_expr.cc
  3. +15 −15 elab_expr.cc
  4. +39 −2 netlist.cc
  5. +14 −5 netlist.h
  6. +105 −73 t-vvm.cc
  7. +181 −23 vpi/sys_display.c
  8. +10 −1 vpi/vpi_user.h
  9. +3 −2 vvm/Makefile.in
  10. +34 −4 vvm/vpi_const.c
  11. +123 −0 vvm/vpi_mcd.c
  12. +9 −6 vvm/vpi_priv.c
  13. +7 −2 vvm/vpi_priv.h
  14. +11 −2 vvm/vpi_systask.c
View
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: design_dump.cc,v 1.83 2000/05/07 04:37:56 steve Exp $"
+#ident "$Id: design_dump.cc,v 1.84 2000/05/07 18:20:07 steve Exp $"
#endif
/*
@@ -850,7 +850,12 @@ void NetEScope::dump(ostream&o) const
void NetESFunc::dump(ostream&o) const
{
- o << name_ << "()";
+ o << name_ << "(";
+ if (nparms() > 0)
+ o << *parm(0);
+ for (unsigned idx = 1 ; idx < nparms() ; idx += 1)
+ o << ", " << *parm(idx);
+ o << ")";
}
void NetESignal::dump(ostream&o) const
@@ -955,6 +960,10 @@ void Design::dump(ostream&o) const
/*
* $Log: design_dump.cc,v $
+ * Revision 1.84 2000/05/07 18:20:07 steve
+ * Import MCD support from Stephen Tell, and add
+ * system function parameter support to the IVL core.
+ *
* Revision 1.83 2000/05/07 04:37:56 steve
* Carry strength values from Verilog source to the
* pform and netlist for gates.
View
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: dup_expr.cc,v 1.3 2000/05/04 03:37:58 steve Exp $"
+#ident "$Id: dup_expr.cc,v 1.4 2000/05/07 18:20:07 steve Exp $"
#endif
# include "netlist.h"
@@ -31,11 +31,19 @@ NetEScope* NetEScope::dup_expr() const
NetESFunc* NetESFunc::dup_expr() const
{
- return new NetESFunc(name_, expr_width());
+ NetESFunc*tmp = new NetESFunc(name_, expr_width(), nparms());
+ for (unsigned idx = 0 ; idx < nparms() ; idx += 1)
+ tmp->parm(idx, tmp->parm(idx)->dup_expr());
+
+ return tmp;
}
/*
* $Log: dup_expr.cc,v $
+ * Revision 1.4 2000/05/07 18:20:07 steve
+ * Import MCD support from Stephen Tell, and add
+ * system function parameter support to the IVL core.
+ *
* Revision 1.3 2000/05/04 03:37:58 steve
* Add infrastructure for system functions, move
* $time to that structure and add $random.
View
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: elab_expr.cc,v 1.24 2000/05/04 03:37:58 steve Exp $"
+#ident "$Id: elab_expr.cc,v 1.25 2000/05/07 18:20:07 steve Exp $"
#endif
@@ -142,25 +142,21 @@ NetEBinary* PEBinary::elaborate_expr_base_(Design*des,
return tmp;
}
-NetExpr* PECallFunction::elaborate_sfunc_(Design*des, NetScope*) const
+NetExpr* PECallFunction::elaborate_sfunc_(Design*des, NetScope*scope) const
{
- if (parms_.count() > 0) {
- cerr << get_line() << ": sorry: system function "
- "parmaeters not supported." << endl;
- des->errors += 1;
- return 0;
- }
+ unsigned wid = 32;
if (name_ == "$time")
- return new NetESFunc(name_, 64);
+ wid = 64;
- if (name_ == "$random")
- return new NetESFunc(name_, 32);
+ NetESFunc*fun = new NetESFunc(name_, wid, parms_.count());
+ for (unsigned idx = 0 ; idx < parms_.count() ; idx += 1) {
+ PExpr*expr = parms_[idx];
+ NetExpr*tmp = expr->elaborate_expr(des, scope);
+ fun->parm(idx, tmp);
+ }
- cerr << get_line() << ": sorry: system function " << name_
- << " not supported." << endl;
- des->errors += 1;
- return 0;
+ return fun;
}
NetExpr* PECallFunction::elaborate_expr(Design*des, NetScope*scope) const
@@ -467,6 +463,10 @@ NetEUnary* PEUnary::elaborate_expr(Design*des, NetScope*scope) const
/*
* $Log: elab_expr.cc,v $
+ * Revision 1.25 2000/05/07 18:20:07 steve
+ * Import MCD support from Stephen Tell, and add
+ * system function parameter support to the IVL core.
+ *
* Revision 1.24 2000/05/04 03:37:58 steve
* Add infrastructure for system functions, move
* $time to that structure and add $random.
View
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: netlist.cc,v 1.123 2000/05/07 04:37:56 steve Exp $"
+#ident "$Id: netlist.cc,v 1.124 2000/05/07 18:20:07 steve Exp $"
#endif
# include <cassert>
@@ -2234,21 +2234,54 @@ const NetScope* NetEScope::scope() const
return scope_;
}
-NetESFunc::NetESFunc(const string&n, unsigned width)
+NetESFunc::NetESFunc(const string&n, unsigned width, unsigned np)
: name_(n)
{
expr_width(width);
+ nparms_ = np;
+ parms_ = new NetExpr*[np];
+ for (unsigned idx = 0 ; idx < nparms_ ; idx += 1)
+ parms_[idx] = 0;
}
NetESFunc::~NetESFunc()
{
+ for (unsigned idx = 0 ; idx < nparms_ ; idx += 1)
+ if (parms_[idx]) delete parms_[idx];
+
+ delete[]parms_;
}
const string& NetESFunc::name() const
{
return name_;
}
+unsigned NetESFunc::nparms() const
+{
+ return nparms_;
+}
+
+void NetESFunc::parm(unsigned idx, NetExpr*v)
+{
+ assert(idx < nparms_);
+ if (parms_[idx])
+ delete parms_[idx];
+ parms_[idx] = v;
+}
+
+const NetExpr* NetESFunc::parm(unsigned idx) const
+{
+ assert(idx < nparms_);
+ return parms_[idx];
+}
+
+NetExpr* NetESFunc::parm(unsigned idx)
+{
+ assert(idx < nparms_);
+ return parms_[idx];
+}
+
NetESignal::NetESignal(NetNet*n)
: NetExpr(n->pin_count()), net_(n)
{
@@ -2604,6 +2637,10 @@ bool NetUDP::sequ_glob_(string input, char output)
/*
* $Log: netlist.cc,v $
+ * Revision 1.124 2000/05/07 18:20:07 steve
+ * Import MCD support from Stephen Tell, and add
+ * system function parameter support to the IVL core.
+ *
* Revision 1.123 2000/05/07 04:37:56 steve
* Carry strength values from Verilog source to the
* pform and netlist for gates.
View
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: netlist.h,v 1.136 2000/05/07 04:37:56 steve Exp $"
+#ident "$Id: netlist.h,v 1.137 2000/05/07 18:20:07 steve Exp $"
#endif
/*
@@ -2035,18 +2035,21 @@ class NetEScope : public NetExpr {
/*
* This node represents a system function call in an expression. The
* object contains the name of the system function, which the backend
- * uses to to VPI matching.
- *
- * XXXX NOTE: parameters are not net supported.
+ * uses to do VPI matching.
*/
class NetESFunc : public NetExpr {
public:
- NetESFunc(const string&name, unsigned width);
+ NetESFunc(const string&name, unsigned width, unsigned nprms);
~NetESFunc();
const string& name() const;
+ unsigned nparms() const;
+ void parm(unsigned idx, NetExpr*expr);
+ NetExpr* parm(unsigned idx);
+ const NetExpr* parm(unsigned idx) const;
+
virtual bool set_width(unsigned);
virtual void dump(ostream&) const;
@@ -2055,6 +2058,8 @@ class NetESFunc : public NetExpr {
private:
string name_;
+ unsigned nparms_;
+ NetExpr**parms_;
private: // not implemented
NetESFunc(const NetESFunc&);
@@ -2510,6 +2515,10 @@ extern ostream& operator << (ostream&, NetNet::Type);
/*
* $Log: netlist.h,v $
+ * Revision 1.137 2000/05/07 18:20:07 steve
+ * Import MCD support from Stephen Tell, and add
+ * system function parameter support to the IVL core.
+ *
* Revision 1.136 2000/05/07 04:37:56 steve
* Carry strength values from Verilog source to the
* pform and netlist for gates.
Oops, something went wrong.

0 comments on commit b28f258

Please sign in to comment.