synthesize the rvalue of <= statements.

This commit is contained in:
steve 2000-11-22 21:18:42 +00:00
parent 4ca0bffc7f
commit 92424eea10
2 changed files with 28 additions and 2 deletions

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: syn-rules.y,v 1.10 2000/11/11 00:03:36 steve Exp $"
#ident "$Id: syn-rules.y,v 1.11 2000/11/22 21:18:42 steve Exp $"
#endif
/*
@ -133,10 +133,17 @@ start
static void make_DFF_CE(Design*des, NetProcTop*top, NetEvWait*wclk,
NetEvent*eclk, NetExpr*cexp, NetAssignBase*asn)
{
assert(asn);
NetEvProbe*pclk = eclk->probe(0);
NetESignal*d = dynamic_cast<NetESignal*> (asn->rval());
NetNet*ce = cexp? cexp->synthesize(des) : 0;
if (d == 0) {
cerr << asn->get_line() << ": internal error: "
<< " not a simple signal? " << *asn->rval() << endl;
}
assert(d);
NetFF*ff = new NetFF(top->scope(), asn->l_val(0)->name(),

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: synth.cc,v 1.10 2000/05/13 20:55:47 steve Exp $"
#ident "$Id: synth.cc,v 1.11 2000/11/22 21:18:42 steve Exp $"
#endif
# include "functor.h"
@ -42,6 +42,7 @@ class do_expr : public proc_match_t {
Design*des_;
virtual int assign(NetAssign*);
virtual int assign_nb(NetAssignNB*);
virtual int event_wait(NetEvWait*);
//virtual int assign_mem(NetAssignMem*);
virtual int condit(NetCondit*);
@ -63,6 +64,21 @@ int do_expr::assign(NetAssign*stmt)
return 0;
}
int do_expr::assign_nb(NetAssignNB*stmt)
{
if (dynamic_cast<NetESignal*>(stmt->rval()))
return 0;
NetNet*tmp = stmt->rval()->synthesize(des_);
if (tmp == 0)
return 0;
NetESignal*tmpe = new NetESignal(tmp);
stmt->set_rval(tmpe);
return 0;
}
int do_expr::condit(NetCondit*stmt)
{
/* synthesize the condition expression, if necessary. */
@ -145,6 +161,9 @@ void synth(Design*des)
/*
* $Log: synth.cc,v $
* Revision 1.11 2000/11/22 21:18:42 steve
* synthesize the rvalue of <= statements.
*
* Revision 1.10 2000/05/13 20:55:47 steve
* Use yacc based synthesizer.
*