UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
856 Views
Registered: ‎11-26-2016

Pass clock frequency attribute to generic

Hello,

 

A custom IP needs to know the frequency in MHz of the clock connected to it in order to do some calculation. It is one possibility to let the user set it in the configuration GUI, however, I would prefer if the generic gets set automatically according to the clock that is connected to it since this is less error-prone. There is, for example, a parameter called FREQ_HZ that could be useful.

 

Is this possible? If so, how?

 

Thanks,
so-lli1

0 Kudos
2 Replies
Scholar dpaul24
Scholar
844 Views
Registered: ‎08-07-2014

Re: Pass clock frequency attribute to generic

@so-lli1,

You can do something like this:

 

 

    clk_info_gen: if ENABLE_CLK_FREQ_X = '1' generate  
        connected_clk_info <= <info_to_pass>;
    else generate
        connected_clk_info <= <someother_info_to_pass>;
    end generate clk_info_gen;

 ENABLE_CLK_FREQ_X would be a generic.

--------------------------------------------------------------------------------------------------------
FPGA enthusiast!
All PMs will be ignored
--------------------------------------------------------------------------------------------------------
0 Kudos
Adventurer
Adventurer
832 Views
Registered: ‎11-26-2016

Re: Pass clock frequency attribute to generic

Hi @dpaul24,

 

Thank you for your quick response. I think there is a misunderstanding. What I actually want is the custom IP-Core to set a generic at the top level of my RTL with the CLK frequency of the clock connected by a user so that specific action can be taken within the module.

0 Kudos