V0.8: allow vthr_vector to be converted to real.

This is a direct back port from development that allows vthread
vectors to be converted to real values. This is the first step
in fixing two more failures in the test suite.
This commit is contained in:
Cary R 2007-12-28 20:42:42 -08:00 committed by Stephen Williams
parent 3f16d3402a
commit f33d477166
1 changed files with 17 additions and 0 deletions

View File

@ -261,6 +261,23 @@ static void vthr_vec_get_value(vpiHandle ref, s_vpi_value*vp)
}
break;
case vpiRealVal:
vp->value.real = 0;
for (unsigned idx = wid ; idx > 0 ; idx -= 1) {
vp->value.real *= 2.0;
switch (get_bit(rfp, idx-1)) {
case 0:
break;
case 1:
vp->value.real += 1.0;
break;
case 2:
case 3:
break;
}
}
break;
case vpiVectorVal:
vp->value.vector = (s_vpi_vecval*)
need_result_buf((wid+31)/32*sizeof(s_vpi_vecval), RBUF_VAL);