Francoise,
I am afraid I cannot agree. Currently the keyword interface is only used
for generic interface ports, not for ports of a known interface type.
I do not consider that the lookup of the type name is a significant
implementation burden, since all type names must be declared before use.
If the type "myl" is intended to be a data type, but is not visible, then
the use of "i" as an expression should generate a syntax error.
If the type "myl" is intended to be an interface, but is not visible,
putting an interface keyword in front of it will not help. It will still
be unresolved at elaboration time.
Peter.
At 15:05 09/03/2004 -0500, Francoise Martinolle wrote:
>Peter,
>
>what you said is true, I should have expressed my concern as:
>
> it would facilitate the parser task if the keyword interface were
> required for an interface declaration (no unnecessary lookup for type
> names), additionally it would improve readability and understandability
> of the code and help catch user errors at parse time rather than at
> elaboration. For example, in the current state, if a user forgets to make
> the type "myI" visible in the module variable "i "is declared, the parser
> will complete successfully and the elaborator will expect to find myI as
> an interface and would issue a message that myI cannot be resolved. All
> this pain can be suppressed by adding the keyword interface for an
> interface declaration. I think it would nicer if the parser could tell
> you immediately that the type myI is used but not visible in that context.
>
>Francoise
> '
>
>At 04:00 PM 3/9/2004 +0000, you wrote:
>>Hi Francoise,
>>
>>If myl is not a typedef or a class, then you know that i must be an
>>interface.
>>
>>Regards,
>>
>>Peter
>>
>>At 17:48 05/03/2004 -0500, Francoise Martinolle wrote:
>>>5) ambiguity of interface declarations with variable declarations
>>>-------------------------------------------------------------------------------------------
>>>When a module has an interface port and uses the non ansi port
>>>declaration, the compiler cannot determine if it was an interface
>>>declaration or a variable declaration.
>>>Ex:
>>>
>>>module ( i);
>>>myI i; // what is i? an interface or a variable, we cannot determine
>>>until the resolution of myI is completed.
>>>
>>>Suggestion is to add the keyword interface before myI:
>>>interface myI i;
>>
Received on Wed Mar 10 04:53:22 2004
This archive was generated by hypermail 2.1.8 : Wed Mar 10 2004 - 04:53:47 PST