From 9d2e22576e24bd69ee20dae80f4a6db9eea89763 Mon Sep 17 00:00:00 2001 From: steve Date: Tue, 3 Apr 2001 03:18:34 +0000 Subject: [PATCH] support functor_set push for blocking assignment. --- vvp/functor.cc | 16 +++++++++++----- vvp/functor.h | 7 +++++-- vvp/vthread.cc | 7 +++++-- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/vvp/functor.cc b/vvp/functor.cc index 4854e4dc6..a2eadf37c 100644 --- a/vvp/functor.cc +++ b/vvp/functor.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: functor.cc,v 1.9 2001/03/31 19:29:23 steve Exp $" +#ident "$Id: functor.cc,v 1.10 2001/04/03 03:18:34 steve Exp $" #endif # include "functor.h" @@ -132,7 +132,7 @@ functor_t functor_index(vvp_ipoint_t point) return functor_table[point]->table[index1]->table + index0; } -static void functor_set_mode0(vvp_ipoint_t ptr, functor_t fp) +static void functor_set_mode0(vvp_ipoint_t ptr, functor_t fp, bool push) { /* Locate the new output value in the table. */ unsigned char out = fp->table[fp->ival >> 2]; @@ -142,7 +142,10 @@ static void functor_set_mode0(vvp_ipoint_t ptr, functor_t fp) /* If the output changes, then create a propagation event. */ if (out != fp->oval) { fp->oval = out; - schedule_functor(ptr, 0); + if (push) + functor_propagate(ptr); + else + schedule_functor(ptr, 0); } } @@ -209,7 +212,7 @@ static void functor_set_mode2(functor_t fp) * output. If the output changes any, then generate the necessary * propagation events to pass the output on. */ -void functor_set(vvp_ipoint_t ptr, unsigned bit) +void functor_set(vvp_ipoint_t ptr, unsigned bit, bool push) { functor_t fp = functor_index(ptr); unsigned pp = ipoint_port(ptr); @@ -223,7 +226,7 @@ void functor_set(vvp_ipoint_t ptr, unsigned bit) switch (fp->mode) { case 0: - functor_set_mode0(ptr, fp); + functor_set_mode0(ptr, fp, push); break; case 1: functor_set_mode1(fp); @@ -297,6 +300,9 @@ const unsigned char ft_var[16] = { /* * $Log: functor.cc,v $ + * Revision 1.10 2001/04/03 03:18:34 steve + * support functor_set push for blocking assignment. + * * Revision 1.9 2001/03/31 19:29:23 steve * Fix compilation warnings. * diff --git a/vvp/functor.h b/vvp/functor.h index f326c1ac7..364226b29 100644 --- a/vvp/functor.h +++ b/vvp/functor.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: functor.h,v 1.8 2001/04/01 21:31:46 steve Exp $" +#ident "$Id: functor.h,v 1.9 2001/04/03 03:18:34 steve Exp $" #endif # include "pointers.h" @@ -112,7 +112,7 @@ extern vvp_ipoint_t functor_allocate(unsigned wid); * calculates a new output value. If there is any propagation to do, * propagation events are created. */ -extern void functor_set(vvp_ipoint_t point, unsigned val); +extern void functor_set(vvp_ipoint_t point, unsigned val, bool push=false); extern unsigned functor_get(vvp_ipoint_t ptr); @@ -145,6 +145,9 @@ extern const unsigned char ft_var[]; /* * $Log: functor.h,v $ + * Revision 1.9 2001/04/03 03:18:34 steve + * support functor_set push for blocking assignment. + * * Revision 1.8 2001/04/01 21:31:46 steve * Add the buf functor type. * diff --git a/vvp/vthread.cc b/vvp/vthread.cc index 15481f9d1..26d2e63c7 100644 --- a/vvp/vthread.cc +++ b/vvp/vthread.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: vthread.cc,v 1.20 2001/04/01 22:25:33 steve Exp $" +#ident "$Id: vthread.cc,v 1.21 2001/04/03 03:18:34 steve Exp $" #endif # include "vthread.h" @@ -475,7 +475,7 @@ bool of_OR(vthread_t thr, vvp_code_t cp) bool of_SET(vthread_t thr, vvp_code_t cp) { unsigned char bit_val = thr_get_bit(thr, cp->bit_idx1); - functor_set(cp->iptr, bit_val); + functor_set(cp->iptr, bit_val, true); return true; } @@ -504,6 +504,9 @@ bool of_WAIT(vthread_t thr, vvp_code_t cp) /* * $Log: vthread.cc,v $ + * Revision 1.21 2001/04/03 03:18:34 steve + * support functor_set push for blocking assignment. + * * Revision 1.20 2001/04/01 22:25:33 steve * Add the reduction nor instruction. *