Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Clear array

Reply
Thread Tools

Clear array

 
 
Daniel
Guest
Posts: n/a
 
      04-03-2008
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;
....
 
Reply With Quote
 
 
 
 
Pieter Hulshoff
Guest
Posts: n/a
 
      04-03-2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Response.Clear() doesn't clear David ASP .Net 2 01-31-2008 08:32 PM
Unrecognized element 'add' after <clear></clear> InvalidLastName ASP .Net Web Services 3 03-06-2007 03:07 AM
ridiculous behavoir of Array#push and Array#clear hongseok.yoon@gmail.com Ruby 5 03-08-2006 03:31 PM
how to clear integer array Junior Java 2 01-19-2004 05:10 PM
clear out an array Ray at ASP General 1 01-16-2004 11:06 PM



Advertisments