Filter a list, resulting in new list
Syntax
filter [‑regexp] [‑nocase] [‑quiet] [‑verbose] [<objects>] [<filter>]
Returns
new list
Usage
Name | Description |
---|---|
[-regexp]
|
Operators =~ and !~ use regular expressions |
[-nocase]
|
Perform case-insensitive matching (valid only when -regexp specified) |
[-quiet]
|
Ignore command errors |
[-verbose]
|
Suspend message limits during command execution |
[<objects>]
|
List of objects to filter |
[<filter>]
|
Filter list with expression |
Categories
Description
Takes a list of objects, and returns a reduced list of objects that match the specified filter search pattern.
Arguments
-regexp
- (Optional) Specifies that the search <patterns> are written as regular expressions. Both search <patterns> and -filter
expressions must be written as regular expressions when this argument is used. Xilinx regular expression Tcl commands are always anchored to the start of the search string. You can add ".*" to the beginning or end of a search string to widen the search to include a substring. See http://perldoc.perl.org/perlre.html for help with regular expression syntax.
regexp
is not anchored, and works as a standard Tcl command. For more information refer to http://www.tcl.tk/man/tcl8.5/TclCmd/regexp.htm.
-nocase
- (Optional) Perform case-insensitive matching when a pattern has been specified. This argument applies to the use of -regexp
only.
-quiet
- (Optional) Execute the command quietly, returning no messages from the command. The command also returns TCL_OK regardless of any errors encountered during execution.
-verbose
- (Optional) Temporarily override any message limits and return all messages from this command.
set_msg_config
command.<objects> - (Optional) A list of objects that should be filtered to reduce the set to the desired results. The list of objects can be obtained by using one of the many get_*
commands such as get_parts
.
<filter> - (Optional) The expression to use for filtering. The specified pattern filters the list of objects returned based on property values on the objects. You can find out which properties are on an object with the report_property
or list_property
command. Any property/value pair can be used as a filter. For example, in the case of the "part" object, "DEVICE", "FAMILY" and "SPEED" are some of the properties that can be used to filter results.
get_pins * -filter {DIRECTION == IN && NAME !~ "*RESET*"}
bool
) type properties can be directly evaluated in filter expressions as true or not true: -filter {IS_PRIMITIVE && !IS_LOC_FIXED}
Examples
filter [get_parts] {speed == -3}
filter [get_parts] {speed == -3 || speed == -2}
filter -regexp [get_ports] {NAME =~ VStatus.*\[[0-9]+\]}