Re: [sv-bc] non local function can be used as constant function?

From: Neil Korpusik <Neil.Korpusik_at_.....>
Date: Wed Mar 14 2007 - 10:13:51 PDT
Hi Gord,

I am wondering if you misread that portion of the LRM that you are
quoting from. Doesn't it say that "Hierarchical names are allowed"?

Neil




Gordon Vreugdenhil wrote On 03/14/07 06:45,:
> P1800-2005, 6.3.5 lists the following:
> 
>     A static constant declared with the const keyword can be set to an
>     expression of literals, parameters, local parameters, genvars,
>     enumerated names, a constant function of these, or other constants.
>     Hierarchical names are allowed because constants declared with the
>     const keyword are calculated after elaboration.
> 
> By this definition, your example is not legal since "constant function"
> explicitly excludes heirarchical references.  The "heirarchical
> names" would, I think, only apply to non-function names.  Strictly
> speaking, a constant couldn't even be defined in terms of another
> static constant since that isn't listed.
> 
> That said, I think the paragraph is too restrictive.  There is
> no design consistency issues that arise when you allow arbitrary
> expressions (as there would be for parameters).  I think that
> SV should clean this up to make this a "non-assignable variable"
> and allow any initialization expression.
> 
> As a side note, in 1364, "constant" essentially means "a value that
> is legal for a parameter".  SV has broadened "constant" to include
> values that are  not legal as the value of a parameter.
> 
> I am beginning to see a fair amount of user confusion about the
> two kinds of "constant" expressions.  Perhaps the traditional
> 1364 term should change to "elaboration constant" or perhaps
> "parametric".
> 
> Gord.
> 
> Dhiraj Kumar Prasad wrote:
> 
>>Hi,
>>
>>can you tell me that a non local function i.e function is defined
>>in some module and used in other module, can be used as constant
>>function i.e like this
>>const shortint myConst2 = botMod.myFunc(3,2);
>>where myFunc is defined in a module named botMod.
>>
>>Thanks,
>>Dhiraj
>>
>>

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Mar 14 10:14:18 2007

This archive was generated by hypermail 2.1.8 : Wed Mar 14 2007 - 10:14:36 PDT