mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-28 16:53:45 +02:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user