Altera_Forum
Honored Contributor
10 years agoclock mux, clock dividers and best clock constraints to use
hi,
i have a slow speed system as follows - 20M refclk -> clk divider giving refclk/2, refclk/4 -> clk_mux (to select clock going into rest of the syste) -> clk_gate -> ciock going into rest of the system the clock divider, clk_mux, clk_gate are coded in verilog (they are not IPs in any way) the above design leads to gates on the clock path, but i still have to implement the design as is and since its a slow speed design, i might be able to get away with the skew. so i had some questions regarding the best way of constraining the above design - 1) is it OK to constraint the clk divider outputs using the following syntax - create_generated_clock -source [get_ports {refclk}] -divide_by 4 -multiply_by 1 [get_pins {clk_divider|DTC_CTSROOT_1|Q|q}] create_generated_clock -source [get_ports {refclk}] -divide_by 2 -multiply_by 1 [get_pins {clk_divider|DTC_CTSROOT_2|Q|q}] or should i use get_keepers in the constraint somewhere? is the above constraint wrong in anyway? Timequest does not throw an error by i've read that get_keepers should be used for this. is that correct? 2) is it OK to constraint the clk mux outputs using the following syntax (constraining the clk_mux output to the fastest/worst case frequency) - create_generated_clock -source [get_ports {refclk}] -divide_by 2 -multiply_by 1 [get_pins {clk_mux_2to1|Z|combout}] 2a) when i use the above constraint, i get a warning in QuartusII saying - No paths exist between clock target "clk_mux_2to1|Z|combout" of clock "clk_mux_2to1|Z|combout" and its clock source. Assuming zero source clock latency.” why is this? 2b) my 2:1 clock mux is simply coded in verilog as - Z = sel? A0, A1 where Z is the output and A0, A1 are the clock inputs, sel is the select line for the mux is the above method of constraint correct or do i need to use get_keepers in the constraint somewhere? 3) i know get_keepers returns a set of non-combinational nodes in the design. so is the get_keepers only applicable to clocked/registered logic? or should it be used to constraint combinatorial logic too? 4) since i have a clock gate in my design as well, is my understanding correct that i will need to constraint the clock gate output as well (to the worst case frequency output from the clk_gate)? if so, can i simply use the constraint below or do i need to use get_keepers in here somewhere? create_generated_clock -source [get_ports {refclk}] -divide_by 2 -multiply_by 1 [get_pins {clk_gate|out_clkt}] please let me know ... thanks in advance ... :) z.