Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Dimensions of 2-d array

Status
Not open for further replies.

nesta

Junior Member level 2
Joined
Feb 19, 2010
Messages
20
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,466
Hi,

How to find dimensions of a given 2-d array in vhdl? is there any standard attribute to find the dim.

Thanks
 

Hi,

On my PC i do not have a VHDL compiler to make a small example,
so have you tried the array2d'range or (array2d'right or arry2d'left).
regards
JoseMiguel
 

IIRC, x'length(2) is defined for this. Most of the dimension attributes are overloaded to default to the first dimension, but do take an argument.

most synthesizers usually list support for arrays of arrays. eg "type mytype is array (natural range <>) of std_logic_vector(7 downto 0)". The tools may not like 2-d arrays in some situations, like unconstrained ports or unconstrained inputs to functions.
 
IIRC, x'length(2) is defined for this. Most of the dimension attributes are overloaded to default to the first dimension, but do take an argument.

There is no overloading of any attributes, the number in brackets refers to the nth dimension (starting from 1, annoyingly) for n-d arrays. But for 1-d array a specific dimension is implied as 1.

You example type is a 1-d array, because it only has 1 range specifier in the array declaration.
 

yes, that is pretty much all I've ever seen recommended from vendors -- the 1d array of 1d arrays where only 1 dimension is not fixed.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top