The object query
get_*
commands have a
common option to filter the query based on any property value attached to the object.
This is a powerful capability for the object query commands. For example, to query all
cells of primitive type FD do the
following:get_cells * -hierarchical -filter “lib_cell == FD”
To do more elaborate string filtering, utilize the =~ operator to do
string pattern matching. For example, to query all flip-flop types in the design, do the
following:
get_cells * -hierarchical -filter “lib_cell =~ FD*”
Multiple filter properties can be combined with other property filters
with logical OR (||) and AND (&&) operators to make very powerful searches. To
query every cell in the design that if of any flop type and has a placed location
constraint:
get_cells * -hierarchical -filter {lib_cell =~ FD* && loc != “”}
Note: In the example, the filter
option value was wrapped with curly braces {} instead of double quotes. This is
normal Tcl syntax that prevents command substitution by the interpreter and allows
users to pass the empty string (“”) to the loc property.