The Tcl API to the ZDB Find Command

The find API.

The following commands are available:

Find Database Objects

$db find

$db find ?-simple? ?-type $type? ?-case $case? ?-exact? ?-resulttype $resulttype? ?-cellref PATTERN? ?-path PATTERN? ?-top PATTERN? ?-dontmatchhiersep? ?-hiersep $char? $pattern $varName $body

Find objects in the database.

The following options are available:

-simple

-simple can only be combined with the -case, -hiersep, -exact, and -type options

-type $type

Search of given type which can be one of module, primitive, cell, inst, instance, port, portBus, pin, pinBus, net, netBus, parasitic, any, *

-case $case

$case can be one of smart, sensitive, and insensitive. sensitive performs a case-sensitive search, insensitive performs a case-insensitive search, smart is the same as case-insensitive unless the search pattern contains some upper-case characters.

-exact

Do fixed-string matching instead of wild-card-style pattern matching.

-resulttype $resulttype

$resulttype can be one of modbased, treebased, both

-cellref PATTERN

Pattern of the reference cell. See Wildcards.

-path PATTERN

Pattern of the path. See Wildcards.

-top PATTERN

Pattern of the top. See Wildcards.

-dontmatchhiersep

Wild-cards in the pathPattern won’t match any hiersep characters.

-hiersep $char

Character which should be used to separate $path.

$pattern

Pattern which should be found in the $db. See Wildcards.

$varName

$body

$body is evaluated for each search result — the current search result can be accessed with $varName. Use the break command in $body to interrupt the current search.

Example
# Search (and print) all netlist objects
      $db find * oid {
          puts $oid
      }
Example
# Search for 10 nets named 'clk*'
      set clockNets {}
      $db find -type net -case insensitive clk* oid {
          lappend clockNets $oid
          if {[llength $clockNets] == 10} {
              break
          }
      }
      # Do something with $clockNets
Example
# Find all instances of '*dffrs*' cells inside the 'top/CPU' hierarchy
      $db find -type inst -cellref *dffrs* -path CPU* -top top * oid {
          puts $oid
      }