[sv-ec] Unpacked arrays fixed and dynamic


Subject: [sv-ec] Unpacked arrays fixed and dynamic
From: Dave Rich (David.Rich@synopsys.com)
Date: Thu Jan 29 2004 - 23:53:10 PST


The following clarification updates the informative section on arrays to deal with enhancements that have been accepted. It also modifies text from the Vera donation which is a language restricted to one-dimensional arrays. This removes a contradiction since the text also said that dynamic and associative arrays could be any type, which could have been another dynamic or associative array


REPLACE section 4.1 Introduction (informative)

SystemVerilog enhances array declarations in several ways. SystemVerilog supports fixed-size arrays,
dynamic arrays, and associative arrays. Fixed-size arrays can be multi-dimensional and have fixed storage
allocated for all the elements of the array. Dynamic arrays also allocate storage for all the elements of the array,
but the array size can be changed dynamically. Dynamic and associative arrays are one-dimensional. Fixed size
and dynamic arrays are indexed using integer expressions, while associative arrays can be indexed using
arbitrary data types. Associative arrays do not have any storage allocated until it is needed, which makes them
ideal for dealing with sparse data.

WITH

SystemVerilog uses the term “packed array” to refer to the dimensions declared before the object name (what
Verilog-2001 refers to as the vector width). The term “unpacked array” is used to refer to the dimensions
declared after the object name.
   bit [7:0] c1; // packed array
   real u [7:0]; // unpacked array

SystemVerilog enhances packed arrays by allowing multiple dimensions. SystemVerilog adds the ability to procedurally change the size of one of the dimensions of an unpacked array. Fixed-size unpacked arrays can be multi-dimensional and have fixed storage allocated for all the elements of the array. Each dimension of an unpacked array can be declared as having a fixed or un-fixed size. A Dynamic array allocates storage for elements at runtime along with option of changing the size of one of its dimensions. An associative array allocate storage for elements individually as they are written. Associative arrays can be indexed using arbitrary data types. A queue type of array grows or shrinks to accommodate the number elements written to the array at runtime..


DELETE from 4.2 (now moved into 4.1)

SystemVerilog uses the term “packed array” to refer to the dimensions declared before the object name (what
Verilog-2001 refers to as the vector width). The term “unpacked array” is used to refer to the dimensions
declared after the object name.
   bit [7:0] c1; // packed array
   real u [7:0]; // unpacked array


Modify the text in section 4.6

A Dynamic arrays is are one-dimensional  dimension of an unpacked arrays whose size can be set or changed at runtime.



-- 

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



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