RE: [sv-ec] RE: [sv-bc] Issues on Queue Operators

From: Rich, Dave <Dave_Rich_at_.....>
Date: Tue May 30 2006 - 17:06:10 PDT
Both dynamic arrays and queues can be resized by being the target of an
assignment (a copy). 

The real difference between the two is pass by reference semantics.
Queues guarantee references to unaffected elements when their size
changes. Dynamic arrays references become outdated whenever they are
re-sized.

The only other difference is that a dynamic array has a malloc-like
constructor, whereas queues have incremental push and pop methods for
changing their size.

Dave



> -----Original Message-----
> From: owner-sv-bc@server.eda.org [mailto:owner-sv-bc@server.eda.org]
On
> Behalf Of Steven Sharp
> Sent: Tuesday, May 30, 2006 4:20 PM
> To: sv-ec@server.eda.org; sv-bc@server.eda.org;
> jonathan.bromley@doulos.com
> Subject: Re: [sv-ec] RE: [sv-bc] Issues on Queue Operators
> 
> 
> >From: "Jonathan Bromley" <jonathan.bromley@doulos.com>
> 
> >However, a queue has the property, not shared with a
> >dynamic array, that it may be resized merely by being
> >the target of an assignment.  I believe this is the
> >only property of queues that is not shared with
> >dynamic arrays.
> 
> What about the ability to extend the size of the queue
> by assigning to an element just beyond the current end
> of the queue?  That is a related but different property.
> 
> 
> >The simplicity of the queue expression syntax could
> >be rescued, and the rigour of assignment patterns
> >preserved, if we could introduce an additional notation
> >into assignment patterns: an "array explode" operation
> >that would act, within an assignment pattern and only
> >within an assignment pattern, as if it were replaced by
> >a comma-separated list of the array's elements.  Only one
> >dimension of an array could be thus exploded.
> 
> I agree that this is probably the best approach.
> 
> 
> > I'm tempted
> >to use inside-out curly brackets for that, on the grounds
> >that it's almost exactly the inverse of concatenation...
> >
> >// append one int to a queue of ints
> >
> >Q = '{ }Q{ , 7 };
> >
> >but it's so ugly that I give up and leave it to someone
> >else to invent the right syntax.
> 
> I don't know if there are any characters left unused in Verilog :-)
> And you want something concise.
> 
> 
> Steven Sharp
> sharp@cadence.com
Received on Tue May 30 17:06:12 2006

This archive was generated by hypermail 2.1.8 : Tue May 30 2006 - 17:06:26 PDT