Subject: Re: [sv-bc] 4.3 out of range indexes
From: Dave Rich (David.Rich@synopsys.com)
Date: Sun Oct 19 2003 - 01:16:53 PDT
Shalom,
I agree with you, illegal is not the appropriate word.
Replace the last paragraph of section 4.3 with
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 may
generate a warning if an out of range index occurs for a read or write
operation.
Dave
Shalom.Bresticker@motorola.com wrote:
>In the IEEE Verilog Standard terminology, "illegal" means something that will
>not pass compliation or will generate a run-time error.
>
>If you just want to say that the behavior is indeterminate, then the term
>"illegal" is not appropriate.
>
>By the way, not all indexes can be checked at compile-time.
>Take a simple example: a function where the input is the index to an array.
>
>Shalom
>
>
>
>
>>In other programming language standards, there are usually two concepts
>>separately defined
>>
>> 1) Conforming implementations of the language - i.e. compilers that
>> do what the standard says.
>> 2) Conforming programs written in the language. i.e. codes that use only
>> the subset which the standard requires all compilers to agree upon.
>>
>>I'm guessing that this author intends to exclude out-of-bound indexes from (2)
>>but not require bounds checking from every (1).
>>
>>Bounds checking costs are not always welcome. A stronger requirement would
>>involve saying that conforming compilers must have a mode in which they check
>>for bounds violations. For synthesis, this is limited to compile-time
>>checks and warnings (although in the case of 2-state variables, won't all
>>accesses happen at compile-time?).
>>
>>Greg Jaxon
>>
>>Greg Jaxon
>>
>>Shalom.Bresticker@motorola.com wrote:
>>
>>
>>>Sorry if this was already brought up.
>>>
>>>The last paragraph of 4.3 says,
>>>
>>>"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 is indeterminate. Implementations shall generate a
>>>warning if an out of range index occurs for a read or write operation."
>>>
>>>I don't understand what this "illegal" means.
>>>"Illegal" usually means that it generates a fatal error.
>>>If the behavior is discussed ("indeterminate" in this case),
>>>and the simulation continues, then it becomes a "use at your own risk",
>>>but not illegal?
>>>
>>>Thanks,
>>>Shalom
>>>
>>>
>>>
>
>
>
-- -- David.Rich@Synopsys.com Technical Marketing Consultant http://www.SystemVerilog.org tele: 650-584-4026 cell: 510-589-2625
This archive was generated by hypermail 2b28 : Sun Oct 19 2003 - 01:21:40 PDT