Implement the < binary operator.

This commit is contained in:
steve 1999-06-07 03:40:22 +00:00
parent 4255ee116c
commit 66ac537c43
2 changed files with 24 additions and 3 deletions

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: vvm.h,v 1.7 1999/05/03 01:51:29 steve Exp $"
#ident "$Id: vvm.h,v 1.8 1999/06/07 03:40:22 steve Exp $"
#endif
# include <vector>
@ -71,6 +71,15 @@ inline vvm_bit_t operator ^ (vvm_bit_t l, vvm_bit_t r)
return (r == V0)? V1 : V0;
}
inline vvm_bit_t less_with_cascade(vvm_bit_t l, vvm_bit_t r, vvm_bit_t c)
{
if (l == Vx) return Vx;
if (r == Vx) return Vx;
if (l > r) return V0;
if (l < r) return V1;
return c;
}
extern vvm_bit_t add_with_carry(vvm_bit_t l, vvm_bit_t r, vvm_bit_t&carry);
inline vvm_bit_t not(vvm_bit_t l)
@ -268,6 +277,9 @@ template <unsigned WIDTH> class vvm_signal_t : public vvm_monitor_t {
/*
* $Log: vvm.h,v $
* Revision 1.8 1999/06/07 03:40:22 steve
* Implement the < binary operator.
*
* Revision 1.7 1999/05/03 01:51:29 steve
* Restore support for wait event control.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: vvm_func.h,v 1.5 1999/06/07 02:23:31 steve Exp $"
#ident "$Id: vvm_func.h,v 1.6 1999/06/07 03:40:22 steve Exp $"
#endif
# include "vvm.h"
@ -252,7 +252,13 @@ template <unsigned LW, unsigned RW>
vvm_bitset_t<1> vvm_binop_lt(const vvm_bitset_t<LW>&l,
const vvm_bitset_t<RW>&r)
{
assert(0); // Not implemented yet.
assert(LW == RW);
vvm_bitset_t<1> result;
result[0] = V0;
for (unsigned idx = 0 ; idx < LW ; idx += 1)
result[0] = less_with_cascade(l[idx], r[idx], result[0]);
return result;
}
template <unsigned LW, unsigned RW>
@ -277,6 +283,9 @@ vvm_bitset_t<1> vvm_binop_lor(const vvm_bitset_t<LW>&l,
/*
* $Log: vvm_func.h,v $
* Revision 1.6 1999/06/07 03:40:22 steve
* Implement the < binary operator.
*
* Revision 1.5 1999/06/07 02:23:31 steve
* Support non-blocking assignment down to vvm.
*