Skip to content

Commit e01bdad

Browse files
authored
Merge pull request #10646 from The-OpenROAD-Project-staging/secure-fix-cts-propagated-clock
cts: Preserve virtual clock latency
2 parents fcf6e5b + f14631c commit e01bdad

5 files changed

Lines changed: 88 additions & 1 deletion

File tree

src/cts/src/TritonCTS.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2574,6 +2574,10 @@ void TritonCTS::setAllClocksPropagated()
25742574
for (sta::Mode* mode : openSta_->modes()) {
25752575
sta::Sdc* sdc = mode->sdc();
25762576
for (sta::Clock* clk : sdc->clocks()) {
2577+
// Virtual clocks model external timing and must keep their latency.
2578+
if (clk->isVirtual()) {
2579+
continue;
2580+
}
25772581
openSta_->setPropagatedClock(clk, mode);
25782582
}
25792583
}

src/cts/test/BUILD

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ COMPULSORY_TESTS = [
5151
"sink_clustering_collision",
5252
"skip_nets",
5353
"twice",
54+
"virtual_clock_latency",
5455
]
5556

5657
ALL_TESTS = COMPULSORY_TESTS
@@ -217,6 +218,9 @@ filegroup(
217218
"twice": [
218219
"16sinks.def",
219220
],
221+
"virtual_clock_latency": [
222+
"16sinks.def",
223+
],
220224
}.get(test_name, []),
221225
)
222226
for test_name in ALL_TESTS

src/cts/test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ or_integration_tests(
4646
sink_clustering_collision
4747
skip_nets
4848
twice
49+
virtual_clock_latency
4950
)
5051

5152
add_executable(cts_unittest cts_unittest.cc)
@@ -69,4 +70,3 @@ gtest_discover_tests(cts_unittest
6970
)
7071

7172
add_dependencies(build_and_test cts_unittest)
72-
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
2+
[INFO ODB-0128] Design: test_16_sinks
3+
[INFO ODB-0130] Created 1 pins.
4+
[INFO ODB-0131] Created 16 components and 96 component-terminals.
5+
[INFO ODB-0133] Created 1 nets and 16 connections.
6+
[INFO CTS-0050] Root buffer is CLKBUF_X3.
7+
[INFO CTS-0051] Sink buffer is CLKBUF_X3.
8+
[INFO CTS-0052] The following clock buffers will be used for CTS:
9+
CLKBUF_X3
10+
[INFO CTS-0049] Characterization buffer is CLKBUF_X3.
11+
[INFO CTS-0007] Net "clk" found for clock "clk".
12+
[INFO CTS-0010] Clock net "clk" has 16 sinks.
13+
[INFO CTS-0008] TritonCTS found 1 clock nets.
14+
[INFO CTS-0097] Characterization used 1 buffer(s) types.
15+
[INFO CTS-0201] 0 blockages from hard placement blockages and placed macros will be used.
16+
[INFO CTS-0027] Generating H-Tree topology for net clk.
17+
[INFO CTS-0028] Total number of sinks: 16.
18+
[INFO CTS-0030] Number of static layers: 0.
19+
[INFO CTS-0020] Wire segment unit: 14000 dbu (7 um).
20+
[INFO CTS-0023] Original sink region: [(3730, 1730), (22730, 20730)].
21+
[INFO CTS-0024] Normalized sink region: [(0.266429, 0.123571), (1.62357, 1.48071)].
22+
[INFO CTS-0025] Width: 1.3571.
23+
[INFO CTS-0026] Height: 1.3571.
24+
Level 1
25+
Direction: Vertical
26+
Sinks per sub-region: 8
27+
Sub-region size: 1.3571 X 0.6786
28+
[INFO CTS-0034] Segment length (rounded): 1.
29+
[INFO CTS-0032] Stop criterion found. Max number of sinks is 15.
30+
[INFO CTS-0035] Number of sinks covered: 16.
31+
[INFO CTS-0018] Created 3 clock buffers.
32+
[INFO CTS-0012] Minimum number of buffers in the clock path: 2.
33+
[INFO CTS-0013] Maximum number of buffers in the clock path: 2.
34+
[INFO CTS-0015] Created 3 clock nets.
35+
[INFO CTS-0016] Fanout distribution for the current clock = 8:2..
36+
[INFO CTS-0017] Max level of the clock tree: 1.
37+
[INFO CTS-0098] Clock net "clk"
38+
[INFO CTS-0099] Sinks 16
39+
[INFO CTS-0100] Leaf buffers 0
40+
[INFO CTS-0101] Average sink wire length 18.87 um
41+
[INFO CTS-0102] Path depth 2 - 2
42+
[INFO CTS-0207] Dummy loads inserted 0
43+
vclk latency preserved: 1
44+
vclk propagated written: 0
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
source "helpers.tcl"
2+
read_lef Nangate45/Nangate45.lef
3+
read_liberty Nangate45/Nangate45_typ.lib
4+
read_def "16sinks.def"
5+
6+
create_clock -period 5 clk
7+
create_clock -name vclk -period 5
8+
set_clock_latency 0.2 [get_clocks vclk]
9+
10+
set_wire_rc -clock -layer metal3
11+
12+
set_cts_config -wire_unit 20 \
13+
-apply_ndr root_only \
14+
-root_buf CLKBUF_X3 \
15+
-buf_list CLKBUF_X3
16+
17+
clock_tree_synthesis
18+
19+
set sdc_file [make_result_file virtual_clock_latency.sdc]
20+
write_sdc -no_timestamp $sdc_file
21+
22+
set stream [open $sdc_file r]
23+
set sdc_text [read $stream]
24+
close $stream
25+
26+
set vclk_latency_found \
27+
[regexp {set_clock_latency 0\.2000 \[get_clocks \{vclk\}\]} $sdc_text]
28+
set vclk_propagated_found \
29+
[regexp {set_propagated_clock \[get_clocks \{vclk\}\]} $sdc_text]
30+
31+
# vclk latency should be preserved
32+
puts "vclk latency preserved: $vclk_latency_found"
33+
34+
# vclk cannot be propagated
35+
puts "vclk propagated written: $vclk_propagated_found"

0 commit comments

Comments
 (0)