Specifications

Tcl Assignment Statements
A component publishes information by including Tcl assignment statements in its component description
file, <component_name>_hw.tcl. Each assignment is a name-value pair that can be associated with the
entire component, or with a single interface. When the assignment statement applies to the entire
component, it is set using the set_module_assignment command. Assignment statements that apply to
an interface are set using the set_interface_assignment command.
# These assignments apply to the entire component
# This is the syntax for the set_module_assignment command:
# set_module_assignment <assignment_name> <value>
# Here are 3 examples
set_module_assignment embeddedsw.CMacro.colorSpace "CMYK"
set_module_assignment embeddedsw.configuration.cpuArchitecture "My processor"
set_module_assignment embeddedsw.memoryInfo.IS_FLASH 1
# This is the syntax of the set_interface_assignment command:
# set_interface_assignment <interface_name> <assignment_name> <value>
# Here is an example
set_interface_assignment lcd0 embeddedsw.configuration.isPrintableDevice 1
When you generate a hardware system, the system integration tool, Qsys or SOPC Builder, creates an
<sopc_builder_system>.sopcinfo file that includes all of the assignments for your component. The
embedded software tools use these assignments for further processing. The system integration tool does
not require any of the information included in these assignments to build the hardware representation of
the component. The tool simply passes the assignments from the _hw.tcl file to the SOPC Information File
(.sopcinfo).
Related Information
Volume 1: Design and Synthesis of the Quartus II Handbook
For more information about the _hw.tcl file and using Tcl to define hardware components, refer to the
"Creating a System With Qsys" chapter.
Embedded Software Assignments
Embedded software assignments are organized in a period-separated namespace. All of the assignments
for embedded software tools have the prefix embeddedsw. The embeddedsw namespace is further divided
into the following three sub-namespaces:
C Macro—Assignment name prefix embeddedsw.CMacro
Configuration—Assignment name prefix embeddedsw.configuration
Memory Initialization—Assignment name prefix embeddedsw.memoryInfo
C Macro Namespace
You can use the C macro namespace to publish information about your component that is converted to
#define’s in a C or C++ system.h file. C macro assignments are associated with the entire hardware
component, not with individual interfaces.
The name of an assignment in the C macro namespace is embeddedsw.CMacro.<assignmentName>. You
must format the value as a legal C or C++ expression.
Example 13–2. Assignment Statement for the BAUD_RATE of uart_0 in a Hardware System
# Tcl assignment statement included in the _hw.tcl file
add_parameter BAUD_RATE_PARAM integer 9600 "This is the default baud rate."
# Dynamically reassign the baud rate based on the parameter value
13-2
Tcl Assignment Statements
NII5V2
2015.05.14
Altera Corporation
Publishing Component Information to Embedded Software
Send Feedback