[sv-bc] Question about of section 7.13 of 1800-D3

From: Francoise Martinolle <fm@cadence.com>
Date: Mon Jan 24 2005 - 11:09:42 PST

I am a little bit confused about some of the new text for array constructors
in section 7.13 which states:
 
"

When the braces include an index, type, or default key, the braces shall not
be interpreted as a concatenation, but as an array constructor, for both
packed and unpacked array types. When an array constructor is assigned to a
left-hand value that is of a simple bit vector type, an explicit type prefix
shall be used.

"
I think that this means that we can use array constructors for packed or
unpacked arrays
but I don't understand the effect of the last sentence of this paragraph.
Why would this only apply to a single bit vector type and not to a multi
dimensional packed vector?
What about if the vector data object does not have a explicit data type
(look at mdv1 declaration in the examples below)?
Perhaps the intent of this last sentence is to determine if curly braces
in the absence of an index, type or default key mean a concatenation of an
array constructor. But it is not
always possible to have an explicit type prefix if the data type of the
object is implicitly declared with ranges. In that
case the curly brace will always be interpreted as concatenation.
Additionally this rule should also apply to multi dimensional packed arrays
and not just simple vectors.
 
ex: I think that all the following assignments are legal and none require a
explicit type prefix
 
logic [1:0] [2:0] mdv2; // 2 dimensional packed vector
 
logic [2:0] mdv1; // simple bit vector
 
// use of index or default keys
mdv2 = {2:2'b1, 1:2'b0, default: 2'bx};
 
// use of replication in array constructors for packed array assignment
 
mdv2 = {3{2'b1}}; equivalent to {2'b1, 2'b1, 2'b1} ?
 
// use of array constructor for a simple packed vector
 
mdv1 = {default: 1'b0}; equivalent to {1'b0, 1'b0, 1b0} ?
A more interesting example for mdv1 would be:
mdv1 = {default: 3'b000}; which is equivalent to {3'b000, 3'b000, 3'b000}
which assigns the value 3'b000 to mdv1
 
or
 
mdv1 = {3'b000, 3'b111, 3'bxxx} which is a concatenation and assigns 3'bxxx
to mdv1.
 
 
 
 
 
Received on Mon Jan 24 11:10:40 2005

This archive was generated by hypermail 2.1.8 : Mon Jan 24 2005 - 11:16:39 PST