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 foreach_in_collection (::quartus::misc)

The following table displays information for the foreach_in_collection Tcl command:

Tcl Package and Version

Belongs to ::quartus::misc

Syntax foreach_in_collection [-h | -help] [-long_help] <variable_name> <collection> <body>
Arguments -h | -help Short help
-long_help Long help with examples and possible return values
<variable_name> Variable name
<collection> Collection
<body> Body

Accesses each element of a collection. Some Tcl commands return a collection. The following table shows examples of commands that return a collection: Tcl package Tcl commands (returning a collection) -------------------------- ---------------------------------------- ::quartus::project get_all_quartus_defaults get_all_global_assignments get_all_instance_assignments get_all_parameters get_names assignment_group (only for the "-get_members" and "-get_exceptions" options) ::quartus::chip_editor get_nodes get_iports get_oports The command is used in the following format: foreach_in_collection <variable name> <collection> { # This is the body of "foreach_in_collection" ... } Unlike a Tcl list, a collection is a container specific to the Quartus II software, whose elements can be accessed by using the "foreach_in_collection" command.

Example Usage
## Get a collection of global assignments
set collection_of_global_assignments [get_all_global_assignments -name *]
## Display the collection string representation
puts $collection_of_global_assignments
## Iterate through the collection and display
## the information for each global as