Subject: RE: [sv-bc] Re: Separate Compilation
From: Jay Lawrence (lawrence@cadence.com)
Date: Thu May 08 2003 - 10:42:39 PDT
The question here is what is the meaning of "different type".
As long as 2 types are the same "shape" (topology) they are still
assignment compatible and can be associated on ports, task arguments,
etc. So who cares if they are declared in a different place and are
called different types, they are completely interchangeable.
Now if we are talking strong typing, then the 2 different typedefs below
would be different types and not be assignment compatible, this is
certainly not the intent in SystemVerilog.
I think the only place where there is still confusion on this is in the
area of enum's and whether they are strongly typed, the LRM is
self-contradictory and allows casting to enums. All other packed and
unpacked types are compatible just on shape. We added this explicitly
due to Matt's feedback.
Jay
===================================
Jay Lawrence
Senior Architect
Functional Verification
Cadence Design Systems, Inc.
(978) 262-6294
lawrence@cadence.com
===================================
> -----Original Message-----
> From: Karen Pieper [mailto:Karen.Pieper@synopsys.com]
> Sent: Thursday, May 08, 2003 1:29 PM
> To: Kevin Cameron x3251; sv-bc
> Subject: Re: [sv-bc] Re: Separate Compilation
>
>
> I've been told two or three times that
>
> typedef int x;
>
> x a;
>
> always begin {
> typedef int x;
>
> x b;
> }
>
> does not make a and b the same type. That would imply that
> seeing typdef
> of the same type several
> times in $root results in different types?
>
> K
>
>
> At 09:43 AM 5/8/03 -0700, Kevin Cameron x3251 wrote:
> >>http://www.eda.org/sv-bc/hm/0587.html
> >...
> >>The original purpose of $root was to share symbols,
> especially types.
> >>'include wouldn't work because you couldn't put a type
> declaration on a
> >>port. Two types declared in two separate places aren't the
> same even if
> >>they are identical.
> >
> >Can someone expand on this for me, why wouldn't identical
> types be the
> >same?
> >
> >Kev.
> >
> >--
> >National Semiconductor, Tel: (408) 721 3251
> >2900 Semiconductor Drive, Mail Stop D3-500, Santa Clara, CA
> 95052-8090
> >
> >
>
>
>
This archive was generated by hypermail 2b28 : Thu May 08 2003 - 10:44:26 PDT