Product Documentation
Virtuoso Space-based Router Command Reference
Product Version IC23.1, September 2023

filter_set

filter_set
-set d_setObj 
-expr s_expression | -expr_ex s_extendedExpr 

Description

Returns a set containing objects from the original set that meet the criteria given by a simple expression (-expr) or a Tcl expression (-expr_ex) which compares property values for objects in the given set to target values. A number of operators are available.

The syntax for simple expressions differs from the Tcl syntax. Basic syntax differences are shown in the following table.

Basic Syntax Differences for filter_set Expressions

Simple Expression (-expr)

Tcl Syntax (-expr_ex)

Property name

Name only
for example, direction

Name must be preceded by a dollar sign ($); for example, $direction

String Value

String only
for example, WEST

String must be enclosed in double quotes ("); for example, "WEST"

Arguments

-expr s_expr

Is an expression in the form:

<propertyName> <operator> <targetValue>

where <operator> is one of the following:

==

is equal to

!=

is not equal to

>

is greater than

>=

is greater than or equal to

<

is less than

<=

is less than or equal to

=~

regular expression matches pattern

!~

regular expression does not match pattern

The property name can be a simple property name, (for example, direction), or a compound property name (for example, net.name). A numeric comparison is performed if the object’s property value and the target value are both numbers, otherwise string comparisons are performed. For the regular expression operators (=~ and !~), the target value is a regular expression. All string comparisons are case-sensitive.

-expr_ex s_extendedExpr

Is an expression in Tcl syntax. Single or compound expressions can be used.

When the Tcl syntax expression is used, property names must be preceded by a dollar sign ($) and string target values must be enclosed in double quotes (“) to ensure that the expressions are parsed correctly.

-set d_setObj

Specifies the set of objects to operate on.

Value Returned

d_setObj

Is the set of objects that meet the expression criteria.

If any object in the original set does not have the given property, an error message is issued and a NULL set is returned.

Examples

Example 1—Simple expression using -expr

The following command evaluates objects in the selected set and returns a set containing all objects whose direction is WEST.

filter_set -set [get_selection_set] -expr {direction == WEST}

If any object in the selected set does not have a direction property, the command will fail and return a NULL set.

Example 2—Simple expression using -expr_ex

The following command will return the same set of objects as in the above example but this command uses the -expr_ex syntax instead.

filter_set -set [get_selection_set] -expr_ex {$direction == "WEST"}

Example 3—Compound expression using -expr_ex

The following command returns the set of objects whose length is greater than 3 and whose direction ends with "TH".

filter_set -set $set1 -expr_ex {$length > 3 && [string match "*TH" $direction]}

Related Topics

Edit Commands


Return to top
 ⠀
X