-1

I need what below if statement gives true or false, Also please explain about "quiet"

if {[sizeof_collection[get_pins $source-quiet]]>0}

What is gives? Note:- $source is I_TEST_MODE4.

Donal Fellows
  • 133,037
  • 18
  • 149
  • 215
  • 1
    You'd have to look up the documentation for `get_pins` in whatever tool or library you're using. It's not part of standard tcl. – Shawn Mar 11 '21 at 06:48
  • 1
    Are you sure it's `$source-quiet` and not `$source -quiet`? – slebetman Mar 11 '21 at 07:56
  • Tcl cares very much about spaces as word separators; what spaces are missing in what you pasted? (The answer to your question depends on `get_pins` behaviour, or on your specific application/data.) – Donal Fellows Mar 11 '21 at 08:33

1 Answers1

0

If I assume spaces in the obvious places and other minor syntactic matters, your code snippet is:

if {[sizeof_collection [get_pins $source -quiet]] > 0} {
   # more stuff...
}

I can find, with a few seconds on a web search, a description of get_pins that mentions that -quiet is an option it supports. Without diving in further — I don't use Synopsis at all — I'd guess that -quiet suppresses diagnostic messages (e.g., on an empty result) so that the only output produced is the collection of pins on the source, which is then measured using sizeof_collection and checked against zero (as a non-emptiness check). That would be a comprehensible pattern.

Donal Fellows
  • 133,037
  • 18
  • 149
  • 215
  • Note that neither `get_pins` nor `sizeof_collection` are standard parts of Tcl at all. They're both specific to a stack of software that runs on/with Tcl, which is probably some form of Synopsis. – Donal Fellows Mar 11 '21 at 08:43