Illegal concurrent statement?

P

Philipp

Hi

I wanna evaluate for each bit in the std_logic_vector I(14 downto 0) the
following espression:


for I in 0 to 14 loop
RanIB_tmp(I) <= '1' when
((DST(I)(conv_integer(std_logic_vector(OLD_Dest)))='1')
and
(CDT(conv_integer(std_logic_vector(OLD_Dest)))='1'))
else '0';
end loop;

However, when I try to run the code it tells me that I am using an
illegal concurrent statement? Anyone an idea how I could write this in
an loop so that I can save some copy & paste?

many thanks
Philipp
 
M

Mike Treseler

Philipp said:
However, when I try to run the code it tells me that I am using an
illegal concurrent statement?

Maybe you forgot to put the loop inside a process.
 
K

kennheinrich

Maybe you forgot to put the loop inside a process.

It looks like the original signal assignment was a concurrent
assignment, which is OK on its own inside an architecture body.
Changing the "for ... loop... end loop", which is a sequential form,
into a "for ... generate ... end generate", which is a concurrent
statement, should make this construct OK in the same context.

- Kenn
 
D

Dal

The 'when ... else ...' is a concurrent signal assignment. If your
code is in a process then changing it to a 'if ... then ... else ...'
should fix the problem. If not in a process then using a generate as
suggested should also fix the problem.

Darrin
 
L

Luc

I think recoding to:

for I in 0 to 14 loop
if (DST(I09conv_integer(std_logic_vector(OLD_Dest)))='1')
and
(CDT(conv_integer(std_logic_vector(OLD_Dest)00='1')) then
RANIB_tmp(I) <= '1';
else
RanIB_tmp(I) <= '0';
end if;
end loop;

this should do it. Both are now sequential statements ( need to place
in a process)
Otherwise use generate ... statement as posted before

Luc
 

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,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top