Parse non-blocking assignment delays.

This commit is contained in:
steve 1999-09-02 01:59:27 +00:00
parent 9f7eb4a935
commit 6fb7120158
4 changed files with 35 additions and 5 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: Statement.cc,v 1.12 1999/07/12 00:59:36 steve Exp $"
#ident "$Id: Statement.cc,v 1.13 1999/09/02 01:59:27 steve Exp $"
#endif
# include "Statement.h"
@ -58,6 +58,11 @@ PAssignNB::PAssignNB(PExpr*lval, PExpr*ex)
{
}
PAssignNB::PAssignNB(PExpr*lval, PExpr*d, PExpr*ex)
: PAssign_(lval, d, ex)
{
}
PAssignNB::~PAssignNB()
{
}
@ -143,6 +148,9 @@ PWhile::~PWhile()
/*
* $Log: Statement.cc,v $
* Revision 1.13 1999/09/02 01:59:27 steve
* Parse non-blocking assignment delays.
*
* Revision 1.12 1999/07/12 00:59:36 steve
* procedural blocking assignment delays.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: Statement.h,v 1.15 1999/07/12 00:59:36 steve Exp $"
#ident "$Id: Statement.h,v 1.16 1999/09/02 01:59:27 steve Exp $"
#endif
# include <string>
@ -114,6 +114,7 @@ class PAssignNB : public PAssign_ {
public:
explicit PAssignNB(PExpr*lval, PExpr*ex);
explicit PAssignNB(PExpr*lval, PExpr*de, PExpr*ex);
~PAssignNB();
virtual void dump(ostream&out, unsigned ind) const;
@ -333,6 +334,9 @@ class PWhile : public Statement {
/*
* $Log: Statement.h,v $
* Revision 1.16 1999/09/02 01:59:27 steve
* Parse non-blocking assignment delays.
*
* Revision 1.15 1999/07/12 00:59:36 steve
* procedural blocking assignment delays.
*

View File

@ -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.75 1999/09/01 20:46:19 steve Exp $"
#ident "$Id: elaborate.cc,v 1.76 1999/09/02 01:59:27 steve Exp $"
#endif
/*
@ -1441,11 +1441,17 @@ NetProc* PAssignNB::elaborate(Design*des, const string&path) const
assert(rval());
if (delay()) {
cerr << get_line() << ": sorry, cannot elaborate delays"
" is non-blocking assignments." << endl;
return 0;
}
/* Elaborate the r-value expression. This generates a
procedural expression that I attach to the assignment. */
NetExpr*rv = rval()->elaborate_expr(des, path);
if (rv == 0) {
cerr << get_line() << ": " << "failed to elaborate expression."
cerr << get_line() << ": failed to elaborate expression."
<< endl;
return 0;
}
@ -2165,6 +2171,9 @@ Design* elaborate(const map<string,Module*>&modules,
/*
* $Log: elaborate.cc,v $
* Revision 1.76 1999/09/02 01:59:27 steve
* Parse non-blocking assignment delays.
*
* Revision 1.75 1999/09/01 20:46:19 steve
* Handle recursive functions and arbitrary function
* references to other functions, properly pass

11
parse.y
View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: parse.y,v 1.61 1999/08/27 15:08:37 steve Exp $"
#ident "$Id: parse.y,v 1.62 1999/09/02 01:59:27 steve Exp $"
#endif
# include "parse_misc.h"
@ -1580,6 +1580,15 @@ statement
tmp->set_lineno(@1.first_line);
$$ = tmp;
}
| lpvalue K_LE delay expression ';'
{ PExpr*del = (*$3)[0];
if ($3->count() != 1)
yyerror(@1, "Sorry, delay lists not supported here.");
PAssignNB*tmp = new PAssignNB($1,del,$4);
tmp->set_file(@1.text);
tmp->set_lineno(@1.first_line);
$$ = tmp;
}
| K_wait '(' expression ')' statement_opt
{ PEventStatement*tmp;
PEEvent*etmp = new PEEvent(NetNEvent::POSITIVE, $3);