Clear array

D

Daniel

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;
....
 
P

Pieter Hulshoff

Daniel said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top