COMPILATION ERROR

Discussion in 'VHDL' started by srinukasam, Jul 5, 2005.

  1. srinukasam

    srinukasam Guest

    Hello
    In my design what i need is to compare 2 bit vectors( one is of multiple
    lenth with the other one) parallel with generate statement. I wrote design
    and test benches. But at the time of compilation its giving errors with
    generate command. Could you please see once and mail me what is the error
    with my design.

    DESIGN:------------------------------------------------------

    LIBRARY ieee;
    USE ieee.std_logic_1164.all;
    USE ieee.std_logic_arith.all;
    use work.contr_pak.all;

    ENTITY nest_addr IS
    generic(pstate_width:integer :=8;
    mem_width:integer:=128; --out from mem..in to logic
    no_of_ns: integer:=16; --for array size .this block
    index: integer :=4);
    port( clk :in std_logic;
    diff_states: in std_logic_vector(mem_width-1 downto 0 );
    pstate: in std_logic_vector(pstate_width-1 downto 0);
    data :eek:ut std_logic_vector(index-1 downto 0));
    END ENTITY nest_addr;

    --
    ARCHITECTURE nest_addr_beh OF nest_addr IS
    type temp is array ( o to no_of_ns-1) of std_logic_vector(0 to
    pstate_width-1);
    signal temp_c:temp;
    signal temp_vect :std_logic_vector (no_of_ns-1 downto 0);
    signal data_temp:integer:=0;
    begin

    assign:process(diff_states)
    variable first:integer:=0;
    variable second:integer:=0;
    begin
    for i in 0 to no_of_ns loop
    if i =0 then
    temp_c(i)<=diff_states(pstate_width-1 downto 0);
    else
    first:=first+pstate_width;
    second:=first+(pstate_width-1);
    temp_c(i)<= diff_states(second downto first);
    end if;
    end loop;
    end process assign;


    ns:for i in 0 to no_of_ns-1 generate
    if (temp_c(i)= pstate) then -- THIS STATEMENT SHOWS THE
    ERROR:
    data_temp<=i;
    --else
    end if;
    end generate ns;

    conv: process(data_temp)
    begin
    data<=int_to_vect(4,data_temp);
    end process;
    END ARCHITECTURE nest_addr_beh;


    THANK YOU
    srinukasam, Jul 5, 2005
    #1
    1. Advertising

  2. > ns:for i in 0 to no_of_ns-1 generate
    > if (temp_c(i)= pstate) then -- THIS STATEMENT SHOWS THE
    > ERROR:
    > data_temp<=i;
    > --else
    > end if;
    > end generate ns;


    The concurrent 'if-then' statement is called 'when' and the else part must
    always exist to infere a MUX:

    data_temp <= i when (temp_c(i)= pstate) else alternative;

    Furthermore, I have doubts that you can assign the data_temp multiple values
    simultaneously.
    valentin tihomirov, Jul 5, 2005
    #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. Vittal
    Replies:
    2
    Views:
    703
    Gordon Burditt
    Jul 8, 2003
  2. =?ISO-8859-1?Q?Martin_J=F8rgensen?=
    Replies:
    5
    Views:
    1,292
    =?ISO-8859-1?Q?Martin_J=F8rgensen?=
    May 6, 2006
  3. Gavin
    Replies:
    3
    Views:
    468
    Chris Uppal
    Mar 28, 2007
  4. C__chp
    Replies:
    4
    Views:
    501
    Puppet_Sock
    Feb 15, 2008
  5. Tassador

    const string error compilation - error C2679

    Tassador, Jul 19, 2009, in forum: C Programming
    Replies:
    0
    Views:
    622
    Tassador
    Jul 19, 2009
Loading...

Share This Page