Intel® Quartus® Prime Pro Edition User Guide: Scripting

ID 683432
Date 10/04/2021

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents get_collection_size (::quartus::misc)

The following table displays information for the get_collection_size Tcl command:

Tcl Package and Version

Belongs to ::quartus::misc

Syntax get_collection_size [-h | -help] [-long_help] [ <collection> ]
Arguments -h | -help Short help
-long_help Long help with examples and possible return values
<collection> Collection

Returns the size of a collection. Unlike a Tcl list, a collection is a container specific to the Quartus Prime software, whose elements can be accessed by using the "foreach_in_collection" command.

Example Usage
## Displays the number of global assignments
project_open chiptrip
set num_global_asgns [get_collection_size [get_all_global_assignments -name {*}]]
puts $num_global_asgns
Return Value Code Name Code String Return
TCL_OK 0 INFO: Operation successful
TCL_ERROR 1 ERROR: Collection does not exist with name: <string>. Specify the collection name returned by a Tcl command that supports foreach_in_collection. Note a valid collection name can become invalid if the variable holding the collection goes out of scope, as well as a result of some built-in TCL commands, for example 'string length'.
TCL_ERROR 1 ERROR: Nested calls to foreach_in_collection with the same collection name <string> are not allowed. Specify a different collection name for the other collection.