RE: [sv-bc] part selects on arbitrary expressions

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Tue Mar 13 2007 - 02:49:42 PDT
Yulik,

I also do not like choosing 0 as a left bound for unpacked dimensions,
but there is a basis for it:

4.7 says,
"The indices of string variables shall be numbered from 0 to N-1 (where
N is the length of the string) so that index 0 corresponds to the first
(leftmost) character of the string and index N-1 corresponds to the last
(rightmost) character of the string."

5.2 says,
"SystemVerilog accepts a single positive number, as an alternative to a
range, to specify the size of an unpacked array, like C. In other words,
[size] becomes the same as [0:size-1]."

F.1 says,
"The C layer of DPI basically uses normalized ranges. The term
normalized ranges means [n-1:0] indexing for the packed part (packed
arrays are restricted to one dimension) and [0:n-1] indexing for a
dimension in the unpacked part of an array. Normalized ranges are used
for the canonical representation of packed arrays in C and for
SystemVerilog arrays passed as actual arguments to C, with the exception
of actual arguments for open arrays. The elements of an open array can
be accessed in C by using the same range of indices as
defined in SystemVerilog for the actual argument for that open array and
the same indexing as in SystemVerilog."

F.6.5 says,
"Packed arrays are treated as one-dimensional; the unpacked part of an
array can have an arbitrary number of dimensions. Normalized ranges mean
[n-1:0] indexing for the packed part and [0:n-1] indexing for a
dimension of the unpacked part of an array. Normalized ranges are used
for accessing all arguments but open arrays. The canonical
representation of packed arrays also uses normalized ranges."

Shalom


> -----Original Message-----
> From: owner-sv-bc@server.eda.org [mailto:owner-sv-bc@server.eda.org]
> On Behalf Of Feldman, Yulik
> Sent: Tuesday, March 13, 2007 8:54 AM
> To: Greg Jaxon; Brad Pierce
> Cc: sv-bc@server.eda-stds.org
> Subject: RE: [sv-bc] part selects on arbitrary expressions
> 
> Greg,
> 
> Maybe you meant (6,6,4), not (0,6,4). (0,6,4) doesn't make sense to
> me.
> First, it is not clear what 0 corresponds to. Second, choosing (0,6,4)
> means that selection from packed array has different bounds from
> selection from unpacked array (note that the two arrays have exactly
> the
> same bounds; the packedness is the only difference). Making such a
> difference seems to me an unnecessary complication in the definition.
> 
> --Yulik.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Mar 13 02:50:24 2007

This archive was generated by hypermail 2.1.8 : Tue Mar 13 2007 - 02:51:13 PDT