• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Digital Implementation
  3. How to constrain a large number of clocks and child clocks...

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 89
  • Views 4583
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to constrain a large number of clocks and child clocks as asynchronous to each other?

FormerMember
FormerMember over 2 years ago

Dear community

Our design has three main clocks. Let's call them clk1, clk2, and clk3. Each clock has several child clocks running at the same frequency. So the SDC file could look like this:

create_clock -name "clk1" -period 62.5 -waveform {0.0 31.25} [get_ports clk1]
create_clock -name "clk2" -period 250.0 -waveform {0.0 125.0} [get_ports clk2]
create_clock -name "clk3" -period 83.3 -waveform {0.0 41.65} [get_ports clk3]

create_generated_clock -name "clk1a" -divide_by 1 -source [get_ports clk1]   [get_pins clk1a]
create_generated_clock -name "clk1b" -divide_by 1 -source [get_ports clk1]   [get_pins clk1b]
create_generated_clock -name "clk1c" -divide_by 1 -source [get_ports clk1]   [get_pins clk1c]
...

create_generated_clock -name "clk2a" -divide_by 1 -source [get_ports clk2]   [get_pins clk2a]
create_generated_clock -name "clk2b" -divide_by 1 -source [get_ports clk2]   [get_pins clk2b]
create_generated_clock -name "clk2c" -divide_by 1 -source [get_ports clk2]   [get_pins clk2c]
...

create_generated_clock -name "clk3a" -divide_by 1 -source [get_ports clk3]   [get_pins clk3a]
create_generated_clock -name "clk3b" -divide_by 1 -source [get_ports clk3]   [get_pins clk3b]
create_generated_clock -name "clk3c" -divide_by 1 -source [get_ports clk3]   [get_pins clk3c]
...

The child clocks are, logically, synchronous to their parent clock and thus to other child clocks derived from the same parent clock, but asynchronous to child clocks from other parent clocks. So for example, clk1 and its childs clk1a, clk1b, clk1c, ... are asynchronous to clk2 and clk3 including their children. Vice versa, clk2 and clk3 are asynchronous to clk1 and its children. Same is true between clk2 and clk3.

How can I constrain this without having to write down every single combination?

  • Cancel
  • RamesNaikBhukya
    RamesNaikBhukya over 2 years ago

    Hi,

    To constrain the timing of the clocks and their child clocks, you can use the "set_clock_groups" command in the SDC file. This command allows you to group clocks together and specify the relationship between them. In your case, you can group each parent clock and its child clocks together and specify that they are synchronous to each other.

    For example, to group clk1 and its child clocks together, you can use the following command:

    set_clock_groups -group [get_clocks -include_generated_clocks clk1] -synchronous
    

    This command groups all clocks related to clk1 together, including its child clocks, and specifies that they are synchronous to all other clock groups. You can use similar commands to group clk2 and its child clocks together and clk3 and its child clocks together.

    Using the "set_clock_groups" command allows you to constrain the timing of your clocks without having to write down every single combination. The command automatically considers all possible combinations within a clock group and constrains them accordingly.

    set_clock_groups -name "clk1_group" -group [get_clocks -include_generated_clocks -of [get_ports clk1]] -synchronous
    set_clock_groups -name "clk2_group" -group [get_clocks -include_generated_clocks -of [get_ports clk2]] -synchronous
    set_clock_groups -name "clk3_group" -group [get_clocks -include_generated_clocks -of [get_ports clk3]] -synchronous
    
    set_clock_groups -name "all_clocks" -group {clk1_group clk2_group clk3_group} -asynchronous
    

    In this example, we create a clock group for each parent clock and its child clocks, and then add these clock groups to a virtual clock group named "all_clocks". This ensures that all clocks in the same group are asynchronous with each other.


    --
    Ramesh

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • FormerMember
    FormerMember over 2 years ago in reply to RamesNaikBhukya

    Great answer! Thank you very much.

    Can you elaborate the difference between these two variants?

    -group [get_clocks -include_generated_clocks clk1]
    -group [get_clocks -include_generated_clocks -of [get_ports clk1]]
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RamesNaikBhukya
    RamesNaikBhukya over 2 years ago in reply to FormerMember

    The first variant uses the command:

    set_clock_groups -group [get_clocks -include_generated_clocks clk1]
    

    In this variant, the "get_clocks" command is used to get all the clocks in the design that are related to the clock "clk1", including the generated clocks derived from "clk1". 

    The second variant uses the command:

    set_clock_groups -group [get_clocks -include_generated_clocks -of [get_ports clk1]]
    

    In this variant, the "get_ports" command is used to get the port object for "clk1", and then the "get_clocks" command is used to get all the clocks related to this port, including the generated clocks. 

    The main difference between the two variants is in how the clock list is generated. The first variant gets all the clocks related to "clk1", regardless of where they are located in the design hierarchy. The second variant gets all the clocks related to the port object for "clk1", which may include clocks from other parts of the design hierarchy if they are connected to the same port as "clk1".

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • FormerMember
    FormerMember over 2 years ago in reply to RamesNaikBhukya

    Fantastic explaination, thank you very much.

    I added the following lines to my SDC file (the numbers in front are the line number):

    59: set_clock_group -name "clk1_group" -group [get_clocks -include_generated_clocks -of [get_ports clk1]] -synchronous
    60: set_clock_group -name "clk2_group" -group [get_clocks -include_generated_clocks -of [get_ports clk2]] -synchronous
    61: set_clock_group -name "clk3_group" -group [get_clocks -include_generated_clocks -of [get_ports clk3]] -synchronous
    
    62: set_clock_group -name "all_clocks" -group {clk1_group clk2_group clk3_group} -asynchronous

    Unfortunately, when reading in the SDC file I get some errors (I am using Innovus 21.10):

    **ERROR: (IMPTCM-67):    Option <patterns> and -of_objects are mutually exclusive. Check if more than one options that are mutually exclusive were given or if an invalid option was given.
    **ERROR: (TCLCMD-1009):    Conflicting options asynchronous and exclusive (File [...], Line 59).

    **ERROR: (IMPTCM-67):    Option <patterns> and -of_objects are mutually exclusive. Check if more than one options that are mutually exclusive were given or if an invalid option was given.
    **ERROR: (TCLCMD-1009):    Conflicting options asynchronous and exclusive (File [...], Line 60).

    **ERROR: (IMPTCM-67):    Option <patterns> and -of_objects are mutually exclusive. Check if more than one options that are mutually exclusive were given or if an invalid option was given.
    **ERROR: (TCLCMD-1009):    Conflicting options asynchronous and exclusive (File [...], Line 61).

    **WARN: (TCLCMD-513):    The software could not find a matching object of the specified type for the pattern 'clk1_group' (File [...], Line 62).

    **WARN: (TCLCMD-513):    The software could not find a matching object of the specified type for the pattern 'clk2_group' (File [...], Line 62).

    **WARN: (TCLCMD-513):    The software could not find a matching object of the specified type for the pattern 'clk3_group' (File [...], Line 62).

    **ERROR: (TCLCMD-917):    Cannot find 'clocks' that match 'clk1_group clk2_group clk3_group' (File [...], Line 62).

    Did I do something wrong?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • FormerMember
    FormerMember over 2 years ago in reply to FormerMember

    Update:

    Using

    set_clock_group -name "all_clocks" -group [list [get_clock_groups clk_group] [get_clock_groups sclk_a_group] [get_clock_groups sclk_raw_group]] -asynchronous

    also does not work. It yields a

    **ERROR: (TCLCMD-917):    Cannot find 'clocks' that match '' (File [...] Line 62).

    error message.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information