Forum Discussion
Altera_Forum
Honored Contributor
15 years agono. the achievement would be to calculate various variables in unconstrained way. Imagine you have entity generating clock enable after X clock cycles. If your clock is a generic as well (so say you define XOSC_CLK : time := 25ns), then you can specify various time constants in the design in terms of time. In case of the clock enable generator you would say that you wish to generate clock enable every 100us, hence the generic input to this entity would be TICKS_WAIT : integer := 100 us / XOSC_CLK.
In standard way this situation is solved using integers because apparently clock division does not work in quartus synthesis (besides the fact the division of two times results in integer and thus fully synthesizable unit). Then you have to pass as generic something like TICKS_WAIT : integer := 4000. While the definition of generic by time would bring you clear understanding what you're setting, number of ticks is in integer is not so clear.