Re: [sv-bc] Constant method calls

From: Sarani Roy <sarani_at_.....>
Date: Mon Feb 04 2008 - 20:59:16 PST
Hi,

Since according to LRM "An enumerated type declares a set of integral 
named constants."
It is not clear to me why we cannot use atleast first() , last() and num()
enum methods as constant function call.
As pointed out by Gord all the normal rules regarding constant function 
behavior would apply to
to these function calls.

Sarani


Brad Pierce wrote:

>Gord,
>
>I didn't say it should be restricted.  I said it's not clear to me from
>the LRM text whether it is restricted.  There's a lot of text saying
>this or that is a legal constant function, so there seems to have been
>an attempt to make an exhaustive list of what is legal.  So, if a
>particular case is not in that list, then it's hard to say for sure that
>it's legal.
>
>A similar issue is
>
>    http://www.eda-stds.org/svdb/view.php?id=1527
>
>regarding whether a constant function call could be to a static class
>method or to a function that is local to the calling interface or
>program.
>
>-- Brad
> 
>
>-----Original Message-----
>From: Gordon Vreugdenhil [mailto:gordonv@model.com] 
>Sent: Wednesday, January 30, 2008 7:09 AM
>To: Brad Pierce
>Cc: sv-bc@eda.org
>Subject: Re: [sv-bc] Constant method calls
>
>I don't see why one would want to consider this illegal.  All the normal
>rules regarding constant function behavior would apply and it seems
>overly restrictive to want to disallow them just because the LRM doesn't
>address that specifically.
>
>Gord.
>
>
>Brad Pierce wrote:
>  
>
>>Can a method_call be a constant_primary if the root of the method_call
>>    
>>
>
>  
>
>>is constant?
>> 
>>For example, could a call to a method of an enum-valued parameter be 
>>used as a constant expression?
>> 
>>        localparam E P = P.first;
>>        localparam E Q = P.next(N-1);
>> 
>>I don't find anything in the LRM saying that this is legal.
>> 
>>-- Brad
>> 
>>
>>--
>>This message has been scanned for viruses and dangerous content by 
>>*MailScanner* <http://www.mailscanner.info/>, and is believed to be 
>>clean.
>>    
>>
>
>--
>--------------------------------------------------------------------
>Gordon Vreugdenhil                                503-685-0808
>Model Technology (Mentor Graphics)                gordonv@model.com
>
>
>  
>



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Feb 4 21:05:24 2008

This archive was generated by hypermail 2.1.8 : Mon Feb 04 2008 - 21:05:59 PST