Clear array

D

Daniel

Guest
Hi all! I don't now how to clear an array. Is there an simple way to do it?

Cheers Daniel

subtype byte is std_logic_vector(7 downto 0);
type fifoType is array (0 to 10) of byte;
signal headerFifo: fifoType;

....
handleFifo: process(clk, reset_n)
begin
if reset_n='0' then
headerFifo<=(others=>'0'); --ERROR!!! <<<---------
elsif rising_edge(clk) then
...
end if;
end process;
....
 
Daniel wrote:
Hi all! I don't now how to clear an array. Is there an simple way to do it?

Cheers Daniel

subtype byte is std_logic_vector(7 downto 0);
type fifoType is array (0 to 10) of byte;
signal headerFifo: fifoType;

...
handleFifo: process(clk, reset_n)
begin
if reset_n='0' then
headerFifo<=(others=>'0'); --ERROR!!! <<<---------
elsif rising_edge(clk) then
...
end if;
end process;
...
It's an array of an array, so use
headerFifo <= (OTHERS => (OTHERS => '0'));

Kind regards,

Pieter Hulshoff
 

Welcome to EDABoard.com

Sponsor

Back
Top