Because it's an iterator. Iterators have the index method. Shalom > -----Original Message----- > From: owner-sv-ec@server.eda.org > [mailto:owner-sv-ec@server.eda.org] On Behalf Of Surya Pratik Saha > Sent: Monday, August 06, 2007 7:00 PM > To: Bresticker, Shalom > Cc: Moumita; sv-bc; sv-ec > Subject: Re: [sv-bc] RE: [sv-ec] Query for Iterator index querying > > Hi Shalom, > Your text is contradictory. You mentioned 'index' can be > applied on an unpacked array. And you mentioned 'item' > iterator is of type 'int'. Then how come, 'index' method is > applied on an int type? > > Regards > Surya > > > > -------- Original Message -------- > Subject: Re:[sv-bc] RE: [sv-ec] Query for Iterator index querying > From: Bresticker, Shalom <shalom.bresticker@intel.com> > To: Moumita <moumita@cal.interrasystems.com> > Cc: "sv-bc" <sv-bc@eda-stds.org>, "sv-ec" <sv-ec@eda-stds.org> > Date: Monday, August 06, 2007 7:48:13 PM > > arr is an unpacked array. > > > > item is the iterator, iterating over the elements of arr, > each of type > > int. > > > > item.index is its index. > > > > q is a list of those elements (items) whose value (item) is > equal to > > its index (item.index). > > > > Shalom > > > > > -------------------------------------------------------------- > ---------- > > *From:* Moumita [mailto:moumita@cal.interrasystems.com] > > *Sent:* Monday, August 06, 2007 5:07 PM > > *To:* Bresticker, Shalom > > *Cc:* sv-bc; sv-ec > > *Subject:* Re: [sv-bc] RE: [sv-ec] Query for Iterator index > > querying > > > > > > But according to the example mentioned in SV LRM(sec > 5.15.4), item > > is not an unpacked array. > > So is the following testcase is valid one? > > > > testcase: > > ------- > > int arr[] ; > > int q[$]; > > q = arr.find with ( item == item.index ); > > > > If it is valid then what is the value of item.index? > > What is the difference between item.index(1) and item.index? > > Another question is whether iterator can be an > unpacked array as > > here item is treated as iterator? > > > > > > Thanks, > > > > Moumita > > > > > > > > Bresticker, Shalom wrote: > >> The descriptions of the array manipulation methods at > the beginning of > >> each of 5.15.1-5.15.3 say what types of arrays they > apply to, and they > >> are unpacked arrays, i.e., not packed arrays. > >> > >> Shalom > >> > >> > >> > >>> -----Original Message----- > >>> From: owner-sv-ec@server.eda.org > >>> [mailto:owner-sv-ec@server.eda.org] On Behalf Of Moumita > >>> Sent: Monday, August 06, 2007 2:38 PM > >>> To: sv-bc; sv-ec > >>> Subject: [sv-ec] Query for Iterator index querying > >>> > >>> Hello, > >>> > >>> IEEE std 1800-2005 standard for System Verilog,sec 5.15.4 > >>> does not say anything about the array for index method ,so my > >>> query is whether index method (Iterator index querying) can > >>> be applied to unpacked array or packed array? > >>> If we have - > >>> q = arr.find with ( item == item.index ); // item is packed > >>> array or unpacked array? > >>> > >>> Also the language "The index method of an iterator returns > >>> the index value of the specified dimension." is not > clear to me. > >>> So for the following testcase what will be value of x? > >>> bit i[2:0]; > >>> int x; > >>> initial begin > >>> x = i.index(); > >>> end > >>> > >>> Thanks and regards, > >>> > >>> Moumita > >>> > >>> > >>> > >>> -- > >>> This message has been scanned for viruses and dangerous > >>> content by MailScanner, and is believed to be clean. > >>> > >>> > >> > >> > > > > > > -- > > This message has been scanned for viruses and dangerous content by > > *MailScanner* <http://www.mailscanner.info/>, and is believed to be > > clean. > > > > > > -- > This message has been scanned for viruses and dangerous > content by MailScanner, and is believed to be clean. > -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Mon Aug 6 09:02:40 2007
This archive was generated by hypermail 2.1.8 : Mon Aug 06 2007 - 09:02:47 PDT