Permalink
Browse files

Named events really should be expressed with PEIdent

 objects in the pform,

 Handle named events within the mix of net events
 and edges. As a unified lot they get caught together.
 wait statements are broken into more complex statements
 that include a conditional.

 Do not generate NetPEvent or NetNEvent objects in
 elaboration. NetEvent, NetEvWait and NetEvProbe
 take over those functions in the netlist.
  • Loading branch information...
steve
steve committed Apr 12, 2000
1 parent b0d0cdb commit b1fd927acbd256953c0ff2bd37a4a2775fdb60d4
Showing with 492 additions and 325 deletions.
  1. +66 −10 PExpr.cc
  2. +36 −23 PExpr.h
  3. +35 −1 Statement.cc
  4. +18 −6 Statement.h
  5. +22 −3 design_dump.cc
  6. +118 −42 elaborate.cc
  7. +14 −17 emit.cc
  8. +45 −5 net_event.cc
  9. +22 −9 netlist.h
  10. +9 −8 parse.y
  11. +28 −18 pform_dump.cc
  12. +14 −3 t-null.cc
  13. +14 −31 t-verilog.cc
  14. +23 −130 t-vvm.cc
  15. +14 −15 target.cc
  16. +14 −4 target.h
View
@@ -17,13 +17,17 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: PExpr.cc,v 1.15 2000/04/01 19:31:57 steve Exp $"
+#ident "$Id: PExpr.cc,v 1.16 2000/04/12 04:23:57 steve Exp $"
#endif
# include "PExpr.h"
# include "Module.h"
# include <typeinfo>
+PExpr::PExpr()
+{
+}
+
PExpr::~PExpr()
{
}
@@ -69,6 +73,11 @@ PECallFunction::~PECallFunction()
{
}
+PEConcat::PEConcat(const svector<PExpr*>&p, PExpr*r)
+: parms_(p), repeat_(r)
+{
+}
+
bool PEConcat::is_constant(Module *mod) const
{
bool constant = repeat_? repeat_->is_constant(mod) : true;
@@ -83,21 +92,16 @@ PEConcat::~PEConcat()
delete repeat_;
}
-PEEvent::PEEvent(NetNEvent::Type t, PExpr*e)
+PEEvent::PEEvent(PEEvent::edge_t t, PExpr*e)
: type_(t), expr_(e)
{
}
-PEEvent::PEEvent(const string&n)
-: name_(n)
-{
-}
-
PEEvent::~PEEvent()
{
}
-NetNEvent::Type PEEvent::type() const
+PEEvent::edge_t PEEvent::type() const
{
return type_;
}
@@ -107,9 +111,18 @@ PExpr* PEEvent::expr() const
return expr_;
}
-string PEEvent::name() const
+PEIdent::PEIdent(const string&s)
+: text_(s), msb_(0), lsb_(0), idx_(0)
{
- return name_;
+}
+
+PEIdent::~PEIdent()
+{
+}
+
+string PEIdent::name() const
+{
+ return text_;
}
/*
@@ -129,6 +142,22 @@ bool PEIdent::is_constant(Module*mod) const
return false;
}
+PENumber::PENumber(verinum*vp)
+: value_(vp)
+{
+ assert(vp);
+}
+
+PENumber::~PENumber()
+{
+ delete value_;
+}
+
+const verinum& PENumber::value() const
+{
+ return *value_;
+}
+
bool PENumber::is_the_same(const PExpr*that) const
{
const PENumber*obj = dynamic_cast<const PENumber*>(that);
@@ -143,6 +172,20 @@ bool PENumber::is_constant(Module*) const
return true;
}
+PEString::PEString(const string&s)
+: text_(s)
+{
+}
+
+PEString::~PEString()
+{
+}
+
+string PEString::value() const
+{
+ return text_;
+}
+
bool PEString::is_constant(Module*) const
{
return true;
@@ -164,6 +207,19 @@ bool PETernary::is_constant(Module*) const
/*
* $Log: PExpr.cc,v $
+ * Revision 1.16 2000/04/12 04:23:57 steve
+ * Named events really should be expressed with PEIdent
+ * objects in the pform,
+ *
+ * Handle named events within the mix of net events
+ * and edges. As a unified lot they get caught together.
+ * wait statements are broken into more complex statements
+ * that include a conditional.
+ *
+ * Do not generate NetPEvent or NetNEvent objects in
+ * elaboration. NetEvent, NetEvWait and NetEvProbe
+ * take over those functions in the netlist.
+ *
* Revision 1.15 2000/04/01 19:31:57 steve
* Named events as far as the pform.
*
View
59 PExpr.h
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: PExpr.h,v 1.34 2000/04/01 21:40:22 steve Exp $"
+#ident "$Id: PExpr.h,v 1.35 2000/04/12 04:23:57 steve Exp $"
#endif
# include <string>
@@ -44,7 +44,9 @@ class NetScope;
*/
class PExpr : public LineInfo {
+
public:
+ PExpr();
virtual ~PExpr();
virtual void dump(ostream&) const;
@@ -86,15 +88,17 @@ class PExpr : public LineInfo {
// of expresions.
virtual bool is_constant(Module*) const;
+ private: // not implemented
+ PExpr(const PExpr&);
+ PExpr& operator= (const PExpr&);
};
ostream& operator << (ostream&, const PExpr&);
class PEConcat : public PExpr {
public:
- PEConcat(const svector<PExpr*>&p, PExpr*r =0)
- : parms_(p), repeat_(r) { }
+ PEConcat(const svector<PExpr*>&p, PExpr*r =0);
~PEConcat();
virtual void dump(ostream&) const;
@@ -122,30 +126,28 @@ class PEConcat : public PExpr {
class PEEvent : public PExpr {
public:
+ enum edge_t {ANYEDGE, POSEDGE, NEGEDGE, POSITIVE};
+
// Use this constructor to create events based on edges or levels.
- PEEvent(NetNEvent::Type t, PExpr*e);
- // Use this to create named events.
- PEEvent(const string&n);
+ PEEvent(edge_t t, PExpr*e);
~PEEvent();
- NetNEvent::Type type() const;
- PExpr* expr() const;
- string name() const;
+ edge_t type() const;
+ PExpr* expr() const;
virtual void dump(ostream&) const;
private:
- NetNEvent::Type type_;
- PExpr*expr_;
- string name_;
+ edge_t type_;
+ PExpr *expr_;
};
class PEIdent : public PExpr {
public:
- explicit PEIdent(const string&s)
- : text_(s), msb_(0), lsb_(0), idx_(0) { }
+ explicit PEIdent(const string&s);
+ ~PEIdent();
virtual void dump(ostream&) const;
@@ -165,8 +167,7 @@ class PEIdent : public PExpr {
virtual bool is_constant(Module*) const;
verinum* eval_const(const Design*des, const string&path) const;
- // XXXX
- string name() const { return text_; }
+ string name() const;
private:
string text_;
@@ -190,11 +191,10 @@ class PEIdent : public PExpr {
class PENumber : public PExpr {
public:
- explicit PENumber(verinum*vp)
- : value_(vp) { assert(vp); }
- ~PENumber() { delete value_; }
+ explicit PENumber(verinum*vp);
+ ~PENumber();
- const verinum& value() const { return *value_; }
+ const verinum& value() const;
virtual void dump(ostream&) const;
virtual NetNet* elaborate_net(Design*des, const string&path,
@@ -216,10 +216,10 @@ class PENumber : public PExpr {
class PEString : public PExpr {
public:
- explicit PEString(const string&s)
- : text_(s) { }
+ explicit PEString(const string&s);
+ ~PEString();
- string value() const { return text_; }
+ string value() const;
virtual void dump(ostream&) const;
virtual NetEConst*elaborate_expr(Design*des, NetScope*) const;
@@ -358,6 +358,19 @@ class PECallFunction : public PExpr {
/*
* $Log: PExpr.h,v $
+ * Revision 1.35 2000/04/12 04:23:57 steve
+ * Named events really should be expressed with PEIdent
+ * objects in the pform,
+ *
+ * Handle named events within the mix of net events
+ * and edges. As a unified lot they get caught together.
+ * wait statements are broken into more complex statements
+ * that include a conditional.
+ *
+ * Do not generate NetPEvent or NetNEvent objects in
+ * elaboration. NetEvent, NetEvWait and NetEvProbe
+ * take over those functions in the netlist.
+ *
* Revision 1.34 2000/04/01 21:40:22 steve
* Add support for integer division.
*
View
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: Statement.cc,v 1.18 2000/04/01 19:31:57 steve Exp $"
+#ident "$Id: Statement.cc,v 1.19 2000/04/12 04:23:57 steve Exp $"
#endif
# include "Statement.h"
@@ -122,13 +122,29 @@ PCase::~PCase()
delete[]items_;
}
+PCondit::PCondit(PExpr*ex, Statement*i, Statement*e)
+: expr_(ex), if_(i), else_(e)
+{
+}
+
PCondit::~PCondit()
{
delete expr_;
delete if_;
delete else_;
}
+
+PDelayStatement::PDelayStatement(PExpr*d, Statement*st)
+: delay_(d), statement_(st)
+{
+}
+
+PDelayStatement::~PDelayStatement()
+{
+}
+
+
PEventStatement::PEventStatement(const svector<PEEvent*>&ee)
: expr_(ee), statement_(0)
{
@@ -146,6 +162,11 @@ PEventStatement::~PEventStatement()
// delete the events and the statement?
}
+void PEventStatement::set_statement(Statement*st)
+{
+ statement_ = st;
+}
+
PForever::PForever(Statement*s)
: statement_(s)
{
@@ -189,6 +210,19 @@ PWhile::~PWhile()
/*
* $Log: Statement.cc,v $
+ * Revision 1.19 2000/04/12 04:23:57 steve
+ * Named events really should be expressed with PEIdent
+ * objects in the pform,
+ *
+ * Handle named events within the mix of net events
+ * and edges. As a unified lot they get caught together.
+ * wait statements are broken into more complex statements
+ * that include a conditional.
+ *
+ * Do not generate NetPEvent or NetNEvent objects in
+ * elaboration. NetEvent, NetEvWait and NetEvProbe
+ * take over those functions in the netlist.
+ *
* Revision 1.18 2000/04/01 19:31:57 steve
* Named events as far as the pform.
*
Oops, something went wrong.

0 comments on commit b1fd927

Please sign in to comment.