Skip to content

cts: fix existing clock tree identification#10291

Open
openroad-ci wants to merge 7 commits intoThe-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:cts_fix_exiting_tree_identification
Open

cts: fix existing clock tree identification#10291
openroad-ci wants to merge 7 commits intoThe-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:cts_fix_exiting_tree_identification

Conversation

@openroad-ci
Copy link
Copy Markdown
Collaborator

Summary

To avoid creating a clock tree on a clock net that already has a tree, CTS looks for a buffer with the source type TIMING. However other commands before CTS can insert buffer in the clock net that have the source type TIMING and CTS doesn't build the tree when it should.

This PR improves the identification of an existing clock tree to look if the TIMING buffer drives the clock net. Also, if there is a TIMING buffer as a load of the net, skip the buffer and build the clock tree only for the other sinks.

Type of Change

  • Bug fix

Impact

This fix corrects how separateMacroRegSinks identifies nets that already belong to an existing clock tree:

  • Output pin of a timing buffer (iterm->isOutputSignal() && isTimingBuffer): The buffer is driving this net, so the net genuinely already has a clock buffer — return false with CTS-0105. This is the same early-exit as before, but now correctly scoped to output pins only.

  • Input pin of a timing buffer (iterm->isInputSignal() && isTimingBuffer): The buffer is a sink that will be traversed by initOneClockTree, so it should be skipped rather than added to register/macro sink lists. The buffer instance is saved in skippedTimingBuf.

  • Post-loop guard (line 1503): If a timing buffer input was skipped but fewer than 2 real sinks remain, the net is effectively already covered by an existing tree — return false with the new CTS-0110 warning.

Verification

  • I have verified that the local build succeeds (./etc/Build.sh).
  • I have run the relevant tests and they pass.
  • My code follows the repository's formatting guidelines.
  • I have included tests to prevent regressions.
  • I have signed my commits (DCO).

Related Issues

Fixes #10177

Signed-off-by: arthurjolo <arthurjl@precisioninno.com>
Signed-off-by: arthurjolo <arthurjl@precisioninno.com>
Signed-off-by: arthurjolo <arthurjl@precisioninno.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the separateMacroRegSinks function in TritonCTS.cpp to properly handle nets that already contain timing buffers by skipping their sinks during separation and issuing a warning (CTS 110) if the net has fewer than two sinks. A new test case, buffer_ports, is added to verify this behavior. Feedback indicates a copy-paste error in the new test script where output and reference filenames do not match the test name.

Comment thread src/cts/test/buffer_ports.tcl Outdated
Comment on lines +42 to +44
set vout_file [make_result_file gated_clock4.v]
write_verilog $vout_file
diff_files gated_clock4.vok $vout_file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The test script appears to use result and comparison filenames (gated_clock4.v and gated_clock4.vok) that do not match the test name (buffer_ports). This suggests a copy-paste error from another test (likely gated_clock4.tcl). Please update these to use names consistent with this test and ensure the corresponding reference file is correctly named and included.

@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: arthurjolo <arthurjl@precisioninno.com>
Signed-off-by: arthurjolo <arthurjl@precisioninno.com>
@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CTS-0105: hierarchical synthesis output buffers incorrectly have dbSourceType::TIMING

2 participants