21.8.7 create_generated_clock
(Ask a Question)Description
Creates a generated clock in the current design at a declared source by defining its frequency with respect to the frequency at the reference pin. The static timing analysis tool uses this information to compute and propagate its waveform across the clock network to the clock pins of all sequential elements driven by this source.
The generated clock information is also used to compute the slacks in the specified clock domain that drive optimization tools such as place-and-route.
create_generated_clock [-name clock_name ] [–add] \
[-master_clock clock_name ] \
-source reference_pin \
[- divide_by divide_factor ] \
[-multiply_by multiply_factor ] \
[-invert] source [-edges values ] \
[-edge_shift values ]
Arguments
Parameter | Type | Description |
---|---|---|
name | string | Specifies the name of the clock constraint. If the -name option is not used,
the generated clock receives the same name specified in the source.
The clock name refer to the clock in other commands. You can specify
-name {my_gen_clk} or -name
my_gen_clk . |
add | None | Specifies that the generated clock constraint is a new clock constraint in addition to the existing one at the same source. Use this option to capture the case where multiple generated clocks must be specified on the same source, because multiple clocks fan into the master pin. If you specify this option, you must also use the -name option. The name of the clock constraint should be different from the existing clock constraint. With this option, the -master_clock and -name options must be specified. |
master_clock | string | Specifies the master clock used for the generated clock when multiple clocks fan into the master pin. This option must be used in conjunction with -add option of the generated clock. Note:
|
source | string | Specifies the reference pin in the design from which the clock waveform is to be derived. You must specify the -source reference pin. |
divide_by | integer | Specifies the frequency division factor. This option cannot be used with -egde list. If -egde is specified, the divide_by value defaults to one. For example, if the divide_factor is equal to 2 , the generated clock period is twice the reference clock period. If you set the divide_by value to 1.2 or 4/2 or 8a2 , it is being truncated as 1 or 4 or 8 , and no warning is reported. |
multiply_by | integer | Specifies the frequency multiplication factor. This option cannot be used with -egde list. If egde is specified, the multiply_by and divide_by values default to one. For example, if the multiply_factor is equal to 2 , the generated clock period is half the reference clock period. If you set the multiply_by value to 1.2 or 4/2 or 8a2 , it is being truncated as 1 or 4 or 8 , and no warning is reported. |
invert | None | Specifies that the generated clock waveform is inverted with respect to the reference clock. |
source | list of strings | Specifies the source of the clock constraint on internal pins of the design. If you specify a clock constraint on a pin that already has a clock, the new clock replaces the existing clock. Only one source is accepted. Wildcards are accepted as long as the resolution shows one pin. You must specify a source. |
edges | list of integers | Specifies a list of positive integers which represent the edges from the source clock that are to form the edges of the generated clock. To generate the clock, three values must be specified. If you specify less than three values, a tool tip indicates an error. This option cannot be used with the -divide_by/-multiply_by factor. |
edge_shift | list of floating point numbers | Specifies a list of three floating point numbers which represent the amount of shift (in nanoseconds) that the specified edges are to undergo to yield the final generated clock waveform. These floating point values can be positive or negative. Positive value indicates a shift later in time, while negative indicates a shift earlier in time. With this option, the -edges option must be specified. |
Return Type | Description |
---|---|
integer | Returns the ID of the generated clock constraint. |
Error Codes
Error Code | Description |
---|---|
Error: SDC0004 | Invalid generated clock constraint: Name does not match any clock name or source. |
Error: SDC0015 | Invalid generated clock constraint: Port list is incorrect. |
Error: SDC0016 | Invalid generated clock constraint: Port list is empty. |
Error: SDC0061 | Invalid generated clock constraint: The -edges argument is empty invoked from within command. |
Error: SDC0062 | Invalid generated clock constraint: The -edges list size must be three. |
Error: SDC0063 | Invalid generated clock constraint: The -edges list elements are not in increasing order. |
Error: SDC0065 | Invalid generated clock constraint: The -edges cannot be used with the -multiply_by or -divide_by option. |
Error: SDC0066 | Invalid generated clock constraint: The -edge_shift does not have accompanying -edges . |
Error: SDC0069 | Invalid clock constraint: Need to specify a clock name with the -add option. |
Supported Families
PolarFire® |
PolarFire SoC |
SmartFusion® 2 |
IGLOO® 2 |
RTG4™ |
Example
The following example creates a generated clock on pin U1/reg1:Q
with a period twice as long as the period at the reference port CLK.
create_generated_clock -name {my_user_clock} -divide_by 2 \
-source [get_ports {CLK}] U1/reg1:Q
The following example creates a generated clock at the primary output of myPLL with a period 3⁄4 of the period at the reference pin clk.
create_generated_clock -divide_by 3 -multiply_by 4 \
-source clk [get_pins {myPLL:CLK1}]
The following example creates a new generated clock gen2 in addition to gen1 derived from same master clock as the existing generated clock, and the new constraint is added to pin r1/CLK
.
create_generated_clock -name gen1 -multiply_by 1 \
-source [get_ports clk1] [get_pins r1/CLK]
create_generated_clock -name gen2 -add -master_clock clk1 \
-source [get_ports clk1] \
-multiply_by 2 [get_pins r1/CLK]
The following example does not create a new generated clock constraint in addition to the existing clock, but overrides even with the -add
option enabled because the same names are used.
create_generated_clock -name gen2 -source [get_ports clk1] \
-multiply_by 3 [get_pins r1/CLK]
create_generated_clock -name gen2 -source [get_ports clk1] \
-multiply_by 4 -master_clock clk1 \
-add [get_pins r1/CLK]
The following example shows an SDC constraint for a generated clock of 50 MHz reference clock and 100 MHz output clock with a 90° phase shift.
create_generated_clock \
-name {FCCC_0/GL0} -multiply_by 4 -divide_by 2 \
-source [get_pins {FCCC_0/CCC_INST/RCOSC_25_50MHZ}] \
-phase 0 [get_pins {FCCC_0/CCC_INST/GL0}]
create_generated_clock \
-name {FCCC_0/GL1} -multiply_by 4 -divide_by 2 \
-source [get_pins {FCCC_0/CCC_INST/RCOSC_25_50MHZ}] \
-phase 90 [get_pins {FCCC_0/CCC_INST/GL1}]
-pll_feedback
and the -pll_output
switches with the create_generated_clock
constraint when the CCC/PLL is used in the external feedback mode.create_clock -period 25.000
-waveform {0.000 12.500}
-name {sys_clk} [get_ports \{clk}]
create_generated_clock
-name {PLL_200MHZ}
-multiply_by 5
-source [ get_pins { phase_locked_loop0/pll_pf_40in_40_100_200out_0/pll_inst_0/REF_CLK_0 } ]
-pll_output [ get_pins { phase_locked_loop0/pll_pf_40in_40_100_200out_0/pll_inst_0/OUT0 } ]
-pll_feedback [ get_pins { phase_locked_loop0/pll_pf_40in_40_100_200out_0/pll_inst_0/FB_CLK } ]
-phase 0 [ get_pins { phase_locked_loop0/pll_pf_40in_40_100_200out_0/pll_inst_0/OUT0 } ]