Add_to_collection, Add_to_collection –67 – Altera SDC and TimeQuest API User Manual
Page 77

Chapter 2: SDC and TimeQuest API Package and Commands
2–67
sta
© December 2009
Altera Corporation
SDC and TimeQuest API Reference Manual
add_to_collection
Usage
add_to_collection
Options
Description
This command takes two collections and returns a new collection that is a union of the two. The second
collection is allowed to be a string, whereas the first has to be previously-created collection, either by
passing any of the "get_" functions directly, or by passing a variable that contains a collection (see code
examples for this command). If a collection is used for the second argument, the types in the second
collection must be the same as or a subset of the types in the first collection.
If the first collection consists of keepers, the second collection can only consist of keepers, registers or
ports. If the first collection consists of partitions, the second collection can only consist of partitions or
cells. If the first collection consists of nodes, the second collection can only consist of nodes, keepers,
registers, ports, pins, nets or combinational nodes.
Example
set kprs1 [get_keepers b*]
set regs1 [get_registers a*]
set regs_union [add_to_collection $kprs1 $regs1]
#or:
set regs_union [add_to_collection [get_keepers b*] $regs1]
#or even:
set regs_union [add_to_collection $kprs1 a*]
# note that the last statement will actually add all keepers with name
# a* not only registers! (will add IOs with name a*, if any)
# Get the first 100 nodes in the collection.
query_collection $regs_union -limit 100