Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   VHDL (http://www.velocityreviews.com/forums/f18-vhdl.html)
-   -   Help: conditional attribute assignment (http://www.velocityreviews.com/forums/t21454-help-conditional-attribute-assignment.html)

itsme 07-23-2003 03:15 PM

Help: conditional attribute assignment
 
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(
:
:
-----------------------------------------------------------






Ralf Hildebrandt 07-23-2003 03:26 PM

Re: Help: conditional attribute assignment
 
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



All times are GMT. The time now is 08:47 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.