From f33d477166752ff608b2c4c4390bebe978a4f3e5 Mon Sep 17 00:00:00 2001 From: Cary R Date: Fri, 28 Dec 2007 20:42:42 -0800 Subject: [PATCH] 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. --- vvp/vpi_vthr_vector.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/vvp/vpi_vthr_vector.cc b/vvp/vpi_vthr_vector.cc index 04ee6292e..8419c0340 100644 --- a/vvp/vpi_vthr_vector.cc +++ b/vvp/vpi_vthr_vector.cc @@ -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);