Skip to content

Commit

Permalink
feat: wildcards in cts_clk_buffers
Browse files Browse the repository at this point in the history
Pretty self-explanatory.
  • Loading branch information
donn committed Feb 12, 2025
1 parent 53f5e7d commit c9f55bd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
* Added flags `CTS_OBSTRUCTION_AWARE` and `CTS_BALANCE_LEVELS`
* Added `CTS_SINK_BUFFER_MAX_CAP_DERATE_PCT`
* Added `CTS_DELAY_BUFFER_DERATE_PCT`
* `CTS_CLK_BUFFERS` can now take wildcards.

* `OpenROAD.CutRows`

Expand Down
25 changes: 23 additions & 2 deletions openlane/scripts/openroad/cts.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,30 @@ puts "\[INFO\] Performing clock tree synthesis…"
puts "\[INFO\] Looking for the following net(s): $::env(CLOCK_NET)"
puts "\[INFO\] Running Clock Tree Synthesis…"

set arg_list [list]
proc get_buflist {} {
set result [list]
foreach selector $::env(CTS_CLK_BUFFERS) {
# if we can find an exact match, avoid expensive search operation
set exact_match [$::db findMaster $selector]
if { "$exact_match" == "NULL" } {
# time to dig for matches…
foreach lib $::libs {
foreach master [$lib getMasters] {
set name [$master getName]
if { [string match $selector $name] } {
lappend result $name
}
}
}
} else {
lappend result [$exact_match getName]
}
}
return $result
}

lappend arg_list -buf_list $::env(CTS_CLK_BUFFERS)
set arg_list [list]
lappend arg_list -buf_list [get_buflist]
lappend arg_list -root_buf $::env(CTS_ROOT_BUFFER)
lappend arg_list -sink_clustering_size $::env(CTS_SINK_CLUSTERING_SIZE)
lappend arg_list -sink_clustering_max_diameter $::env(CTS_SINK_CLUSTERING_MAX_DIAMETER)
Expand Down
2 changes: 1 addition & 1 deletion openlane/steps/openroad.py
Original file line number Diff line number Diff line change
Expand Up @@ -2195,7 +2195,7 @@ class CTS(OpenROADStep):
Variable(
"CTS_CLK_BUFFERS",
List[str],
"Defines the list of clock buffers to be used in CTS.",
"Defines the list of clock buffer names or buffer name wildcards to be used in CTS.",
deprecated_names=["CTS_CLK_BUFFER_LIST"],
pdk=True,
),
Expand Down

0 comments on commit c9f55bd

Please sign in to comment.