From 41c6ada050f9db782f7433f047f642babb89d407 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Thu, 13 Jul 2023 07:30:30 -0700 Subject: [PATCH 1/2] typos Signed-off-by: James Cherry --- README.md | 4 ++-- tcl/Search.tcl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e743a969..ef77c834 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,8 @@ netlist data structures without duplicating them. * Query based incremental update of delays, arrival and required times * Simulator to propagate constants from constraints and netlist tie high/low -See doc/OpenSTA.pdf for command documentiaton. -See doc/StaApi.txt for timing engine API documentiaton. +See doc/OpenSTA.pdf for command documentation. +See doc/StaApi.txt for timing engine API documentation. See doc/ChangeLog.txt for changes to commands. OpenSTA is dual licensed. It is released under GPL v3 as OpenSTA and diff --git a/tcl/Search.tcl b/tcl/Search.tcl index 7b2a40ea..87d20af3 100644 --- a/tcl/Search.tcl +++ b/tcl/Search.tcl @@ -836,7 +836,7 @@ proc parse_rise_fall_arg { arg } { if { $arg eq "r" || $arg eq "^" || $arg eq "rise" } { return "rise" } elseif { $arg eq "f" || $arg eq "v" || $arg eq "fall" } { - retur "fall" + return "fall" } else { error "unknown rise/fall transition name." } From aefa3c8d9d60bcb706ea692b27487e7a14001e1d Mon Sep 17 00:00:00 2001 From: James Cherry Date: Fri, 14 Jul 2023 12:38:24 -0700 Subject: [PATCH 2/2] get_lib_cells_arg Signed-off-by: James Cherry --- tcl/CmdArgs.tcl | 75 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 53 insertions(+), 22 deletions(-) diff --git a/tcl/CmdArgs.tcl b/tcl/CmdArgs.tcl index bcbd16e1..7610315a 100644 --- a/tcl/CmdArgs.tcl +++ b/tcl/CmdArgs.tcl @@ -605,6 +605,7 @@ proc get_lib_cell_arg { arg_name arg error_proc } { return $lib_cell } +# Not used by OpenSTA proc get_lib_cells_arg { arg_name arglist error_proc } { set lib_cells {} # Copy backslashes that will be removed by foreach. @@ -612,16 +613,16 @@ proc get_lib_cells_arg { arg_name arglist error_proc } { foreach arg $arglist { if {[llength $arg] > 1} { # Embedded list. - set lib_cells [concat $lib_cells [get_lib_cells_arg $arg_name $arg $warn_error]] + set lib_cells [concat $lib_cells [get_lib_cells_arg $arg_name $arg $error_proc]] } elseif { [is_object $arg] } { set object_type [object_type $arg] if { $object_type == "LibertyCell" } { lappend lib_cells $arg } else { - sta_warn_error 306 $warn_error "unsupported object type $object_type." + $error_proc 306 "unsupported object type $object_type." } } elseif { $arg != {} } { - set arg_lib_cells [get_lib_cells -quiet $arg] + set arg_lib_cells [get_lib_cells1 $arg $error_proc] if { $arg_lib_cells != {} } { set lib_cells [concat $lib_cells $arg_lib_cells] } @@ -630,6 +631,36 @@ proc get_lib_cells_arg { arg_name arglist error_proc } { return $lib_cells } +# Based on get_lib_cells +proc get_lib_cells1 { patterns error_proc } { + global hierarchy_separator + + set cells {} + set cell_regexp [cell_regexp_hsc $hierarchy_separator] + foreach pattern $patterns { + if { ![regexp $cell_regexp $pattern ignore lib_name cell_pattern]} { + set lib_name "*" + set cell_pattern $pattern + } + # Allow wildcards in the library name (incompatible). + set libs [get_libs -quiet $lib_name] + if { $libs == {} } { + $error_proc 375 "library '$lib_name' not found." + } else { + foreach lib $libs { + set matches [$lib find_liberty_cells_matching $cell_pattern 0 0] + if {$matches != {}} { + set cells [concat $cells $matches] + } + } + if { $cells == {} } { + $error_proc 376 "cell '$cell_pattern' not found." + } + } + } + return $cells +} + proc get_instance_error { arg_name arg } { set inst "NULL" if {[llength $arg] > 1} { @@ -661,16 +692,16 @@ proc get_instances_error { arg_name arglist } { } elseif { [is_object $arg] } { set object_type [object_type $arg] if { $object_type == "Instance" } { - lappend insts $arg + lappend insts $arg } else { - sta_error 486 "$arg_name type '$object_type' is not an instance." + sta_error 486 "$arg_name type '$object_type' is not an instance." } } elseif { $arg != {} } { set arg_insts [get_cells -quiet $arg] if { $arg_insts != {} } { - set insts [concat $insts $arg_insts] + set insts [concat $insts $arg_insts] } else { - sta_error 487 "instance '$arg' not found." + sta_error 487 "instance '$arg' not found." } } } @@ -726,19 +757,19 @@ proc get_port_pins_error { arg_name arglist } { } elseif { [is_object $arg] } { set object_type [object_type $arg] if { $object_type == "Pin" } { - lappend pins $arg + lappend pins $arg } elseif { $object_type == "Port" } { - # Convert port to pin. - lappend pins [find_pin [get_name $arg]] + # Convert port to pin. + lappend pins [find_pin [get_name $arg]] } else { - sta_error 488 "$arg_name type '$object_type' is not a pin or port." + sta_error 488 "$arg_name type '$object_type' is not a pin or port." } } elseif { $arg != {} } { set arg_pins [get_ports_or_pins $arg] if { $arg_pins != {} } { - set pins [concat $pins $arg_pins] + set pins [concat $pins $arg_pins] } else { - sta_error 489 "pin '$arg' not found." + sta_error 489 "pin '$arg' not found." } } } @@ -756,14 +787,14 @@ proc get_ports_error { arg_name arglist } { } elseif { [is_object $arg] } { set object_type [object_type $arg] if { $object_type == "Port" } { - lappend ports $arg + lappend ports $arg } else { - sta_error 490 "$arg_name type '$object_type' is not a port." + sta_error 490 "$arg_name type '$object_type' is not a port." } } elseif { $arg != {} } { set arg_ports [get_ports $arg] if { $arg_ports != {} } { - set ports [concat $ports $arg_ports] + set ports [concat $ports $arg_ports] } } } @@ -837,14 +868,14 @@ proc get_clocks_warn { arg_name arglist } { } elseif { [is_object $arg] } { set object_type [object_type $arg] if { $object_type == "Clock" } { - lappend clks $arg + lappend clks $arg } else { - sta_warn 313 "unsupported object type $object_type." + sta_warn 313 "unsupported object type $object_type." } } elseif { $arg != {} } { set arg_clocks [get_clocks $arg] if { $arg_clocks != {} } { - set clks [concat $clks $arg_clocks] + set clks [concat $clks $arg_clocks] } } } @@ -890,14 +921,14 @@ proc get_nets_arg { arg_name arglist warn_error } { } elseif { [is_object $arg] } { set object_type [object_type $arg] if { $object_type == "Net" } { - lappend nets $arg + lappend nets $arg } else { - sta_warn_error 317 $warn_error "unsupported object type $object_type." + sta_warn_error 317 $warn_error "unsupported object type $object_type." } } elseif { $arg != {} } { set arg_nets [get_nets -quiet $arg] if { $arg_nets != {} } { - set nets [concat $nets $arg_nets] + set nets [concat $nets $arg_nets] } } }