RE: [sv-bc] Iterating over arrayed and generated instances with 'foreach'

From: Rich, Dave <Dave_Rich_at_.....>
Date: Sun Feb 05 2006 - 22:00:34 PST
Brad,

Arrays of instances are not data types; they are like generated
hierarchical references and share a common syntax with array selects for
data types.

Dynamically selecting hierarchical references would be an enhancement.
Since we already have virtual interfaces, we could certainly have
dynamics selects. Not having dynamic selects is basically why virtual
interfaces were created in the first place.

Dave


> -----Original Message-----
> From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of
Brad
> Pierce
> Sent: Sunday, February 05, 2006 9:40 PM
> To: sv-bc@eda.org
> Subject: Re: [sv-bc] Iterating over arrayed and generated instances
with
> 'foreach'
> 
> Gord,
> 
> As noted in http://eda.org/svdb/bug_view_page.php?bug_id=897 , I agree
> that there ought to be a generate foreach.  But how would that help
with
> the example of sending messages at run time to each interface instance
> in an array?
> 
> -- Brad
> 
> -----Original Message-----
> From: Gordon Vreugdenhil [mailto:gordonv@model.com]
> Sent: Sunday, February 05, 2006 9:11 PM
> To: Brad Pierce
> Cc: sv-bc@eda.org
> Subject: Re: [sv-bc] Iterating over arrayed and generated instances
with
> 'foreach'
> 
> Brad, hierarchical references into arrayed instances are required
> to have constant index values -- they are hierarchical names,
> not selects.  SV has, unfortunately, deepened the confusion
> between "select" and "hierarchical reference".  Unless you
> want to have a "generate foreach" (which wouldn't be such a
> bad idea if properly restricted), there isn't any way to
> dynamically iterate over an array of interfaces or other
> instances, including generates.
> 
> Gord
> 
> 
> Brad Pierce wrote:
> > A natural usage for 'foreach' is to iterate over an array of
> instances,
> > for example, to send a message across each interface instance in an
> > array of interfaces.  I can't see in the LRM anyplace that
explicitly
> > says that's legal.
> >
> >
> >
> > Likewise, even iterating the old-fashioned way (with 'for'), the LRM
> > seems silent about the legality of applying the array querying
> > functions, such as $left(), to arrayed instances.
> >
> >
> >
> > For generated instances, it's even more important to be able to
> iterate
> > with 'foreach', because generated instances are not necessarily
> contiguous
> >
> >
> >
> >             for (genvar I = 0; I < N; I += 2) begin:GEN
> >
> >                        ...
> >
> >
> >
> > This is similar to iterating over an associative dimension, which
can
> be
> > done with 'foreach', but not generally with 'for'.
> >
> >
> >
> > -- Brad
> >
> >
> >
> >
> >
> 
> --
> --------------------------------------------------------------------
> Gordon Vreugdenhil                                503-685-0808
> Model Technology (Mentor Graphics)                gordonv@model.com
Received on Sun Feb 5 22:00:40 2006

This archive was generated by hypermail 2.1.8 : Sun Feb 05 2006 - 22:00:44 PST