diff --git a/include/verilated_vpi.cpp b/include/verilated_vpi.cpp index efd2feaf1..c728e7dcd 100644 --- a/include/verilated_vpi.cpp +++ b/include/verilated_vpi.cpp @@ -2850,7 +2850,7 @@ bool vl_check_array_format(const VerilatedVar* varp, const p_vpi_arrayvalue arra } } else if (arrayvalue_p->format == vpiRealVal) { switch (varp->vltype()) { - case VLVT_REAL: + case VLVT_UINT64: return status; default: status = false; @@ -3000,6 +3000,25 @@ void vl_get_value_array(vpiHandle object, p_vpi_arrayvalue arrayvalue_p, return; } + else if(arrayvalue_p->format==vpiRealVal) { + + double *reals; + + if (arrayvalue_p->flags & vpiUserAllocFlag) { + reals = arrayvalue_p->value.reals; + } else { + reals = (double*)malloc(num * 8); + arrayvalue_p->value.reals = reals; + } + if(varp->vltype()==VLVT_UINT64) { + QData *ptr = reinterpret_cast(vop->varDatap()); + for (int i = 0; i < num; i++) { + reals[i] = ptr[index++]; + index = index % size; + } + } + return; + } VL_VPI_ERROR_(__FILE__, __LINE__, "%s: Unsupported format (%s) as requested for %s", __func__, VerilatedVpiError::strFromVpiVal(arrayvalue_p->format), vop->fullname());