Sachin,
Section 7.3 "The semantics of such an assignment expression are those of
a function which evaluates the right hand side,
casts the right hand side to the left hand data type, stacks it, updates
the left hand side and returns the stacked
value. The type returned is the type of the left hand side data type. If
the left hand side is a concatenation, the
type returned shall be an unsigned integral value whose bit length is
the sum of the length of its operands."
The value returned is always the type of the embedded lvalue in the
assignment. The RHS of the embedded assignment is evaluated in the
context of an assignment to the embedded lvalue. So your assumptions in
1b and 2 are correct in my opinion.
Dave
Kakkar, Sachin wrote:
>Hi,
>
>Could you please clarify my confusion regarding the "size" of
>expressions with side effect operators used in assignments.
>
>
>[1]
> The behavior of ++/-- operator.
>
>------------------------
>Consider the case :
>
>out[7:0] = ++in[1:0];
>
>
>It can be interpreted in 2 ways :
>
>a)when size depends on max(Lhs, Rhs) of assignment.
> t[7:0] = in1[1:0] + 1;
> in1[1:0] = t[1:0];
> out[7:0] = t[7:0];
>
>
>b)when size of operand with ++ operator is
> self-determined.
>
> t[1:0] = in1[1:0] + 1;
> in1[1:0] = t[1:0];
> out[7:0] = t[1:0];
>
>Please let me know, which one is the correct interpretation ?
>-----------------------
>
>[2]
>
> Also for assignment like this
> a = (b = c + d) ;
>
>Please let me know, is it correct to assume that this expr. (b = c + d )
>will be treated as a separate assignment and size of temporaries during
>assignment will not depend on size of surrounding context ie. "a" in
>this case?
>
>
>
>Thanks & Regards,
>-Sachin
>
>****************************************************
>Sachin Kakkar
>Sr. Member Technical Staff
>Mentor Graphics(NOIDA) Pvt Ltd
>Email : sachin_kakkar@mentorg.com
>****************************************************
>
>
>
>
-- -- David.Rich@Synopsys.com Technical Marketing Consultant and/or Principal Product Engineer http://www.SystemVerilog.org tele: 650-584-4026 cell: 510-589-2625Received on Fri Jun 18 10:02:35 2004
This archive was generated by hypermail 2.1.8 : Fri Jun 18 2004 - 10:02:55 PDT