From 7cf702830bc2f12108a1e7b98cc486bc549ac1e2 Mon Sep 17 00:00:00 2001 From: Akash Levy Date: Wed, 2 Sep 2026 11:33:19 -0700 Subject: [PATCH] Revert "Return an empty list from get_property on an empty collection" --- tcl/Property.tcl | 7 ++----- test/get_property_empty.ok | 12 ------------ test/get_property_empty.tcl | 31 ------------------------------- test/get_property_empty.v | 8 -------- test/regression_vars.tcl | 1 - 5 files changed, 2 insertions(+), 57 deletions(-) delete mode 100644 test/get_property_empty.ok delete mode 100644 test/get_property_empty.tcl delete mode 100644 test/get_property_empty.v diff --git a/tcl/Property.tcl b/tcl/Property.tcl index 4c3285c38..015f6683b 100644 --- a/tcl/Property.tcl +++ b/tcl/Property.tcl @@ -26,7 +26,7 @@ namespace eval sta { define_cmd_args "get_property" \ {[-object_type library|liberty_library|cell|liberty_cell|instance|pin|net|port|clock|timing_arc] object property} \ - -help {The `get_property` command returns a property of an object. Given a collection of objects it returns one value per object, so an empty collection returns an empty list. Properties for each object type are shown below. + -help {The `get_property` command returns a property of an object. Properties for each object type are shown below. | Object type | Properties | | --- | --- | @@ -64,10 +64,7 @@ proc get_property_cmd { cmd type_key cmd_args } { set object [lindex $cmd_args 0] set prop [lindex $cmd_args 1] if { $object == "" } { - # Both list and collection mode encode "nothing matched" as the empty string, so this is - # the zero-element case of the collection branch below: no objects, no property values. - # The get_*/all_* command that came up empty already warned unless it was given -quiet. - return {} + sta_error 2200 "get_property object is null." } elseif { [sta::is_collection $object] || [sizeof_collection $object] > 1 } { set results {} foreach_in_collection element $object { diff --git a/test/get_property_empty.ok b/test/get_property_empty.ok deleted file mode 100644 index 13ac45a8b..000000000 --- a/test/get_property_empty.ok +++ /dev/null @@ -1,12 +0,0 @@ -all_outputs: '' 0 -nets of all_outputs: '' 0 -get_ports: '' 0 -get_pins: '' 0 -get_cells: '' 0 -get_clocks: '' 0 -get_lib_cells: '' 0 -empty list: '' 0 -empty string: '' 0 -empty -object_type: '' 0 -one port: 'in1' 1 -all_inputs: 'in1 in2 clk' 3 diff --git a/test/get_property_empty.tcl b/test/get_property_empty.tcl deleted file mode 100644 index 46c6c7a73..000000000 --- a/test/get_property_empty.tcl +++ /dev/null @@ -1,31 +0,0 @@ -# get_property on an empty collection used to abort with Error 2200, so any script that -# asked for a property of a get_*/all_* result that matched nothing died on the spot. -read_liberty ../examples/nangate45_slow.lib.gz -read_verilog get_property_empty.v -link_design no_outputs -create_clock -name clk -period 10 [get_ports clk] - -proc show { label value } { - puts "$label: '$value' [llength $value]" -} - -# The reported case: a design with no output ports, and the SDC idiom that consumes -# the names it returns. -show "all_outputs" [get_property [all_outputs] name] -show "nets of all_outputs" [get_nets -quiet [get_property [all_outputs] name]] - -# Any object type whose lookup matched nothing. -show "get_ports" [get_property [get_ports -quiet no_such_port*] name] -show "get_pins" [get_property [get_pins -quiet no_such_pin*] direction] -show "get_cells" [get_property [get_cells -quiet no_such_inst*] full_name] -show "get_clocks" [get_property [get_clocks -quiet no_such_clock*] period] -show "get_lib_cells" [get_property [get_lib_cells -quiet *no_such_cell*] area] - -# Literal empty object arguments, including the -object_type name lookup path. -show "empty list" [get_property {} name] -show "empty string" [get_property "" name] -show "empty -object_type" [get_property -object_type port {} name] - -# Non-empty results are unchanged: a bare value for one object, a list for many. -show "one port" [get_property [get_ports in1] name] -show "all_inputs" [get_property [all_inputs] name] diff --git a/test/get_property_empty.v b/test/get_property_empty.v deleted file mode 100644 index dfa5ea960..000000000 --- a/test/get_property_empty.v +++ /dev/null @@ -1,8 +0,0 @@ -// Every port is an input, so all_outputs comes back empty. -module no_outputs (in1, in2, clk); - input in1, in2, clk; - wire r1q, u1z; - - DFF_X1 r1 (.D(in1), .CK(clk), .Q(r1q)); - BUF_X1 u1 (.A(r1q), .Z(u1z)); -endmodule // no_outputs diff --git a/test/regression_vars.tcl b/test/regression_vars.tcl index 02379fd05..3f9a99fa9 100644 --- a/test/regression_vars.tcl +++ b/test/regression_vars.tcl @@ -164,7 +164,6 @@ record_public_tests { get_lib_pins_of_objects get_noargs get_objrefs - get_property_empty get_property_flags get_scenes input_delay_ref_pin_rebuild