Arrange bufif to support notif as well.

This commit is contained in:
steve 2001-12-14 06:03:17 +00:00
parent 4dd5f97a96
commit a0526cdd32
3 changed files with 31 additions and 18 deletions

View File

@ -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)

View File

@ -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.

View File

@ -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.
*