M
--MMS--
How can I initialize/assign all the bits of a two-dimensional array to
zero?
Below is part of my code:
-----------------------------------------------------------------------
SUBTYPE tags IS std_logic_vector (16 DOWNTO 0);
TYPE entry IS RECORD
-- valid : BOOLEAN;
tag : tags;
data: std_logic_vector(31 downto 0);
END RECORD;
TYPE eachCache IS ARRAY (sets) OF entry;
Type elCache is array (INTEGER RANGE 0 TO 1) of eachCache;
TYPE ww IS ARRAY(ways) OF ways;
Signal cache : elCache;
-------------------------------------------------------------------------
Specifically, what I wish to know is how to set all bits of signal
"cache" to zero.
It apparently works if I do....
cache(w)(s).data <= (others => '0');
....but I would like to know if I can do something like that in the
same line were I declare the signal. I have tried many alternatives,
but have not get the solution yet.
Thanks in advance,
MMS
zero?
Below is part of my code:
-----------------------------------------------------------------------
SUBTYPE tags IS std_logic_vector (16 DOWNTO 0);
TYPE entry IS RECORD
-- valid : BOOLEAN;
tag : tags;
data: std_logic_vector(31 downto 0);
END RECORD;
TYPE eachCache IS ARRAY (sets) OF entry;
Type elCache is array (INTEGER RANGE 0 TO 1) of eachCache;
TYPE ww IS ARRAY(ways) OF ways;
Signal cache : elCache;
-------------------------------------------------------------------------
Specifically, what I wish to know is how to set all bits of signal
"cache" to zero.
It apparently works if I do....
cache(w)(s).data <= (others => '0');
....but I would like to know if I can do something like that in the
same line were I declare the signal. I have tried many alternatives,
but have not get the solution yet.
Thanks in advance,
MMS