Intel® Quartus® Prime Standard Edition User Guide: Platform Designer

ID 683364
Date 12/15/2018
Public
Document Table of Contents

1.8.1. Creating an Instance Parameter Script in Platform Designer

The first command in an instance parameter script must specify the Tcl command version. The version command ensures the Tcl commands behave identically in future versions of the tool. Use the following command to specify the version of the Tcl commands, where <version> is the Intel® Quartus® Prime software version number, such as 14.1:

package require -exact qsys <version>

To use Tcl commands that work with instance parameters in the instance script, you must specify the commands within a Tcl composition callback. In the instance script, you specify the name for the composition callback with the following command:

set_module_property COMPOSITION_CALLBACK <name of callback procedure>

Specify the appropriate Tcl commands inside the Tcl procedure with the following syntax:

proc <name of procedure defined in previous command> {}
{#Tcl commands to query and set parameters go here}

Instance Parameter Script Example

In this example, an instance script uses the pio_width parameter to set the width parameter of a parallel I/O (PIO) component. The script combines the get_parameter_value and set_instance_parameter_value commands using brackets.

# Request a specific version of the scripting API
package require -exact qsys 13.1

# Set the name of the procedure to manipulate parameters:
set_module_property COMPOSITION_CALLBACK compose 

proc compose {} {

# Get the pio_width parameter value from this Platform Designer system and
# pass the value to the width parameter of the pio_0 instance

set_instance_parameter_value pio_0 width \
[get_parameter_value pio_width]
}