I was the one who raised the possibility of b), basically to make the semantics simpler for problematic cases. The issue is that I don't think we have any definition now for what precisely a queue element is, how they are assembled into a queue, and how the various operations affect the arrangement of elements in the queue. I will assume that nobody wants a queue element to be a first-class type (e.g., no variables of type "queue element"), but since it affects user-visible behavior it must be defined. By the way, I think I almost gave some folks a heart attack when I compared queues to linked lists in the meeting :)Dave Thanks for this excellent exposition.a) the reference is a handle to the element, or b) the reference is a handle to the queue + an offset? I believe the intent is answer (a)I definitely agree that this makes the most sense, partly because it is precisely the behavior that a user would likely get if they were to implement a double-ended linked list of class objects for themselves. Option (b) simply doesn't do the things I would want to do with such references - even the most obvious thing, keeping a reference to a transaction as it flows through a FIFO, requires (a).
This was my feeling as well - that assignment to a queue outdates references to the original queue elements, even if the RHS of the assignment is composed of a concatenation of elements of the original queue. I hadn't thought of assignment to part-selects of queues, but I see no problem with the behavior you describe.Now to the second issue that is more specific to unpacked concatenation. What if the queue methods in the example above are replaced with concatenation?I guess I've already made my own position clear on this by writing-up the 1702 proposal to say that any write to an unpacked array variable trashes any existing elements in the written array. I guess I should have been clearer in 1702 about what happens if you write to *part* of an array: q[2:3] = '{1,2}; My expectation here would be that any references to q[2] or q[3] would go stale, but references to any elements in q[0:1] or q[4:$] would remain live. I just can't see any alternative that would make consistent sense across all the variety of possible operations on a queue variable. I agree that it forces a potentially inefficient copy in some situations where that could perhaps be avoided, but I'd far sooner have that than confusing or fragile behavior. I also think that it's a behavior that's easy to define and easy to educate users about. And, as you say, a few new queue methods could claw back the efficiency in most of the practically useful cases.
-- Jonathan Bromley, Consultant DOULOS - Developing Design Know-how VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK Tel: +44 (0)1425 471223 Email: jonathan.bromley@doulos.com Fax: +44 (0)1425 471573 Web: http://www.doulos.com The contents of this message may contain personal views which are not the views of Doulos Ltd., unless specifically stated.
This archive was generated by hypermail 2.1.8 : Tue Dec 04 2007 - 08:59:04 PST