get_lib_pins make library optional

This commit is contained in:
James Cherry 2020-05-07 18:00:15 -07:00
parent ba28f7e99c
commit 7c02b7425a
1 changed files with 30 additions and 25 deletions

View File

@ -683,40 +683,45 @@ proc get_lib_pins { args } {
set divider $keys(-hsc) set divider $keys(-hsc)
check_path_divider $divider check_path_divider $divider
} }
set port_regexp [port_wild_regexp $divider] set port_regexp1 [port_wild_regexp $divider]
set port_regexp2 [cell_wild_regexp $divider]
set ports {} set ports {}
foreach pattern $patterns { foreach pattern $patterns {
if [regexp $port_regexp $pattern ignore lib_name cell_name port_pattern] { # match library/cell/port
set liberty [find_liberty $lib_name] set libs {}
if { $liberty != "NULL" } { if { [regexp $port_regexp1 $pattern ignore lib_name cell_name port_pattern] } {
set cells [$liberty find_liberty_cells_matching $cell_name \ set libs [get_libs -quiet $lib_name]
$regexp $nocase] # match cell/port
if { $cells != {} } { } elseif { [regexp $port_regexp2 $pattern ignore cell_name port_pattern] } {
foreach cell $cells { set libs [get_libs *]
set matches [$cell find_liberty_ports_matching $port_pattern \ } else {
$regexp $nocase] if { !$quiet } {
if {$matches != {}} { sta_warn "library/cell/port '$pattern' not found."
set ports [concat $ports $matches] }
} return {}
} }
if { $ports == {} } { if { $libs != {} } {
if { !$quiet } { set found_match 0
sta_warn "port '$port_pattern' not found." set cells {}
} foreach lib $libs {
} set cells [$lib find_liberty_cells_matching $cell_name $regexp $nocase]
} else { foreach cell $cells {
if { !$quiet } { set matches [$cell find_liberty_ports_matching $port_pattern \
sta_warn "cell '$cell_name' not found." $regexp $nocase]
foreach match $matches {
lappend ports $match
set found_match 1
} }
} }
} else { }
if { !$found_match } {
if { !$quiet } { if { !$quiet } {
sta_warn "library '$lib_name' not found." sta_warn "port '$port_pattern' not found."
} }
} }
} else { } else {
if { !$quiet } { if { !$quiet } {
sta_warn "library/cell/port '$pattern' not found." sta_warn "library '$lib_name' not found."
} }
} }
} }