Clear array

Discussion in 'VHDL' started by Daniel, Apr 3, 2008.

  1. Daniel

    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, Apr 3, 2008
    #1
    1. Advertising

  2. 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
    Pieter Hulshoff, Apr 3, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Junior

    how to clear integer array

    Junior, Jan 19, 2004, in forum: Java
    Replies:
    2
    Views:
    11,544
    Michael Borgwardt
    Jan 19, 2004
  2. David

    Response.Clear() doesn't clear

    David, Jan 31, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    1,003
    Mark Fitzpatrick
    Jan 31, 2008
  3. InvalidLastName

    Unrecognized element 'add' after <clear></clear>

    InvalidLastName, Feb 26, 2007, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    933
    Steven Cheng[MSFT]
    Mar 6, 2007
  4. Ray at

    clear out an array

    Ray at, Jan 16, 2004, in forum: ASP General
    Replies:
    1
    Views:
    98
  5. Replies:
    5
    Views:
    130
    YANAGAWA Kazuhisa
    Mar 8, 2006
Loading...

Share This Page