How to Initialize 2D array in VHDL?

Status
Not open for further replies.

alexz

Full Member level 5
Joined
Nov 19, 2004
Messages
283
Helped
6
Reputation
12
Reaction score
3
Trophy points
1,298
Location
UK
Activity points
2,246
vhdl initialize array

How to Initialize 2D array in VHDL?


Code:
subtype	latchType   is std_logic_vector(15 downto 0) ;
type 	latchesType  is array (9 downto 0) of latchType ;
signal	mylatches	:	latchesType := ((others=>'0'),(others=>'0'),(others=>'0'),(others=>'0'),(others=>'0'),(others=>'0'),(others=>'0'),(others=>'0'),(others=>'0'),(others=>'0'));

Is there any more clever form of doing this?
 

vhdl array initialization


Try this:

Code:
signal	mylatches	:	latchesType := ((others=> (others=>'0')));

Can't get smaller than that

Ajeetha. CVC
www.noveldv.com
 
Reactions: verylsi

    verylsi

    Points: 2
    Helpful Answer Positive Rating
initialize array vhdl

Excellent !
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…