Get vpiVectorVal from memory words.
This commit is contained in:
parent
50ad415c0d
commit
a721586acb
|
|
@ -18,7 +18,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CVS_IDENT
|
#ifdef HAVE_CVS_IDENT
|
||||||
#ident "$Id: vpi_memory.cc,v 1.29 2006/02/21 02:39:27 steve Exp $"
|
#ident "$Id: vpi_memory.cc,v 1.30 2006/02/21 02:56:49 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "vpi_priv.h"
|
# include "vpi_priv.h"
|
||||||
|
|
@ -453,7 +453,6 @@ static void memory_word_get_value(vpiHandle ref, s_vpi_value*vp)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if 0
|
|
||||||
case vpiVectorVal: {
|
case vpiVectorVal: {
|
||||||
unsigned hwid = (width - 1)/32 + 1;
|
unsigned hwid = (width - 1)/32 + 1;
|
||||||
|
|
||||||
|
|
@ -463,20 +462,20 @@ static void memory_word_get_value(vpiHandle ref, s_vpi_value*vp)
|
||||||
|
|
||||||
op->aval = op->bval = 0;
|
op->aval = op->bval = 0;
|
||||||
for (unsigned idx = 0 ; idx < width ; idx += 1) {
|
for (unsigned idx = 0 ; idx < width ; idx += 1) {
|
||||||
switch (memory_get(rfp->mem->mem, bidx+idx)) {
|
switch (word_val.value(idx)) {
|
||||||
case 0:
|
case BIT4_0:
|
||||||
op->aval &= ~(1 << idx % 32);
|
op->aval &= ~(1 << idx % 32);
|
||||||
op->bval &= ~(1 << idx % 32);
|
op->bval &= ~(1 << idx % 32);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case BIT4_1:
|
||||||
op->aval |= (1 << idx % 32);
|
op->aval |= (1 << idx % 32);
|
||||||
op->bval &= ~(1 << idx % 32);
|
op->bval &= ~(1 << idx % 32);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case BIT4_X:
|
||||||
op->aval |= (1 << idx % 32);
|
op->aval |= (1 << idx % 32);
|
||||||
op->bval |= (1 << idx % 32);
|
op->bval |= (1 << idx % 32);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case BIT4_Z:
|
||||||
op->aval &= ~(1 << idx % 32);
|
op->aval &= ~(1 << idx % 32);
|
||||||
op->bval |= (1 << idx % 32);
|
op->bval |= (1 << idx % 32);
|
||||||
break;
|
break;
|
||||||
|
|
@ -488,7 +487,6 @@ static void memory_word_get_value(vpiHandle ref, s_vpi_value*vp)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -555,6 +553,9 @@ vpiHandle vpip_make_memory(vvp_memory_t mem, const char*name)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: vpi_memory.cc,v $
|
* $Log: vpi_memory.cc,v $
|
||||||
|
* Revision 1.30 2006/02/21 02:56:49 steve
|
||||||
|
* Get vpiVectorVal from memory words.
|
||||||
|
*
|
||||||
* Revision 1.29 2006/02/21 02:39:27 steve
|
* Revision 1.29 2006/02/21 02:39:27 steve
|
||||||
* Support string values for memory words.
|
* Support string values for memory words.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue