I will declare three asynchronous clocks.
1-clk1
2-clk2
3- the output of the two divided register
the open point is, do you have some logic between clk1 or clk2 to two-divided register output? Are they considere as asynchronous domains?
I may only select the fastest clock from clk1 and clk2, define it as the source clock for your divided-by-2 clock. The generated clock should be defined at the output of the flipflop. In the meantime, set constant value on the mux to propagate the fastest clock.
First create the two clocks by create_clock command.
set false path between clk1 and clk2
create generated clock as u are dividing it by 2 there is a direct command for that create_generated_clock.
I second with nisshith's opinion . First create CLK1 and CLK2 definition by create_clock and then create one more clock at output of the register by using create_generated_clock
If output of the register be the main clock and clock generation starts from register output and goes to all leaf registers clock input then no need to specify relationship between CLK1 and CLK2.
If CLK1 and CLK2 still existing in the design then need to provide relationship between those two clocks.Like
bschaitanya is correct but still I want to add few more points.
first of all - clk1 and clk2 are exclusive to each other. so you have to set a clock group with respect to these 2 clocks. For setting the exclusive clock you can use any of the option.
you can also use the case analysis in case you want to disable a particular clock for any of your operation.
you can use the physically_exclusive option also in case there is not past relationship between the CLK1 and CLK2.. physically exclusive means no crosstalk between these clocks.
now for the divide by 2 clock .. you cn use following command- which is well know...
now the main question is how to generate or say name of the clock at port CLK of flipflop/register because after multiplexing the name of clocks are different.. for that purpose this -add option is used. See the snap shot of the -add switch in the create_clock
-add
Specifies whether to add this clock to the existing clock or to overwrite it. Use this option to capture the case where multiple clocks must be specified on the same source for simultaneous analysis with different clock waveforms. When you specify this option, you must also use the -name option.
if you are using the case analysis .... then there is no need of using this..
@Birdy
Thanks for putting additional info especially physically_exclusive switch. It's a good way to define constraint with "set_clock_groups"
@ Kumar
Birdy provides info on " -add " switch
Here is an explanation why "-add" added..
That is, during timing analysis, CLK2 is never seen after the div_by_2 register.
During clock tree synthesis, only CLK1 is balanced through the MUX and the div_by_2_reg and CLK2 stop at the same register and treat it as a
SYNC pin. If you want CLK2 to trace through the div_by_2_reg, so we need to add the following additional generated clock: