Subject: Re: [sv-bc] 4.3 out of range indexes
From: Shalom.Bresticker@motorola.com
Date: Sat Oct 18 2003 - 11:52:57 PDT
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
> >
>
-- Shalom Bresticker Shalom.Bresticker@motorola.com Design & Reuse Methodology Tel: +972 9 9522268 Motorola Semiconductor Israel, Ltd. Fax: +972 9 9522890 POB 2208, Herzlia 46120, ISRAEL Cell: +972 50 441478
This archive was generated by hypermail 2b28 : Sat Oct 18 2003 - 11:55:11 PDT