Size of an array

Hi Kwaj,
No "command", but an attribute of a vector named Length

a_vec'length

HTH,
Srinivasan

--
Srinivasan Venkataramanan
Senior Verification Engineer, Intel Bangalore, India
Co-Author of: Using PSL/SUGAR for Formal and Dynamic Verification 2nd
Edition,
2004 isbn 0-9705394-6-0, Ben Cohen, Srinivasan & Ajeetha

http://www.noveldv.com
I don't speak for Intel

"kwaj" <k.otengNOSPAM@student.unsw.edu.auNOSPAM> wrote in message
news:c0c0rm$djj$1@tomahawk.unsw.edu.au...
Is there a command to return the size of an array?

--
- Kwaj
 
"kwaj" <k.otengNOSPAM@student.unsw.edu.auNOSPAM> wrote in message news:<c0c0rm$djj$1@tomahawk.unsw.edu.au>...
Is there a command to return the size of an array?
There is a predefined attribute that will do this:

A'Length (n) returns number of values in the n-th index range of array A
For a single-dimensional array (n) can be omitted.

A'Length can be used like this:

signal b : std_logic_vector( A'Length - 1 downto 0 );


or almost anywhere where you would want to plug in the length of A
 

Welcome to EDABoard.com

Sponsor

Back
Top