Example: Generated Clock with Clock Multiplexer
The following figure illustrates multiple generated clocks defined at the same
divclk
Q pin. Because multiple clocks are defined at the same clkin pin, the
generated clock pin also needs to have multiple clocks defined to address all cases.
Notice that the examples uses the set_clock_groups SDC command because
only one of the two clocks are active at a given time.
SDC Commands
# Create 2 clocks and use the -add option to avoid overwriting the second one
create_clock -period 10 -name clk0 [get_ports clkin]
create_clock -period 10 -waveform {2.5 7.25} -name clk0_shift [get_ports clkin] -add
# There are 2 master clocks, so this example needs 2 generated clocks as well
create_generated_clock -source [get_ports clkin] -master_clock [get_clocks clk0] \
-divide_by 2 [ get_pins divclk|Q ] -name gen_clk0
create_generated_clock -source [get_ports clkin] -master_clock [get_clocks clk0_shift] \
-divide_by 2 [ get_pins divclk|Q ] -name gen_clk0_shift -add
# clk0 and it's generated counterpart operate independently from the clk0_shift and
# it's counterpart
set_clock_groups -exclusive -group {clk0 gen_clk0} -group {clk0_shift gen_clk0_shift}