[sv-cc] RE: DPI-OO: enums

From: Warmke, Doug <doug_warmke@mentor.com>
Date: Wed Aug 24 2011 - 09:49:15 PDT

Hi Vitaly and team,

A little historical background here.

The main driver of the SV enum type discussion in the old days was the SV-BC group.
There was debate about “hardware oriented” vs. “software oriented” enum type initialization.
i.e. should an enum initialize to its left-most enum literal, or should it initialize to the natural
initial value of its base type. In the end the hardware-side won out. It was a difficult philosophical
debate since enum types are used both in hardware descriptions (DUT) and software descriptions (TB).

SV-CC followed suit by considering enum types as their equivalent basetype. (See 35.5.6 in P1800-2012 D2).

That is the motivation in DPI-C. I don’t believe anything regarding enums in DPI-C should or needs to be
changed at this point.

Thanks,
Doug

From: owner-sv-cc@eda.org [mailto:owner-sv-cc@eda.org] On Behalf Of Vitaly Yankelevich
Sent: Wednesday, August 24, 2011 9:39 AM
To: Saha, Arnab
Cc: sv-cc@eda.org
Subject: [sv-cc] DPI-OO: enums

Hi Arnab,

In your summary of DPI-OO issues you wrote:

“Need to understand the motivation for how enums are represented in DPI-C. Mapping them directly to C++ enums is convenient as the symbolic names can be used in the foreign language instead of just values but 4 state enums are not supported. A compromise would be to map enum of base type int to C++ enums and represent all other types of enums

as values of the base type. IMO this should be extended in DPI-C and not DPI-OO if possible.”

I didn’t take part in the DPI-C discussions – hence I cannot provide any comments concerning the motivation there. Your comment concerning the 4-state base types is very valid. IMO we need to update the proposal, based on your comment, so that it will specify that the enumerated types which base type is 2-state shall be mapped to enumerations in the C++ intermediate layer. The enumerated types which base type is 4-state shall be mapped in the same way as in DPI-C.

We think that changing DPI-C is beyond our scope, however we would like to comment that DPI-C doesn’t export user-defined types at all.

Regards,

Vitaly

--
This message has been scanned for viruses and
dangerous content by MailScanner<http://www.mailscanner.info/>, and is
believed to be clean.
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Aug 24 09:49:47 2011

This archive was generated by hypermail 2.1.8 : Wed Aug 24 2011 - 09:49:49 PDT