Help: conditional attribute assignment

Discussion in 'VHDL' started by itsme, Jul 23, 2003.

  1. itsme

    itsme Guest

    Hi all,
    I have a quite simple question:
    Is it possible to set an attribute depending on a generic variable. As an
    example I have the following code. I want to set the attribute
    CLKFX_MULTIPLY to 4 or 8 depending on FastClk. Hoe can I do this?
    thanks peter

    ----------------------------------------------------------------------
    entity Clock_gen is
    generic (Is_FastClk: boolean:=false);
    port (P_50MHZ_CLK : in std_logic;
    :
    :
    );
    end Clock_gen;

    architecture structural of Clock_gen is
    component DCM
    :
    end component;

    attribute CLKFX_MULTIPLY : integer;

    -- if Is_FastClk
    attribute CLKFX_MULTIPLY of U_DCM : label is 4;
    -- else
    attribute CLKFX_MULTIPLY of U_DCM : label is 8;

    begin

    U_DCM: DCM
    port_map(
    :
    :
    -----------------------------------------------------------
    itsme, Jul 23, 2003
    #1
    1. Advertising

  2. Hi "itsme"!


    > Is it possible to set an attribute depending on a generic variable.


    Hmm. I'm not sure, bute what about the following:


    gen1: if generic_parameter=1 generate
    -- set you attribute
    end generate;

    gen0: if generic_parameter=0 generate
    -- set you attribute not / an other attribute
    end generate;


    (generic_parameter is of type integer in this example)

    Ralf
    Ralf Hildebrandt, Jul 23, 2003
    #2
    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. Anand P Paralkar
    Replies:
    2
    Views:
    9,348
    Srinivasan Venkataramanan
    Aug 4, 2003
  2. Johnsy Joseph

    Conditional assignment to signals

    Johnsy Joseph, Sep 21, 2004, in forum: VHDL
    Replies:
    8
    Views:
    4,852
    Raghavendra
    Sep 24, 2004
  3. Replies:
    2
    Views:
    2,760
  4. Alec S.
    Replies:
    10
    Views:
    10,083
    Alec S.
    Apr 16, 2005
  5. xamdam

    Assignment-in-conditional

    xamdam, Aug 31, 2006, in forum: Python
    Replies:
    5
    Views:
    400
    Simon Forman
    Sep 1, 2006
Loading...

Share This Page