[sv-bc] out of range selections of array of unions and structure issue


Subject: [sv-bc] out of range selections of array of unions and structure issue
From: Francoise Martinolle (fm@cadence.com)
Date: Wed Nov 26 2003 - 14:01:26 PST


The current spec only specified what out of range index selections do for
array of 4 state and 2 state types. It does not say anything specific for
arrays of unpacked union or unpacked structs, unless it is intended that it
is indeterminate.

In SV3.1 section 4.3

If an index expression is of a 4-state type, and the array is of a 4-state
type, an X or Z in the index expression
shall cause a read to return X, and a write to issue a run-time warning. If
an index expression is of a 4-state
type, but the array is of a 2-state type, an X or Z in the index expression
shall generate a run-time warning and
be treated as 0. If an index expression is out of bounds, a run-time
warning can be generated.
Out of range index values shall be illegal for both reading from and
writing to an array of 2-state variables,
such as int. The result of an out of range index value is indeterminate.
Implementations shall generate a warning
if an out of range index occurs for a read or write operation.



This archive was generated by hypermail 2b28 : Wed Nov 26 2003 - 14:02:23 PST