OpenSTA/tcl/CmdArgs.tcl

932 lines
25 KiB
Tcl
Raw Normal View History

2018-09-28 17:54:21 +02:00
# OpenSTA, Static Timing Analyzer
# Copyright (c) 2024, Parallax Software, Inc.
2018-09-28 17:54:21 +02:00
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2018-09-28 17:54:21 +02:00
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
2018-09-28 17:54:21 +02:00
################################################################
#
# Command helper functions.
#
################################################################
namespace eval sta {
#################################################################
#
# Argument parsing functions.
#
################################################################
# Parse multiple object type args.
# For object name args the search order is as follows:
# clk
# liberty_cell
# liberty_port
# cell
# inst
# port
# pin
# net
proc get_object_args { objects clks_var libcells_var libports_var \
cells_var insts_var ports_var pins_var nets_var \
edges_var timing_arc_sets_var } {
if { $clks_var != {} } {
upvar 1 $clks_var clks
}
if { $libcells_var != {} } {
upvar 1 $libcells_var libcells
}
if { $libports_var != {} } {
upvar 1 $libports_var libports
}
if { $cells_var != {} } {
upvar 1 $cells_var cells
}
if { $insts_var != {} } {
upvar 1 $insts_var insts
}
if { $ports_var != {} } {
upvar 1 $ports_var ports
}
if { $pins_var != {} } {
upvar 1 $pins_var pins
}
if { $nets_var != {} } {
upvar 1 $nets_var nets
}
if { $edges_var != {} } {
upvar 1 $edges_var edges
}
if { $timing_arc_sets_var != {} } {
upvar 1 $timing_arc_sets_var timing_arc_sets
}
# Copy backslashes that will be removed by foreach.
set objects [string map {\\ \\\\} $objects]
foreach obj $objects {
if { [llength $obj] > 1 } {
# List arg. Recursive call without initing objects.
get_object_args $obj clks libcells libports cells insts \
ports pins nets edges timing_arc_sets
} elseif { [is_object $obj] } {
# Explicit object arg.
set object_type [object_type $obj]
if { $pins_var != {} && $object_type == "Pin" } {
lappend pins $obj
} elseif { $insts_var != {} && $object_type == "Instance" } {
lappend insts $obj
} elseif { $nets_var != {} && $object_type == "Net" } {
lappend nets $obj
} elseif { $ports_var != {} && $object_type == "Port" } {
lappend ports $obj
} elseif { $edges_var != {} && $object_type == "Edge" } {
lappend edges $obj
} elseif { $clks_var != {} && $object_type == "Clock" } {
lappend clks $obj
} elseif { $libcells_var != {} && $object_type == "LibertyCell" } {
lappend libcells $obj
} elseif { $libports_var != {} && $object_type == "LibertyPort" } {
lappend libports $obj
} elseif { $cells_var != {} && $object_type == "Cell" } {
lappend cells $obj
} elseif { $timing_arc_sets_var != {} \
&& $object_type == "TimingArcSet" } {
lappend timing_arc_sets $obj
} else {
sta_error 100 "unsupported object type $object_type."
2018-09-28 17:54:21 +02:00
}
} elseif { $obj != {} } {
# Check for implicit arg.
# Search for most general object type first.
set matches {}
if { $clks_var != {} } {
set matches [get_clocks -quiet $obj]
}
if { $matches != {} } {
set clks [concat $clks $matches]
} else {
if { $libcells_var != {} } {
set matches [get_lib_cells -quiet $obj]
}
if { $matches != {} } {
set libcells [concat $libcells $matches]
} else {
if { $libports_var != {} } {
set matches [get_lib_pins -quiet $obj]
}
if { $matches != {} } {
set libports [concat $libports $matches]
} else {
if { $cells_var != {} } {
set matches [find_cells_matching $obj 0 0]
}
if { $matches != {} } {
set cells [concat $cells $matches]
} else {
if { $insts_var != {} } {
set matches [get_cells -quiet $obj]
}
if { $matches != {} } {
set insts [concat $insts $matches]
} else {
if { $ports_var != {} } {
set matches [get_ports -quiet $obj]
}
if { $matches != {} } {
set ports [concat $ports $matches]
} else {
if { $pins_var != {} } {
set matches [get_pins -quiet $obj]
}
if { $matches != {} } {
set pins [concat $pins $matches]
} else {
if { $nets_var != {} } {
set matches [get_nets -quiet $obj]
}
if { $matches != {} } {
set nets [concat $nets $matches]
} else {
sta_warn 101 "object '$obj' not found."
2018-09-28 17:54:21 +02:00
}
}
}
}
}
}
}
}
}
}
}
proc parse_clk_cell_port_args { objects clks_var cells_var ports_var } {
upvar 1 $clks_var clks
upvar 1 $cells_var cells
upvar 1 $ports_var ports
set clks {}
set cells {}
set ports {}
get_object_args $objects clks {} {} cells {} ports {} {} {} {}
}
proc parse_clk_cell_port_pin_args { objects clks_var cells_var ports_var \
pins_arg } {
upvar 1 $clks_var clks
upvar 1 $cells_var cells
upvar 1 $ports_var ports
upvar 1 $pins_arg pins
set clks {}
set cells {}
set ports {}
set pins {}
get_object_args $objects clks {} {} cells {} ports pins {} {} {}
}
proc parse_clk_inst_pin_arg { objects clks_var insts_var pins_var } {
upvar 1 $clks_var clks
upvar 1 $insts_var insts
upvar 1 $pins_var pins
set clks {}
set insts {}
set pins {}
get_object_args $objects clks {} {} {} insts {} pins {} {} {}
}
proc parse_clk_inst_port_pin_arg { objects clks_var insts_var pins_var } {
upvar 1 $clks_var clks
upvar 1 $insts_var insts
upvar 1 $pins_var pins
set clks {}
set insts {}
set pins {}
set ports {}
get_object_args $objects clks {} {} {} insts ports pins {} {} {}
foreach port $ports {
2019-01-17 00:37:31 +01:00
lappend pins [[top_instance] find_pin [get_name $port]]
2018-09-28 17:54:21 +02:00
}
}
proc parse_clk_port_pin_arg { objects clks_var pins_var } {
upvar 1 $clks_var clks
upvar 1 $pins_var pins
set clks {}
set pins {}
set ports {}
get_object_args $objects clks {} {} {} {} ports pins {} {} {}
foreach port $ports {
2019-01-17 00:37:31 +01:00
lappend pins [[top_instance] find_pin [get_name $port]]
2018-09-28 17:54:21 +02:00
}
}
proc parse_libcell_libport_inst_port_pin_edge_timing_arc_set_arg { objects \
libcells_var \
libports_var \
insts_var \
ports_var \
pins_var \
edges_var \
timing_arc_sets_var } {
upvar 1 $libcells_var libcells
upvar 1 $libports_var libports
upvar 1 $insts_var insts
upvar 1 $ports_var ports
upvar 1 $pins_var pins
upvar 1 $edges_var edges
upvar 1 $timing_arc_sets_var timing_arc_sets
set libcells {}
set libports {}
set insts {}
set ports {}
set pins {}
set edges {}
set timing_arc_sets {}
get_object_args $objects {} libcells libports {} insts ports pins {} \
edges timing_arc_sets
}
2020-07-15 16:56:34 +02:00
proc parse_libcell_arg { objects } {
set libcells {}
get_object_args $objects {} libcells {} {} {} {} {} {} {} {}
return $libcells
}
2018-09-28 17:54:21 +02:00
proc parse_libcell_inst_arg { objects libcells_var insts_var } {
upvar 1 $libcells_var libcells
upvar 1 $insts_var insts
set libcells {}
set insts {}
get_object_args $objects {} libcells {} {} insts {} {} {} {} {}
}
proc parse_libcell_inst_net_arg { objects libcells_var insts_var nets_var } {
upvar 1 $libcells_var libcells
upvar 1 $insts_var insts
upvar 1 $nets_var nets
set libcells {}
set insts {}
set nets {}
get_object_args $objects {} libcells {} {} insts {} {} nets {} {}
}
proc parse_cell_arg { objects } {
set cells {}
get_object_args $objects {} {} {} cells {} {} {} {} {} {}
return $cells
}
2018-09-28 17:54:21 +02:00
proc parse_cell_port_args { objects cells_var ports_var } {
upvar 1 $cells_var cells
upvar 1 $ports_var ports
set cells {}
set ports {}
get_object_args $objects {} {} {} cells {} ports {} {} {} {}
}
proc parse_cell_port_pin_args { objects cells_var ports_var pins_var } {
upvar 1 $cells_var cells
upvar 1 $ports_var ports
upvar 1 $pins_var pins
set cells {}
set ports {}
set pins {}
get_object_args $objects {} {} {} cells {} ports pins {} {} {}
}
proc parse_inst_port_pin_arg { objects insts_var pins_var } {
upvar 1 $insts_var insts
upvar 1 $pins_var pins
set insts {}
set pins {}
set ports {}
get_object_args $objects {} {} {} {} insts ports pins {} {} {}
foreach port $ports {
2019-01-17 00:37:31 +01:00
lappend pins [[top_instance] find_pin [get_name $port]]
2018-09-28 17:54:21 +02:00
}
}
proc parse_inst_pin_arg { objects insts_var pins_var } {
upvar 1 $insts_var insts
upvar 1 $pins_var pins
set insts {}
set pins {}
get_object_args $objects {} {} {} {} insts {} pins {} {} {}
}
proc parse_inst_port_pin_net_arg { objects insts_var pins_var nets_var } {
upvar 1 $insts_var insts
upvar 1 $pins_var pins
upvar 1 $nets_var nets
set insts {}
set ports {}
set pins {}
set nets {}
get_object_args $objects {} {} {} {} insts ports pins nets {} {}
foreach port $ports {
2019-01-17 00:37:31 +01:00
lappend pins [[top_instance] find_pin [get_name $port]]
2018-09-28 17:54:21 +02:00
}
}
proc parse_inst_net_arg { objects insts_var nets_var } {
upvar 1 $insts_var insts
upvar 1 $nets_var nets
set insts {}
set nets {}
get_object_args $objects {} {} {} {} insts {} {} nets {} {}
}
proc parse_port_pin_net_arg { objects pins_var nets_var } {
upvar 1 $pins_var pins
upvar 1 $nets_var nets
set ports {}
set pins {}
set nets {}
get_object_args $objects {} {} {} {} {} ports pins nets {} {}
2019-01-17 00:37:31 +01:00
2018-09-28 17:54:21 +02:00
foreach port $ports {
2019-01-17 00:37:31 +01:00
lappend pins [[top_instance] find_pin [get_name $port]]
2018-09-28 17:54:21 +02:00
}
}
proc parse_port_net_args { objects ports_var nets_var } {
upvar 1 $ports_var ports
upvar 1 $nets_var nets
set ports {}
set nets {}
get_object_args $objects {} {} {} {} {} ports {} nets {} {}
}
proc parse_pin_net_args { objects pins_var nets_var } {
upvar 1 $pins_var pins
upvar 1 $nets_var nets
set pins {}
set nets {}
get_object_args $objects {} {} {} {} {} {} pins nets {} {}
}
proc get_ports_or_pins { pattern } {
set matches [find_port_pins_matching $pattern 0 0]
if { $matches != {} } {
return $matches
} else {
return [find_pins_matching $pattern 0 0]
}
}
################################################################
2018-12-05 23:18:41 +01:00
# If -corner keyword is missing:
2018-12-11 19:47:04 +01:00
# one corner: return default
# multiple corners: error
2018-09-28 17:54:21 +02:00
proc parse_corner { keys_var } {
upvar 1 $keys_var keys
if { [info exists keys(-corner)] } {
set corner_name $keys(-corner)
set corner [find_corner $corner_name]
if { $corner == "NULL" } {
sta_error 102 "$corner_name is not the name of process corner."
2018-09-28 17:54:21 +02:00
} else {
return $corner
}
} elseif { [multi_corner] } {
sta_error 103 "-corner keyword required with multi-corner analysis."
2018-09-28 17:54:21 +02:00
} else {
2019-04-01 18:05:07 +02:00
return [cmd_corner]
2018-09-28 17:54:21 +02:00
}
}
2018-12-11 19:47:04 +01:00
# -corner keyword is required.
2018-12-05 23:18:41 +01:00
# Assumes caller checks for existence of -corner keyword arg.
proc parse_corner_required { keys_var } {
upvar 1 $keys_var keys
if { [info exists keys(-corner)] } {
set corner_name $keys(-corner)
set corner [find_corner $corner_name]
if { $corner == "NULL" } {
sta_error 104 "$corner_name is not the name of process corner."
2018-12-05 23:18:41 +01:00
} else {
return $corner
}
} else {
sta_error 105 "missing -corner arg."
2018-12-05 23:18:41 +01:00
}
}
2018-11-26 18:15:52 +01:00
proc parse_corner_or_default { keys_var } {
upvar 1 $keys_var keys
if { [info exists keys(-corner)] } {
set corner_name $keys(-corner)
set corner [find_corner $corner_name]
if { $corner == "NULL" } {
sta_error 106 "$corner_name is not the name of process corner."
2018-11-26 18:15:52 +01:00
} else {
return $corner
}
} else {
2019-04-01 18:05:07 +02:00
return [cmd_corner]
2018-11-26 18:15:52 +01:00
}
}
Network::id for maps/sets commit be70d30ae05665021254b0d7e69fb8d2f0a82890 Author: James Cherry <cherry@parallaxsw.com> Date: Tue Jan 17 17:04:49 2023 -0700 cmp Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 4d4ef96948afe3d6a00c4521aeb5bc74274f5737 Author: James Cherry <cherry@parallaxsw.com> Date: Tue Jan 17 16:08:50 2023 -0700 rvo, const Signed-off-by: James Cherry <cherry@parallaxsw.com> commit bb584e4264af2bea867b17d07e8d38c0e9eb0025 Author: James Cherry <cherry@parallaxsw.com> Date: Tue Jan 17 15:05:00 2023 -0700 const Signed-off-by: James Cherry <cherry@parallaxsw.com> commit a08fe558bca6b769b2728882258bd85aed990a27 Author: James Cherry <cherry@parallaxsw.com> Date: Tue Jan 17 14:57:33 2023 -0700 LibertyPortPair no ptrs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 4d3bd60c109d1ce9d0589d746f4968fa7bebd90d Author: James Cherry <cherry@parallaxsw.com> Date: Tue Jan 17 14:13:07 2023 -0700 cleanup Signed-off-by: James Cherry <cherry@parallaxsw.com> commit dc25ff77771cfbe26f9318bad2b3c45879614783 Author: James Cherry <cherry@parallaxsw.com> Date: Tue Jan 17 14:06:13 2023 -0700 const Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 06e81586ce11a0cc06948ed78fef99353077d69e Author: James Cherry <cherry@parallaxsw.com> Date: Tue Jan 17 14:01:10 2023 -0700 sortByName Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 9d8592aff5b246f83e47e1b94490e3cef8d8e119 Author: James Cherry <cherry@parallaxsw.com> Date: Tue Jan 17 11:57:17 2023 -0700 sort pred Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 462a8e14df8b561ddfc842addc62c4b8435b6347 Author: James Cherry <cherry@parallaxsw.com> Date: Tue Jan 17 11:09:57 2023 -0700 const Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 69f71505b684e88b22d395510429497e87bf1015 Author: James Cherry <cherry@parallaxsw.com> Date: Tue Jan 17 10:45:14 2023 -0700 flush ConstPortSeq Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 6429d578b78eac3fe7e99fcd67a120789932b2eb Author: James Cherry <cherry@parallaxsw.com> Date: Tue Jan 17 09:19:15 2023 -0700 rm ConstNetSet Signed-off-by: James Cherry <cherry@parallaxsw.com> commit f247930b16e40560b957a36af68947249ed1ef04 Author: James Cherry <cherry@parallaxsw.com> Date: Tue Jan 17 08:50:50 2023 -0700 sortPathNames Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 4ca2b0e0af7252c7bcbc65cf141d0ce40634d329 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Jan 16 10:14:05 2023 -0700 const Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 3d18640d2ebc4aae3098c7e7242a554fcb64fd42 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Jan 16 09:41:27 2023 -0700 set_input/ouput_delay -reference_pin Signed-off-by: James Cherry <cherry@parallaxsw.com> commit d4a0854dd2102f46f96a94fb9eb8749f1593a85f Author: James Cherry <cherry@parallaxsw.com> Date: Mon Jan 16 09:13:46 2023 -0700 PinPairSet no malloc Signed-off-by: James Cherry <cherry@parallaxsw.com> commit a6f1583fc6a856c5ecc0dcb15a1d8b1f61e30718 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Jan 16 08:53:33 2023 -0700 no malloc for EdgePins Signed-off-by: James Cherry <cherry@parallaxsw.com> commit c8e4b92e8b619109d6aa3c141c720646067ccb4b Author: James Cherry <cherry@parallaxsw.com> Date: Mon Jan 16 06:31:08 2023 +0000 leak commit abab99e0fc3e466d914f6c1705aa08cdc204df51 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Jan 16 06:07:36 2023 +0000 leaks commit d1913b554bb6e98b89673d80d2295f552eb4ffca Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 15 19:48:39 2023 -0700 LibertyCell::checkCornerCell Signed-off-by: James Cherry <cherry@parallaxsw.com> commit bcc172237d48deed647374f9592bac70bd2d5425 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 15 18:19:47 2023 -0700 rvo Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 8ef9800b87f5e5548055a13afc21397f28a6bcf7 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 15 18:07:46 2023 -0700 sdc net id Signed-off-by: James Cherry <cherry@parallaxsw.com> commit d7235abed04ced4e2d84e91bf9968e621268567d Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 15 16:00:27 2023 -0700 range iter Signed-off-by: James Cherry <cherry@parallaxsw.com> commit a22f91a3c54c644574339d1126821d9bc8045bd6 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 15 15:52:50 2023 -0700 range iter Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 762615ce3de91d950eeaaa4680549a45b13e0e0a Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 15 15:42:19 2023 -0700 range iter Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 7e0c531613d343d23f064c24873bf5a498f6f4ce Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 15 12:26:49 2023 -0700 rm removeLoadCaps, removeNetLoadCaps Signed-off-by: James Cherry <cherry@parallaxsw.com> commit f2e88c6082e2d4605e9849348008bf4065401fc8 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 15 12:21:03 2023 -0700 sdc rm map ptrs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit b5939666188c0b94dfe957e22bbd8a92f4786125 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 15 11:36:16 2023 -0700 sdc rm map ptrs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit a435081bafe10260743319f53a59cbe2ed0388b7 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 15 08:43:37 2023 -0700 sdc rm map ptrs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit acfb247559db7b726d47f203613488df0f7add53 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 15 08:38:07 2023 -0700 sdc rm map ptrs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 7541b71da92ea15085615988a1e6ea1d4d53d8d6 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 15 08:00:55 2023 -0700 sdc rm map ptrs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit d033210132656ea68fa834228575b9def1d02d90 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 15 07:52:03 2023 -0700 sdc rm map ptrs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit ca6e9ecb7821b83ab024c4fee6df8f7fc8fc2ce2 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 15 07:38:12 2023 -0700 instance_pvt_maps_ Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 631e4209b596386f5818045d521784db5239f58d Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 15 07:26:42 2023 -0700 rm GroupPathIterator Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 059c32afa87617fff530c9afa1ef8005a136739d Author: James Cherry <cherry@parallaxsw.com> Date: Sat Jan 14 20:07:44 2023 -0700 rm ClockIterator Signed-off-by: James Cherry <cherry@parallaxsw.com> commit c65fe873a6a6696220bbb44c4ecac87d5ca978ac Author: James Cherry <cherry@parallaxsw.com> Date: Sat Jan 14 19:45:58 2023 -0700 rvo Signed-off-by: James Cherry <cherry@parallaxsw.com> commit ce15c9a0cc78915acddc2f03749573d989ae96d6 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 15 01:04:03 2023 +0000 leaks commit f97955a0c7e70b65ceb3f697ff47c0524a9b3cd4 Author: James Cherry <cherry@parallaxsw.com> Date: Sat Jan 14 01:17:58 2023 +0000 leaks commit 7cdd65684adeb14e02827f5d93e7fab3b19af5dd Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 13 16:07:47 2023 -0700 leaks Signed-off-by: James Cherry <cherry@parallaxsw.com> commit ee97c7e50394a3927458e7ef09c5dbeb27719d15 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 13 11:52:48 2023 -0700 swig rm Tmp collections Signed-off-by: James Cherry <cherry@parallaxsw.com> commit c49935da8704e41459280971b7645fccd97e3d13 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 13 11:18:36 2023 -0700 swig rm Tmp types Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 4320b00ce700914843006f592126cd8cc1c4657a Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 13 10:55:10 2023 -0700 swig rm TmpPinSet, TmpPinSeq Signed-off-by: James Cherry <cherry@parallaxsw.com> commit ff6004910980c9b09b41f63a553a4481404cc539 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 13 10:45:06 2023 -0700 swig rm Tmp collections Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 9a5bf5c1a3e5a6d2996b3ab327fa2f3015f2ff20 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 13 10:15:29 2023 -0700 swig rm one TmpPinSet Signed-off-by: James Cherry <cherry@parallaxsw.com> commit f441116b56e23849485b2393b30e7086c33165a8 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 13 09:16:56 2023 -0700 leak Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 050b08df8618340b568d9cd41fd3d5f052e2c680 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 13 09:10:53 2023 -0700 leak Signed-off-by: James Cherry <cherry@parallaxsw.com> commit be8c17f3a715ab53140748dc1d94698209965cf9 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 13 08:59:06 2023 -0700 leak Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e43b82f8fb52eaeda90e3c7e76cf350ae6735ebd Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 12 18:57:49 2023 -0700 range iter Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 8db56209de7805ac2574fd2f76170bf68afd156d Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 12 18:08:54 2023 -0700 GroupPathSet net id Signed-off-by: James Cherry <cherry@parallaxsw.com> commit cb7917f9827c2ea3afebd735cd4508405a0d77d4 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 12 12:00:15 2023 -0700 DataCheckLess net id Signed-off-by: James Cherry <cherry@parallaxsw.com> commit d9da3c62d7a76699c6ad62cebb1f5c39f89722fa Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 12 11:42:27 2023 -0700 rm hashPtr uses Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 5bbea162bb1e023aba813598c7992c740ddf9d0b Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 12 11:30:12 2023 -0700 EdgePins has use net id Signed-off-by: James Cherry <cherry@parallaxsw.com> commit df38405e2ebaabdd7bbf99f3b19d78b25bd95720 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 12 09:51:38 2023 -0700 ExceptionPath hash use net id Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 9a6dcfa54c54c9f50b14248a2449c70c20a0d977 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 12 08:56:49 2023 -0700 ClockInsertion, ClockLatency net id Signed-off-by: James Cherry <cherry@parallaxsw.com> commit dbb6dc0b8c93812458df31e93f08e0dbd74e8105 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 12 08:34:03 2023 -0700 ExceptionStateSet obj id Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 70b8721c48ec0816289ee09b664c332ee095875f Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 12 08:14:37 2023 -0700 ClockGroups cmp Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 4c6c4ca191a99cd8541e106fec3202ee14968f39 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 12 07:38:17 2023 -0700 ClockGroup typedef to ClockSet Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 66f425315e16deee5f00b05c0a505766e7afbf01 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 11 20:32:38 2023 -0700 set cmps Signed-off-by: James Cherry <cherry@parallaxsw.com> commit a94866c7828af5b6714e3e4fffc13bdaf5155c0e Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 11 19:08:09 2023 -0700 net use id Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 6348320908f42ebb5262117182e13d0024f65537 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 11 11:52:13 2023 -0700 exception id cmp Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 0edfca41b6d6408ac17f8dfe10e697c55146c1ef Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 11 10:47:02 2023 -0700 range iter Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 44ad77985da9f0b9e7f4780e3f233c8d94fa7db7 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 11 08:27:58 2023 -0700 non-ptr set cmp Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 36de7d88c3fa683465604a9e16b2fc1f6bc5fdd0 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 11 08:00:54 2023 -0700 range iteration Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 4a31a2c8d9bdae58b09af8c05a64702ea3ac6c15 Author: James Cherry <cherry@parallaxsw.com> Date: Tue Jan 10 16:43:54 2023 -0700 tcl types Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 056a7447b494a4c8ecc9764650d78a5bed3d87e8 Author: James Cherry <cherry@parallaxsw.com> Date: Tue Jan 10 16:10:36 2023 -0700 tcl types Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 97239554c7625ba50ee729260f08eda7dec02365 Author: James Cherry <cherry@parallaxsw.com> Date: Tue Jan 10 13:10:42 2023 -0700 use RVO Signed-off-by: James Cherry <cherry@parallaxsw.com> commit c3247d8937d483102e3e1f2b69d7ac1d331ba9d4 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Jan 9 22:41:20 2023 -0700 swig template seq's Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 5431c06feb256adb46858819fcf5d513cfa6b5ec Author: James Cherry <cherry@parallaxsw.com> Date: Mon Jan 9 20:50:24 2023 -0700 swig set in template Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 592ad641bf01d3beb862314a0d8986f66e258642 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Jan 9 17:27:25 2023 -0700 network return containers Signed-off-by: James Cherry <cherry@parallaxsw.com> commit c95f8b77e0d6bd5ffa5ba8102413c70883c756e1 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Jan 9 12:15:37 2023 -0700 PinSeq const Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 702e7f9ba2f901066a38f32e67b35602b6c7bbdf Author: James Cherry <cherry@parallaxsw.com> Date: Mon Jan 9 12:02:29 2023 -0700 InstanceSeq const Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 44fc25ba4a15e4ae570d74af27c9435872a126e0 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Jan 9 12:01:45 2023 -0700 NetSeq const Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 03b2725c81f5d52c33c875b55056c11d482144f1 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Jan 9 11:33:18 2023 -0700 rm PortPair Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 3fb82a7344dc053171c9883a113764ba691ab827 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Jan 9 11:20:53 2023 -0700 PinSet id Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 3dd31f027e15d40d62a11d0a88ef2a115f01fb73 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 8 15:03:33 2023 -0700 InstanceSet id Signed-off-by: James Cherry <cherry@parallaxsw.com> commit a91dea5cc0af3bede36b3faed13adb05239ff907 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 8 11:40:15 2023 -0700 NetSet id Signed-off-by: James Cherry <cherry@parallaxsw.com> commit b91e4b6410134eccae7969ddcfb0b27933b2e746 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 8 10:44:47 2023 -0700 CellSet, PortSet id Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 6f891f77fae5a6b19c1454a1a4b4e3dfae0b5c50 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 8 10:29:25 2023 -0700 network object sets Signed-off-by: James Cherry <cherry@parallaxsw.com> commit eb8c627a57ecc6e7c5846a01d62b090ff91c08bf Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 8 10:09:00 2023 -0700 PinSet1 Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 8e864ecbdf87000fbb3c3097c39f06173c941e35 Author: James Cherry <cherry@parallaxsw.com> Date: Sat Jan 7 17:13:03 2023 -0700 concrete network object id Signed-off-by: James Cherry <cherry@parallaxsw.com> Signed-off-by: James Cherry <cherry@parallaxsw.com>
2023-01-19 19:23:45 +01:00
# Return NULL for all.
2018-09-28 17:54:21 +02:00
proc parse_corner_or_all { keys_var } {
upvar 1 $keys_var keys
if { [info exists keys(-corner)] } {
set corner_name $keys(-corner)
set corner [find_corner $corner_name]
if { $corner == "NULL" } {
sta_error 107 "$corner_name is not the name of process corner."
2018-09-28 17:54:21 +02:00
} else {
return $corner
}
} else {
return "NULL"
}
}
################################################################
proc parse_rise_fall_flags { flags_var } {
upvar 1 $flags_var flags
if { [info exists flags(-rise)] && ![info exists flags(-fall)] } {
return "rise"
} elseif { [info exists flags(-fall)] && ![info exists flags(-rise)] } {
return "fall"
} else {
return "rise_fall"
}
}
proc parse_min_max_flags { flags_var } {
upvar 1 $flags_var flags
if { [info exists flags(-min)] && [info exists flags(-max)] } {
sta_error 108 "both -min and -max specified."
2018-09-28 17:54:21 +02:00
} elseif { [info exists flags(-min)] && ![info exists flags(-max)] } {
return "min"
} elseif { [info exists flags(-max)] && ![info exists flags(-min)] } {
return "max"
} else {
# Default.
return "max"
}
}
proc parse_min_max_all_flags { flags_var } {
upvar 1 $flags_var flags
if { [info exists flags(-min)] && [info exists flags(-max)] } {
sta_error 109 "both -min and -max specified."
2018-09-28 17:54:21 +02:00
} elseif { [info exists flags(-min)] && ![info exists flags(-max)] } {
return "min"
} elseif { [info exists flags(-max)] && ![info exists flags(-min)] } {
return "max"
} else {
return "all"
}
}
# parse_min_max_all_flags and require analysis type to be min/max.
proc parse_min_max_all_check_flags { flags_var } {
upvar 1 $flags_var flags
if { [info exists flags(-min)] && [info exists flags(-max)] } {
return "all"
} elseif { [info exists flags(-min)] && ![info exists flags(-max)] } {
return "min"
} elseif { [info exists flags(-max)] && ![info exists flags(-min)] } {
return "max"
} else {
return "all"
}
}
proc parse_early_late_flags { flags_var } {
upvar 1 $flags_var flags
if { [info exists flags(-early)] && [info exists flags(-late)] } {
sta_error 110 "only one of -early and -late can be specified."
2018-09-28 17:54:21 +02:00
} elseif { [info exists flags(-early)] } {
return "min"
} elseif { [info exists flags(-late)] } {
return "max"
} else {
sta_error 111 "-early or -late must be specified."
2018-09-28 17:54:21 +02:00
}
}
proc parse_early_late_all_flags { flags_var } {
upvar 1 $flags_var flags
if { [info exists flags(-early)] && [info exists flags(-late)] } {
sta_error 112 "both -early and -late specified."
2018-09-28 17:54:21 +02:00
} elseif { [info exists flags(-early)] && ![info exists flags(-late)] } {
return "min"
} elseif { [info exists flags(-late)] && ![info exists flags(-early)] } {
return "max"
} else {
return "all"
}
}
################################################################
proc get_liberty_error { arg_name arg } {
set lib "NULL"
if {[llength $arg] > 1} {
sta_error 113 "$arg_name must be a single library."
2018-09-28 17:54:21 +02:00
} elseif { [is_object $arg] } {
set object_type [object_type $arg]
if { $object_type == "LibertyLibrary" } {
set lib $arg
} else {
sta_error 114 "$arg_name type '$object_type' is not a library."
2018-09-28 17:54:21 +02:00
}
} else {
set lib [find_liberty $arg]
if { $lib == "NULL" } {
sta_error 115 "library '$arg' not found."
2018-09-28 17:54:21 +02:00
}
}
return $lib
}
proc get_lib_cell_warn { arg_name arg } {
2019-06-13 17:43:38 +02:00
return [get_lib_cell_arg $arg_name $arg sta_warn]
}
proc get_lib_cell_error { arg_name arg } {
return [get_lib_cell_arg $arg_name $arg sta_error]
}
proc get_lib_cell_arg { arg_name arg error_proc } {
2018-09-28 17:54:21 +02:00
set lib_cell "NULL"
if { [llength $arg] > 1 } {
sta_error 116 "$arg_name must be a single lib cell."
2018-09-28 17:54:21 +02:00
} elseif { [is_object $arg] } {
set object_type [object_type $arg]
if { $object_type == "LibertyCell" } {
set lib_cell $arg
} else {
$error_proc 116 "$arg_name type '$object_type' is not a liberty cell."
2018-09-28 17:54:21 +02:00
}
# Parse library_name/cell_name.
} elseif {[regexp [cell_regexp] $arg ignore lib_name cell_name]} {
set library [find_liberty $lib_name]
if { $library != "NULL" } {
set lib_cell [$library find_liberty_cell $cell_name]
if { $lib_cell == "NULL" } {
$error_proc 117 "liberty cell '$arg' not found."
2018-09-28 17:54:21 +02:00
}
} else {
$error_proc 118 "library '$lib_name' not found."
2018-09-28 17:54:21 +02:00
}
} else {
set lib_cell [find_liberty_cell $arg]
if { $lib_cell == "NULL" } {
$error_proc 119 "liberty cell '$arg' not found."
2018-09-28 17:54:21 +02:00
}
}
return $lib_cell
}
# Not used by OpenSTA
2020-04-26 17:49:09 +02:00
proc get_lib_cells_arg { arg_name arglist error_proc } {
set lib_cells {}
# Copy backslashes that will be removed by foreach.
set arglist [string map {\\ \\\\} $arglist]
foreach arg $arglist {
if {[llength $arg] > 1} {
# Embedded list.
set lib_cells [concat $lib_cells [get_lib_cells_arg $arg_name $arg $error_proc]]
2020-04-26 17:49:09 +02:00
} elseif { [is_object $arg] } {
set object_type [object_type $arg]
if { $object_type == "LibertyCell" } {
lappend lib_cells $arg
} else {
$error_proc 120 "unsupported object type $object_type."
2020-04-26 17:49:09 +02:00
}
} elseif { $arg != {} } {
set arg_lib_cells [get_lib_cells1 $arg $error_proc]
2020-04-26 17:49:09 +02:00
if { $arg_lib_cells != {} } {
set lib_cells [concat $lib_cells $arg_lib_cells]
}
}
}
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 121 "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 122 "cell '$cell_pattern' not found."
}
}
}
return $cells
}
2018-09-28 17:54:21 +02:00
proc get_instance_error { arg_name arg } {
set inst "NULL"
if {[llength $arg] > 1} {
sta_error 123 "$arg_name must be a single instance."
2018-09-28 17:54:21 +02:00
} elseif { [is_object $arg] } {
set object_type [object_type $arg]
if { $object_type == "Instance" } {
2019-06-02 03:41:09 +02:00
set inst $arg
2018-09-28 17:54:21 +02:00
} else {
sta_error 124 "$arg_name type '$object_type' is not an instance."
2018-09-28 17:54:21 +02:00
}
} else {
set inst [find_instance $arg]
if { $inst == "NULL" } {
sta_error 125 "instance '$arg' not found."
2018-09-28 17:54:21 +02:00
}
}
return $inst
}
proc get_instances_error { arg_name arglist } {
set insts {}
# Copy backslashes that will be removed by foreach.
set arglist [string map {\\ \\\\} $arglist]
foreach arg $arglist {
if {[llength $arg] > 1} {
# Embedded list.
set insts [concat $insts [get_instances_error $arg_name $arg]]
} elseif { [is_object $arg] } {
set object_type [object_type $arg]
if { $object_type == "Instance" } {
lappend insts $arg
2018-09-28 17:54:21 +02:00
} else {
sta_error 126 "$arg_name type '$object_type' is not an instance."
2018-09-28 17:54:21 +02:00
}
} elseif { $arg != {} } {
set arg_insts [get_cells -quiet $arg]
if { $arg_insts != {} } {
set insts [concat $insts $arg_insts]
2018-09-28 17:54:21 +02:00
} else {
sta_error 127 "instance '$arg' not found."
2018-09-28 17:54:21 +02:00
}
}
}
return $insts
}
proc get_port_pin_warn { arg_name arg } {
return [get_port_pin_arg $arg_name $arg "warn"]
}
proc get_port_pin_error { arg_name arg } {
return [get_port_pin_arg $arg_name $arg "error"]
}
proc get_port_pin_arg { arg_name arg warn_error } {
set pin "NULL"
if {[llength $arg] > 1} {
sta_warn_error 128 $warn_error "$arg_name must be a single port or pin."
2018-09-28 17:54:21 +02:00
} elseif { [is_object $arg] } {
set object_type [object_type $arg]
if { $object_type == "Pin" } {
set pin $arg
} elseif { $object_type == "Port" } {
# Explicit port arg - convert to pin.
2019-01-17 00:37:31 +01:00
set pin [find_pin [get_name $arg]]
2018-09-28 17:54:21 +02:00
} else {
sta_warn_error 129 $warn_error "$arg_name type '$object_type' is not a pin or port."
2018-09-28 17:54:21 +02:00
}
} else {
set top_instance [top_instance]
set top_cell [$top_instance cell]
set port [$top_cell find_port $arg]
if { $port == "NULL" } {
set pin [find_pin $arg]
} else {
2019-01-17 00:37:31 +01:00
set pin [$top_instance find_pin [get_name $port]]
2018-09-28 17:54:21 +02:00
}
if { $pin == "NULL" } {
sta_warn_error 130 $warn_error "pin $arg not found."
2018-09-28 17:54:21 +02:00
}
}
return $pin
}
proc get_port_pins_error { arg_name arglist } {
set pins {}
# Copy backslashes that will be removed by foreach.
set arglilst [string map {\\ \\\\} $arglist]
foreach arg $arglist {
if {[llength $arg] > 1} {
# Embedded list.
set pins [concat $pins [get_port_pins_error $arg_name $arg]]
} elseif { [is_object $arg] } {
set object_type [object_type $arg]
if { $object_type == "Pin" } {
lappend pins $arg
2018-09-28 17:54:21 +02:00
} elseif { $object_type == "Port" } {
# Convert port to pin.
lappend pins [find_pin [get_name $arg]]
2018-09-28 17:54:21 +02:00
} else {
sta_error 131 "$arg_name type '$object_type' is not a pin or port."
2018-09-28 17:54:21 +02:00
}
} elseif { $arg != {} } {
set arg_pins [get_ports_or_pins $arg]
if { $arg_pins != {} } {
set pins [concat $pins $arg_pins]
2018-09-28 17:54:21 +02:00
} else {
sta_error 132 "pin '$arg' not found."
2018-09-28 17:54:21 +02:00
}
}
}
return $pins
}
proc get_ports_error { arg_name arglist } {
set ports {}
# Copy backslashes that will be removed by foreach.
set arglist [string map {\\ \\\\} $arglist]
foreach arg $arglist {
if {[llength $arg] > 1} {
# Embedded list.
set ports [concat $ports [get_ports_error $arg_name $arg]]
} elseif { [is_object $arg] } {
set object_type [object_type $arg]
if { $object_type == "Port" } {
lappend ports $arg
2018-09-28 17:54:21 +02:00
} else {
sta_error 133 "$arg_name type '$object_type' is not a port."
2018-09-28 17:54:21 +02:00
}
} elseif { $arg != {} } {
set arg_ports [get_ports $arg]
if { $arg_ports != {} } {
set ports [concat $ports $arg_ports]
2018-09-28 17:54:21 +02:00
}
}
}
return $ports
}
proc get_pin_error { arg_name arg } {
return [get_pin_arg $arg_name $arg "error"]
}
proc get_pin_warn { arg_name arg } {
return [get_pin_arg $arg_name $arg "warn"]
}
proc get_pin_arg { arg_name arg warn_error } {
set pin "NULL"
if {[llength $arg] > 1} {
sta_warn_error 134 $warn_error "$arg_name must be a single pin."
2018-09-28 17:54:21 +02:00
} elseif { [is_object $arg] } {
set object_type [object_type $arg]
if { $object_type == "Pin" } {
set pin $arg
} else {
sta_warn_error 135 $warn_error "$arg_name type '$object_type' is not a pin."
2018-09-28 17:54:21 +02:00
}
} else {
set pin [find_pin $arg]
if { $pin == "NULL" } {
sta_warn_error 136 $warn_error "$arg_name pin $arg not found."
2018-09-28 17:54:21 +02:00
}
}
return $pin
}
proc get_clock_warn { arg_name arg } {
return [get_clock_arg $arg_name $arg sta_warn]
}
proc get_clock_error { arg_name arg } {
return [get_clock_arg $arg_name $arg sta_error]
}
proc get_clock_arg { arg_name arg error_proc } {
set clk "NULL"
if {[llength $arg] > 1} {
$error_proc 137 "$arg_name arg must be a single clock, not a list."
2018-09-28 17:54:21 +02:00
} elseif { [is_object $arg] } {
set object_type [object_type $arg]
if { $object_type == "Clock" } {
set clk $arg
} else {
$error_proc 138 "$arg_name arg value is a $object_type, not a clock."
2018-09-28 17:54:21 +02:00
}
} elseif { $arg != {} } {
set clk [find_clock $arg]
if { $clk == "NULL" } {
$error_proc 138 "$arg_name arg '$arg' clock not found."
2018-09-28 17:54:21 +02:00
}
}
return $clk
}
proc get_clocks_warn { arg_name arglist } {
set clks {}
# Copy backslashes that will be removed by foreach.
set arglist [string map {\\ \\\\} $arglist]
foreach arg $arglist {
if {[llength $arg] > 1} {
# Embedded list.
set clks [concat $clks [get_clocks_warn $arg_name $arg]]
} elseif { [is_object $arg] } {
set object_type [object_type $arg]
if { $object_type == "Clock" } {
lappend clks $arg
2018-09-28 17:54:21 +02:00
} else {
sta_warn 139 "unsupported object type $object_type."
2018-09-28 17:54:21 +02:00
}
} elseif { $arg != {} } {
set arg_clocks [get_clocks $arg]
if { $arg_clocks != {} } {
set clks [concat $clks $arg_clocks]
2018-09-28 17:54:21 +02:00
}
}
}
return $clks
}
proc get_net_arg { arg_name arg } {
2018-09-28 17:54:21 +02:00
set net "NULL"
if {[llength $arg] > 1} {
sta_warn 140 "$arg_name must be a single net."
2018-09-28 17:54:21 +02:00
} elseif { [is_object $arg] } {
set object_type [object_type $arg]
if { $object_type == "Net" } {
set net $arg
} else {
sta_warn 141 "$arg_name '$object_type' is not a net."
2018-09-28 17:54:21 +02:00
}
} else {
set net [find_net $arg]
if { $net == "NULL" } {
sta_warn 143 "$arg_name '$arg' not found."
2018-09-28 17:54:21 +02:00
}
}
return $net
}
proc get_nets_arg { arg_name arglist } {
2018-09-28 17:54:21 +02:00
set nets {}
# Copy backslashes that will be removed by foreach.
set arglist [string map {\\ \\\\} $arglist]
foreach arg $arglist {
if {[llength $arg] > 1} {
# Embedded list.
set nets [concat $nets [get_nets_arg $arg_name $arg]]
2018-09-28 17:54:21 +02:00
} elseif { [is_object $arg] } {
set object_type [object_type $arg]
if { $object_type == "Net" } {
lappend nets $arg
2018-09-28 17:54:21 +02:00
} else {
sta_warn 142 "unsupported object type $object_type."
2018-09-28 17:54:21 +02:00
}
} elseif { $arg != {} } {
set arg_nets [get_nets $arg]
2018-09-28 17:54:21 +02:00
if { $arg_nets != {} } {
set nets [concat $nets $arg_nets]
2018-09-28 17:54:21 +02:00
}
}
}
return $nets
}
# sta namespace end.
}