From 466ab5c2c70278fef2ee1735bc364c989266adb2 Mon Sep 17 00:00:00 2001 From: steve Date: Wed, 15 Jun 2005 00:47:15 +0000 Subject: [PATCH] Resolv do not propogate inputs that do not change. --- vvp/resolv.cc | 8 +++++++- vvp/vvp_net.cc | 21 ++++++++++++++++++++- vvp/vvp_net.h | 9 ++++++++- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/vvp/resolv.cc b/vvp/resolv.cc index 531dcd8bd..5dd00f5d6 100644 --- a/vvp/resolv.cc +++ b/vvp/resolv.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: resolv.cc,v 1.23 2005/04/13 06:34:20 steve Exp $" +#ident "$Id: resolv.cc,v 1.24 2005/06/15 00:47:15 steve Exp $" #endif # include "resolv.h" @@ -64,6 +64,9 @@ void resolv_functor::recv_vec8(vvp_net_ptr_t port, vvp_vector8_t bit) unsigned pdx = port.port(); vvp_net_t*ptr = port.ptr(); + if (val_[pdx].eeq(bit)) + return; + val_[pdx] = bit; vvp_vector8_t out (bit); @@ -90,6 +93,9 @@ void resolv_functor::recv_vec8(vvp_net_ptr_t port, vvp_vector8_t bit) /* * $Log: resolv.cc,v $ + * Revision 1.24 2005/06/15 00:47:15 steve + * Resolv do not propogate inputs that do not change. + * * Revision 1.23 2005/04/13 06:34:20 steve * Add vvp driver functor for logic outputs, * Add ostream output operators for debugging. diff --git a/vvp/vvp_net.cc b/vvp/vvp_net.cc index 68108a9ec..105be1d59 100644 --- a/vvp/vvp_net.cc +++ b/vvp/vvp_net.cc @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#ident "$Id: vvp_net.cc,v 1.31 2005/06/13 00:54:04 steve Exp $" +#ident "$Id: vvp_net.cc,v 1.32 2005/06/15 00:47:15 steve Exp $" # include "config.h" # include "vvp_net.h" @@ -632,6 +632,22 @@ void vvp_vector8_t::set_bit(unsigned idx, vvp_scalar_t val) bits_[idx] = val; } +bool vvp_vector8_t::eeq(const vvp_vector8_t&that) const +{ + if (size_ != that.size_) + return false; + + if (size_ == 0) + return true; + + for (unsigned idx = 0 ; idx < size_ ; idx += 1) { + if (! bits_[idx] .eeq( that.bits_[idx] )) + return false; + } + + return true; +} + ostream& operator<<(ostream&out, const vvp_vector8_t&that) { out << "C8<"; @@ -1393,6 +1409,9 @@ vvp_bit4_t compare_gtge_signed(const vvp_vector4_t&a, /* * $Log: vvp_net.cc,v $ + * Revision 1.32 2005/06/15 00:47:15 steve + * Resolv do not propogate inputs that do not change. + * * Revision 1.31 2005/06/13 00:54:04 steve * More unified vec4 to hex string functions. * diff --git a/vvp/vvp_net.h b/vvp/vvp_net.h index 5fdece21e..ab40d7e0b 100644 --- a/vvp/vvp_net.h +++ b/vvp/vvp_net.h @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#ident "$Id: vvp_net.h,v 1.33 2005/06/14 00:42:06 steve Exp $" +#ident "$Id: vvp_net.h,v 1.34 2005/06/15 00:47:15 steve Exp $" # include "config.h" # include @@ -196,6 +196,7 @@ class vvp_scalar_t { unsigned strength0() const; unsigned strength1() const; + bool eeq(vvp_scalar_t that) const { return value_ == that.value_; } bool is_hiz() const { return value_ == 0; } private: @@ -233,6 +234,9 @@ class vvp_vector8_t { vvp_scalar_t value(unsigned idx) const; void set_bit(unsigned idx, vvp_scalar_t val); + // Test that the vectors are exactly equal + bool eeq(const vvp_vector8_t&that) const; + vvp_vector8_t(const vvp_vector8_t&that); vvp_vector8_t& operator= (const vvp_vector8_t&that); @@ -756,6 +760,9 @@ class vvp_wide_fun_t : public vvp_net_fun_t { /* * $Log: vvp_net.h,v $ + * Revision 1.34 2005/06/15 00:47:15 steve + * Resolv do not propogate inputs that do not change. + * * Revision 1.33 2005/06/14 00:42:06 steve * Accomodate fussy compilers. *