Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - COMPILATION ERROR

 
Thread Tools Search this Thread
Old 07-05-2005, 02:00 PM   #1
Default COMPILATION ERROR


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 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

assignrocess(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
  Reply With Quote
Old 07-05-2005, 02:27 PM   #2
valentin tihomirov
 
Posts: n/a
Default Re: COMPILATION ERROR
> 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
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
URGENT Help needed with ASP.NET Compilation error nunu_bug General Help Related Topics 0 08-06-2009 01:26 PM
Need help on Modelsim VHDL syntax? ASAP:) kaji General Help Related Topics 0 03-14-2007 10:43 PM
Need help on a Modelsim VHDL Syntax? ASAP:) kaji Software 0 03-14-2007 10:43 PM
Need Help on a Modelsim VHDL Syntax....ASAP:) kaji Hardware 0 03-14-2007 10:41 PM
Parser Error Message: Could not load type 'Microsoft.SharePoint.ApplicationPages.Glob rasmita General Help Related Topics 0 09-05-2006 05:49 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46