Subject: RE: ( i++ += ++i++ )
From: Jacobi, Dan (dan.jacobi@intel.com)
Date: Thu Nov 21 2002 - 23:48:01 PST
Hello All,
This issue was partly mentioned in my document I send
The item labeled as SV-BC-19-44 deals with this issue and other odd things
such as
always aReg = function_call(arg1,arg2)++;
however SV-BC-19-44 does not deal with enabling / disabling the
auto-increment operator in the left hand side of an assignment.
-----Original Message-----
From: Steven Sharp [mailto:sharp@cadence.com]
Sent: Friday, November 22, 2002 2:38 AM
To: sv-bc@eda.org
Subject: Re: ( i++ += ++i++ )
>According to the BNF, the following is a legal SystemVerilog expression --
>
> ( i++ += ++i++ )
>
>Doesn't this seem kind of weird? (This goes way beyond what's allowed in
>C.)
In C, i is an lvalue, but i++ is not. It is an rvalue. You can only
increment or otherwise assign to an lvalue.
Assuming that this weird example is not supposed to be allowed in SV,
the error is presumably the production that allows "variable_lvalue"
to expand to "variable_lvalue_item inc_or_dec_operator".
Can someone tell me what the second production for variable_lvalue
of a variable identifier followed by a parenthesized list of constants
is intended for? There is a similar one for net_lvalue.
Steven Sharp
sharp@cadence.com
This archive was generated by hypermail 2b28 : Thu Nov 21 2002 - 23:48:39 PST