Re: [sv-ec] RE: [sv-bc] query for assignment pattern evalution

From: Greg Jaxon <Greg.Jaxon_at_.....>
Date: Wed Apr 09 2008 - 07:07:17 PDT
Sumay,

   I concur with Shalom's answer for type-directed patterns over packed
arrays.  "Default" accepts more kinds of matching and tends to want to
fill simple bit VECTOR elements, not scalars.  Your 001001 answer seems good.

   I guess one follow-up question would ask whether a multi-dimensional
packed element type would be considered a "simple bit vector type"?
E.g., bit [2:0] [5:4] arr [ 1:0];
Is  arr = '{default:1'b1};  //  000001000001 or 001001001001 ?

We know that packed multi-dimensional arrays and packed structs or unions
are equivalent to some simple bit vectors, but section 6.11.1 (of 2008)
suggests that these types do not "match", and so the correct answer above
is 001001001001.

Greg

Sumay Guin wrote:
> Hi,
>      Thanks for your answer. But if we specified 'default' in place of
> 'bit'
>      in the assignment pattern then what will be the result for current
> test
>      scenario ? Whether it will be 111111 or 001001.
> 
> Thanks &regards,
> Sumay
> 
> Bresticker, Shalom wrote:
> 
>> The LRM says,
>>
>> "For type:value, if the element or subarray type of the array matches
>> this type, then each element or subarray shall be set to the value. The
>> value must be castable to the array element or subarray type. Otherwise,
>> if the array is multidimensional, then there is a recursive descent into
>> each subarray of the array using the rules in this clause and the type
>> and default keys."
>>
>> So I would expect the output to be 111111.
>>
>> Shalom
>>
>>
>>  
>>
>>>       module top;
>>>         ...........
>>>         bit [2:0] arr [ 1:0];
>>>         .........
>>>         initial
>>>             arr = '{bit : 1'b1}; // whether output will be 011011 or
>>> 111111
>>>       endmodule
>>>
>>>       For the above scenario Please can any one tell me whether 1'b1
>>> wiil be
>>>       assigned to each bit of "bit [2:0]" or to the entire "bit
>>> [2:0]" for
>>>       arr[1] or arr[0]. Most of the standard simulator does not
>>> support this
>>>       scenario. Your response is important for me.   
>> ---------------------------------------------------------------------
>> 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 Wed Apr 9 07:10:17 2008

This archive was generated by hypermail 2.1.8 : Wed Apr 09 2008 - 07:10:36 PDT