mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-08 04:20:49 +02:00
Fix the vpiObjTypeVal for signals to be scalar or vector.
Scalar signals have a preferred type of vpiScalarVal, but vectors
have a preferred type of vpiVectorVal. Use the signal width to
distinguish.
(cherry picked from commit 5fb89262df)
This commit is contained in:
+10
-1
@@ -696,7 +696,6 @@ static void signal_get_value(vpiHandle ref, s_vpi_value*vp)
|
||||
format_vpiStringVal(vsig, 0, wid, vp);
|
||||
break;
|
||||
|
||||
case vpiObjTypeVal:
|
||||
case vpiVectorVal:
|
||||
format_vpiVectorVal(vsig, 0, wid, vp);
|
||||
break;
|
||||
@@ -705,6 +704,16 @@ static void signal_get_value(vpiHandle ref, s_vpi_value*vp)
|
||||
format_vpiRealVal(vsig, 0, wid, rfp->signed_flag, vp);
|
||||
break;
|
||||
|
||||
case vpiObjTypeVal:
|
||||
if (wid == 1) {
|
||||
vp->format = vpiScalarVal;
|
||||
format_vpiScalarVal(vsig, 0, vp);
|
||||
} else {
|
||||
vp->format = vpiVectorVal;
|
||||
format_vpiVectorVal(vsig, 0, wid, vp);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "vvp internal error: get_value: "
|
||||
"value type %u not implemented."
|
||||
|
||||
Reference in New Issue
Block a user