Re: [sv-bc] expressions not allowed in RHS or continous assign or on port connection list

From: Gordon Vreugdenhil <gordonv@model.com>
Date: Fri Apr 09 2010 - 07:59:58 PDT

Another way of talking about this, as has been implied
by an earlier comment, is that any impure expression
is unsafe in a continuous (or procedural continuous)
assignment. There is no guarantee about what a simulator
might do with a continuous assignment and the LRM does
not really give direct event semantics for continuous
assignments (in fact even what it does say is somewhat
misleading in practice). So it is immaterial whether
the impurity is in a function body (a traditional
side-effecting function) or in an expression assignment
operator -- it is not safe. The SV LRM restricts the new
SV assignment operators but doesn't attempt to address
the pre-existing issues of impure functions inherited
from base Verilog.

Gord.

Steven Sharp wrote:
>> Date: Thu, 08 Apr 2010 13:31:31 -0700
>> From: John Michael Williams <john@svtii.com>
>
>> Minor point of terminology:
>>
>> I agree that the ++ operation in the argument list
>> of a nonprocedural function call should not be allowed.
>> However, I would not call it a "side effect".
>>
>> The increment is unrelated to the function; it is applied
>> directly to the variable being used as a real parameter
>> in the call. This is what makes it illegal. If it were
>> in the function body, or perhaps applied to a formal
>> parameter of the function, an increment of a variable declared
>> outside the function would be causing what I would
>> call a side effect.
>
> I think you are fixating on the use of the term "side effect"
> as a property of a function. It has a more general meaning.
>
> I am not calling this a side effect of the function. I am calling
> it a side effect of evaluating the expression. The main effect of
> evaluating the expression is to get its value. Changing the values
> of any variables in the process is a side effect of the evaluation.
> This is a correct use of the term.
>
> Steven Sharp
> sharp@cadence.com
>
>

-- 
--------------------------------------------------------------------
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 Fri Apr 9 08:00:47 2010

This archive was generated by hypermail 2.1.8 : Fri Apr 09 2010 - 08:03:50 PDT