Skip to content

Commit 3c80e73

Browse files
authored
Merge pull request #1652 from Pinata-Consulting/cts-args-env-vars-2
cts: add CTS_ARGS env var to override CTS arguments
2 parents 8c90610 + c267c98 commit 3c80e73

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

docs/user/FlowVariables.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ Note:
166166

167167
| Variable | Description |
168168
|-----------------------|--------------------------------------------------------------------------------------------------------------|
169+
| `CTS_ARGS` | Override `clock_tree_synthesis` arguments |
169170
| `CTS_BUF_CELL` | The buffer cell used in the clock tree. |
170171
| `FILL_CELLS` | Fill cells are used to fill empty sites. |
171172
| `HOLD_SLACK_MARGIN` | Specifies a time margin for the slack when fixing hold violations. This option allow you to overfix. |

flow/scripts/cts.tcl

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,24 @@ proc save_progress {stage} {
2424
write_sdc $::env(RESULTS_DIR)/$stage.sdc
2525
}
2626

27+
set cts_args [list -root_buf "$::env(CTS_BUF_CELL)" -buf_list "$::env(CTS_BUF_CELL)" \
28+
-sink_clustering_enable \
29+
-sink_clustering_size $cluster_size \
30+
-sink_clustering_max_diameter $cluster_diameter \
31+
-balance_levels]
32+
2733
if {[info exist ::env(CTS_BUF_DISTANCE)]} {
28-
clock_tree_synthesis -root_buf "$::env(CTS_BUF_CELL)" -buf_list "$::env(CTS_BUF_CELL)" \
29-
-sink_clustering_enable \
30-
-sink_clustering_size $cluster_size \
31-
-sink_clustering_max_diameter $cluster_diameter \
32-
-distance_between_buffers "$::env(CTS_BUF_DISTANCE)" \
33-
-balance_levels
34-
} else {
35-
clock_tree_synthesis -root_buf "$::env(CTS_BUF_CELL)" -buf_list "$::env(CTS_BUF_CELL)" \
36-
-sink_clustering_enable \
37-
-sink_clustering_size $cluster_size \
38-
-sink_clustering_max_diameter $cluster_diameter \
39-
-balance_levels
34+
lappend cts_args -distance_between_buffers "$::env(CTS_BUF_DISTANCE)"
35+
}
36+
37+
if {[info exist ::env(CTS_ARGS)]} {
38+
set cts_args $::env(CTS_ARGS)
4039
}
4140

41+
puts "clock_tree_synthesis [join $cts_args " "]"
42+
43+
clock_tree_synthesis {*}$cts_args
44+
4245
if {[info exist ::env(CTS_SNAPSHOTS)]} {
4346
save_progress 4_1_pre_repair_clock_nets
4447
}

0 commit comments

Comments
 (0)