RE: [sv-bc] RE: [sv-ec] Multidim array of interfaces - supported?

From: Steven Sharp <sharp_at_.....>
Date: Tue Apr 01 2008 - 16:17:05 PDT
>From: "danielm" <danielm@aldec.com.pl>

>module top;
>
>    sub uut[0:9]();
>
>    initial uut[1:4].data = 1; //???????? legal
>
>endmodule

Expanding on what Greg and Shalom said:

This would not be legal even if uut were an ordinary array.  As Shalom
said, you cannot have any more selects after a slice.  Greg put it
another way by saying that any select has to refer to contiguous storage.
This kind of construct that would select subparts from different elements
of the array is not allowed.

Even if the language did allow this kind of construct, the result would
presumably be treated as some kind of array with 4 elements.  You cannot
assign a singular value to an entire array.  You would have to use an
assignment pattern.

Greg also pointed out that instance "arrays" are not really arrays in
the usual sense.  In a normal array, all of the elements are of the
same type.  But each instance in an instance array can be different due
to parameterization.  For example, the variable or net 'data' might have
a different width in different instances.  So even if this construct were
allowed for ordinary arrays, and were treated as some kind of array type,
that would not work for an instance "array" because the elements would
not be guaranteed to be the same type.

Steven Sharp
sharp@cadence.com


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Apr 1 16:17:53 2008

This archive was generated by hypermail 2.1.8 : Tue Apr 01 2008 - 16:18:10 PDT