Xilinx 8.2i manual Search search and return matching objects, Type type of object

Models: 8.2i

1 422
Download 422 pages 26.35 Kb
Page 91
Image 91

R

Tcl Commands for Advanced Scripting

type (type of object)

The object type command returns the type of any Xilinx object.

%object type <object_name>

object is the name of the Xilinx Tcl command.

name is the name of the object subcommand.

object_name specifies the object to return the type of. The object name will always be a Tcl variable. The set command is used to create a Tcl variable, as shown in the following example.

Example:

% set colVar [search * -type instance]

 

% object type [collection index $colVar 1]

 

 

Description:

In this example, the set command is first used to create the colVar

 

collection variable. The nested search command defines the value of

 

the collection variable.

 

In the second line, the object type command is used to get the type

 

information for the object in the collection. The collection index

 

command defines which object to get, where:

 

$colvar specifies the collection to get the object from.

 

1 specifies the index into the collection. In this case, the second object

 

in the collection is returned because index values start at 0. See the

 

collection index command for more information.

 

 

Tcl Return:

The type of the object as a text string.

 

 

search (search and return matching objects)

The search command is used to search for specific design objects that match a specified pattern.

search <pattern_string> [-exactmatch][-matchcase][-regexp][-type <object_type>]

search is the name of the Xilinx Tcl command.

pattern_string specifies a string to be used for the search. In Tcl, a string is distinguished on the command line with double quotes (“). This string may contain regular expressions.

-exactmatchspecifies that any matches found by the search, should match the pattern string exactly.

-matchcasespecifies that the search is case-sensitive.

-regexpspecifies that the pattern string uses regular expressions. If not specified, the matching is simple matching.

-type <object_type> specifies what type of design objects to search for. Supported search types are partition and instance.

Development System Reference Guide

www.xilinx.com

91

Page 91
Image 91
Xilinx 8.2i manual Search search and return matching objects, Type type of object, Object type collection index $colVar