ISSUE 638

Add Proposal  Add Analysis  Edit Class, Environment, or Release
Number 638
Category pending
Synopsis erratum/282: PROPOSAL - 4.5 sign and size rules
State open
Class errata-simple
Arrival-DateNov 28 2004
Originator Steven Sharp <sharp@cadence.com>
Release
Description
Proposal for expression signedness and sizing issues

Commentary:

This is a stab at clarifying the description of how context-determined
signedness and expression sizing works (a variety of errata). It also
covers how reals work (erratum 83), and the special behavior of compares.
It may not be adequate to resolve the issues, but it is an attempt. It
was done in a hurry, so there may be problems with it. Insert more
disclaimers here.

The new text refers to a "primary" from the grammar. For some reason,
"primary" does not include a string. Instead, strings are listed separately
as expressions. This is apparently an error in the grammar, since it
prevents the use of unary operators on strings, which should be legal. The
new text assumes that this will be fixed; otherwise it needs to say
"primary or string".

Changes:

In 4.5.2, CHANGE:

-- Coerce the type of each operand of the expression (excepting those which
are self-determined) to the type of the expression.
-- Extend the size of each operand (excepting those which are self-determined)
to the size of the expression. Perform sign extension if and only if the
operand type (after type coercion) is signed.

TO:

-- Propagate the type and size of the expression (or self-determined sub-
expression) back down to the context-determined operands of the expression.
In general, any context-determined operand of an operator is the same
type and size as the result of the operator. However, there are two
exceptions:
- If the result type of the operator is real, and it has a context-
determined operand that is not real, that operand is treated as if
it were self-determined and then converted to real just before the
operator is applied.
- The relational and equality operators have operands that are neither
fully self-determined or context-determined. The operands affect
each other as if they were context-determined operands with a result
type and size (maximum of the two operand sizes) determined from them.
However, the actual result type is always 1 bit unsigned. The type
and size of the operands is independent of the rest of the expression
and vice-versa.
-- When propagation reaches a simple operand as defined in 4.2 (a primary
as defined in A.8.4), then that operand is converted to the propagated
type and size. If the operand must be extended, then it is sign-extended
only if the propagated type is signed.

Fix

Unknown

Hosted by Boyd Technology