Subject: [sv-bc] out of range indexes
From: Dave Rich (David.Rich@synopsys.com)
Date: Thu Jan 29 2004 - 23:35:41 PST
The last two paragraphs of section 4.3 contradict each other in regard
to the return values of a 2-state array when the index is is out of
range. This clarification generalizes the return type for invalid
indexes for arrays of any data type
In section 4.3 REPLACE
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.
The result of reading from an array of 2-state variables, such as int,
with an out of range index is indeterminate.
Writing to an array with an out of range index performs no operation.
Implementations can generate
a warning if an out of range index occurs for a read or write operation.
WITH
If an index expression is out of the address bounds or if any bit in the
address is X or Z, then the index shall be invalid. The result of
reading from an array with an invalid index shall return the default
uninitialized value for the array element type. Writing to an array with
an invalid index shall perform no operation. Implementations can
generate a warning if an invalid index occurs for a read or write
operation of an array.
-- -- David.Rich@Synopsys.com Principal Product Engineer http://www.SystemVerilog.org tele: 650-584-4026 cell: 510-589-2625
This archive was generated by hypermail 2b28 : Thu Jan 29 2004 - 23:42:42 PST