[sv-ec] Manti 958, 974

From: Jonathan Bromley <jonathan.bromley_at_.....>
Date: Tue Nov 27 2007 - 05:53:36 PST
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.
Received on Tue Nov 27 05:54:21 2007

This archive was generated by hypermail 2.1.8 : Tue Nov 27 2007 - 05:54:57 PST