08-16-2018 03:07 AM
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?
08-16-2018 03:44 AM - edited 08-16-2018 03:46 AM
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.
Consider giving "Kudos" if you like my answer. Please mark my post "Accept as solution" if my answer has solved your problem
08-16-2018 04:13 AM
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.