Re: [sv-bc] query regarding $bits function

From: Surya Pratik Saha <spsaha_at_.....>
Date: Tue Feb 05 2008 - 21:57:03 PST
Hi Steven,
If the 'side-effect' is not concern, then I am not clear about the 
reason behind the restriction. $bits can not evaluate width for any 
dynamic variables without evaluating it. For e.g.

string s;
initial begin
    s = "abc";
    i = $bits(s);
end

Is it possible to evaluate the width of 's' without evaluating it? I 
don't think so.

Regards
Surya



-------- Original Message  --------
Subject: Re:[sv-bc] query regarding $bits function
From: Steven Sharp <sharp@cadence.com>
To: sharp@cadence.com, spsaha@cal.interrasystems.com
Cc: sv-bc@eda-stds.org, sarani@cal.interrasystems.com
Date: Wednesday, February 06, 2008 11:09:05 AM
>> From: Surya Pratik Saha <spsaha@cal.interrasystems.com>
>>     
>
>   
>> I understand your point, that - to get the width of a function call 
>> having dynamic return type the function needs to be evaluated and that 
>> can cause side effect. To avoid that it is restricted to be used in $bits.
>> But this is very generic restriction, all functions don't cause side 
>> effect. We can easily filter out those by imposing constant function 
>> restriction on that.
>>     
>
> You could.  But if you are trying to determine compliance of an
> implementation, you should follow what is actually in the LRM.
> The text is clear that an implementation is not to evaluate the
> expression, whether it has side-effects or not.  And for that
> reason, the expression must not contain any calls to functions
> that return dynamic results.  The wording is not perfect, but it
> seems clear enough that this testcase is illegal.
>
> Steven Sharp
> sharp@cadence.com
>
>
>
>
>
>   





-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Feb 5 21:58:13 2008

This archive was generated by hypermail 2.1.8 : Tue Feb 05 2008 - 21:58:26 PST