diff --git a/vvm/vpi_bit.c b/vvm/vpi_bit.c index 722158870..a7732542e 100644 --- a/vvm/vpi_bit.c +++ b/vvm/vpi_bit.c @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: vpi_bit.c,v 1.4 2000/05/09 21:16:35 steve Exp $" +#ident "$Id: vpi_bit.c,v 1.5 2000/05/11 01:37:33 steve Exp $" #endif # include "vpi_priv.h" @@ -28,7 +28,7 @@ * bits are identical. This means that the VSSSvsss bits of the 8bit * value have V==v and SSS==sss. */ -#define UNAMBIG(v) (((v)&0x0f) == (((v)>>4)&0x0f)) +#define UNAMBIG(v) (! B_ISAMBIG(v)) # define STREN1(v) ( ((v)&0x80)? ((v)&0xf0) : (0x70 - ((v)&0xf0)) ) @@ -134,6 +134,9 @@ vpip_bit_t vpip_bits_resolve(const vpip_bit_t*bits, unsigned nbits) /* * $Log: vpi_bit.c,v $ + * Revision 1.5 2000/05/11 01:37:33 steve + * Calculate the X output value from drive0 and drive1 + * * Revision 1.4 2000/05/09 21:16:35 steve * Give strengths to logic and bufz devices. * diff --git a/vvm/vpi_priv.h b/vvm/vpi_priv.h index d9fbdeff2..ae73600be 100644 --- a/vvm/vpi_priv.h +++ b/vvm/vpi_priv.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: vpi_priv.h,v 1.19 2000/05/09 21:16:35 steve Exp $" +#ident "$Id: vpi_priv.h,v 1.20 2000/05/11 01:37:33 steve Exp $" #endif /* @@ -87,15 +87,24 @@ typedef unsigned char vpip_bit_t; # define StX 0xe6 # define HiZ 0x08 - /* Compare the logic values of two vpip_bit_t variables, or test - the logical value of the bit. */ + /* Compare the logic values of two vpip_bit_t variables. This + is like the === operator of Verilog, it ignored strengths. */ # define B_EQ(l,r) (((l)&0x88) == ((r)&0x88)) + + /* Test and return true if the value has ambiguous + strength. The logic value may yet be knowable. */ +# define B_ISAMBIG(v) (((v)&0x0f) != (((v)>>4)&0x0f)) + + /* Test whether the value is of the specified logic value. It + is possible for even ambiguous signals to have a known + logic value. */ # define B_IS0(v) (((v)&0x88) == 0x00) # define B_IS1(v) (((v)&0x88) == 0x88) # define B_ISX(v) (((v)&0x88) == 0x80) # define B_ISZ(v) ((v) == HiZ) # define B_ISXZ(v) (1 & (((v)>>7) ^ ((v)>>3))) + /* Take as input an array of bits, and return the resolved value. The result accounts for the strengths involved. */ extern vpip_bit_t vpip_pair_resolve(vpip_bit_t a, vpip_bit_t b); @@ -368,6 +377,9 @@ extern int vpip_finished(); /* * $Log: vpi_priv.h,v $ + * Revision 1.20 2000/05/11 01:37:33 steve + * Calculate the X output value from drive0 and drive1 + * * Revision 1.19 2000/05/09 21:16:35 steve * Give strengths to logic and bufz devices. * diff --git a/vvm/vvm_gates.cc b/vvm/vvm_gates.cc index 4e1527885..cc353cec0 100644 --- a/vvm/vvm_gates.cc +++ b/vvm/vvm_gates.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: vvm_gates.cc,v 1.15 2000/05/09 21:16:35 steve Exp $" +#ident "$Id: vvm_gates.cc,v 1.16 2000/05/11 01:37:33 steve Exp $" #endif # include "vvm_gates.h" @@ -52,16 +52,13 @@ vvm_1bit_out::~vvm_1bit_out() void vvm_1bit_out::drive0(vpip_bit_t v) { drive0_ = v; + driveX_ = (drive1_&0xf0) | (drive0_&0x0f); } void vvm_1bit_out::drive1(vpip_bit_t v) { drive1_ = v; -} - -void vvm_1bit_out::driveX(vpip_bit_t v) -{ - driveX_ = v; + driveX_ = (drive1_&0xf0) | (drive0_&0x0f); } void vvm_1bit_out::driveZ(vpip_bit_t v) @@ -353,6 +350,9 @@ void vvm_not::take_value(unsigned, vpip_bit_t val) /* * $Log: vvm_gates.cc,v $ + * Revision 1.16 2000/05/11 01:37:33 steve + * Calculate the X output value from drive0 and drive1 + * * Revision 1.15 2000/05/09 21:16:35 steve * Give strengths to logic and bufz devices. * diff --git a/vvm/vvm_gates.h b/vvm/vvm_gates.h index 832a93a56..c0571107b 100644 --- a/vvm/vvm_gates.h +++ b/vvm/vvm_gates.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: vvm_gates.h,v 1.62 2000/05/09 21:16:35 steve Exp $" +#ident "$Id: vvm_gates.h,v 1.63 2000/05/11 01:37:33 steve Exp $" #endif # include "vvm.h" @@ -71,7 +71,6 @@ class vvm_1bit_out : public vvm_nexus::drive_t { void drive0(vpip_bit_t); void drive1(vpip_bit_t); - void driveX(vpip_bit_t); void driveZ(vpip_bit_t); private: @@ -940,6 +939,9 @@ class vvm_posedge : public vvm_nexus::recvr_t { /* * $Log: vvm_gates.h,v $ + * Revision 1.63 2000/05/11 01:37:33 steve + * Calculate the X output value from drive0 and drive1 + * * Revision 1.62 2000/05/09 21:16:35 steve * Give strengths to logic and bufz devices. *