> You can see that the DPI 4-state canonical encoding is reversed from
> PLI's aval/bval representation.
> To be compatable with IEEE PLI, we should name those fields a and b
> rather than c and d,
> and we should reverse their order in the typedef struct.
>
> We would like to be compatible with Verilog legacy IEEE 1364 conventions
> in this case,
> as is stated in the blue text above.
> Somehow we all must have overlooked the technical
> incompatibility identified in this mail
No, it was not an overlook. DPI had been derived from VCS DirectC.
VCS DirectC uses c/d representation instead of aval/bval.
Do we want to be compatible with IEEE PLI conventions?
I don't think so.
First, the canonical representation defined in DPI is not meant for PLI.
The representation of unpacked arrays (formerly known as "memories") defined
in PLI is unsuitable for SV, see "struct memval", IEEE 1364-1995 section 21.35
Fig.21-9.
Then, PLI does not define 2-state types.
So I think that pretending that the canonical representation is compatible
with IEEE PLI would add confusion rather than make things cleaner.
The canonical representation in DPI is not IEEE PLI. Period.
Besides, there is no issue of legacy PLI C code being transitioned to DPI.
There are way too many differences. There is, however, legacy DirectC code.
So personally I'm more concerned with DPI/DirectC compatibility than with
DPI/PLI compatibility.
Regards,
Andrzej
> In SV 3.1a E.6.7, there is a discussion of canonical value
> representation.
> The following statement appears:
>
>
>
> The Direct Programming Interface defines the canonical representation of
> packed 2-state (type svBitVec32)
> and 4-state arrays (type svLogicVec32). This canonical representation is
> derived from on the Verilog legacy
> PLI's avalue/bvalue representation of 4-state vectors.
>
> Next, table E.2 and the associated typedef in svdpi.h:
>
> Table E-2: Encoding of bits in svLogicVec32
>
> c d Value
> 0 0 0
> 0 1 1
> 1 0 z
> 1 1 x
>
> typedef struct { unsigned int c; unsigned int d;} svLogicVec32; /* (a
> chunk of) packed logic array */
>
>
>
> Now, here is an excerpt IEEE 1364-2001c's VPI section 27.14:
>
> Figure 178-The s_vpi_value structure definition
>
> typedef struct t_vpi_vecval
> {
> /* following fields are repeated enough times to contain vector */
> PLI_INT32 aval, bval; /* bit encoding: ab: 00=0, 10=1, 11=X, 01=Z */
> } s_vpi_vecval, *p_vpi_vecval;
>
>
>
>
> Thanks and regards,
> Doug
>
Received on Thu Apr 15 12:45:56 2004
This archive was generated by hypermail 2.1.8 : Thu Apr 15 2004 - 12:45:59 PDT