Synthesis error: assignment outside of process using WHEN

L

lomtik

Hi, I am getting the following error inside my architecture.

"EN_lower <= '1' when ((not CSN) and (ADDR(8)='0'))" gives me the
following error:
"can not have such operands in this context."

All my signals are declared.
I guess (1) I cannot use boolean expressions, so instead of (not CSN) I
would use "EN_lower <= '1' when (CSN='0').


How to fix that?
 
M

Mike Treseler

What happens with:
EN_lower <= '1' when ((CSN='0') and (ADDR(8)='0'))
-- Mike Treseler
 
R

rickman

lomtik said:
Hi, I am getting the following error inside my architecture.

"EN_lower <= '1' when ((not CSN) and (ADDR(8)='0'))" gives me the
following error:
"can not have such operands in this context."

All my signals are declared.
I guess (1) I cannot use boolean expressions, so instead of (not CSN) I
would use "EN_lower <= '1' when (CSN='0').

How to fix that?

You are mixing boolean results with signal results. "not CSN" is a
signal, inverted from CSN. "ADDR(8) = '0'" is a boolean result which is
true when ADDR(8) is 0. There is no AND operator which can use one
signal input and one boolean input.

There are many ways to fix this. You can change it to

EN_lower <= '1' when CSN = '0' and ADDR(8)='0'...

or you can just use the logical operators to assign a value,

EN_lower <= not CSN and not ADDR(8);


--

Rick "rickman" Collins

(e-mail address removed)
Ignore the reply address. To email me use the above address with the XY
removed.

Arius - A Signal Processing Solutions Company
Specializing in DSP and FPGA design URL http://www.arius.com
4 King Ave 301-682-7772 Voice
Frederick, MD 21701-3110 301-682-7666 FAX
 
J

Jim Lewis

rickman said:
There are many ways to fix this. You can change it to

EN_lower <= '1' when CSN = '0' and ADDR(8)='0'...

or you can just use the logical operators to assign a value,

EN_lower <= not CSN and not ADDR(8);

From a simulation accuracy stand point, use the last
from (with no when) when possible (anytime not using
an array or array slice). If you use the when form and
either CSN or ADDR(8) are 'X' that sense of 'X' is lost.
Cheers,
Jim

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jim Lewis
Director of Training mailto:[email protected]
SynthWorks Design Inc. http://www.SynthWorks.com
1-503-590-4787

Expert VHDL Training for Hardware Design and Verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
L

lomtik

so, (CSN = 'X' and ADDR(8) = '0' )
will result in 'X', thus EN_lower <= '1' when (CSN = 'X' and ADDR(8) =
'0' ) else '0'
will result in 0, thus missing the sence of 'X', right?
Thank you for fast replies
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top