Jonathan, The details are the section on pass by reference 12.4.2. They key difference is how they are implemented and memory managed. A dynamic array can be allocated as a contiguous array of memory. A queue can be implemented as a linked list. I say "can be" because the LRM is not supposed to dictate implementation, just semantics. However, it might be important in how the VPI/DPI allows access to each element in an array A little history: A queue was a feature of Superlog that was not part of the original donation to SystemVerilog. A dynamic array was a feature of Vera that was donated to SystemVerilog. Later on, queues were added to both Vera and then SystemVerilog. Superlog did not have the concept of methods on anything but classes, so it overloaded the {} to do all of its queue manipulations. In Vera, a method was the only way to access a queue; it had no concept of aggregates. Queues in Superlog using the {} notation was one of the most widely used feature of the language, which is why I would like to keep the syntax. Plus, it's already been put into practice that way in SystemVerilog in more than one implementation. Dave > -----Original Message----- > From: owner-sv-ec@server.eda.org [mailto:owner-sv-ec@server.eda.org] On > Behalf Of Jonathan Bromley > Sent: Wednesday, May 31, 2006 6:01 AM > To: sv-ec@server.eda.org > Subject: RE: [sv-ec] RE: [sv-bc] Issues on Queue Operators > > [me] > > > >a queue has the property, not shared with a > > > >dynamic array, that it may be resized merely by being > > > >the target of an assignment. > > [Dave Rich] > > Both dynamic arrays and queues can be resized by being the > > target of an assignment (a copy). > > My error; of course you're exactly right. > > > 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. > > OK, that's very important and makes a big difference to my suggestion > that queues and dynamic arrays should be merged, but I didn't find > it in the LRM... what did I miss? > > > 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. > > I'm not entirely sure I follow how this difference is important when > I assign to a queue from entirely new data using Q={,,,}; syntax. > --Received on Wed May 31 07:31:13 2006
This archive was generated by hypermail 2.1.8 : Wed May 31 2006 - 07:31:19 PDT