Repository navigation
Conversation
Automatically blackbox macros from ADDITIONAL_LIBS so that any competing Verilog definitions in the source files are ignored in favor of the liberty view. This mirrors the behavior the yosys+slang frontend gained for issue The-OpenROAD-Project#3849 (synth_preamble.tcl), expressed through OpenSTA since the liberty views are already loaded here. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
There was a problem hiding this comment.
Code Review
This pull request updates flow/scripts/synth_syn.tcl to automatically blackbox macros from ADDITIONAL_LIBS so that liberty views are preferred over competing Verilog definitions. The review feedback suggests a performance optimization to retrieve and unique-sort library cells in a single step instead of using nested loops.
| set liberty_cells [dict create] | ||
| foreach lib [get_libs *] { | ||
| foreach cell [get_lib_cells "[get_name $lib]/*"] { | ||
| dict set liberty_cells [get_name $cell] 1 | ||
| } | ||
| } | ||
| foreach m [dict keys $liberty_cells] { | ||
| lappend elaborate_args --blackboxed-module "$m" | ||
| } |
There was a problem hiding this comment.
The nested loops querying get_libs and then querying get_lib_cells for each library individually can be slow, especially for designs with multiple large liberty files.
We can optimize this by querying all library cells at once using get_lib_cells */* and extracting their names with get_name. Using lsort -unique simplifies the code, avoids the need for a temporary dictionary, and is significantly faster.
foreach m [lsort -unique [get_name [get_lib_cells */*]]] {
lappend elaborate_args --blackboxed-module "$m"
}
Automatically blackbox macros from ADDITIONAL_LIBS so that any competing Verilog definitions in the source files are ignored in favor of the liberty view. This mirrors the behavior the yosys+slang frontend gained for issue #3849 (
synth_preamble.tcl), expressed through OpenSTA since the liberty views are already loaded here.