Synthesis error: assignment outside of process using WHEN

Discussion in 'VHDL' started by lomtik, Dec 16, 2004.

  1. lomtik

    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?
     
    lomtik, Dec 16, 2004
    #1
    1. Advertising

  2. What happens with:
    EN_lower <= '1' when ((CSN='0') and (ADDR(8)='0'))
    -- Mike Treseler
     
    Mike Treseler, Dec 16, 2004
    #2
    1. Advertising

  3. lomtik

    rootz anabo Guest

    You need to have
    "else 0";
     
    rootz anabo, Dec 17, 2004
    #3
  4. lomtik

    rickman Guest

    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


    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
     
    rickman, Dec 18, 2004
    #4
  5. lomtik

    Jim Lewis Guest

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

    Expert VHDL Training for Hardware Design and Verification
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
    Jim Lewis, Dec 20, 2004
    #5
  6. lomtik

    lomtik Guest

    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, Dec 20, 2004
    #6
    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. walala
    Replies:
    4
    Views:
    2,158
    Ralf Hildebrandt
    Sep 8, 2003
  2. walala
    Replies:
    4
    Views:
    1,258
    Technology Consultant
    Sep 9, 2003
  3. WangE
    Replies:
    0
    Views:
    317
    WangE
    Nov 17, 2006
  4. fpgaengineer
    Replies:
    7
    Views:
    3,886
    Mike Treseler
    Mar 12, 2007
  5. Krzysztof Poc

    outside type, outside function

    Krzysztof Poc, Feb 3, 2012, in forum: C++
    Replies:
    1
    Views:
    305
    Victor Bazarov
    Feb 7, 2012
Loading...

Share This Page