Skip to content

Commit e395950

Browse files
committed
synth: Ask yosys for cell names rather than .lib parsing
Signed-off-by: Martin Povišer <povik@cutebit.org>
1 parent 9e88579 commit e395950

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

flow/scripts/synth_preamble.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ proc read_design_sources { } {
6868
# ignored in favor of the liberty view, consistent with the
6969
# behavior of the builtin Verilog frontend.
7070
if { [env_var_exists_and_non_empty ADDITIONAL_LIBS] } {
71-
foreach m [get_liberty_cell_names $::env(ADDITIONAL_LIBS)] {
71+
foreach m [get_liberty_cell_names] {
7272
lappend slang_args --blackboxed-module "$m"
7373
}
7474
}

flow/scripts/util.tcl

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
1-
# Extract cell names from liberty files by parsing "cell(...)" declarations
2-
proc get_liberty_cell_names { lib_files } {
3-
set cell_names [list]
4-
foreach lib $lib_files {
5-
set fid [open $lib r]
6-
while { [gets $fid line] >= 0 } {
7-
if { [regexp {^\s*cell\s*\(\s*"?([^")\s]+)"?\s*\)} $line -> cell_name] } {
8-
lappend cell_names $cell_name
9-
}
10-
}
11-
close $fid
12-
}
13-
return $cell_names
1+
# Extract cell names
2+
proc get_liberty_cell_names { } {
3+
return [tee -q -s result.string select -list-mod =A:liberty_cell]
144
}
155

166
proc log_cmd { cmd args } {

0 commit comments

Comments
 (0)