Synthesis error: assignment outside of process using WHEN

L

lomtik

Guest
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?
 
What happens with:
EN_lower <= '1' when ((CSN='0') and (ADDR(8)='0'))
-- Mike Treseler
 
rickman wrote:

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:Jim@SynthWorks.com
SynthWorks Design Inc. http://www.SynthWorks.com
1-503-590-4787

Expert VHDL Training for Hardware Design and Verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
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
 
lomtik wrote:
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

rick.collins@XYarius.com
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
 

Welcome to EDABoard.com

Sponsor

Back
Top