RE: [sv-ec] 5.15 Array manipulation methods - question

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Thu Nov 17 2005 - 22:55:32 PST
Which brings me back to the question:

 int mem[9:0][9:0], mem2[9:0][9:0];
 int q[$];
 ...
 // find all items in mem that are greater than corresponding item in
mem2
 q = mem.find( x ) with ( x > mem2[x.index(1)][x.index(2)];

What would I get in this example if I used mem.find_index instead of
mem.find?

Thanks,
Shalom


>-----Original Message-----
>From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On
>Behalf Of Arturo Salz
>Sent: Thursday, November 17, 2005 11:09 PM
>To: Rich, Dave; sv-ec@eda.org
>Subject: RE: [sv-ec] 5.15 Array manipulation methods - question
>
>Hi Dave,
>
>I agree that better, more explicit verbiage can clarify much.
>
>However, from that statement (actually in 5.15.4), one cannot
>conclude
>that the iteration is over one dimension. Only that the default
>index
>that
>is returned by the index method is '1' (the first dimension).
>In fact,
>the
>existence of multiple indices does reinforce the concept of
>iteration
>over
>multiple dimensions.
>
>	Arturo
>
>-----Original Message-----
>From: Rich, Dave [mailto:Dave_Rich@mentor.com]
>Sent: Thursday, November 17, 2005 11:44 AM
>To: Arturo Salz; sv-ec@eda.org
>Subject: RE: [sv-ec] 5.15 Array manipulation methods - question
>
>Hi Arturo,
>
>5.14.4 "If the dimension is not specified, the first dimension
>is used
>by default"
>
>So index is the same as index(1) when there are multiple
>dimensions. In
>any case, there is no text in the LRM that defines this.
>
>I agree that returning a empty queue would help with the not
>found case.
>This needs to be documented.
>
>Dave
>
>
>> -----Original Message-----
>> From: Arturo Salz [mailto:Arturo.Salz@synopsys.com]
>> Sent: Thursday, November 17, 2005 10:33 AM
>> To: Rich, Dave; sv-ec@eda.org
>> Subject: RE: [sv-ec] 5.15 Array manipulation methods -
>question
>>
>> Dave,
>>
>> I don't know how you concluded from the LRM that array
>manipulation
>> methods
>> iterate over a single dimension. The example quoted by Shalom
>does
>> suggest
>> iteration over all (unpacked) dimensions. The array re-
>ordering
>methods
>> are the
>> only array manipulation methods that do explicitly specify a
>single
>> dimension.
>> What you suggest might be a reasonable approach, but a change
>> nonetheless.
>>
>> As for you question:
>> 	What should find_first_index and find_last_index return if
>not
>> found?
>> The answer is: a empty queue.
>> One of the reasons why all locator methods return a queue is
>because
>> they provide a general mechanism
>> for returning
>>
>> -----Original Message-----
>> From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On
>Behalf Of
>> Rich, Dave
>> Sent: Thursday, November 17, 2005 8:41 AM
>> To: sv-ec@eda.org
>> Subject: RE: [sv-ec] 5.15 Array manipulation methods -
>question
>>
>> Shalom,
>>
>> The array manipulation methods only iterate over a single
>dimension
>> (dimension 1) unless you explicitly select a dimension.
>Unfortunately,
>> this is only shown by example without normative text. (I
>would have
>> preferred square brackets to select the index)
>>
>> Coincidentally, I was reading this yesterday too and found
>that not
>all
>> array manipulation methods should return queues, only find,
>and
>> find_index return queues.
>>
>> What should find_first_index and find_last_index return if
>not found?
>> Unfortunately, the default value may also be a valid index.
>>
>>
>> > -----Original Message-----
>> > From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On
>Behalf Of
>> > Bresticker, Shalom
>> > Sent: Thursday, November 17, 2005 6:07 AM
>> > To: sv-ec@eda.org
>> > Subject: [sv-ec] 5.15 Array manipulation methods - question
>> >
>> > Hi,
>> >
>> > 5.15 ("Array manipulation methods") gives the impression
>that all
>> these
>> > methods relate to 1-dimensional arrays. Or at least, if the
>array is
>> > multi-dimensional, then they relate to it as an array of
>arrays,
>since
>> the
>> > array type can be anything.
>> >
>> > So it makes sense that they return queues of array_type,
>and the
>index
>> > locator methods return queues of indexes, where each index
>is of
>type
>> int.
>> >
>> > I understood all that, till I got to 5.15.4 "Iterator index
>querying".
>> > Suddenly I find that the methods seem to iterate over each
>individual
>> > element of a multi-dimensional array, as in the last
>example:
>> >
>> > int mem[9:0][9:0], mem2[9:0][9:0];
>> > int q[$];
>> > ...
>> > // find all items in mem that are greater than
>corresponding item in
>> mem2
>> > q = mem.find( x ) with ( x > mem2[x.index(1)][x.index(2)]
>);
>> >
>> > Now I'm confused about how it works.
>> >
>> > For example, what would I get in this example if I used
>mem.find_index
>> > instead of mem.find?
>> >
>> > And what is the meaning of the previous code line from the
>same
>> example:
>> >
>> > // find all items equal to their position (index)
>> > q = arr.find with ( item == item.index );
>> >
>> > My head hurts...
>> >
>> > Shalom Bresticker
>> > Intel Jerusalem LAD DA
>> > +972 2 589-6852
>> > +972 54 721-1033
>> > I don't represent Intel
>> >
>>
>
Received on Thu Nov 17 22:55:46 2005

This archive was generated by hypermail 2.1.8 : Thu Nov 17 2005 - 22:57:55 PST