Re: [sv-bc] query regarding array assignment pattern

From: Subhamoy Pal <subhamoy_at_.....>
Date: Thu Jun 01 2006 - 21:55:37 PDT
Sharmistha Rakshit wrote:

> Hi,
> I have query regarding the following testcase::
> module top;
>    integer a1 ,a2 ;
>    initial
>    begin
>        a1= '{0:1'b0,3:1'b1,default:1'b0}; 

I have a more basic query regarding this LRM testcase. The right hand 
side expression is an array assignment pattern. For array assignment 
pattern LRM 8.13.1 says
"Each expression item shall be evaluated in the context of an assignment 
to the type of the corresponding element in the array".

 From this statement it can be inferred that the left hand side for this 
perticular case is an array. But LRM 5.2 also says:
"Integer types with predefined widths cannot have packed array 
dimensions declared. These types are byte, shortint, int, longint, and 
integer. Although an integer type with a predefined width n* is not a 
packed array*, it matches (see 6.9.2), and can be selected from as if it 
were, a packed array type with a single [n-1:0] dimension."

My question is that whether this LRM example (of assigning an array 
literal to a integer type) is really correct one or not?

>
>        a2 ='{32{1'b1}};
>    end
> endmodule
>
> Now by LRM , the  first assignment is valid.
> and LRM also states that
> "A syntax resembling multiple concatenations can be used in array 
> assignment patterns as well"
> So , shouldn't the second assignment be also valid ?
>
> Thanks,
> Sharmistha
>
>

-- Subhamoy
Received on Fri, 02 Jun 2006 10:25:37 +0530

This archive was generated by hypermail 2.1.8 : Thu Jun 01 2006 - 21:55:17 PDT