Xilinx 8.2i Life Jacket User Manual


 
84 www.xilinx.com Development System Reference Guide
Chapter 3: Tcl
R
equal (compare two collections)
The collection equal command compares the contents of two collections. Collections are
considered equal when the objects in both collections are the same. If the same objects are
in both collections, the result is 1. If the objects in the compared collections are different,
then the result is 0. By default, the order of the objects does not matter. Optionally, the
order_dependent command can be specified for the order of the objects to be considered.
% collection equal <colVar_1> <colVar_2> [-order_dependent]
collection is the name of the Xilinx Tcl command.
equal is the name of the collection subcommand.
colVar_1 specifies the base collection for the comparison.
colVar_2 specifies the collection to compare with the base collection.
order_dependent optionally specifies that the collections are considered different when the
order of the objects in both collections are not the same.
Note:
When two empty collections are compared, they are considered identical and the result is 1.
Example 2: % set colVar_2 [collection copy $colVar_1]
Description: In this example, the set command creates the collection variable
colVar_2. The nested collection copy command makes a duplicate of
the colVar_1 collection and assigns it to the colVar2 collection
variable, making it a completely separate collection.
Tcl Return: A new collection.
Example: % set colVar_1 [search * -type instance]
% set colVar_2 [search /top/T* -type instance]
% collection equal $colVar_1 $colVar_2
Description: In this example, the contents of two collections are compared. First,
the Tcl set command is used to assign a collection of instances to the
collection variable colVar_1; then another collection of filtered
instance names is assigned to the collection variable colVar_2.
The collection equal command is used to specify the two collections
to compare. The dollar sign ($) syntax is used to obtain the values of
the collection variables. In this case, the values of colVar_1 and
colVar_2 to determine if they are equal.
Tcl Return: 0 if the collections are not the same, 1 if the collections are the same.