RE: [sv-bc] 6.9.2 Equivalent types - question

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Tue Nov 22 2005 - 06:57:31 PST
Note also the last paragraph before 6.9.1, which also makes a
distinction between packed and unpacked structs and unions with respect
to matching and equivalence:

"To have type matching or equivalence among multiple instances of the
same module, interface or program, a class, enum, unpacked structure or
unpacked union type must be declared at a higher level in the
compilation unit scope than the declaration of the module, interface or
program, or imported from a package. For type matching, this is true
even for packed structure and packed union types."

Shalom


>-----Original Message-----
>From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On
>Behalf Of Bresticker, Shalom
>Sent: Tuesday, November 22, 2005 12:05 PM
>To: Greg Jaxon
>Cc: sv-bc@eda.org
>Subject: RE: [sv-bc] 6.9.2 Equivalent types - question
>
>OK, let me clarify my comments.
>
>The structure of each sub-section of 6.9 is to say that each
>level of
>compatibility includes everything included in the preceding
>level, plus
>a list of additional cases.
>
>In particular, 6.9.2 (1) says, "If two types match, they are
>equivalent.".
>
>This IMPLIES, or at least, gives the impression, that 6.9.2 (2)
>describes a case not included in (1), i.e., NON-matching.
>
>This implication/impression is strengthened by the fact that
>the example
>in 6.9.1 (3) is of PACKED structs, whereas the text of 6.9.2
>(2) and its
>example are of UNPACKED structs.
>
>The combination of these facts gives a strong impression that
>6.9.1(3)
>was intended to relate only to packed structs and unions.
>
>Since both Francoise and Greg seem to agree that 6.9.1(3) does
>indeed
>apply to unpacked as well as packed structs and unions,
>6.9.2(2) should be deleted and the example of 6.9.1(3) should
>be of
>unpacked structs.
>
>Thanks,
>Shalom
>
>>-----Original Message-----
>>From: Greg Jaxon [mailto:Greg.Jaxon@synopsys.com]
>>Sent: Monday, November 21, 2005 8:27 PM
>>To: Bresticker, Shalom
>>Cc: sv-bc@eda.org
>>Subject: Re: [sv-bc] 6.9.2 Equivalent types - question
>>
>>The relationship between Matching and Equivalence here could
>>be made clearer by changing 6.9.2(2) to say
>>
>>"2) Anonymous enum, unpacked struct, or unpacked union types
>>     are Equivalent if and only if they are Matching."
>>
>>Shalom is right that for these cases, Equivalence is /not/
>>weaker
>>than Matching.  These are the types for which our goal was to
>>provide "strong type checking", so for these, equivalence
>makes
>>no compromises and becomes as strong as exact matching.
>>
>>Greg Jaxon
>>Synopsys DCSV
>>
>>Bresticker, Shalom wrote:
>>> Hi,
>>>
>>> I have a question on Matching types vs. Equivalent types.
>>>
>>> 6.9.1(3) says,
>>>
>>> "3) An anonymous enum, struct, or union type matches itself
>>among data objects declared within the same declaration
>>statement and no other data types.
>>>
>>> struct packed {int A; int B;} AB1, AB2;// AB1, AB2 have
>>matching types
>>> struct packed {int A; int B;} AB3;     // the type of AB3
>>does not match the type of AB1"
>>>
>>>
>>> 6.9.2(2) says,
>>>
>>> "2) An anonymous enum, unpacked struct, or unpacked union
>>type is equivalent to itself among data objects declared
>within
>>the same declaration statement and no other data types.
>>>
>>> struct {int A; int B;} AB1, AB2; // AB1, AB2 have equivalent
>>types
>>> struct {int A; int B;} AB3;      // AB3 is not type
>>equivalent to AB1"
>>>
>>>
>>> If we look at the two texts, it seems that the case
>described
>>by 6.9.2(2) is included in 6.9.1(3). 6.9.2(2) relates only to
>>unpacked structs and unions (ignoring enums for now), whereas
>>6.9.1(3) makes no distinction between unpacked and packed
>>structs and unions.
>>>
>>> The example of 6.9.1(3) is of packed structs, but the text
>>makes no such restriction.
>>>
>>> Since matching is stronger than equivalence, this seems
>>strange.
>>>
>>> Comments?
>>>
>>> Thanks,
>>> Shalom
>>>
>>>
>>> Shalom Bresticker
>>> Intel Jerusalem LAD DA
>>> +972 2 589-6852
>>> +972 54 721-1033
>>> I don't represent Intel
>>>
>>>
>
Received on Tue Nov 22 06:57:42 2005

This archive was generated by hypermail 2.1.8 : Tue Nov 22 2005 - 06:59:10 PST