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,42 +683,47 @@ 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] } {
set libs [get_libs *]
} else {
if { !$quiet } {
sta_warn "library/cell/port '$pattern' not found."
}
return {}
}
if { $libs != {} } {
set found_match 0
set cells {}
foreach lib $libs {
set cells [$lib find_liberty_cells_matching $cell_name $regexp $nocase]
foreach cell $cells { foreach cell $cells {
set matches [$cell find_liberty_ports_matching $port_pattern \ set matches [$cell find_liberty_ports_matching $port_pattern \
$regexp $nocase] $regexp $nocase]
if {$matches != {}} { foreach match $matches {
set ports [concat $ports $matches] lappend ports $match
set found_match 1
} }
} }
if { $ports == {} } { }
if { !$found_match } {
if { !$quiet } { if { !$quiet } {
sta_warn "port '$port_pattern' not found." sta_warn "port '$port_pattern' not found."
} }
} }
} else {
if { !$quiet } {
sta_warn "cell '$cell_name' not found."
}
}
} else { } else {
if { !$quiet } { if { !$quiet } {
sta_warn "library '$lib_name' not found." sta_warn "library '$lib_name' not found."
} }
} }
} else {
if { !$quiet } {
sta_warn "library/cell/port '$pattern' not found."
}
}
} }
return $ports return $ports
} }