Xilinx 8.2i Life Jacket User Manual


 
Development System Reference Guide www.xilinx.com 83
Tcl Commands for Advanced Scripting
R
collection_variable specifies the name of the collection variable, which references the
collection. If the collection variable does not exist, then it is created.
objects_to_append specifies an object or a collection of objects to be added to the collection.
-unique optionally adds only objects that are not already in the collection. If the -unique
option is not used, then duplicate objects may be added to the collection.
copy (copy a collection)
The collection copy command creates a duplicate of an existing collection. Alternatively, you
can have more than one collection variable referencing a collection, rather than copying it.
See Example 1 below.
In most cases, a second reference to a collection is all that is needed. However, if a separate
copy is required, use the collection copy command to create the new collection as shown in
Example 2 below.
collection copy <collection_variable>
collection is the name of the Xilinx Tcl command.
copy is the name of the collection subcommand.
collection_variable specifies the name of the collection to copy.
Example:
% collection append_to colVar [search * -type instance]
Description: In this example, the collection append_to command is used to create
a new collection variable named colVar. The nested search command
returns a collection of all the instances in the current design. These
instances are objects that are added to the collection, referenced by
the colVar collection variable.
Tcl Return: A collection of objects.
Example 1: % set colVar_1 [search * -type instance]
% set colVar_2 $colVar_1
Description: In this example, the Tcl set command in the first line creates a
collection assigned to the collection variable colVar_1. The second
line creates a second collection variable, colVar_2, that references
the value of colVar_1, which is the first collection.
There is still only one underlying collection referenced. Any
changes made to colVar_1 will be visible in colVar_2, and if
colVar1_1 is changed, then colVar_2 continues to reference the same
underlying collection.
Tcl Return: A new variable reference to the collection.