We investigated an alternative approach to packed type binary
compatibility based on byte allocation.
Overall, we believe that the original proposal -- based on 4-byte (C
unsigned int) allocation --
offers more advantages. Thus, we encourage adopting the original item
205 proposal.
Here is a short review of the alternative approach and our reasons for
favoring the original proposal.
Byte-based Allocation for Packed Types
The approach would standardize the size of packed type 'actual'
implementation formats,
making actual format size equal to the smallest number of bytes (C
unsigned chars) needed to represent
.. a 2-state packed type:
.. a 4-state packed type if cvals and dvals were carried in separate
bytes (though they need not be).
DISCUSSION:
. The scheme uses the smallest storage unit that could reasonably be
employed to interact with C and
has desirable struct field alignment properties.
. However, this layout is most likely to match actual formats for SV
memories (unpacked array of packed types),
rather than stand-alone packed types. Since we think stand-alone uses
will be far more prevalent,
this scheme is likely to avoid marshalling for rarer cases but require
it for more common cases.
SUMMARY
We think that the original proposal (based on allocating in 4-byte
chunks) provides the most benefits,
when compared to either the 1-byte approach or to the current
binary/source compatibility scheme:
. binary compatibility for packed types,
. a single compatibility scheme for users to understand,
. an intuitive macro interface that reveals data type and array
dimensions,
. a single base type to drive alignment behavior,
. minimized data marshalling for the most likely uses of packed types.
Ralph Duncan
Mentor Graphics
San Jose, CA
Received on Wed Oct 20 14:05:55 2004
This archive was generated by hypermail 2.1.8 : Wed Oct 20 2004 - 14:06:00 PDT