From a0526cdd3214187dccfd70fce12d89d38f3bdddc Mon Sep 17 00:00:00 2001 From: steve Date: Fri, 14 Dec 2001 06:03:17 +0000 Subject: [PATCH] Arrange bufif to support notif as well. --- vvp/bufif.cc | 13 ++++++++----- vvp/bufif.h | 21 +++++++++++---------- vvp/logic.cc | 15 ++++++++++++--- 3 files changed, 31 insertions(+), 18 deletions(-) diff --git a/vvp/bufif.cc b/vvp/bufif.cc index 84a93e2e7..7829673e4 100644 --- a/vvp/bufif.cc +++ b/vvp/bufif.cc @@ -17,14 +17,14 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: bufif.cc,v 1.4 2001/12/06 03:31:24 steve Exp $" +#ident "$Id: bufif.cc,v 1.5 2001/12/14 06:03:17 steve Exp $" #endif # include "bufif.h" # include "functor.h" # include "schedule.h" -void vvp_bufif1_s::set(vvp_ipoint_t ptr, bool push, unsigned v, unsigned) +void vvp_bufif_s::set(vvp_ipoint_t ptr, bool push, unsigned v, unsigned) { put(ptr, v); @@ -40,16 +40,16 @@ void vvp_bufif1_s::set(vvp_ipoint_t ptr, bool push, unsigned v, unsigned) unsigned val; unsigned str; - switch (in1 ^ pol) { + switch (in1 ^ pol_) { case 1: switch (in0) { case 0: - val = 0; + val = 0 ^ inv_; str = out0; break; case 1: - val = 1; + val = 1 ^ inv_; str = out1; break; default: @@ -85,6 +85,9 @@ void vvp_bufif1_s::set(vvp_ipoint_t ptr, bool push, unsigned v, unsigned) /* * $Log: bufif.cc,v $ + * Revision 1.5 2001/12/14 06:03:17 steve + * Arrange bufif to support notif as well. + * * Revision 1.4 2001/12/06 03:31:24 steve * Support functor delays for gates and UDP devices. * (Stephan Boettcher) diff --git a/vvp/bufif.h b/vvp/bufif.h index d14a81406..818d73555 100644 --- a/vvp/bufif.h +++ b/vvp/bufif.h @@ -19,28 +19,29 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: bufif.h,v 1.2 2001/10/31 04:27:46 steve Exp $" +#ident "$Id: bufif.h,v 1.3 2001/12/14 06:03:17 steve Exp $" #endif # include "functor.h" -class vvp_bufif1_s : public functor_s { +class vvp_bufif_s : public functor_s { public: - vvp_bufif1_s() : pol(0) {} + vvp_bufif_s(bool en_invert, bool out_invert) + : pol_(en_invert? 1 : 0), inv_(out_invert? 1 : 0) {} + virtual void set(vvp_ipoint_t i, bool push, unsigned val, unsigned str); - protected: - unsigned pol : 1; -}; -class vvp_bufif0_s : public vvp_bufif1_s { - - public: - vvp_bufif0_s() { pol = 1; } + private: + unsigned pol_ : 1; + unsigned inv_ : 1; }; /* * $Log: bufif.h,v $ + * Revision 1.3 2001/12/14 06:03:17 steve + * Arrange bufif to support notif as well. + * * Revision 1.2 2001/10/31 04:27:46 steve * Rewrite the functor type to have fewer functor modes, * and use objects to manage the different types. diff --git a/vvp/logic.cc b/vvp/logic.cc index b5afa4d58..ceec4c82e 100644 --- a/vvp/logic.cc +++ b/vvp/logic.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: logic.cc,v 1.5 2001/12/14 02:04:49 steve Exp $" +#ident "$Id: logic.cc,v 1.6 2001/12/14 06:03:17 steve Exp $" #endif # include "logic.h" @@ -83,10 +83,10 @@ void compile_functor(char*label, char*type, obj = new table_functor_s(ft_BUF, ostr0, ostr1); } else if (strcmp(type, "BUFIF0") == 0) { - obj = new vvp_bufif0_s; + obj = new vvp_bufif_s(true,false); } else if (strcmp(type, "BUFIF1") == 0) { - obj = new vvp_bufif1_s; + obj = new vvp_bufif_s(false,false); } else if (strcmp(type, "PMOS") == 0) { obj = new vvp_pmos_s; @@ -115,6 +115,12 @@ void compile_functor(char*label, char*type, } else if (strcmp(type, "NOT") == 0) { obj = new table_functor_s(ft_NOT, ostr0, ostr1); + } else if (strcmp(type, "NOTIF0") == 0) { + obj = new vvp_bufif_s(true,true); + + } else if (strcmp(type, "NOTIF1") == 0) { + obj = new vvp_bufif_s(false,true); + } else if (strcmp(type, "XNOR") == 0) { obj = new table_functor_s(ft_XNOR, ostr0, ostr1); @@ -146,6 +152,9 @@ void compile_functor(char*label, char*type, /* * $Log: logic.cc,v $ + * Revision 1.6 2001/12/14 06:03:17 steve + * Arrange bufif to support notif as well. + * * Revision 1.5 2001/12/14 02:04:49 steve * Support strength syntax on functors. *