[sv-bc] contradiction with array assignment rules


Subject: [sv-bc] contradiction with array assignment rules
From: Dave Rich (David.Rich@synopsys.com)
Date: Fri Jan 30 2004 - 14:49:12 PST


There is a contradiction between section 4.7 and sections 4.8 and 7.16 about assignment compatibility of unpacked arrays. This proposal fixes that to show that unpacked arrays use assignment compatibility rules for assignment. This also removes some redundant text.

Dave

In section 4.8 modify

Arrays can be passed as arguments to tasks or functions. The rules that govern array argument passing by value
are the same as for array assignment (see Section 10.4) are the same as for array assignment. When an array
argument is passed by value, a copy of the array is passed to the called task or function. This is true for all
array types: fixed-size, dynamic, or associative.
Passing fixed-size arrays as arguments to subroutines requires that the actual argument and the formal argument
in the function declaration be of  compatible types
and that all sized dimensions be of the same size.

reg b[3:1][3:1]; //error: incompatible type

reg b[3:1][3:1]; //OK: assignment compatible type
event b[3:1][3:1]; //error: incompatible type

In section 7.16 modify as follows

To be copied or compared, the type of an aggregate expression must be assignment compatible equivalent. See Section 5.8.21 Assignment Compatible Equivalent types.


--
David.Rich@Synopsys.com
Technical Marketing Consultant and/or
Principal Product Engineer
http://www.SystemVerilog.org
tele: 650-584-4026
cell: 510-589-2625



This archive was generated by hypermail 2b28 : Fri Jan 30 2004 - 14:56:22 PST