Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
15052 Discussions

Constraints for Multiplexed Clocks

Honored Contributor I

I have an Arria V design that has 4 clocks: 


base_clk : from device pin to PLL input 

clk_1x : 1x output from PLL (same frequency as base_clk) 

clk_2x : 2x output from PLL (twice frequency of base_clk) 

clk_mux : output of a 2:1 mux whose inputs are clk_1x and clk_2x 


I can't see to determine how to setup the .sdc constraints for these clocks to meet these requirements: 


1) there is logic on clk_1x, clk_2x, and clk_mux that assumes all of these clocks are synchronous to each other 

2) the clk_mux is mode-based configured (i.e. the mux selection control is constant for a given operating mode) 


I have these basic lines in the .sdc file: 


create_clock -name base_clk -period 13.42 [get_nets {base_clk}] 




These constraints seem to take care of clk_1x and clk_2x domains but I can't figure out how to constrain clk_mux (assuming one is needed). 


I looked at the set_clock_groups documentation but I don't think I can use that because it would false path all nets between clk_1x and clk_2x (at least as I understand how the command works). 


Can someone help with this problem?
0 Kudos
2 Replies
Honored Contributor I

I'm not sure why you're using get_nets. You should be pointing to the input port for the base clock: 


create_clock -name base_clk -period 13.42 [get_ports {base_clk}] 


You also probably need to make clk_mux a generated clock. It might even need to be two generated clocks, clk_mux_1x and clk_mux_2x, if the output of the mux is used as the source or destination clock and clk_1x or clk_2x are used at the other end. In other words, you need to think of all possibilities that you are using for the source and destination clocks throughout your design. 


As for your question, if all possibilities of source and destination clock are valid throughout your design (1x -> 2x, 2x -> 1x, 1x -> 1x, 2x -> 2x), then you don't need any false paths or clock group timing exceptions. Those are only needed when clock crossings in either direction between 1x and 2x should not be analyzed. What you do need, if you don't use separate registers to handle the transfers between the 1x and 2x clock domains, are multicycle timing exceptions. For going from 2x to 1x, you'll need start multicycle to move the launch edge and for going from 1x to 2x you may need end multicycle to move the latch edge used in the 2x domain to match up with the 1x domain. So it might look like this: 


set_multicycle_path –from clk_2x –to clk_1x –setup –start 2 

set_multicycle_path –from clk_2x –to clk_1x –hold –start 1 

set_multicycle_path –from clk_1x –to clk_2x –setup –end 2 

set_multicycle_path –from clk_1x –to clk_2x –hold –end 1 


This Wiki page gives a good rundown of multicycle:
Honored Contributor I

Yes, the "get_nets" should have been "get_ports" for my example (unfortunate typo). 


Your suggestions make sense and I will try to implement these in my next build and TimeQuest runs. 


Thanks for your help!