Re: [sv-bc] Query about bit-length of Context-Determined Expression

From: Steven Sharp <sharp@cadence.com>
Date: Tue May 18 2010 - 10:46:59 PDT

>Date: Tue, 18 May 2010 18:25:15 +0530
>From: Ishita Ghosh <ighosh@cal.interrasystems.com>

>Does this imply that, the bit-length of the context-determined
>expression is given by the
>*/maximum/* of bit-lengths of the operand(s) and the context? Please
>confirm.

In general, yes.

>In statement 3, if the bit-length of the context-determined binary
>expression on RHS is
>taken to be the maximum of bit-lengths of the operands and the context,
>i.e. 6 (which is
>the size of regA), then "regC" contains "xxx".
>But if, the bit-length of the RHS is taken to be determined by the size
>of the LHS
>expression, i.e. 3, then value in "regC" must be "000".
>
>Standard simulators give result "xxx".

That is correct. All of the (context-determined) operands are extended
to the 6-bit width of the expression context, the operations are performed,
and then the result is truncated during the assignment.

An example where it is more clear that this is useful would involve
a right-shift of the result before assigning it. If the expression
were evaluated at the narrower width of the LHS, the upper bits
would have been lost before they could be shifted down into the
lower bits.

Steven Sharp | Architect | Cadence

P: 508.459.1436 M: 774.535.4149 www.cadence.com

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue May 18 10:47:26 2010

This archive was generated by hypermail 2.1.8 : Tue May 18 2010 - 10:50:15 PDT