Intel® Quartus® Prime Pro Edition User Guide: Scripting

ID 683432
Date 12/13/2021
Public

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

Document Table of Contents

2.6.3.1. The foreach_in_collection Command

The foreach_in_collection command is similar to the foreach Tcl command. Use it to iterate through all elements in a collection. The following example prints all instance assignments in an open project.

foreach_in_collection Example

set all_instance_assignments [get_all_instance_assignments -name *]
foreach_in_collection asgn $all_instance_assignments {
	# Information about each assignment is
	# returned in a list. For information
	# about the list elements, refer to Help
	# for the get-all-instance-assignments command.
	set to [lindex $asgn 2]
	set name [lindex $asgn 3]
	set value [lindex $asgn 4]
	puts "Assignment to $to: $name = $value"
}