[sv-cc] More information on C ABI's for those interested

From: Warmke, Doug <doug_warmke@mentorg.com>
Date: Wed Oct 13 2004 - 21:37:17 PDT

Hello folks,

I'm aware that Francoise and others from Cadence had
some concerns about our SV DPI standard not directly
addressing C datatype layout issues.

Here is some thoughtful information from one of our
low-level ABI experts:

   ABI specifications are not national or international
   standards but rather "industry" standards typically
   promulgated and controlled by a hardware or software
   vendor or the user community. A processor architecture
   may have more than one ABI, for example the Intel ia32
   (x86) family has ABIs for Linux, Microsoft Windows, and
   perhaps others. ABI specifications often change as
   processor architectures are enhanced or extended, or as
   components of the tool chain (compilers, linkers, loaders,
   libraries, operating systems, and utilities) are upgraded.
   Because the low level implementation details covered by
   ABI specifications practically defy standardization,
   high-level language standards almost universally say
   nothing about them.

   For Sun Solaris, the SPARC Compliance Definition document
   details the SPARC v8 (32-bit) and SPARC v9 (64-bit) ABIs.
   The SCD can be downloaded from the SPARC Standards
   Depository, http://www.sparc.org/standards.html.

   For Linux ABIs, look to http://www.linuxbase.org/spec/

   Google might be able to help find other ABI documents.

As I looked into those two standards repositories, I found the
following relevant documents on the Linux i386 ABI and Sparc ABI:

   http://www.caldera.com/developers/devspecs/abi386-4.pdf
   http://www.sparc.com/standards/psABI3rd.pdf

These documents directly and completely describe the rules
for layout, alignment, byte ordering, and padding in aggregate
types (struct, array) and unions. We have experimentally
confirmed all rules in the standards for both platforms.

In keeping with convention, it seems like our high-level
language standard should remain moot on this subject, with
the exception that it already specifies "layout of unpacked
type arguments must confrom to layouts used by C compilers".
Implementors of SystemVerilog are responsible to look up
such layouts in the appropriate C ABI specifications, and
then do the right thing.

Thanks and regards,
Doug
Received on Wed Oct 13 21:37:59 2004

This archive was generated by hypermail 2.1.8 : Wed Oct 13 2004 - 21:38:11 PDT