Jonathan, I agree that empty and uninitialized should be treated the same. The problem started with 19.7 saying, implicitly, that $size should also return 'x for an empty array. I agree that is wrong. I note that 19.7 says, "$increment shall return 1 if $left is greater than or equal to $right and -1 if $left is less than $right." This does not specify what happens if $left==$right. That can happen with a 1-element array, and there are such things. I can accept $left being 0 and $right being -1 for empty arrays, but then the definitions of $low and $high have to change, currently: "- $low shall return the minimum of $left and $right of the dimension. - $high shall return the maximum of $left and $right of the dimension. " Regards, Shalom > -----Original Message----- > From: owner-sv-ec@server.eda.org > [mailto:owner-sv-ec@server.eda.org] On Behalf Of Jonathan Bromley > Sent: Tuesday, November 27, 2007 3:54 PM > To: sv-ec@server.eda.org > Subject: [sv-ec] Manti 958, 974 > > hi EC, > > I've added a note to 974 proposing that it be closed as > duplicating (a small part of) 1447. > > 958 is a little more problematic - it asks what the .size > method and $size() function should return when applied to > uninitialized dynamic arrays or queues. > > My personal view is that there is little point in trying to > distinguish between a "null" (uninitialized) queue or dynamic > array and one having zero size. If dynamic array and queue > variables were in fact *references* to the underlying array > object, I'd take a very different view. > But they're not - at least, not from the user's viewpoint. > The tools I've tried all seem to agree with me, and therefore > disagree with the current LRM. > > I therefore plan to write a short proposal saying that > uninitialized queues and dynamic arrays have a .size() of > zero, and yield zero from the $size() system function. > > However, that's not the end of it. We also have the other > functions $left, $right, $low, $high, $increment to consider. > At present, 19.7 says... > > When used on a dynamic array or queue dimension, > these functions return information about the > current state of the array. If the dimension is > currently empty, these functions shall return > a 'x. > > This seems very strange for $increment, which surely should > always return -1 for queues and dynamic arrays. > I would also have thought that $left and $low should always > return 0 even if the array is empty. The interesting > question is whether $right/$high should return -1 or 'x. If > we agree that an empty queue or dynamic array is a legitimate > object, and that an uninitialized queue or dynamic array is > indistinguishable from an empty one, then I would have > thought that -1 would make more sense. > > Opinions? Please? > -- > 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 message has been scanned for viruses and dangerous > content by MailScanner, and is believed to be clean. > --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Tue Nov 27 06:47:47 2007
This archive was generated by hypermail 2.1.8 : Tue Nov 27 2007 - 06:48:09 PST