Re: [sv-bc] DataTypes: wording for optional "var"

From: Neil Korpusik <Neil.Korpusik@sun.com>
Date: Thu Nov 18 2004 - 17:49:47 PST

This seems to create potential coding errors.

Today we know that if someone codes up the following

   typedef my_logic;

that my_logic will be defined at some point later in the code. If we also
allow this to be a shorthand for

   typedef logic my_logic;

we could end up with coding errors due to people forgetting to provide the
true definition for my_logic. The definition of my_logic will end up being

   typedef logic my_logic;

Based on this I am voicing my dislike of this change. The savings in typing
seems to be outweighted by the potential problems.

Neil

Kathy McKinley wrote:
> I like this idea, but I agree that it is beyond the scope of this
> proposal. I think that it would be worth bringing up when the var
> proposal is discussed, just to get people thinking about it.
>
>
>>Date: Thu, 18 Nov 2004 19:16:23 -0500 (EST)
>>From: Steven Sharp <sharp@cadence.com>
>>Subject: RE: [sv-bc] DataTypes: wording for optional "var"
>>To: btf-dtype@boyd.com, sv-bc@eda.org, Brad.Pierce@synopsys.com
>>
>>
>>>There would be an ambiguity on
>>>
>>> typedef my_logic ;
>>>
>>>Is that a forward typedef or
>>>
>>> typedef logic my_logic ;
>>
>>Good point. That is a bit of a flaw.
>>
>>
>>
>>>Otherwise it makes sense to me. The only BNF change needed would be
>>>in A.2.1.3 and Syntax 3-2, in type_declaration, REPLACE
>>>
>>> data_type
>>>
>>>WITH
>>>
>>> data_type_or_implicit
>>>
>>>Plus some footnote to resolve the ambiguity of
>>>
>>> typedef my_logic ;
>>
>>I will withdraw the suggestion on the grounds that it is getting beyond
>>the scope of this proposal, and we don't have much time. However, it
>>might be something to keep in mind. It would be consistent. It would
>>be nice that you could take whatever syntax appears in the data_type spot
>>in a declaration and use that in a typedef for a type to replace it.
>>
>>Steven Sharp
>>sharp@cadence.com
>>

-- 
---------------------------------------------------------------------
Neil Korpusik                                     Tel: 408-720-4852
Member of Technical Staff                         Fax: 408-720-4850
Frontend Technologies - ASICs & Processors (FTAP)
Sun Microsystems
email: neil.korpusik@sun.com
---------------------------------------------------------------------
Received on Thu Nov 18 17:49:52 2004

This archive was generated by hypermail 2.1.8 : Thu Nov 18 2004 - 17:49:56 PST