Warn instead of aborting when get_property is given an empty collection - #82
Merged
Conversation
Reapplies #80, which was reverted in #81 for dropping the diagnostic entirely. get_property aborted with Error 2200 whenever its object argument was an empty collection, so a design with no output ports killed the script at `get_property [all_outputs] name`. That took down whole power-characterization runs: 16 STA shards died on line 1 of the SDC and lost hours of results. An empty collection is the zero-element case of the collection branch already below it, so return an empty list, but keep telling the user about it. The warning reuses id 2200 so an existing suppress_msg 2200 still applies, and -quiet silences it per call. Co-authored-by: Cursor <cursoragent@cursor.com>
Greptile SummaryThe PR changes
Confidence Score: 5/5The PR appears safe to merge; no actionable correctness, compatibility, or security issues were identified. The empty-object path initializes warning suppression correctly, returns the expected Tcl empty value, retains diagnostic ID compatibility, and is covered across both ordinary and collection modes without changing non-empty behavior.
|
| Filename | Overview |
|---|---|
| tcl/Property.tcl | Converts the empty-object error into a suppressible warning and empty result while preserving non-empty property behavior. |
| test/get_property_empty.tcl | Exercises empty results across supported object types, suppression mechanisms, the motivating nested-command case, and non-empty results. |
| test/get_property_empty.ok | Pins warning counts and returned values for the new regression coverage. |
| test/get_property_empty.v | Provides an input-only linked design whose output-port collection is empty. |
| test/regression_vars.tcl | Adds the new test to the public regression suite. |
Reviews (1): Last reviewed commit: "Warn instead of aborting when get_proper..." | Re-trigger Greptile
This was referenced Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reapplies #80, which was reverted in #81 because it dropped the diagnostic entirely. Same fix,
except the empty-collection case now warns rather than going silent.
Problem
get_propertyaborts withError 2200: get_property object is null.whenever its objectargument is an empty collection. Every
get_*/all_*command encodes "nothing matched" asthe empty string, in both list mode and collections mode, so this fires on ordinary code:
set outnets [get_nets -quiet [get_property [all_outputs] name]]That line is the first line of Preqorsor's power-characterization SDC. On a carved-out block
with no output ports,
[all_outputs]is empty and the error killed the interpreter. In oneproduction run all 16 STA shards died there, losing the timing/power data for ~4100 of 4630
cells about 6.5 hours in.
Fix
Warn and return an empty list. The branch immediately below already maps the property over
every element of a collection, and an empty collection is simply the zero-element case of
that: no objects, no property values. An unmatched lookup is worth telling the user about,
but it should not take the script down with it.
Three details worth reviewing:
suppress_msg 2200keeps the behavior they asked for.-quietsilences it per call. The flag was already parsed and already suppressed thesibling "not found" diagnostic on the
-object_typepath; it is now documented, which itpreviously was not.
list.
Test
New
test/get_property_empty.tcllinks a design whose ports are all inputs and walks thepaths that used to abort:
[all_outputs], emptyget_ports/get_pins/get_cells/get_clocks/get_lib_cells, a literal{}and"", the-object_typename-lookup path,and the
get_netsidiom from the SDC above. It pins one warning per call site, covers both-quietandsuppress_msg 2200, and pins the unchanged non-empty results. Output isidentical with and without
sta_enable_collections.Test plan
./regression -j 12 fast— 110/110 pass./regression -j 12 -collections fast— the same 4 tests fail before and after thischange (
all_inputs_filters,user_properties,vcd_begin_end_time,verilog_port_bundle_find_pin); collections mode is beta and CI does not run itMade with Cursor