Professional Documents
Culture Documents
Synthesis
The Quartus® Prime software organizes and manages the elements of your design within a project. The
project encapsulates information about your design hierarchy, libraries, constraints, and project settings.
Click File > New Project Wizard to create a new project quickly and specify basic project settings.
When you open a project, a unified GUI displays integrated project information. The Project Navigator
allows you to view and edit the elements of your project. The Messages window lists important informa‐
tion about project processing.
You can save multiple revisions of your project to experiment with settings that achieve your design goals.
Quartus Prime projects support team-based, distributed work flows and a scripting interface.
Quick Start
To quickly create a project and specify basic settings, click File > New Project Wizard.
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V1
1-2 Understanding Quartus Prime Projects 2016.05.03
Note: The New Project Wizard offers project templates based on fully functioning design examples.
Select the Project template option to choose a project template that is ready to compile. Altera
provides additional project templates as available.
IP core files IP core logic, synthesis, Tools > IP Catalog All supported HDL files
and simulation
Quartus Prime IP File (.qip)
information
Qsys system Qsys system and IP core Tools > Qsys Qsys System File (.qsys)
files files
Send Feedback
QPS5V1
2016.05.03 Project Management Best Practices 1-3
Archive files Complete project as single Project > Archive Project Quartus Prime Archive File (.qar)
compressed file
Send Feedback
QPS5V1
1-4 Viewing Basic Project Information 2016.05.03
Send Feedback
QPS5V1
2016.05.03 Viewing Project Reports 1-5
Related Information
List of Compilation Reports
Send Feedback
QPS5V1
1-6 Viewing Project Messages 2016.05.03
You can suppress display of unimportant messages so they do not obscure valid messages.
Figure 1-4: Message Suppression by Message ID Number
Suppressing Messages
To supress messages, right-click a message and choose any of the following:
Send Feedback
QPS5V1
2016.05.03 Message Suppression Guidelines 1-7
Send Feedback
QPS5V1
1-8 Optimizing Project Settings 2016.05.03
The Assignment Editor (Tools > Assignment Editor) provides a spreadsheet-like interface for assigning
all instance-specific settings and constraints.
Figure 1-6: Assignment Editor Spreadsheet
Send Feedback
QPS5V1
2016.05.03 Optimizing with Design Space Explorer II 1-9
Send Feedback
QPS5V1
1-10 Copying Your Project 2016.05.03
can compare revisions to determine the best combination, or optimize different revisions for various
applications. Use revisions for the following:
• Create a unique revision to optimize a design for different criteria, such as by area in one revision and
by fMAX in another revision.
• When you create a new revision the default Quartus Prime settings initially apply.
• Create a revision of a revision to experiment with settings and constraints. The child revision includes
all the assignments and settings of the parent revision.
You create, delete, specify current, and compare revisions in the Revisions dialog box. Each time you
create a new project revision, the Quartus Prime software creates a new .qsf using the revision name.
To compare each revision’s synthesis, fitting, and timing analysis results side-by-side, click Project >
Revisions and then click Compare.
In addition to viewing the compilation results of each revision, you can also compare the assignments for
each revision. This comparison reveals how different optimization options affect your design.
Figure 1-8: Comparing Project Revisions
Send Feedback
QPS5V1
2016.05.03 Including Design Libraries 1-11
software also supports Verilog Quartus Mapping (.vqm) design files generated by other design entry and
synthesis tools. In addition, you can combine your logic design files with Altera and third-party IP core
design files, including combining components into a Qsys system (.qsys).
The New Project Wizard prompts you to identify logic design files. Add or remove project files by clicking
Project > Add/Remove Files in Project. View the project’s logic design files in the Project Navigator.
Figure 1-9: Design and IP Files in Project Navigator
Related Information
• Recommended Design Practices on page 11-1
• Recommended HDL Coding Styles on page 12-1
Send Feedback
QPS5V1
1-12 Managing Timing Constraints 2016.05.03
Related Information
Quartus Prime TimeQuest Timing Analyzer
Send Feedback
QPS5V1
2016.05.03 IP Catalog and Parameter Editor 1-13
the IP Catalog to efficiently parameterize and generate synthesis and simulation files for your custom IP
variation. The Altera IP library includes the following types of IP cores:
• Basic functions
• DSP functions
• Interface protocols
• Low power functions
• Memory interfaces and controllers
• Processors and peripherals
The IP Catalog (Tools > IP Catalog) and parameter editor help you easily customize and integrate IP
cores into your project. Use the IP Catalog and parameter editor to select, customize, and generate files
representing the custom IP variation in your project.
Filter IP by
device
Double-click to parameterize
Right-click for details
Send Feedback
QPS5V1
1-14 Using the Parameter Editor 2016.05.03
The IP Catalog is also available in Qsys (View > IP Catalog). The Qsys IP Catalog includes exclusive
system interconnect, video and image processing, and other system-level IP that are not available in the
Quartus Prime IP Catalog. For more information about using the Qsys IP Catalog, refer to Creating a
System with Qsys in Volume 1 of the Quartus Prime Handbook.
Related Information
• Creating a System With Qsys on page 5-1
• Creating a System with Qsys
View IP port
and parameter
details
Legacy parameter
editors
• Use preset settings in the parameter editor (where provided) to instantly apply preset parameter values
for specific applications.
• View port and parameter descriptions, and click links to documentation.
• Generate testbench systems or example designs (where provided).
Send Feedback
QPS5V1
2016.05.03 Adding IP Cores to IP Catalog 1-15
The Quartus Prime software searches the directories listed in the IP search path for the following IP core
files:
• Component Description File (_hw.tcl)—Defines a single IP core.
• IP Index File (.ipx)—Each .ipx file indexes a collection of available IP cores. This file can specify the
relative path of directories to search for IP cores. In general, .ipx files facilitate faster searches.
The Quartus Prime software searches some directories recursively and other directories only to a specific
depth. When the search is recursive, the search stops at any directory that contains a _hw.tcl or .ipx file.
In the following list of search locations, ** indicates a recursive descent.
Location Description
PROJECT_DIR/* Finds IP components and index files in the Quartus Prime project directory.
PROJECT_DIR/ip/**/* Finds IP components and index files in any subdirectory of the /ip subdirectory
of the Quartus Prime project directory.
Send Feedback
QPS5V1
1-16 General Settings for IP 2016.05.03
If the Quartus Prime software recognizes two IP cores with the same name, the following search path
precedence rules determine the resolution of files:
1. Project directory.
2. Project database directory.
3. Project IP search path specified in IP Search Locations, or with the SEARCH_PATH assignment for the
current project revision.
4. Global IP search path specified in IP Search Locations, or with the SEARCH_PATH assignment in the
quartus2.ini file.
5. Quartus software libraries directory, such as <Quartus Installation>\libraries.
Note: If you add a component to the search path, you must update the IP Catalog by clicking Refresh IP
Catalog in the drop-down list. In Qsys, click File > Refresh System to update the IP Catalog.
Tools > Options > IP • Specify additional project and global IP search locations. The Quartus
Catalog Search Locations Prime software searches for IP cores in the project directory, in the Altera
Or installation directory, and in the IP search path.
Assignments > Settings > • Specify general options for generating files for simulation of IP cores.
Simulation Quartus Prime Standard Edition also includes options for NativeLink
integration with other EDA tools.
Licensing IP Cores
The Altera IP Library provides many useful IP core functions for your production use without purchasing
an additional license. Some Altera MegaCore® IP functions require that you purchase a separate license
for production use. However, the OpenCore® feature allows evaluation of any Altera IP core in simulation
Send Feedback
QPS5V1
2016.05.03 OpenCore Plus IP Evaluation 1-17
and compilation in the Quartus Prime software. After you are satisfied with functionality and
performance, visit the Self Service Licensing Center to obtain a license number for any Altera product.
Figure 1-13: IP Core Installation Path
acds
quartus - Contains the Quartus Prime software
ip - Contains the Altera IP Library and third-party IP cores
altera - Contains the Altera IP Library source code
<IP core name> - Contains the IP core source files
Generating IP Cores
You can quickly configure a custom IP variation in the parameter editor.
Use the following steps to specify IP core options and parameters in the parameter editor:
Send Feedback
QPS5V1
1-18 Generating IP Cores 2016.05.03
View IP port
and parameter
details
1. In the IP Catalog (Tools > IP Catalog), locate and double-click the name of the IP core to customize.
The parameter editor appears.
2. Specify a top-level name for your custom IP variation. The parameter editor saves the IP variation
settings in a file named <your_ip>.qsys. Click OK. Do not include spaces in IP variation names or
paths.
3. Specify the parameters and options for your IP variation in the parameter editor, including one or
more of the following:
• Optionally select preset parameter values if provided for your IP core. Presets specify initial
parameter values for specific applications.
• Specify parameters defining the IP core functionality, port configurations, and device-specific
features.
• Specify options for processing the IP core files in other EDA tools.
Note: Refer to your IP core user guide for information about specific IP core parameters.
4. Click Generate HDL. The Generation dialog box appears.
Send Feedback
QPS5V1
2016.05.03 Files Generated for Altera IP Cores and Qsys Systems 1-19
5. Specify output file generation options, and then click Generate. The IP variation files synthesis and/or
simulation files generate according to your specifications.
6. To generate a simulation testbench, click Generate > Generate Testbench System. Specify testbench
generation options, and then click Generate.
7. To generate an HDL instantiation template that you can copy and paste into your text editor, click
Generate > Show Instantiation Template.
8. Click Finish. Click Yes if prompted to add files representing the IP variation to your project.
Optionally turn on the option to Automatically add Quartus Prime IP Files to All Projects. Click
Project > Add/Remove Files in Project to add IP files at any time.
Figure 1-15: Adding IP Files to Project
Auto adds
IP without
prompt
Adds IP
Note: For Arria 10 devices, the generated .qsys file must be added to your project to represent IP and
Qsys systems. For devices released prior to Arria 10 devices, the generated .qip and .sip files
must be added to your project for IP and Qsys systems.
9. After generating and instantiating your IP variation, make appropriate pin assignments to connect
ports.
Note: Some IP cores generate different HDL implementations according to the IP core parameters.
The underlying RTL of these IP cores contains a unique hash code that prevents module name
collisions between different variations of the IP core. This unique code remains consistent,
given the same IP settings and software version during IP generation. This unique code can
change if you edit the IP core's parameters or upgrade the IP core version. To avoid dependency
on these unique codes in your simulation environment, refer to Generating a Combined
Simulator Setup Script.
Related Information
• IP User Guide Documentation
• Altera IP Release Notes
Send Feedback
QPS5V1
1-20 Files Generated for Altera IP Cores and Qsys Systems 2016.05.03
<Project Directory>
<your_ip>.qip or .qsys - System or IP integration file
<your_ip>.sopcinfo - Software tool-chain integration file
<your_ip> - IP core variation files
<your_ip>.bsf - Block symbol schematic file
<your_ip>.cmp - VHDL component declaration
<your_ip>.debuginfo - Post-generation debug data
<your_ip>.html - Memory map data
<your_ip>.ppf - XML I/O pin information file
<your_ip>.qip - Lists files for IP core synthesis
<your_ip>.sip - NativeLink simulation integration file
<your_ip>.spd - Combines individual simulation startup scripts 1
<your_ip>_bb.v - Verilog HDL black box EDA synthesis file
<your_ip>_generation.rpt - IP generation report
<your_ip>_inst.v or .vhd - Lists file for IP core synthesis
sim - IP simulation files
<your_ip>.v or vhd - Top-level simulation file
<simulator vendor> - Simulator setup scripts
<simulator_setup_scripts>
synth - IP synthesis files
<your_ip>.v or .vhd - Top-level IP synthesis file
<IP Submodule> - IP Submodule Library
sim- IP submodule 1 simulation files
<HDL files>
synth - IP submodule 1 synthesis files
<HDL files>
<your_ip>_tb - IP testbench system 1
<your_testbench>_tb.qsys - testbench system file
<your_ip>_tb - IP testbench files
<your_testbench>_tb.csv or .spd - testbench file
sim - IP testbench simulation files
1. If supported and enabled for your IP core variation.
Send Feedback
QPS5V1
2016.05.03 Files Generated for Altera IP Cores and Qsys Systems 1-21
<my_ip>.cmp The VHDL Component Declaration (.cmp) file is a text file that
contains local generic and port definitions that you can use in VHDL
design files.
<my_ip>.html A report that contains connection information, a memory map
showing the slave address with respect to each master that the slave
connects to, and parameter assignments.
<my_ip>.bsf A Block Symbol File (.bsf) representation of the IP variation for use
in Quartus Prime Block Diagram Files (.bdf).
<my_ip>.ppf The Pin Planner File (.ppf) stores the port and node assignments for
IP components created for use with the Pin Planner.
<my_ip>_bb.v You can use the Verilog blackbox (_bb.v) file as an empty module
declaration for use as a blackbox.
<my_ip>.sip Contains information required for NativeLink simulation of IP
components. You must add the .sip file to your Quartus project to
enable NativeLink for Arria II, Arria V, Cyclone IV, Cyclone V, MAX
10, MAX II, MAX V, Stratix IV, and Stratix V devices. The Quartus
Prime Pro Edition does not support NativeLink simulation.
<my_ip>_inst.v or _inst.vhd HDL example instantiation template. You can copy and paste the
contents of this file into your HDL file to instantiate the IP variation.
Send Feedback
QPS5V1
1-22 Scripting IP Core Generation 2016.05.03
<my_ip>.v <my_ip>.vhd HDL files that instantiate each submodule or child IP core for
synthesis or simulation.
mentor/ Contains a ModelSim® script msim_setup.tcl to set up and run a
simulation.
/cadence Contains a shell script ncsim_setup.sh and other setup files to set up
and run an NCSIM simulation.
qsys-script --script=<script_file>.tcl
Send Feedback
QPS5V1
2016.05.03 Scripting IP Core Generation 1-23
Note: Creating an IP generation script is an advanced feature that requires access to special IP core
parameters. For more information about creating an IP generation script, contact your Altera sales
representative.
Send Feedback
QPS5V1
1-24 Scripting IP Core Generation 2016.05.03
Send Feedback
QPS5V1
2016.05.03 Generating IP Cores (Legacy Editors) 1-25
Note: The legacy parameter editor generates a different output file structure than the latest parameter
editor. Refer to Specifying IP Core Parameters and Options for configuration of IP cores that use the
latest parameter editor.
Send Feedback
QPS5V1
1-26 Files Generated for Altera IP Cores (Legacy Parameter Editors) 2016.05.03
1. In the IP Catalog (Tools > IP Catalog), locate and double-click the name of the IP core to customize.
The parameter editor appears.
2. Specify a top-level name and output HDL file type for your IP variation. This name identifies the IP
core variation files in your project. Click OK. Do not include spaces in IP variation names or paths.
3. Specify the parameters and options for your IP variation in the parameter editor. Refer to your IP core
user guide for information about specific IP core parameters.
4. Click Finish or Generate (depending on the parameter editor version). The parameter editor generates
the files for your IP variation according to your specifications. Click Exit if prompted when generation
is complete. The parameter editor adds the top-level .qip file to the current project automatically.
Note: For devices released prior to Arria 10 devices, the generated .qip and .sip files must be added to
your project to represent IP and Qsys systems. To manually add an IP variation generated with
legacy parameter editor to a project, click Project > Add/Remove Files in Project and add the
IP variation .qip file.
Note: Some IP cores generate different HDL implementations according to the IP core parameters.
The underlying RTL of these IP cores contains a unique code that prevents module name
collisions between different variations of the IP core. This unique code remains consistent,
given the same IP settings and software version during IP generation. This unique code can
change if you edit the IP core's parameters or upgrade the IP core version. To avoid dependency
on these unique codes in your simulation environment, refer to Generating a Combined
Simulator Setup Script.
Related Information
• IP User Guide Documentation
• Altera IP Release Notes
Send Feedback
QPS5V1
2016.05.03 Modifying an IP Variation 1-27
Note: For devices released prior to Arria 10 devices, the generated .qip and .sip files must be added to
your project to represent IP and Qsys systems. To manually add an IP variation to a Quartus Prime
project, click Project > Add/Remove Files in Project and add only the IP variation .qip or .qsys
file, but not both, to the project. Do not manually add the top-level HDL file to the project. The
Quartus Prime Pro Edition does not support NativeLink simulation.
Modifying an IP Variation
After generating an IP core variation, you can modify the IP core parameters in the parameter editor. Use
any of the following methods to modify an IP variation in the parameter editor.
Send Feedback
QPS5V1
1-28 Upgrading IP Cores 2016.05.03
Upgrading IP Cores
IP core variants generated with a previous version or different edition of the Quartus Prime software may
require upgrading before use in the current version or edition of the Quartus Prime software. When you
open a project containing outdated IP, the Project Navigator displays a banner indicating the IP upgrade
status. Click Launch IP Upgrade Tool or Project > Upgrade IP Components to upgrade outdated IP
cores.
Figure 1-19: IP Upgrade Alert in Project Navigator
Icons in the Upgrade IP Components dialog box indicate when IP upgrade is required, optional, or
unsupported for IP cores in your design. You must upgrade IP cores that require upgrade before you can
compile the IP variation in the current version of the Quartus Prime software.
The upgrade process preserves the original IP variation file in the project directory as <my_variant>_
BAK.qsys.
Note: Upgrading IP cores may append a unique identifier to the original IP core entity name(s), without
similarly modifying the IP instance name. There is no requirement to update these entity
references in any supporting Quartus Prime file; such as the Quartus Prime Settings File (.qsf),
Synopsys Design Constraints File (.sdc), or SignalTap File (.stp), if these files contain instance
Send Feedback
QPS5V1
2016.05.03 Upgrading IP Cores 1-29
names. The Quartus Prime software reads only the instance name and ignores the entity name in
paths that specify both names. Use only instance names in assignments.
IP Upgrade Optional Indicates that upgrade is optional for this IP variation in the current version of
the Quartus Prime software. You can upgrade this IP variation to take
advantage of the latest development of this IP core. Alternatively, you can
retain previous IP core characteristics by declining to upgrade. Refer to the
Description for details about IP core version differences. If you do not upgrade
the IP, the IP variation synthesis and simulation files are unchanged and you
cannot modify parameters until upgrading.
IP Upgrade Required Indicates that you must upgrade the IP variation before compiling in the
current version of the Quartus Prime software. Refer to the Description for
details about IP core version differences.
IP Upgrade Unsupported indicates that upgrade of the IP variation is not supported in the current
version of the Quartus Prime software due to incompatibility with the current
version of the Quartus Prime software. The Quartus Prime software prompts
you to replace the unsupported IP core with a supported equivalent IP core
from the IP Catalog. Refer to the Description for details about IP core version
differences and links to Release Notes.
IP End of Life Indicates that Altera designates the IP core as end-of-life status. You may or
may not be able to edit the IP core in the parameter editor. Support for this IP
core discontinues in future releases of the Quartus Prime software.
Send Feedback
QPS5V1
1-30 Upgrading IP at Command-Line 2016.05.03
2. To upgrade one or more IP cores that support automatic upgrade, ensure that the Auto Upgrade
option is turned on for the IP core(s), and then click Perform Automatic Upgrade. The Status and
Version columns update when upgrade is complete. Example designs provided with any Altera IP core
regenerate automatically whenever you upgrade an IP core.
3. To manually upgrade an individual IP core, select the IP core and then click Upgrade in Editor (or
simply double-click the IP core name). The parameter editor opens, allowing you to adjust parameters
and regenerate the latest version of the IP core.
Figure 1-20: Upgrading IP Cores
“Auto Upgrade”
supported
Upgrade details
Upgrade required
Note: IP cores older than Quartus Prime software version 12.0 do not support upgrade. Altera verifies
that the current version of the Quartus Prime software compiles the previous two versions of
each IP core. The Altera IP Release Notes reports any verification exceptions for Altera IP cores.
Altera does not verify compilation for IP cores older than the previous two releases.
Related Information
Altera IP Release Notes
Upgrading IP at Command-Line
You can upgrade an IP core at the command-line if the IP core supports auto upgrade. IP cores that do
not support automatic upgrade do not support command-line upgrade.
Send Feedback
QPS5V1
2016.05.03 Migrating IP Cores to a Different Device 1-31
Example:
quartus_sh -ip_upgrade -variation_files mega/pll25.qsys hps_testx
• To simultaneously upgrade multiple IP cores at the command-line, type the following command:
Example:
quartus_sh -ip_upgrade -variation_files "mega/pll_tx2.qsys;mega/pll3.qsys" hps_testx
Migration details
Migration success
Upgrade in editor
(no auto-upgrade)
Send Feedback
QPS5V1
1-32 Troubleshooting IP or Qsys System Upgrade 2016.05.03
Related Information
Altera IP Release Notes
Send Feedback
QPS5V1
2016.05.03 Troubleshooting IP or Qsys System Upgrade 1-33
Click to open
upgrade report Upgrade details
Upgrade failed
Upgrade in editor
(no auto-upgrade)
Send Feedback
QPS5V1
1-34 Troubleshooting IP or Qsys System Upgrade 2016.05.03
Use the following techniques to resolve errors if your Altera IP core or Qsys system "Failed" to upgrade
versions or migrate to another device. Review and implement the instructions in the Description field,
including one or more of the following:
1. If the current version of the software does not support the IP variant, right-click the component and
click Remove IP Component from Project. Replace this IP core or Qsys system with the one
supported in the current version of the software.
2. If the current target device does not support the IP variant, select a supported device family for the
project, or replace the IP variant with a suitable replacement that supports your target device.
3. If an upgrade or migration fails, click Failed in the Regeneration Status field to display and review
details of the IP Upgrade Report. Click the Release Notes link for the latest known issues about the
Altera IP core. Use this information to determine the nature of the upgrade or migration failure and
make corrections before upgrade.
Figure 1-23: IP Upgrade Report
Reports on failed
IP upgrades
Report summary
4. Run Perform Automatic Upgrade to automatically generate an IP Ports Diff report for each IP core
or Qsys system that fails upgrade. Review the reports to determine any port differences between the
Send Feedback
QPS5V1
2016.05.03 Simulating Altera IP Cores 1-35
current and previous IP core version. Click Upgrade in Editor to make specific port changes and
regenerate your IP core or Qsys system.
5. If your IP core or Qsys system does not support Perform Automatic Upgrade, click Upgrade in
Editor to resolve errors and regenerate the component in the parameter editor.
Related Information
Simulating Altera Designs
Send Feedback
QPS5V1
1-36 Generating IP Simulation Files 2016.05.03
Send Feedback
QPS5V1
2016.05.03 Scripting IP Simulation 1-37
Scripting IP Simulation
The Quartus Prime software supports the use of scripts to automate simulation processing in your
preferred simulation environment. You can use your preferred scripting methodology to control
simulation.
Altera recommends the use of a version-independent, top-level simulation script to control design,
testbench, and IP core simulation. Because Quartus Prime-generated simulation file names may change
after IP upgrade or regeneration, Altera recommends that your top-level simulation script "sources" any
generated setup scripts, rather than using the generated setup scripts directly. You can click Project >
Upgrade IP Components > Generate Simulator Script for IP (or run the ip-setup-simulation utility)
to generate or regenerate a combined simulator setup script for all IP for each simulator. Use the
templates in the generated script to source the combined script in your top-level simulation script. Each
simulator's combined script file contains a rudimentary template that you can adapt for integration of the
setup script into a top-level simulation script. This technique eliminates the requirement to manually
update simulation scripts when you modify or upgrade the IP variation.
Figure 1-24: Incorporating Generated Simulator Setup Scripts into a Top-Level Simulation Script
Send Feedback
QPS5V1
1-38 Generating a Combined Simulator Setup Script 2016.05.03
the default library, work. Click OK to generate the file. By default, the files generate into the /<project
directory>/<simulator>/ directory using relative paths.
Figure 1-25: Generate Simulator Setup Script for IP
3. To incorporate the generated simulator setup script into your top-level simulation script, refer to the
template section in the generated simulator setup script as a guide to creating a top-level script:
a. Copy the specified template sections from the simulator-specific generated scripts and paste them
into a new top-level file.
b. Remove the comments at the beginning of each line from the copied template sections.
c. Specify the customizations required to match your design simulation requirements, for example:
• Specify the TOP_LEVEL_NAME variable to the design’s simulation top-level file. The top-level
entity of your simulation is often a testbench that instantiates your design, and then your design
instantiates IP cores and/or Qsys systems. Set the value of TOP_LEVEL_NAME to the top-level
entity.
• If necessary, set the QSYS_SIMDIR variable to point to the location of the generated IP simulation
files.
• Compile the top-level HDL file (e.g. a test program) and all other files in the design.
• Specify any other changes, such as using the grep command-line utility to search a transcript file
for error signatures, or e-mail a report.
4. Re-run Tools > Generate Simulator Setup Script for IP (or ip-setup-simulation) after regenera‐
tion of an IP variation.
Utility Syntax
ip-setup-simulation generates a combined,
ip-setup-simulation
version-independent simulation script for all Altera --quartus-project=<my proj>
IP cores in your project, and automates regenera‐ --output-directory=<my_dir>
tion of the script after upgrading software or IP --use-relative-paths
--compile-to-work
versions. Use the compile-to-work option to
compile all simulation files into a single work --use-relative-paths and --compile-to-work
library if your simulation environment requires that are optional. For command-line help listing all
structure. Use the --use-relative-paths option options for these executables, type: <utility name> --
to use relative paths whenever possible. help.
Send Feedback
QPS5V1
2016.05.03 Sourcing Aldec Simulator Setup Scripts 1-39
Utility Syntax
ip-make-simscript generates a combined
ip-make-simscript
simulation script for all IP cores specified on the --spd=<ipA.spd,ipB.spd>
command line. Specify one or more .spd files and --output-directory=<directory>
an output directory in the command. Running the
script compiles IP simulation models into various
simulation libraries.
Note: Generate Simulator Script for IP is also available by clicking Project > Upgrade IP
Components.
The following sections provide step-by-step instructions for sourcing each simulator setup script in your
top-level simulation script.
# # Start of template
# # If the copied and modified template file is "aldec.do", run it as:
# # vsim -c -do aldec.do
# #
# # Source the generated sim script
# source rivierapro_setup.tcl
# # Compile eda/sim_lib contents first
# dev_com
# # Override the top-level name (so that elab is useful)
# set TOP_LEVEL_NAME top
# # Compile the standalone IP.
# com
# # Compile the user top-level
# vlog -sv2k5 ../../top.sv
# # Elaborate the design.
# elab
# # Run the simulation
# run
# # Report success to the shell
# exit -code 0
# # End of template
2. Delete the first two characters of each line (comment and space):
# Start of template
# If the copied and modified template file is "aldec.do", run it as:
# vsim -c -do aldec.do
#
# Source the generated sim script source rivierapro_setup.tcl
# Compile eda/sim_lib contents first dev_com
# Override the top-level name (so that elab is useful)
set TOP_LEVEL_NAME top
# Compile the standalone IP.
com
# Compile the user top-level vlog -sv2k5 ../../top.sv
# Elaborate the design.
elab
# Run the simulation
run
Send Feedback
QPS5V1
1-40 Sourcing Cadence Simulator Setup Scripts 2016.05.03
3. Modify the TOP_LEVEL_NAME and compilation step appropriately, depending on the simulation’s top-
level file. For example:
4. If necessary, add the QSYS_SIMDIR variable to point to the location of the generated IP simulation files.
Specify any other changes required to match your design simulation requirements. The scripts offer
variables to set compilation or simulation options. Refer to the generated script for details.
5. Run the new top-level script from the generated simulation directory:
# # Start of template
# # If the copied and modified template file is "ncsim.sh", run it as:
# # ./ncsim.sh
# #
# # Do the file copy, dev_com and com steps
# source ncsim_setup.sh \
# SKIP_ELAB=1 \
# SKIP_SIM=1
#
# # Compile the top level module
# ncvlog -sv "$QSYS_SIMDIR/../top.sv"
#
# # Do the elaboration and sim steps
# # Override the top-level name
# # Override the user-defined sim options, so the simulation
# # runs forever (until $finish()).
# source ncsim_setup.sh \
# SKIP_FILE_COPY=1 \
# SKIP_DEV_COM=1 \
# SKIP_COM=1 \
# TOP_LEVEL_NAME=top \
# USER_DEFINED_SIM_OPTIONS=""
# # End of template
2. Delete the first two characters of each line (comment and space):
# Start of template
# If the copied and modified template file is "ncsim.sh", run it as:
# ./ncsim.sh
#
# Do the file copy, dev_com and com steps
source ncsim_setup.sh \
SKIP_ELAB=1 \
SKIP_SIM=1
# Compile the top level module
ncvlog -sv "$QSYS_SIMDIR/../top.sv"
# Do the elaboration and sim steps
# Override the top-level name
Send Feedback
QPS5V1
2016.05.03 Sourcing ModelSim Simulator Setup Scripts 1-41
3. Modify the TOP_LEVEL_NAME and compilation step appropriately, depending on the simulation’s top-
level file. For example:
TOP_LEVEL_NAME=sim_top \
ncvlog -sv "$QSYS_SIMDIR/../top.sv"
4. If necessary, add the QSYS_SIMDIR variable to point to the location of the generated IP simulation files.
Specify any other changes required to match your design simulation requirements. The scripts offer
variables to set compilation or simulation options. Refer to the generated script for details.
5. Run the resulting top-level script from the generated simulation directory by specifying the path to
ncsim.sh.
# # Start of template
# # If the copied and modified template file is "mentor.do", run it
# # as: vsim -c -do mentor.do
# #
# # Source the generated sim script
# source msim_setup.tcl
# # Compile eda/sim_lib contents first
# dev_com
# # Override the top-level name (so that elab is useful)
# set TOP_LEVEL_NAME top
# # Compile the standalone IP.
# com
# # Compile the user top-level
# vlog -sv ../../top.sv
# # Elaborate the design.
# elab
# # Run the simulation
# run -a
# # Report success to the shell
# exit -code 0
# # End of template
2. Delete the first two characters of each line (comment and space):
# Start of template
# If the copied and modified template file is "mentor.do", run it
# as: vsim -c -do mentor.do
#
# Source the generated sim script source msim_setup.tcl
# Compile eda/sim_lib contents first
dev_com
# Override the top-level name (so that elab is useful)
set TOP_LEVEL_NAME top
Send Feedback
QPS5V1
1-42 Sourcing VCS Simulator Setup Scripts 2016.05.03
3. Modify the TOP_LEVEL_NAME and compilation step appropriately, depending on the simulation’s top-
level file. For example:
4. If necessary, add the QSYS_SIMDIR variable to point to the location of the generated IP simulation files.
Specify any other changes required to match your design simulation requirements. The scripts offer
variables to set compilation or simulation options. Refer to the generated script for details.
5. Run the resulting top-level script from the generated simulation directory:
# # Start of template
# # If the copied and modified template file is "vcs_sim.sh", run it
# # as: ./vcs_sim.sh
# #
# # Override the top-level name
# # specify a command file containing elaboration options
# # (system verilog extension, and compile the top-level).
# # Override the user-defined sim options, so the simulation
# # runs forever (until $finish()).
# source vcs_setup.sh \
# TOP_LEVEL_NAME=top \
# USER_DEFINED_ELAB_OPTIONS="'-f ../../../synopsys_vcs.f'" \
# USER_DEFINED_SIM_OPTIONS=""
#
# # helper file: synopsys_vcs.f
# +systemverilogext+.sv
# ../../../top.sv
# # End of template
2. Delete the first two characters of each line (comment and space) for the vcs.sh file, as shown below:
# Start of template
# If the copied and modified template file is "vcs_sim.sh", run it
# as: ./vcs_sim.sh
#
# Override the top-level name
# specify a command file containing elaboration options
# (system verilog extension, and compile the top-level).
# Override the user-defined sim options, so the simulation
# runs forever (until $finish()).
source vcs_setup.sh \
TOP_LEVEL_NAME=top \
Send Feedback
QPS5V1
2016.05.03 Sourcing VCS MX Simulator Setup Scripts 1-43
USER_DEFINED_ELAB_OPTIONS="'-f ../../../synopsys_vcs.f'" \
USER_DEFINED_SIM_OPTIONS=""
3. Delete the first two characters of each line (comment and space) for the synopsys_vcs.f file, as shown
below:
4. Modify the TOP_LEVEL_NAME and compilation step appropriately, depending on the simulation’s top-
level file. For example:
TOP_LEVEL_NAME=sim_top \
5. If necessary, add the QSYS_SIMDIR variable to point to the location of the generated IP simulation files.
Specify any other changes required to match your design simulation requirements. The scripts offer
variables to set compilation or simulation options. Refer to the generated script for details.
6. Run the resulting top-level script from the generated simulation directory by specifying the path to
vcs_sim.sh.
# # Start of template
# # If the copied and modified template file is "vcsmx_sim.sh", run
# # it as: ./vcsmx_sim.sh
# #
# # Do the file copy, dev_com and com steps
# source vcsmx_setup.sh \
# SKIP_ELAB=1 \
# SKIP_SIM=1
#
# # Compile the top level module vlogan +v2k
+systemverilogext+.sv "$QSYS_SIMDIR/../top.sv"
2. Delete the first two characters of each line (comment and space), as shown below:
# Start of template
# If the copied and modified template file is "vcsmx_sim.sh", run
# it as: ./vcsmx_sim.sh
#
# Do the file copy, dev_com and com steps
source vcsmx_setup.sh \
Send Feedback
QPS5V1
1-44 Using NativeLink Simulation 2016.05.03
SKIP_ELAB=1 \
SKIP_SIM=1
3. Modify the TOP_LEVEL_NAME and compilation step appropriately, depending on the simulation’s top-
level file. For example:
TOP_LEVEL_NAME=”-top sim_top’” \
4. Make the appropriate changes to the compilation of the your top-level file, for example:
5. If necessary, add the QSYS_SIMDIR variable to point to the location of the generated IP simulation files.
Specify any other changes required to match your design simulation requirements. The scripts offer
variables to set compilation or simulation options. Refer to the generated script for details.
6. Run the resulting top-level script from the generated simulation directory by specifying the path to
vcsmx_sim.sh.
Send Feedback
QPS5V1
2016.05.03 Generating IP Functional Simulation Models for 40nm Devices 1-45
Simulator Path
Mentor Graphics <drive letter>:\<simulator install path>\win32aloem (Windows)
ModelSim-Altera
/<simulator install path>/bin (Linux)
3. Click Assignments > Settings and specify options on the Simulation page and More NativeLink
Settings dialog box. Specify default options for simulation library compilation, netlist and tool
command script generation, and for launching RTL or gate-level simulation automatically following
Quartus Prime processing.
4. If your design includes a testbench, turn on Compile test bench and then click Test Benches to specify
options for each testbench. Alternatively, turn on Use script to compile testbench and specify the
script file.
5. If you want to use a script to setup a simulation, turn on Use script to setup simulation.
Send Feedback
QPS5V1
1-46 Instantiating IP Cores in HDL 2016.05.03
and timing estimation netlist. To enable generation, turn on Create timing and resource estimates for
third-party EDA synthesis tools when customizing your IP variation.
The area and timing estimation netlist describes the IP core connectivity and architecture, but does not
include details about the true functionality. This information enables certain third-party synthesis tools to
better report area and timing estimates. In addition, synthesis tools can use the timing information to
achieve timing-driven optimizations and improve the quality of results.
The Quartus Prime software generates the <variant name>_syn.v netlist file in Verilog HDL format
regardless of the output file format you specify. If you use this netlist for synthesis, you must include the
IP core wrapper file <variant name>.v or <variant name>.vhd in your Quartus Prime project.
Related Information
Quartus Prime Integrated Synthesis
defparam
inst1.pipeline = 11,
inst1.width_exp = 8,
inst1.width_man = 23,
inst1.exception_handling = "no";
endmodule
library ieee;
use ieee.std_logic_1164.all;
library altera_mf;
use altera_mf.altera_mf_components.all;
entity MF_top is
port (clock, sel : in std_logic;
a, b, datab : in std_logic_vector(31 downto 0);
result : out std_logic_vector(31 downto 0));
end entity;
Send Feedback
QPS5V1
2016.05.03 Support for IP Core Encryption with the IEEE 1735 Standard 1-47
inst1 : altfp_mult
generic map (
pipeline => 11,
width_exp => 8,
width_man => 23,
exception_handling => "no")
port map (
dataa => wire_dataa,
datab => datab,
clock => clock,
result => result);
end arch_MF_top;
In Verilog/SystemVerilog:
In VHDL:
In either case, you need to include the key value which is available from your sales representative or FAE.
You can also file a service request on myAltera.com
Related Information
myAltera.com
Send Feedback
QPS5V1
1-48 Managing Team-based Projects 2016.05.03
The Quartus Prime software manages EDA tool files and provides the following integration capabilities:
• Automatically generate files for synthesis and simulation and automatically launch other EDA tools
(Assignments > Settings > EDA Tool Settings > NativeLink Settings ). The Quartus Prime Pro
Edition software does not support NativeLink.
• Compile all RTL and gate-level simulation model libraries for your device, simulator, and design
language automatically (Tools > Launch Simulation Library Compiler).
• Include files (.edf, .vqm) generated by other EDA design entry or synthesis tools in your project as
synthesized design files (Project > Add/Remove File from Project) .
• Automatically generate optional files for board-level verification (Assignments > Settings > EDA Tool
Settings).
Figure 1-26: EDA Tool Settings
Related Information
• Mentor Graphics Precision Synthesis SupportGraphics on page 19-1
• Simulating Altera Designs
Related Information
• Using External Revision Control on page 1-52
• Migrating Projects Across Operating Systems on page 1-53
Send Feedback
QPS5V1
2016.05.03 Preserving Compilation Results 1-49
Send Feedback
QPS5V1
1-50 Importing the Results Database 2016.05.03
• Click Processing > Start > Start Analysis & Synthesis to generate a post-synthesis netlist.
• Click Processing > Start Compilation to generate a post-fit netlist.
3. Click Project > Export Database and specify the Export directory.
Note: You can turn on Assignments > Settings > Compilation Process Settings > Export version-
compatible database if you want to always export the database following compilation.
Figure 1-27: Quartus Prime Version-Compatible Database Structure
Archiving Projects
You can save the elements of a project in a single, compressed Quartus Prime Archive File (.qar) by
clicking Project > Archive Project.
Send Feedback
QPS5V1
2016.05.03 Manually Adding Files To Archives 1-51
The .qar captures logic design, project, and settings files required to restore the project.
Use this technique to share projects between designers, or to transfer your project to a new version of the
Quartus Prime software, or to Altera support. You can optionally add compilation results, Qsys system
files, and third-party EDA tool files to the archive. If you restore the archive in a different version of the
Quartus Prime software, you must include the original .qdf in the archive to preserve original compilation
results.
Send Feedback
QPS5V1
1-52 Using External Revision Control 2016.05.03
• Project source and setting files (.v, .vhd, .vqm, .qsf, .sdc, .qip, .qpf, .cmp, .sip)
• Automatically detected source files (various)
• Programming output files (.jdi, .sof, .pof)
• Report files (.rpt, .pin, .summary, .smsg)
• Qsys system and IP files (.qsys, .qip)
4. Click OK, and then click Archive.
Figure 1-28: Archiving Project for Service Request
Send Feedback
QPS5V1
2016.05.03 Migrating Projects Across Operating Systems 1-53
Send Feedback
QPS5V1
1-54 Design Library Migration Guidelines 2016.05.03
Figure 1-30: Quartus Prime Project Directory Separate from Design Files
Scripting API
You can use command-line executables or scripts to execute project commands, rather than using the
GUI. The following commands are available for scripting project management.
Send Feedback
QPS5V1
2016.05.03 Project Revision Commands 1-55
The .qsf supports only a limited subset of Tcl commands. Therefore, pass settings and constraints using a
Tcl script:
1. Create a text file with the extension.tcl that contains your assignments in Tcl format.
2. Source the Tcl script file by adding the following line to the .qsf: set_global_assignment -name
SOURCE_TCL_SCR IPT_FILE <file name>.
Option Description
based_on (optional) Specifies the revision name on which the new revision bases
its settings.
copy_results Copies the results from the "based_on" revision.
set_current (optional) Sets the new revision as the current revision.
get_project_revisions <project_name>
Send Feedback
QPS5V1
1-56 Creating a Project Archive 2016.05.03
project_archive <name>.qar
Note: Version-compatible databases are not available for some device families. If you require the
database files to reproduce the compilation results in the same Quartus software version, use the -
use_file_set full_db option to archive the complete database.
Send Feedback
QPS5V1
2016.05.03 Generate Version-Compatible Database After Compilation 1-57
Related Information
• Tcl Scripting
• CommandLine Scripting
• Quartus Settings File Manual
Send Feedback
QPS5V1
1-58 Document Revision History 2016.05.03
Send Feedback
QPS5V1
2016.05.03 Document Revision History 1-59
May 2013 13.0.0 • Overhaul for improved usability and updated information.
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2016.05.03
Design Planning with the Quartus
Prime Software 2
QPS5V1 Subscribe Send Feedback
device.
If more than one designer works on your design, you must consider a common design directory structure
or source control system to make design integration easier. Consider whether you want to standardize on
an interface protocol for each design block.
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V1
2-2 Selecting Intellectual Property Cores 2016.05.03
Related Information
• Planning for On-Chip Debugging Tools on page 2-10
For guidelines related to analyzing and debugging the device after it is in the system.
• Planning for Hierarchical and Team-Based Design on page 2-13
For more suggestions on team-based designs.
• Using Qsys and Standard Interfaces in System Design on page 2-2
For improved reusability and ease of integration.
can connect any logical device (either on-chip or off-chip) that has an Avalon interface. The Avalon
Memory-Mapped interface allows a component to use an address mapped read or write protocol that
enables flexible topologies for connecting master components to any slave components. The Avalon
Streaming interface enables point-to-point connections between streaming components that send and
receive data using a high-speed, unidirectional system interconnect between source and sink ports.
In addition to enabling the use of a system integration tool such as Qsys, using standard interfaces ensures
compatibility between design blocks from different design teams or vendors. Standard interfaces simplify
the interface logic to each design block and enable individual team members to test their individual design
blocks against the specification for the interface protocol to ease system integration.
Send Feedback
QPS5V1
2016.05.03 Device Selection 2-3
Related Information
• System Design with Qsys
For more information about using Qsys to improve your productivity.
• SOPC Builder User Guide
For more information about SOPC Builder.
Device Selection
The device you choose affects board specification and layout. Use the following guidelines for selecting a
device.
Choose the device family that best suits your design requirements. Families differ in cost, performance,
logic and memory density, I/O density, power utilization, and packaging. You must also consider feature
requirements, such as I/O standards support, high-speed transceivers, global or regional clock networks,
and the number of phase-locked loops (PLLs) available in the device.
Each device family has complete documentation, including a data sheet, which documents device features
in detail. You can also see a summary of the resources for each device in the Device dialog box in the
Quartus Prime software.
Carefully study the device density requirements for your design. Devices with more logic resources and
higher I/O counts can implement larger and more complex designs, but at a higher cost. Smaller devices
use lower static power. Select a device larger than what your design requires if you want to add more logic
later in the design cycle to upgrade or expand your design, and reserve logic and memory for on-chip
debugging. Consider requirements for types of dedicated logic blocks, such as memory blocks of different
sizes, or digital signal processing (DSP) blocks to implement certain arithmetic functions.
If you have older designs that target an Altera device, you can use their resources as an estimate for your
design. Compile existing designs in the Quartus Prime software with the Auto device selected by the
Fitter option in the Settings dialog box. Review the resource utilization to learn which device density fits
your design. Consider coding style, device architecture, and the optimization options used in the Quartus
Prime software, which can significantly affect the resource utilization and timing performance of your
design.
Related Information
• Planning for On-Chip Debugging Tools on page 2-10
For information about on-chip debugging.
• Altera Product Selector
You can refer to the Altera website to help you choose your device.
• Selector Guides
You can review important features of each device family in the refer to the Altera website.
• Devices and Adapters
For a list of device selection guides.
• IP and Megafunctions
For information on how to obtain resource utilization estimates for certain configurations of Altera’s
IP, refer to the user guides for Altera megafunctions and IP MegaCores on the literature page of the
Altera website.
Send Feedback
QPS5V1
2-4 Device Migration Planning 2016.05.03
Send Feedback
QPS5V1
2016.05.03 Specifying a Development Kit for an Existing Project 2-5
Figure 2-1: Selecting the Desired Board from New Project Wizard
Note: If you are unable to find the board you are looking for in the Available Boards table, click Design
Store link at the bottom of the page. This link takes you to the Altera development store from
where you can purchase development kits and download baseline design examples.
Related Information
Design Store
Send Feedback
QPS5V1
2-6 Planning for Device Programming or Configuration 2016.05.03
source <current_project_dir>/devkits/<design_name>/platform_setup.tcl
setup_project
This command populates all assignments available in the setup_platform.tcl file to your .qsf file.
Estimating Power
You can use the Quartus Prime power estimation and analysis tools to provide information to PCB board
and system designers. Power consumption in FPGA devices depends on the design logic, which can make
planning difficult. You can estimate power before you create any source code, or when you have a
preliminary version of the design source code, and then perform the most accurate analysis with the
PowerPlay Power Analyzer when you complete your design.
You must accurately estimate device power consumption to develop an appropriate power budget and to
design the power supplies, voltage regulators, heat sink, and cooling system. Power estimation and
analysis helps you satisfy two important planning requirements:
• Thermal—ensure that the cooling solution is sufficient to dissipate the heat generated by the device.
The computed junction temperature must fall within normal device specifications.
• Power supply—ensure that the power supplies provide adequate current to support device operation.
The PowerPlay Early Power Estimator (EPE) spreadsheet allows you to estimate power utilization for
your design.
You can manually enter data into the EPE spreadsheet, or use the Quartus Prime software to generate
device resource information for your design.
Send Feedback
QPS5V1
2016.05.03 Early Pin Planning and I/O Analysis 2-7
To manually enter data into the EPE spreadsheet, enter the device resources, operating frequency, toggle
rates, and other parameters for your design. If you do not have an existing design, estimate the number of
device resources used in your design, and then enter the data into the EPE spreadsheet manually.
If you have an existing design or a partially completed design, you can use the Quartus Prime software to
generate the PowerPlay Early Power Estimator File (.txt, .csv) to assist you in completing the PowerPlay
EPE spreadsheet.
The PowerPlay EPE spreadsheet includes the Import Data macro that parses the information in the
PowerPlay EPE File and transfers the information into the spreadsheet. If you do not want to use the
macro, you can manually transfer the data into the EPE spreadsheet. For example, after importing the
PowerPlay EPE File information into the PowerPlay EPE spreadsheet, you can add device resource
information. If the existing Quartus Prime project represents only a portion of your full design, manually
enter the additional device resources you use in the final design.
Estimating power consumption early in the design cycle allows planning of power budgets and avoids
unexpected results when designing the PCB.
When you complete your design, perform a complete power analysis to check the power consumption
more accurately. The PowerPlay Power Analyzer tool in the Quartus Prime software provides an accurate
estimation of power, ensuring that thermal and supply limitations are met.
Related Information
• PowerPlay Power Analysis
For more information about power estimation and analysis.
• Performing an Early Power Estimate Using the PowerPlay Early Power Estimator
For more information about generating the PowerPlay EPE File, refer to Quartus Prime Help.
• PowerPlay Early Power Estimator and Power Analyzer
The PowerPlay EPE spreadsheets for each supported device family are available on the Altera website.
Send Feedback
QPS5V1
2-8 Early Pin Planning and I/O Analysis 2016.05.03
The Pin Planner interfaces with the IP core parameter editor, which allows you to create or import
custom IP cores that use I/O interfaces. You can configure how to connect the functions and cores to each
other by specifying matching node names for selected ports. You can create other I/O-related assignments
for these interfaces or other design I/O pins in the Pin Planner, as described in this section. The Pin
Planner creates virtual pin assignments for internal nodes, so internal nodes are not assigned to device
pins during compilation. After analysis and synthesis of the newly generated top-level wrapper file, use
the generated netlist to perform I/O Analysis with the Start I/O Assignment Analysis command.
You can use the I/O analysis results to change pin assignments or IP parameters even before you create
your design, and repeat the checking process until the I/O interface meets your design requirements and
passes the pin checks in the Quartus Prime software. When you complete initial pin planning, you can
create a revision based on the Quartus Prime-generated netlist. You can then use the generated netlist to
develop the top-level design file for your design, or disregard the generated netlist and use the generated
Quartus Prime Settings File (.qsf) with your design.
During this early pin planning, after you have generated a top-level design file, or when you have
developed your design source code, you can assign pin locations and assignments with the Pin Planner.
With the Pin Planner, you can identify I/O banks, voltage reference (VREF) groups, and differential pin
pairings to help you through the I/O planning process. If you selected a migration device, the Pin
Migration View highlights the pins that have changed functions in the migration device when compared
to the currently selected device. Selecting the pins in the Device Migration view cross-probes to the rest of
the Pin Planner, so that you can use device migration information when planning your pin assignments.
You can also configure board trace models of selected pins for use in “board-aware” signal integrity
reports generated with the Enable Advanced I/O Timing option . This option ensures that you get
accurate I/O timing analysis. You can use a Microsoft Excel spreadsheet to start the I/O planning process
if you normally use a spreadsheet in your design flow, and you can export a Comma-Separated Value File
(.csv) containing your I/O assignments for spreadsheet use when you assign all pins.
When you complete your pin planning, you can pass pin location information to PCB designers. The Pin
Planner is tightly integrated with certain PCB design EDA tools, and can read pin location changes from
these tools to check suggested changes. Your pin assignments must match between the Quartus Prime
software and your schematic and board layout tools to ensure the FPGA works correctly on the board,
especially if you must make changes to the pin-out. The system architect uses the Quartus Prime software
to pass pin information to team members designing individual logic blocks, allowing them to achieve
better timing closure when they compile their design.
Start FPGA planning before you complete the HDL for your design to improve the confidence in early
board layouts, reduce the chance of error, and improve the overall time to market of the design. When
you complete your design, use the Fitter reports for the final sign-off of pin assignments. After compila‐
tion, the Quartus Prime software generates the Pin-Out File (.pin), and you can use this file to verify that
each pin is correctly connected in board schematics.
Related Information
• Device Migration Planning on page 2-4
• Set Up Top-Level Design File Window (Edit Menu)
For more information about setting up the nodes in your design, refer to Quartus Prime Help.
• I/O Management
For more information about I/O assignment and analysis.
• Mentor Graphics PCB Design Tools Support
Send Feedback
QPS5V1
2016.05.03 Simultaneous Switching Noise Analysis 2-9
Synthesis Tool
The Quartus Prime software includes integrated synthesis that supports Verilog HDL, VHDL, Altera
Hardware Description Language (AHDL), and schematic design entry.
You can also use supported standard third-party EDA synthesis tools to synthesize your Verilog HDL or
VHDL design, and then compile the resulting output netlist file in the Quartus Prime software. Different
synthesis tools may give different results for each design. To determine the best tool for your application,
you can experiment by synthesizing typical designs for your application and coding style. Perform
placement and routing in the Quartus Prime software to get accurate timing analysis and logic utilization
results.
The synthesis tool you choose may allow you to create a Quartus Prime project and pass constraints, such
as the EDA tool setting, device selection, and timing requirements that you specified in your synthesis
project. You can save time when setting up your Quartus Prime project for placement and routing.
Tool vendors frequently add new features, fix tool issues, and enhance performance for Altera devices,
you must use the most recent version of third-party synthesis tools.
Simulation Tool
Altera provides the Mentor Graphics ModelSim -Altera Starter Edition with the Quartus Prime software.
®
You can also purchase the ModelSim-Altera Edition or a full license of the ModelSim software to support
large designs and achieve faster simulation performance. The Quartus Prime software can generate both
functional and timing netlist files for ModelSim and other third-party simulators.
Send Feedback
QPS5V1
2-10 Formal Verification Tools 2016.05.03
Use the simulator version that your Quartus Prime software version supports for best results. You must
also use the model libraries provided with your Quartus Prime software version. Libraries can change
between versions, which might cause a mismatch with your simulation netlist.
Send Feedback
QPS5V1
2016.05.03 Design Practices and HDL Coding Styles 2-11
If you intend to use any of these tools, you may have to plan for the tools when developing your system
board, Quartus Prime project, and design. Consider the following debugging requirements when you plan
your design:
• JTAG connections—required to perform in-system debugging with JTAG tools. Plan your system and
board with JTAG ports that are available for debugging.
• Additional logic resources—required to implement JTAG hub logic. If you set up the appropriate tool
early in your design cycle, you can include these device resources in your early resource estimations to
ensure that you do not overload the device with logic.
• Reserve device memory—required if your tool uses device memory to capture data during system
operation. To ensure that you have enough memory resources to take advantage of this debugging
technique, consider reserving device memory to use during debugging.
• Reserve I/O pins—required if you use the Logic Analyzer Interface (LAI) or SignalProbe tools, which
require I/O pins for debugging. If you reserve I/O pins for debugging, you do not have to later change
your design or board. The LAI can multiplex signals with design I/O pins if required. Ensure that your
board supports a debugging mode, in which debugging signals do not affect system operation.
• Instantiate an IP core in your HDL code—required if your debugging tool uses an Altera IP core.
• Instantiate the SignalTap II Logic Analyzer IP core—required if you want to manually connect the
SignalTap II Logic Analyzer to nodes in your design and ensure that the tapped node names do not
change during synthesis.
Note: You can add the SignalTap II Logic Analyzer as a separate design partition for incremental
compilation to minimize recompilation times.
Table 2-1: Factors to Consider When Using Debugging Tools During Design Planning Stages
Design Planning Factor SignapT System In- Logic SignalP‐ In- Virtual
ap II Console System Analyze robe System JTAG IP
Memory r Sources Core
Logic
Interfac
Analyze Content and
e
r Editor Probes
(LAI)
JTAG connections Yes Yes Yes Yes — Yes Yes
Additional logic resources — Yes — — — — Yes
Reserve device memory Yes Yes — — — — —
Reserve I/O pins — — — Yes Yes — —
Instantiate IP core in your — — — — — Yes Yes
HDL code
Related Information
• System Debugging Tools Overview
For an overview of debugging tools that can help you decide which tools to use.
• Design Debugging Using the SignalTap II Logic Analyzer
For more information on using the SignalTap II Logic Analyzer.
Send Feedback
QPS5V1
2-12 Design Recommendations 2016.05.03
Design Recommendations
Use synchronous design practices to consistently meet your design goals. Problems with asynchronous
design techniques include reliance on propagation delays in a device, incomplete timing analysis, and
possible glitches.
In a synchronous design, a clock signal triggers all events. When you meet all register timing require‐
ments, a synchronous design behaves in a predictable and reliable manner for all process, voltage, and
temperature (PVT) conditions. You can easily target synchronous designs to different device families or
speed grades.
Clock signals have a large effect on the timing accuracy, performance, and reliability of your design.
Problems with clock signals can cause functional and timing problems in your design. Use dedicated clock
pins and clock routing for best results, and if you have PLLs in your target device, use the PLLs for clock
inversion, multiplication, and division. For clock multiplexing and gating, use the dedicated clock control
block or PLL clock switchover feature instead of combinational logic, if these features are available in your
device. If you must use internally-generated clock signals, register the output of any combinational logic
used as a clock signal to reduce glitches.
The Design Assistant in the Quartus Prime software is a design-rule checking tool that enables you to
verify design issues. The Design Assistant checks your design for adherence to Altera-recommended
design guidelines. You can also use third-party lint tools to check your coding style. The Design Assistant
does not support Max 10 and Arria 10 devices.
Consider the architecture of the device you choose so that you can use specific features in your design. For
example, the control signals should use the dedicated control signals in the device architecture.
Sometimes, you might need to limit the number of different control signals used in your design to achieve
the best results.
Related Information
• Design Assistant Rules
For more information about running the Design Assistant, refer to Quartus Prime Help.
• Recommended Design Practices on page 11-1
For more information about design recommendations and using the Design Assistant.
• www.sunburst-design.com
You can also refer to industry papers for more information about multiple clock design. For a good
analysis, refer to Synthesis and Scripting Techniques for Designing Multi-Asynchronous Clock Designs
under Papers.
Send Feedback
QPS5V1
2016.05.03 Managing Metastability 2-13
Managing Metastability
Metastability problems can occur in digital design when a signal is transferred between circuitry in
unrelated or asynchronous clock domains, because the designer cannot guarantee that the signal meets
the setup and hold time requirements during the signal transfer.
Designers commonly use a synchronization chain to minimize the occurrence of metastable events.
Ensure that your design accounts for synchronization between any asynchronous clock domains.
Consider using a synchronizer chain of more than two registers for high-frequency clocks and frequently-
toggling data signals to reduce the chance of a metastability failure.
You can use the Quartus Prime software to analyze the average mean time between failures (MTBF) due
to metastability when a design synchronizes asynchronous signals, and optimize your design to improve
the metastability MTBF. The MTBF due to metastability is an estimate of the average time between
instances when metastability could cause a design failure. A high MTBF (such as hundreds or thousands
of years between metastability failures) indicates a more robust design. Determine an acceptable target
MTBF given the context of your entire system and the fact that MTBF calculations are statistical
estimates.
The Quartus Prime software can help you determine whether you have enough synchronization registers
in your design to produce a high enough MTBF at your clock and data frequencies.
Related Information
Managing Metastability with the Quartus Prime Software on page 13-1
For information about metastability analysis, reporting, and optimization features in the Quartus Prime
software
Related Information
Power-Up Level on page 16-34
Send Feedback
QPS5V1
2-14 Incremental Compilation with Design Partitions 2016.05.03
The flat compilation flow is easy to use; you do not have to plan any design partitions. However, because
the Quartus Prime software recompiles the entire design whenever you change your design, compilation
times can be slow for large devices. Additionally, you may find that the results for one part of the design
change when you change a different part of your design. You run Rapid Recompile to preserve portions
of previous placement and routing in subsequent compilations. This option can reduce your compilation
time in a flat or partitioned design when you make small changes to your design.
Send Feedback
QPS5V1
2016.05.03 Running Fast Synthesis 2-15
design requirements when integrated with the rest of your design, reducing time you spend integrating
and verifying the timing of the top-level design.
Related Information
• Best Practices for Incremental Compilation Partitions and Floorplan Assignments on page 14-1
• Analyzing and Optimizing the Design Floorplan
For more information about creating floorplan assignments in the Chip Planner .
Send Feedback
QPS5V1
2-16 Document Revision History 2016.05.03
July 2010 10.0.0 • Added new section “System Design” on page 1–3
• Removed details about debugging tools from “Planning for On-Chip
Debugging Options” on page 1–10 and referred to other handbook
chapters for more information
• Updated information on recommended design flows in “Incremental
Compilation with Design Partitions” on page 1–14 and removed
“Single-Project Versus Multiple-Project Incremental Flows” heading
• Merged the “Planning Design Partitions” section with the “Creating a
Design Floorplan” section. Changed heading title to “Planning Design
Partitions and Floorplan Location Assignments” on page 1–15
• Removed “Creating a Design Floorplan” section
• Removed “Referenced Documents” section
• Minor updates throughout chapter
Send Feedback
QPS5V1
2016.05.03 Document Revision History 2-17
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2016.05.03
Quartus Prime Incremental Compilation for
Hierarchical and Team-Based Design 3
QPS5V1 Subscribe Send Feedback
The ability to iterate rapidly through FPGA design and debugging stages is critical. The Quartus Prime
software introduced the FPGA industry’s first true incremental design and compilation flow, with the
following benefits:
• Preserves the results and performance for unchanged logic in your design as you make changes
elsewhere.
• Reduces design iteration time by an average of 75% for small changes in large designs, so that you can
perform more design iterations per day and achieve timing closure efficiently.
• Facilitates modular hierarchical and team-based design flows, as well as design reuse and intellectual
property (IP) delivery.
Quartus Prime incremental compilation supports the Arria , Stratix , and Cyclone series of devices.
® ® ®
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V1
3-2 Incremental Capabilities Available When A Design Has No Partitions 2016.05.03
Related Information
Reducing Compilation Time documentation
Related Information
Smart Compilation online help
design, even if the design does not have partitions. To preserve the compilation netlist for the entire
design, instruct the software to reuse the compilation results for the automatically-created "Top" partition
that contains the entire design.
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Impact of Using Incremental Compilation with Design Partitions 3-3
To take advantage of incremental compilation, start by splitting your design along any of its hierarchical
boundaries into design blocks to be compiled incrementally, and set each block as a design partition. The
Quartus Prime software synthesizes each individual hierarchical design partition separately, and then
merges the partitions into a complete netlist for subsequent stages of the compilation flow. When
recompiling your design, you can use source code, post-synthesis results, or post-fitting results to preserve
satisfactory results for each partition.
In a team-based environment, part of your design may be incomplete, or it may have been developed by
another designer or IP provider. In this scenario, you can add the completed partitions to the design
incrementally. Alternatively, other designers or IP providers can develop and optimize partitions
independently and the project lead can later integrate the partitions into the top-level design.
Related Information
• Team-Based Design Flows and IP Delivery on page 3-5
• Incremental Compilation Summary on page 3-7
• Best Practices for Incremental Compilation Partitions and Floorplan Assignments documentation
on page 14-1
Compilation Time Savings Typically saves an average of 75% of compilation time for small design
changes in large designs when post-fit netlists are preserved; there are
savings in both Quartus Prime Integrated Synthesis and the Fitter. (1)
Performance Preservation Excellent performance preservation when timing critical paths are
contained within a partition, because you can preserve post-fitting
information for unchanged partitions.
Node Name Preservation Preserves post-fitting node names for unchanged partitions.
Area Changes The area (logic resource utilization) might increase because cross-
boundary optimizations are limited, and placement and register packing
are restricted.
(1)
Quartus Prime incremental compilation does not reduce processing time for the early "pre-fitter"
operations, such as determining pin locations and clock routing, so the feature cannot reduce compila‐
tion time if runtime is dominated by those operations.
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-4 Quartus Prime Design Stages for Incremental Compilation 2016.05.03
System
Verilog VHDL AHDL Block EDIF VQM
HDL (.vhd) (.tdf) Design File Netlist Netlist
(.sv) (.bdf) (.edf) (.vqm)
Partition Top
Partition 1
Design Partition Partition 2
Assignments
One Post-Synthesis
Netlist per Partition
Partition Merge
Create Complete Netlist Using Appropriate Source Netlists for Each
Partition (Post-Fit, Post-Synthesis, or Imported Netlist)
One Post-Fit
Netlist per Single Netlist for
Partition Complete Design
Floorplan
Fitter
Location
Place-and-Route Changed Partitions,
Assignments
Preserve Others
Create Individual Netlists and
Complete Netlists Settings &
Assignments
Single Post-Fit
Netlist for
Complete Design
Assembler Timing
in parallel Analyzer
Yes
Program/Configure Device
Note: When you use EDIF or VQM netlists created by third-party EDA synthesis tools, Analysis and
Synthesis creates the design database, but logic synthesis and technology mapping are performed
only for black boxes.
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Partition Merge Stage 3-5
unchanged partitions. After completion of Analysis and Synthesis, there is one post-synthesis netlist for
each partition.
Fitter Stage
The Fitter then processes the merged netlist, preserves the placement and routing of unchanged
partitions, and refits only those partitions that have changed. The Fitter generates the complete netlist for
use in future stages of the compilation flow, including timing analysis and programming file generation,
which can take place in parallel if more than one processor is enabled for use in the Quartus Prime
software. The Fitter also generates individual netlists for each partition so that the Partition Merge stage
can use the post-fit netlist to preserve the placement and routing of a partition, if specified, for future
compilations.
Related Information
• Incremental Compilation Page online help
• Design Partition Properties Dialog Box online help
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-6 With Multiple Quartus Prime Projects 2016.05.03
Related Information
• Exporting Design Partitions from Separate Quartus Prime Projects on page 3-30
• Project Management— Making the Top-Level Design Available to Other Designers on page 3-32
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Incremental Compilation Summary 3-7
Perform Elaboration
Repeat as Needed
Set Netlist Type for Each Partition During Design, Verification,
& Debugging Stages
Perform Incremental Compilation
(Partitions are Compiled if Required)
Related Information
Using the Incremental Compilation Design Flow online help
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-8 Compiling a Design Using Incremental Compilation 2016.05.03
Related Information
Specifying the Level of Results Preservation for Subsequent Compilations on page 3-24
Related Information
Deciding Which Design Blocks Should Be Design Partitions on page 3-19
Related Information
• Netlist Type for Design Partitions on page 3-24
• Creating Design Partitions online help
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Creating Design Partitions With Tcl Scripting 3-9
The Design Partition Planner displays a visual representation of design connectivity and hierarchy, as well
as partitions and entity relationships. You can explore the connectivity between entities in the design,
evaluate existing partitions with respect to connectivity between entities, and try new partitioning
schemes in "what if" scenarios.
When you extract design blocks from the top-level design and drag them into the Design Partition
Planner, connection bundles are drawn between entities, showing the number of connections existing
between pairs of entities. In the Design Partition Planner, you can then set extracted design blocks as
design partitions.
The Design Partition Planner also has an Auto-Partition feature that creates partitions based on the size
and connectivity of the hierarchical design blocks.
Related Information
Best Practices for Incremental Compilation Partitions and Floorplan Assignments documentation on
page 14-1
Related Information
Scripting Support on page 3-53
Automatically-Generated Partitions
The Compiler creates some partitions automatically as part of the compilation process, which appear in
some post-compilation reports. For example, the sld_hub partition is created for tools that use JTAG hub
connections, such as the SignalTap II Logic Analyzer. The hard_block partition is created to contain
certain "hard" or dedicated logic blocks in the device that are implemented in a separate partition so that
they can be shared throughout the design.
Reducing Compilation Time When Changing Source Files for One Partition
Scenario background: You set up your design to include partitions for several of the major design blocks,
and now you have just performed a lengthy compilation of the entire design. An error is found in the
HDL source file for one partition and it is being fixed. Because the design is currently meeting timing
requirements, and the fix is not expected to affect timing performance, it makes sense to compile only the
affected partition and preserve the rest of the design.
Use the flow in this example to update the source file in one partition without having to recompile the
other parts of the design. To reduce the compilation time, instruct the software to reuse the post-fit
netlists for the unchanged partitions. This flow also preserves the performance of these blocks, which
reduces additional timing closure efforts.
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-10 Optimizing a Timing-Critical Partition 2016.05.03
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Adding Design Logic Incrementally or Working With an Incomplete Design 3-11
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-12 Functional Safety IP Implementation 2016.05.03
Use this flow to reduce compilation times when you add the logic analyzer to debug your design, or when
you want to modify the configuration of the SignalTap II File without modifying your design logic or its
placement.
It is not necessary to create design partitions in order to use the SignalTap II incremental compilation
feature. The SignalTap II Logic Analyzer acts as its own separate design partition.
Perform the following steps to use the SignalTap II Logic Analyzer in an incremental compilation flow:
1. Open the Design Partitions window.
2. Set the netlist type to Post-fit for all partitions to preserve their placement.
• The netlist type for the top-level partition defaults to Source File, so be sure to change this “Top”
partition in addition to any design partitions that you have created.
3. If you have not already compiled the design with the current set of partitions, perform a full compila‐
tion. If the design has already been compiled with the current set of partitions, the design is ready to
add the SignalTap II Logic Analyzer.
4. Set up your SignalTap II File using the post-fitting filter in the Node Finder to add signals for logic
analysis. This allows the Fitter to add the SignalTap II logic to the post-fit netlist without modifying the
design results.
To add signals from the pre-synthesis netlist, set the partition’s netlist type to Source File and use the
presynthesis filter in the Node Finder. This allows the software to resynthesize the partition and to tap
directly to the pre-synthesis node names that you choose. In this case, the partition is resynthesized and
refit, so the placement is typically different from previous fitting results.
Related Information
Design Debugging Using the SignalTap II Embedded Logic Analyzer documentation
Related Information
AN 704: FPGA-based Safety Separation Design Flow for Rapid Functional Safety Certification
This design flow significantly reduces the certification efforts for the lifetime of an FPGA-based industrial
system containing both safety critical and nonsafety critical components.
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Functional Safety Separation Flow 3-13
Design activity
entry point
no yes
New Design?
no yes
Safety IP Change?
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-14 Design Modification Flow 2016.05.03
Verification
The design creation flow becomes active when you have a valid safety IP partition in your Quartus Prime
project and that safety IP partition does not have place and route data from a previous compile. In the
design creation flow, the Assembler generates a Partial Settings Mask (.psm) file for each safety IP
partition. Each .psm file contains a list of programming bits for its respective safety IP partition.
The Quartus Prime software determines whether to use the design creation flow or design modification
flow on a per partition basis. It is possible to have multiple safety IP partitions in a design where some are
running the design creation flow and others are running the design modification flow.
To reset the complete design to the design creation flow, remove the previous place and route data by
cleaning the project (removing the dbs). Alternatively, use the partition import flow, to selectively reset
the design. You can remove the netlists for the imported safety IP partitions individually using the Design
Partitions window.
Related Information
• Exporting and Importing Your Safety IP on page 3-18
• Design Partitions Window online help
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Design Modification Flow 3-15
Use the design modification flow only after you qualify your design in the design creation flow.
Figure 3-5: Design Modification Flow
Modify Standard IP
Hardware Verification
(readback of POF)
When the design modification flow is active for a safety IP partition, the Fitter runs in Strict Preservation
mode for that partition. The Assembler performs run-time checks that compare the Partial Settings Mask
information matches the .psm file generated in the design creation flow. If the Assembler detects a
mismatch, a "Bad Mask!" or "ASM_STRICT_PRESERVA‐
TION_BITS_UTILITY::compare_masked_byte_array failed" internal error message is shown. If you see
either error message while compiling your design, contact Altera support for assistance.
When a change is made to any HDL source file that belongs to a safety IP, the default behavior of the
Quartus Prime software is to resynthesize and perform a clean place and route for that partition, which
then activates the design creation flow for that partition. To change this default behavior and keep the
design modification flow active, do the following:
• Use the partition export/import flow.
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-16 How to Turn On the Functional Safety Separation Flow 2016.05.03
or
• Use the Design Partitions window to modify the design partition properties and turn on Ignore
changes in source files and strictly use the specified netlist, if available.
The Fitter applies the same design flow to all partitions that belong to the same safety IP. If more than one
safety IP is used in the design, the Fitter may evoke different flows for different safety IPs.
Note: If your safety IP is a sub-block in a Qsys system, every time you regenerate HDL for the Qsys
system, the timestamp for the safety IP HDL changes. This results in resynthesis of the safety IP,
unless the default behavior (described above) is changed.
Related Information
• Exporting and Importing Your Safety IP on page 3-18
• Design Partitions Window online help
When this global assignment is designated as ON for a partition, the partition is protected from recompi‐
lation, exported as a safety IP, and included in the safety IP POF mask. Specifying the value as ON for any
partition turns on the functional safety separation flow.
When this global assignment is designated as OFF, the partition is considered as standard IP or as not
having a PARTITION_ENABLE_STRICT_PRESERVATION assignment at all. Logic that is not assigned to a
partition is considered as part of the top partition and treated as standard logic.
Note: Only partitions and I/O pins can be assigned to SIP.
A partition assigned to safety IP can contain safety logic only. If the parent partition is assigned to a safety
IP, then all the child partitions for this parent partition are considered as part of the safety IP. If you do
not explicitly specify a child partition as a safety IP, a critical warning notifies you that the child partition
is treated as part of a safety IP.
A design can contain several safety IPs. All the partitions containing logic that implements a single safety
IP function should belong with the same top-level parent partition.
You can also turn on the functional safety separation flow from the Design Partition Properties dialog
box. Click the Advanced tab and turn on Allow partition to be strictly preserved for safety.
When the functional safety separation flow is active, you can view which partitions in your design have
the Strict Preservation property turned on. The Design Partitions window displays a on or off value for
safety IP in your design (in the Strict Preservation column).
Related Information
• Design Partition Properties Dialog box online help
• Design Partitions Window online help
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Preservation of Device Resources 3-17
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-18 Reports for Safety IP 2016.05.03
Fitter Report
The Fitter report includes information for each safety IP and the respective partition and I/O usage. The
report contains the following information:
• Safety IP name defined as the name of the top-level safety IP partition
• Effective design flow for the safety IP
• Names of all partitions that belong to the safety IP
• Number of safety/standard inputs to the safety IP
• Number of safety/standard outputs to the safety IP
• LogicLock region names along with size and locations for the regions
• I/O pins used for the respective safety IP in your design
• Safety-related error messages
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 POF Comparison Tool for Verification 3-19
• (Optional) Import into the original project to ensure that any potential source code changes do not
trigger the design creation flow unintentionally.
• Import into a new or clean project where you want to use the design modification flow for the safety
IP. As the exported partition is independent of your Quartus Prime software version, you can import
the .qxp into a future Quartus Prime software release.
To import a previously exported design partition, use the Design Partitions window and import the .qxp.
Related Information
• Export Design Partition online help
• Import Design Partition online help
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-20 Deciding Which Design Blocks Should Be Design Partitions 2016.05.03
Representation i
Partition Top
A
B C
D E F G
Partition B Merged Partition F-G
Representation ii
A
B C
D E F G
You can create partition assignments to any design instance. The instance can be defined in HDL or
schematic design, or come from a third-party synthesis tool as a VQM or EDIF netlist instance.
To take advantage of incremental compilation when source files change, create separate design files for
each partition. If you define two different entities as separate partitions but they are in the same design
file, you cannot maintain incremental compilation because the software would have to recompile both
partitions if you changed either entity in the design file. Similarly, if two partitions rely on the same lower-
level entity definition, changes in that lower-level affect both partitions.
The remainder of this section provides information to help you choose which design blocks you should
assign as partitions.
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Impact of Design Partitions on Design Optimization 3-21
Related Information
• Design Partition Properties Dialog Box online help
• Best Practices for Incremental Compilation Partitions and Floorplan Assignments documentation
on page 14-1
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-22 Design Partition Assignments Compared to Physical Placement Assignments 2016.05.03
Related Information
• Creating a Design Floorplan With LogicLock Regions on page 3-46
• Best Practices for Incremental Compilation Partitions and Floorplan Assignments documentation
on page 14-1
Related Information
• Synopsys Synplify Support documentation on page 18-1
• Mentor Graphics Precision Synthesis Support documentation on page 19-1
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Other Synthesis Tools 3-23
Related Information
Best Practices for Incremental Compilation Partitions and Floorplan Assignments documentation on
page 14-1
The Partition Timing Overview report shows the total number of failing paths for each partition and the
worst-case slack for any path involving the partition.
The Partition Timing Details report shows the number of failing partition-to-partition paths and worst-
case slack for partition-to-partition paths, to provide a more detailed breakdown of where the critical
paths in the design are located with respect to design partitions.
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-24 Specifying the Level of Results Preservation for Subsequent Compilations 2016.05.03
your design does not follow the recommendation, the Check Recommendations operation creates a table
that lists any nodes or paths in your design that could be improved. The relevant timing-independent
recommendations for the design are also listed in the Design Partitions window and the LogicLock
Regions window.
To verify that your design follows the recommendations, go to the Timing Independent Recommenda‐
tions page or the Timing Dependent Recommendations page, and then click Check Recommendations.
For large designs, these operations can take a few minutes.
After you perform a check operation, symbols appear next to each recommendation to indicate whether
the design or project setting follows the recommendations, or if some or all of the design or project
settings do not follow the recommendations. Following these recommendations is not mandatory to use
the incremental compilation feature. The recommendations are most important to ensure good results for
timing-critical partitions.
For some items in the Advisor, if your design does not follow the recommendation, the Check
Recommendations operation lists any parts of the design that could be improved. For example, if not all
of the partition I/O ports follow the Register All Non-Global Ports recommendation, the advisor displays
a list of unregistered ports with the partition name and the node name associated with the port.
When the advisor provides a list of nodes, you can right-click a node, and then click Locate to cross-probe
to other Quartus Prime features, such as the RTL Viewer, Chip Planner, or the design source code in the
text editor.
Note: Opening a new TimeQuest report resets the Incremental Compilation Advisor results, so you must
rerun the Check Recommendations process.
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Netlist Type for Design Partitions 3-25
Netlist Type Quartus Prime Software Behavior for Partition During Compilation
Source File Always compiles the partition using the associated design source file(s). (2)
Use this netlist type to recompile a partition from the source code using new
synthesis or Fitter settings.
Post-Synthesis Preserves post-synthesis results for the partition and reuses the post-synthesis
netlist when the following conditions are true:
• A post-synthesis netlist is available from a previous synthesis.
• No change that initiates an automatic resynthesis has been made to the
partition since the previous synthesis. (3)
Compiles the partition from the source files if resynthesis is initiated or if a
post-synthesis netlist is not available. (2)
Use this netlist type to preserve the synthesis results unless you make design
changes, but allow the Fitter to refit the partition using any new Fitter
settings.
Post-Fit Preserves post-fit results for the partition and reuses the post-fit netlist when
the following conditions are true:
• A post-fit netlist is available from a previous fitting.
• No change that initiates an automatic resynthesis has been made to the
partition since the previous fitting. (3)
When a post-fit netlist is not available, the software reuses the post-synthesis
netlist if it is available, or otherwise compiles from the source files. Compiles
the partition from the source files if resynthesis is initiated. (2)
The Fitter Preservation Level specifies what level of information is preserved
from the post-fit netlist.
Assignment changes, such as Fitter optimization settings, do not cause a
partition set to Post-Fit to recompile.
(2)
If you use Rapid Recompile, the Quartus Prime software might not recompile the entire partition from
the source code as described in this table; it will reuse compatible results if there have been only small
changes to the logic in the partition.
(3)
You can turn on the Ignore changes in source files and strictly use the specified netlist, if available
option on the Advanced tab in the Design Partitions Properties dialog box to specify whether the
Compiler should ignore source file changes when deciding whether to recompile the partition.
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-26 Fitter Preservation Level for Design Partitions 2016.05.03
Netlist Type Quartus Prime Software Behavior for Partition During Compilation
Empty Uses an empty placeholder netlist for the partition. The partition's port
interface information is required during Analysis and Synthesis to connect the
partition correctly to other logic and partitions in the design, and peripheral
nodes in the source file including pins and PLLs are preserved to help connect
the empty partition to the rest of the design and preserve timing of any lower-
level non-empty partitions within empty partitions. If the source file is not
available, you can create a wrapper file that defines the design block and
specifies the input, output, and bidirectional ports. In Verilog HDL: a module
declaration, and in VHDL: an entity and architecture declaration.
You can use this netlist type to skip the compilation of a partition that is
incomplete or missing from the top-level design. You can also set an empty
partition if you want to compile only some partitions in the design, such as to
optimize the placement of a timing-critical block such as an IP core before
incorporating other design logic, or if the compilation time is large for one
partition and you want to exclude it.
If the project database includes a previously generated post-synthesis or post-
fit netlist for an unchanged Empty partition, you can set the netlist type from
Empty directly to Post-Synthesis or Post-Fit and the software reuses the
previous netlist information without recompiling from the source files.
Related Information
• What Changes Initiate the Automatic Resynthesis of a Partition? on page 3-28
• Fitter Preservation Level for Design Partitions on page 3-26
• Incremental Capabilities Available When A Design Has No Partitions on page 3-2
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Where Are the Netlist Databases Saved? 3-27
Fitter Preservation Level Quartus Prime Behavior for Partition During Compilation
Placement and Routing Preserves the design partition’s netlist atoms and
their placement and routing.
This setting reduces compilation times compared to
Placement only, but provides less flexibility to the
router to make changes if there are changes in other
parts of the design.
By default, the Fitter preserves the usage of high-
speed programmable power tiles contained within
the selected partition, for devices that support high-
speed and low-power tiles. You can turn off the
Preserve high-speed tiles when preserving
placement and routing option on the Advanced
tab in the Design Partitions Properties dialog box.
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-28 Deleting Netlists 2016.05.03
To manually create a project archive that preserves compilation results without keeping the incremental
compilation database, you can keep all source and settings files, and create and save a Quartus Prime
Settings File (.qxp) for each partition in the design that will be integrated into the top-level design.
Related Information
• Using Incremental Compilation With Quartus Prime Archive Files on page 3-48
• Exporting Design Partitions from Separate Quartus Prime Projects on page 3-30
Deleting Netlists
You can choose to abandon all levels of results preservation and remove all netlists that exist for a
particular partition with the Delete Netlists command in the Design Partitions window. When you delete
netlists for a partition, the partition is compiled using the associated design source file(s) in the next
compilation. Resetting the netlist type for a partition to Source would have the same effect, though the
netlists would not be permanently deleted and would be available for use in subsequent compilations. For
an imported partition, the Delete Netlists command also optionally allows you to remove the
imported .qxp.
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Resynthesis Due to Source Code Changes 3-29
The software reuses the post-synthesis results but re-fits the design if you change the device setting within
the same device family. The software reuses the post-fitting netlist if you change only the device speed
grade.
Synthesis and Fitter assignments, such as optimization settings, timing assignments, or Fitter location
assignments including pin assignments, do not trigger automatic recompilation in the incremental
compilation flow. To recompile a partition with new assignments, change the netlist type for that partition
to one of the following:
• Source File to recompile with all new settings
• Post-Synthesis to recompile using existing synthesis results but new Fitter settings
• Post-Fit with the Fitter Preservation Level set to Placement to rerun routing using existing
placement results, but new routing settings (such as delay chain settings)
You can use the LogicLock Origin location assignment to change or fine-tune the previous Fitter results
from a Post-Fit netlist.
Related Information
Changing Partition Placement with LogicLock Changes on page 3-47
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-30 Forcing Use of the Compilation Netlist When a Partition has Changed 2016.05.03
To avoid this type of problem, ensure that files common to all entities, such as a common include file,
contain only the set of information that is truly common to all entities. Remove use work.all statements
in your VHDL file or replace them by including only the specific design units needed for each entity.
Related Information
Incremental Capabilities Available When A Design Has No Partitions on page 3-2
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Preparing the Top-Level Design 3-31
Note: You cannot export or import partitions that have been merged.
Related Information
• Deciding Which Design Blocks Should Be Design Partitions on page 3-19
• Incremental Compilation Restrictions on page 3-48
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-32 Empty Partitions 2016.05.03
Next, create the appropriate design partition assignments and set the netlist type for each design partition
that will be developed in a separate Quartus Prime project to Empty. It may be necessary to constrain the
location of partitions with LogicLock region assignments if they are timing-critical and are expected to
change in future compilations, or if the designer or IP provider wants to place and route their design
partition independently, to avoid location conflicts.
Finally, provide the top-level project framework to the partition designers, preferably through a source
control system.
Related Information
Creating a Design Floorplan With LogicLock Regions on page 3-46
Empty Partitions
You can use a design flow in which some partitions are set to an Empty netlist type to develop pieces of
the design separately, and then integrate them into the top-level design at a later time. In a team-based
design environment, you can set the netlist type to Empty for partitions in your design that will be
developed by other designers or IP providers. The Empty setting directs the Compiler to skip the
compilation of a partition and use an empty placeholder netlist for the partition.
When a netlist type is set to Empty, peripheral nodes including pins and PLLs are preserved and all other
logic is removed. The peripheral nodes including pins help connect the empty partition to the design, and
the PLLs help preserve timing of non-empty partitions within empty partitions.
When you set a design partition to Empty, a design file is required during Analysis and Synthesis to
specify the port interface information so that it can connect the partition correctly to other logic and
partitions in the design. If a partition is exported from another project, the .qxp contains this information.
If there is no .qxp or design file to represent the design entity, you must create a wrapper file that defines
the design block and specifies the input, output, and bidirectional ports. For example, in Verilog HDL,
you should include a module declaration, and in VHDL, you should include an entity and architecture
declaration.
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Generating Design Partition Scripts 3-33
• If partition designers have access to the top-level project framework, the project will already include all
the settings and constraints needed for the design. This framework should include PLLs and other
interface logic if this information is important to optimize partitions.
• If designers are part of the same design environment, they can check out the required project files
from the same source control system. This is the recommended way to share a set of project files.
• Otherwise, the project lead can provide a copy of the top-level project framework so that each
design develops their partition within the same project framework.
• If a partition designer does not have access to the top-level project framework, the project lead can give
the partition designer a Tcl script or other documentation to create the separate Quartus Prime project
and all the assignments from the top-level design.
If the partition designers provide the project lead with a post-synthesis .qxp and fitting is performed in
the top-level design, integrating the design partitions should be quite easy. If you plan to develop a
partition in a separate Quartus Prime project and integrate the optimized post-fitting results into the top-
level design, use the following guidelines to improve the integration process:
• Ensure that a LogicLock region constrains the partition placement and uses only the resources
allocated by the project lead.
• Ensure that you know which clocks should be allocated to global routing resources so that there are no
resource conflicts in the top-level design.
• Set the Global Signal assignment to On for the high fan-out signals that should be routed on global
routing lines.
• To avoid other signals being placed on global routing lines, turn off Auto Global Clock and Auto
Global Register Controls under More Settings on the Fitter page in the Settings dialog box.
Alternatively, you can set the Global Signal assignment to Off for signals that should not be placed
on global routing lines.
Placement for LABs depends on whether the inputs to the logic cells within the LAB use a global
clock. You may encounter problems if signals do not use global lines in the partition, but use global
routing in the top-level design.
• Use the Virtual Pin assignment to indicate pins of a partition that do not drive pins in the top-level
design. This is critical when a partition has more output ports than the number of pins available in the
target device. Using virtual pins also helps optimize cross-partition paths for a complete design by
enabling you to provide more information about the partition ports, such as location and timing
assignments.
• When partitions are compiled independently without any information about each other, you might
need to provide more information about the timing paths that may be affected by other partitions in
the top-level design. You can apply location assignments for each pin to indicate the port location after
incorporation in the top-level design. You can also apply timing assignments to the I/O ports of the
partition to perform timing budgeting.
Related Information
Best Practices for Incremental Compilation Partitions and Floorplan Assignments documentation on
page 14-1
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-34 Exporting Partitions 2016.05.03
• Determine which assignments should be propagated from the top-level design to the partitions. This
requires detailed knowledge of which assignments are required to set up low-level designs.
• Communicate the top-level assignments to the partitions. This requires detailed knowledge of Tcl or
other scripting languages to efficiently communicate project constraints.
• Determine appropriate timing and location assignments that help overcome the limitations of team-
based design. This requires examination of the logic in the partitions to determine appropriate timing
constraints.
• Perform final timing closure and resource conflict avoidance in the top-level design. Because the
partitions have no information about each other, meeting constraints at the lower levels does not
guarantee they are met when integrated at the top-level. It then becomes the project lead’s responsi‐
bility to resolve the issues, even though information about the partition implementation may not be
available.
Design partition scripts automate the process of transferring the top-level project framework to partition
designers in a flow where each design block is developed in separate Quartus Prime projects before being
integrated into the top-level design. If the project lead cannot provide each designer with a copy of the
top-level project framework, the Quartus Prime software provides an interface for managing resources
and timing budgets in the top-level design. Design partition scripts make it easier for partition designers
to implement the instructions from the project lead, and avoid conflicts between projects when
integrating the partitions into the top-level design. This flow also helps to reduce the need to further
optimize the designs after integration.
You can use options in the Generate Design Partition Scripts dialog box to choose which types of
assignments you want to pass down and create in the partitions being developed in separate Quartus
Prime projects.
Related Information
• Enabling Designers on a Team to Optimize Independently on page 3-41
• Generate Design Partition Scripts Dialog Box online help
Exporting Partitions
When partition designers achieve the design requirements in their separate Quartus Prime projects, each
designer can export their design as a partition so it can be integrated into the top-level design by the
project lead. The Export Design Partition dialog box, available from the Project menu, allows designers
to export a design partition to a Quartus Prime Exported Partition File (.qxp) with a post-synthesis netlist,
a post-fit netlist, or both. The project lead then adds the .qxp to the top-level design to integrate the
partition.
A designer developing a timing-critical partition or who wants to optimize their partition on their own
would opt to export their completed partition with a post-fit netlist, allowing for the partition to more
reliably meet timing requirements after integration. In this case, you must ensure that resources are
allocated appropriately to avoid conflicts. If the placement and routing optimization can be performed in
the top-level design, exporting a post-synthesis netlist allows the most flexibility in the top-level design
and avoids potential placement or routing conflicts with other partitions.
When designing the partition logic to be exported into another project, you can add logic around the
design block to be exported as a design partition. You can instantiate additional design components for
the Quartus Prime project so that it matches the top-level design environment, especially in cases where
you do not have access to the full top-level design project. For example, you can include a top-level PLL in
the project, outside of the partition to be exported, so that you can optimize the design with information
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Viewing the Contents of a Quartus Prime Exported Partition File (.qxp) 3-35
about the frequency multipliers, phase shifts, compensation delays, and any other PLL parameters. The
software then captures timing and resource requirements more accurately while ensuring that the timing
analysis in the partition is complete and accurate. You can export the partition for the top-level design
without any auxiliary components that are instantiated outside the partition being exported.
If your design team uses makefiles and design partition scripts, the project lead can use the make
command with the master_makefile command created by the scripts to export the partitions and
create .qxp files. When a partition has been compiled and is ready to be integrated into the top-level
design, you can export the partition with option on the Export Design Partition dialog box, available
from the Project menu.
Related Information
Impact of Design Partitions on Design Optimization on page 3-21
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-36 Design Partition Assignments Within the Exported Partition 2016.05.03
Synopsys Design Constraint Files for the Quartus Prime TimeQuest Timing Analyzer
Timing assignments made for the Quartus Prime TimeQuest analyzer in a Synopsys Design Constraint
File (.sdc) in the lower-level partition project are not added to the top-level design. Ensure that the top-
level design includes all of the timing requirements for the entire project.
Related Information
Best Practices for Incremental Compilation Partitions and Floorplan Assignments documentation on
page 14-1
Global Assignments
The project lead should make all global project-wide assignments in the top-level design. Global
assignments from the exported partition's project are not added to the top-level design. When it is
possible for a particular constraint, the global assignment is converted to an instance-specific assignment
for the exported design partition.
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Importing LogicLock Assignments 3-37
When you use the Import Design Partition dialog box to integrate a partition into the top-level design,
the import process sets the partition’s netlist type to Imported in the Design Partitions window.
After you compile the entire design, if you make changes to the place-and-route results (such as
movement of an imported LogicLock region), use the Post-Fit netlist type on subsequent compilations.
To discard an imported netlist and recompile from source code, you can compile the partition with the
netlist type set to Source File and be sure to include the relevant source code in the top-level design. The
import process sets the partition’s Fitter Preservation Level to the setting with the highest degree of
preservation supported by the imported netlist. For example, if a post-fit netlist is imported with
placement information, the Fitter Preservation Level is set to Placement, but you can change it to the
Netlist Only value.
When you import a partition from a .qxp, the .qxp itself is not part of the top-level design because the
netlists from the file have been imported into the project database. Therefore if a new version of a .qxp is
exported, the top-level designer must perform another import of the .qxp.
When you import a partition into a top-level design with the Import Design Partition dialog box, the
software imports relevant assignments from the partition into the top-level design. If required, you can
change the way some assignments are imported, as described in the following subsections.
Related Information
• Netlist Type for Design Partitions on page 3-24
• Fitter Preservation Level for Design Partitions on page 3-26
Related Information
Changing Partition Placement with LogicLock Changes on page 3-47
Related Information
Advanced Import Settings Dialog Box online help
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-38 Team-Based Design Optimization and Third-Party IP Delivery Scenarios 2016.05.03
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Creating Precompiled Design Blocks (or Hard-Wired Macros) for Reuse 3-39
Related Information
• Creating Design Partitions on page 3-53
• Netlist Type for Design Partitions on page 3-24
• Changing Partition Placement with LogicLock Changes on page 3-47
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-40 Incorporate IP Core 2016.05.03
Incorporate IP Core
As the customer in this example, incorporate the IP core in your design by performing the following steps:
1. Create a Quartus Prime project for the top-level design that targets the same device and instantiate a
copy or multiple copies of the IP core. Use a black box wrapper file to define the port interface of the
IP core.
2. Perform Analysis and Elaboration to identify the design hierarchy.
3. Create a design partition for each instance of the IP core with the netlist type set to Empty.
4. You can now continue work on your part of the design and accept the IP core from the IP provider
when it is ready.
5. Include the .qxp from the IP provider in your project to replace the empty wrapper-file for the IP
instance. Or, if you are importing multiple copies of the design block and want to import relative
placement, follow these additional steps:
a. Use the Import command to select each appropriate partition hierarchy. You can import a .qxp
from the GUI, the command-line, or with Tcl commands:
• If you are using the Quartus Prime GUI, use the Import Design Partition command.
• If you are using command-line executables, run quartus_cdb with the incremental_compila-
tion_import option.
• If you are using Tcl commands, use the following command:execute_flow -
incremental_compilation_import.
b. When you have multiple instances of the IP block, you can set the imported LogicLock regions to
floating, or move them to a new location, and the software preserves the relative placement for each
of the imported modules (relative to the origin of the LogicLock region). Routing information is
preserved whenever possible.
Note: The Fitter ignores relative placement assignments if the LogicLock region’s location in the
top-level design is not compatible with the locations exported in the .qxp.
6. You can control the level of results preservation with the Netlist Type setting.
If the IP provider did not define a LogicLock region in the exported partition, the software preserves
absolute placement locations and this leads to placement conflicts if the partition is imported for more
than one instance
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Exporting Your Partition 3-41
and instantiates wrapper files that represent each subdesign by defining only the port interfaces, but
not the implementation.
2. Make project-wide settings. Select the device, make global assignments such as device I/O ports, define
the top-level timing constraints, and make any global signal allocation constraints to specify which
signals can use global routing resources.
3. Make design partition assignments for each subdesign and set the netlist type for each design partition
to be imported to Empty in the Design Partitions window.
4. Create LogicLock regions to create a design floorplan for each of the partitions that will be developed
separately. This floorplan should consider the connectivity between partitions and estimates of the size
of each partition based on any initial implementation numbers and knowledge of the design specifica‐
tions.
5. Provide the top-level project framework to partition designers using one of the following procedures:
• Allow access to the full project for all designers through a source control system. Each designer can
check out the projects files as read-only and work on their blocks independently. This design flow
provides each designer with the most information about the full design, which helps avoid resource
conflicts and makes design integration easy.
• Provide a copy of the top-level Quartus Prime project framework for each designer. You can use the
Copy Project command on the Project menu or create a project archive.
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-42 Preparing Your Top-level Design 2016.05.03
This scenario assumes that there are several design blocks being developed independently (instead of just
one IP block), and the project lead can provide some information about the design to the individual
designers.
This scenario describes how to use incremental compilation in a team-based design environment where
designers or IP developers want to fully optimize the placement and routing of their design independently
in a separate Quartus Prime project before sending the design to the project lead. This design flow
requires more planning and careful resource allocation because design blocks are developed independ‐
ently.
Related Information
• Creating Precompiled Design Blocks (or Hard-Wired Macros) for Reuse on page 3-39
• Designing in a Team-Based Environment on page 3-40
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Exporting Without Makefiles 3-43
If you are using makefiles with the design partition scripts, perform the following steps:
1. Use the make command and the makefile provided by the project lead to create a Quartus Prime
project with all design constraints, and compile the project.
2. The information about which source file should be associated with which partition is not available to
the software automatically, so you must specify this information in the makefile. You must specify the
dependencies before the software rebuilds the project after the initial call to the makefile.
3. When you have achieved the desired compilation results and the design is ready to be imported into
the top-level design, the project lead can use the master_makefile command to export this partition
and create a .qxp, and then import it into the top-level design.
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-44 Importing Without Makefiles 2016.05.03
If you are using makefiles with the design partition scripts, perform the following steps:
1. Use the master_makefile command to export each partition and create .qxp files, and then import
them into the top-level design.
2. The software does not have all the information about which source files should be associated with
which partition, so you must specify this information in the makefile. The software cannot rebuild the
project if source files change unless you specify the dependencies.
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Performing Design Iterations With Lower-Level Partitions 3-45
If you resolve conflicts manually, you can use the import options and manual LogicLock assignments to
specify the placement of each instance in the top-level design.
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-46 Creating a Design Floorplan With LogicLock Regions 2016.05.03
• Location constraints for the virtual pins that reflect the initial top-level placement of the pin’s
source or destination. These help make the lower-level placement “aware” of its surroundings in the
top-level design, leading to a greater chance of timing closure during integration at the top level.
• INPUT_MAX_DELAY and OUTPUT_MAX_DELAY timing constraints on the paths to and from the I/O
pins of the partition. These constrain the pins to optimize the timing paths to and from the pins.
5. The partition designers source the file provided by the project lead.
• To source the Tcl script from the Quartus Prime GUI, on the Tools menu, click Utility Windows
and open the Tcl console. Navigate to the script’s directory, and type the following command:
source <filename>
• To source the Tcl script at the system command prompt, type the following command:
quartus_cdb -t <filename>.tcl
6. The partition designers recompile their designs with the new project information or assignments and
optimize as needed. When the results are satisfactory and the timing requirements are met, export the
updated partition as a .qxp.
The project lead obtains the updated .qxp files from the partition designers and adds them to the top-
level design. When a new .qxp is added to the files list, the software will detect the change in the
“source file” and use the new .qxp results during the next compilation. If the project uses the advanced
import flow, the project lead must perform another import of the new .qxp.
You can now analyze the design to determine whether the timing requirements have been achieved.
Because the partitions were compiled with more information about connectivity at the top level, it is
more likely that the inter-partition paths have improved placement which helps to meet the timing
requirements.
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Creating and Manipulating LogicLock Regions 3-47
The simplest way to create a floorplan for a partitioned design is to create one LogicLock region per
partition (including the top-level partition). If you have a compilation result for a partitioned design with
no LogicLock regions, you can use the Chip Planner with the Design Partition Planner to view the
partition placement in the device floorplan. You can draw regions in the floorplan that match the general
location and size of the logic in each partition. Or, initially, you can set each region with the default
settings of Auto size and Floating location to allow the Quartus Prime software to determine the prelimi‐
nary size and location for the regions. Then, after compilation, use the Fitter-determined size and origin
location as a starting point for your design floorplan. Check the quality of results obtained for your
floorplan location assignments and make changes to the regions as needed. Alternatively, you can
perform synthesis, and then set the regions to the required size based on resource estimates. In this case,
use your knowledge of the connections between partitions to place the regions in the floorplan.
Once you have created an initial floorplan, you can refine the region using tools in the Quartus Prime
software. You can also use advanced techniques such as creating non-rectangular regions by merging
LogicLock regions.
You can use the Incremental Compilation Advisor to check that your LogicLock regions meet Altera’s
guidelines.
Related Information
• Incremental Compilation Advisor on page 3-23
• Best Practices for Incremental Compilation Partitions and Floorplan Assignments documentation
on page 14-1
Related Information
Creating and Manipulating LogicLock Regions online help
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-48 Incremental Compilation Restrictions 2016.05.03
However, you can use the LogicLock Origin location assignment to change or fine-tune the previous
Fitter results. When you change the Origin setting for a region, the Fitter can move the region in the
following manner, depending upon how the placement is preserved for that region's members:
• When you set a new region Origin, the Fitter uses the new origin and replaces the logic, preserving the
relative placement of the member logic.
• When you set the region Origin to Floating, the following conditions apply:
• If the region’s member placement is preserved with an imported partition, the Fitter chooses a new
Origin and re-places the logic, preserving the relative placement of the member logic within the
region.
• If the region’s member placement is preserved with a Post-Fit netlist type, the Fitter does not
change the Origin location, and reuses the previous placement results.
Related Information
What Changes Initiate the Automatic Resynthesis of a Partition? on page 3-28
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Formal Verification Support 3-49
includes the compilation database, or turn on Incremental compilation database files to create a Custom
file set.
When you include the database, the file size of the .qar archive file may be significantly larger than an
archive without the database.
The netlist information for imported partitions is already saved in the corresponding .qxp. Imported .qxp
files are automatically saved in a subdirectory called imported_partitions, so you do not need to archive
the project database to keep the results for imported partitions. When you restore a project archive, the
partition is automatically reimported from the .qxp in this directory if it is available.
For new device families with advanced support, a version-compatible database might not be available. In
this case, the archive will not include the compilation database. If you require the database files to
reproduce the compilation results in the same Quartus Prime version, you can use the following
command-line option to archive a full database:
quartus_sh --archive -use_file_set full_db [-revision <revision name>]<project name>
Related Information
• Quick Design Debugging Using SignalProbe documentation
• Engineering Change Management with the Chip Planner documentation
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-50 External Logic Analyzer Interface in Exported Partitions 2016.05.03
the netlist type is Post-Fit to incrementally tap node names in the post-fit netlist database. Use SignalTap
II: pre-synthesis if the netlist type is Source File to make connections to the source file (pre-synthesis)
node names when you synthesize the partition from the source code.
If incremental compilation is turned off, the debugging logic is added to the design during Analysis and
Elaboration, and you cannot tap post-fitting nodes or modify debug settings without fully compiling the
design.
For design partitions that are being developed independently in separate Quartus Prime projects and
contain the logic analyzer, when you export the partition, the Quartus Prime software automatically
removes the SignalTap II logic analyzer and related SLD_HUB logic. You can tap any nodes in a Quartus
Prime project, including nodes within .qxp partitions. Therefore, you can use the logic analyzer within the
full top-level design to tap signals from the .qxp partition.
You can also instantiate the SignalTap II IP core directly in your lower-level design (instead of using
an .stp file) and export the entire design to the top level to include the logic analyzer in the top-level
design.
Related Information
Design Debugging Using the SignalTap II Embedded Logic Analyzer documentation
Related Information
In-System Debugging Using External Logic Analyzers documentation
Synopsys Design Constraint Files for the TimeQuest Timing Analyzer in Design Partition Scripts
After you have compiled a design using TimeQuest constraints, and the timing assignments option is
turned on in the scripts, a separate Tcl script is generated to create an .sdc file for each lower-level project.
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Wildcard Support in Design Partition Scripts 3-51
This script includes only clock constraints and minimum and maximum delay settings for the TimeQuest
Timing Analyzer.
Note: PLL settings and timing exceptions are not passed to lower-level designs in the scripts.
Related Information
Best Practices for Incremental Compilation Partitions and Floorplan Assignments documentation on
page 14-1
Pin Assignments for GXB and LVDS Blocks in Design Partition Scripts
Pin assignments for high-speed GXB transceivers and hard LVDS blocks are not written in the scripts.
You must add the pin assignments for these hard IP blocks in the lower-level projects manually.
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-52 Top-Level Ports that Feed Multiple Lower-Level Pins in Design Partition... 2016.05.03
project. These assignments require that the software specify the clock domain for the assignment and set
this clock domain to ” * ”.
This clock domain assignment means that there may be some paths constrained and reported by the
timing analysis engine that are not required.
To restrict which clock domains are included in these assignments, edit the generated scripts or change
the assignments in your lower-level Quartus Prime project. In addition, because there is no known clock
associated with the delay assignments, the software assumes the worst-case skew, which makes the paths
seem more timing critical than they are in the top-level design. To make the paths appear less
timing-critical, lower the delay values from the scripts. If required, enter negative numbers for input and
output delay values.
Top-Level Ports that Feed Multiple Lower-Level Pins in Design Partition Scripts
When a single top-level I/O port drives multiple pins on a lower-level module, it unnecessarily restricts
the quality of the synthesis and placement at the lower-level. This occurs because in the lower-level
design, the software must maintain the hierarchical boundary and cannot use any information about pins
being logically equivalent at the top level. In addition, because I/O constraints are passed from the top-
level pin to each of the children, it is possible to have more pins in the lower level than at the top level.
These pins use top-level I/O constraints and placement options that might make them impossible to place
at the lower level. The software avoids this situation whenever possible, but it is best to avoid this design
practice to avoid these potential problems. Restructure your design so that the single I/O port feeds the
design partition boundary and the single connection is split into multiple signals within the lower-level
partition.
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Scripting Support 3-53
The following specific circumstances are required for input pin cross-partition register packing:
• The input pin feeds exactly one register.
• The path between the input pin and register includes only input ports of partitions that have one fan-
out each.
The following specific circumstances are required for output register cross-partition register packing:
• The register feeds exactly one output pin.
• The output pin is fed by only one signal.
• The path between the register and output pin includes only output ports of partitions that have one
fan-out each.
Output pins with an output enable signal cannot be packed into the device I/O cell if the output enable
logic is part of a different partition from the output register. To allow register packing for output pins with
an output enable signal, structure your HDL code or design partition assignments so that the register and
tri-state logic are defined in the same partition.
Bidirectional pins are handled in the same way as output pins with an output enable signal. If the registers
that need to be packed are in the same partition as the tri-state logic, you can perform register packing.
The restrictions on tri-state logic exist because the I/O atom (device primitive) is created as part of the
partition that contains tri-state logic. If an I/O register and its tri-state logic are contained in the same
partition, the register can always be packed with tri-state logic into the I/O atom. The same cross-partition
register packing restrictions also apply to I/O atoms for input and output pins. The I/O atom must feed
the I/O pin directly with exactly one signal. The path between the I/O atom and the I/O pin must include
only ports of partitions that have one fan-out each.
Related Information
Best Practices for Incremental Compilation Partitions and Floorplan Assignments documentation on
page 14-1
Scripting Support
You can run procedures and make settings described in this chapter in a Tcl script or at a command-line
prompt.
Related Information
• ::quartus::incremental_compilation online help
• Quartus Prime Software Scripting Support website
Scripting support information, design examples, and training
• Tcl Scripting documentation
• Command-Line Scripting documentation
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-54 Enabling or Disabling Design Partition Assignments During Compilation 2016.05.03
Argument Description
Value Description
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Setting the Fitter Preservation Level for a Post-fit or Imported Netlist 3-55
Specifying the Software Should Use the Specified Netlist and Ignore Source File Changes
To specify that the software should use the specified netlist and ignore source file changes, even if the
source file has changed since the netlist was created, use the following command:
load_package incremental_compilation
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-56 Optimizing the Placement for a Timing-Critical Partition 2016.05.03
load_package flow
project_open $project
project_close
load_package flow
load_package incremental_compilation
load_package project
project_open $project
project_close
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Generating Design Partition Scripts 3-57
#close project
project_close
Related Information
Generate Design Partition Scripts Dialog Box online help
Exporting a Partition
To open a project and load the::quartus::incremental_compilation package before you use the Tcl
commands to export a partition to a .qxp that contains both a post-synthesis and post-fit netlist, with
routing, use the following script:
# open project
project_open <project name>
#close project
project_close
# open project
project_open <project name>
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-58 Makefiles 2016.05.03
#import partition
import_partition -partition <partition name> -qxp <.qxp file>
<-options>
#close project
project_close
Makefiles
For an example of how to use incremental compilation with a makefile as part of the team-based
incremental compilation design flow, refer to the read_me.txt file that accompanies the incr_comp
example located in the /qdesigns/incr_comp_makefile subdirectory.
When using a team-based incremental compilation design flow, the Generate Design Partition Scripts
dialog box can write makefiles that automatically export lower-level design partitions and import them
into the top-level design whenever design files change.
Related Information
Generate Design Partition Scripts Dialog Box online help
November 2013 13.1.0 Removed HardCopy device information. Revised information about
Rapid Recompile. Added information about functional safety. Added
information about flattening sub-partition hierarchies.
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
QPS5V1
2016.05.03 Document Revision History 3-59
July 2010 10.0.0 • Removed the explanation of the “bottom-up design flow” where
designers work completely independently, and replaced with
Altera’s recommendations for team-based environments where
partitions are developed in the same top-level project framework,
plus an explanation of the bottom-up process for including
independent partitions from third-party IP designers.
• Expanded the Merge command explanation to explain how it now
accommodates cross-partition boundary optimizations.
• Restructured Altera recommendations for when to use a
floorplan.
• Added “Viewing the Contents of a Quartus Prime Exported
Partition File (.qxp)” section.
• Reorganized chapter to make design flow scenarios more visible;
integrated into various sections rather than at the end of the
chapter.
October 2009 9.1.0 • Redefined the bottom-up design flow as team-based and reorgan‐
ized previous design flow examples to include steps on how to
pass top-level design information to lower-level designers.
• Moved SDC Constraints from Lower-Level Partitions section to
the Best Practices for Incremental Compilation Partitions and
Floorplan Assignments chapter in volume 1 of the Quartus Prime
Handbook.
• Reorganized the “Conclusion” section.
• Removed HardCopy APEX and HardCopy Stratix Devices
section.
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design Altera Corporation
Send Feedback
QPS5V1
3-60 Document Revision History 2016.05.03
November 2008 8.1.0 • Added new section “Importing SDC Constraints from Lower-
Level Partitions” on page 2–44
• Removed the Incremental Synthesis Only option
• Removed section “OpenCore Plus Feature for MegaCore
Functions in Bottom-Up Flows”
• Removed section “Compilation Time with Physical Synthesis
Optimizations”
• Added information about using a .qxp as a source design file
without importing
• Reorganized several sections
• Updated Figure 2–10
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Altera Corporation Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
2015.11.02
Design Planning for Partial Reconfiguration
4
QPS5V1 Subscribe Send Feedback
The Partial Reconfiguration (PR) feature in the Quartus® Prime software allows you to reconfigure a
portion of the FPGA dynamically, while the remainder of the device continues to operate.
This chapter assumes a basic knowledge of Altera’s FPGA design flow, incremental compilation, and
LogicLock™ region features available in the Quartus Prime software. It also assumes knowledge of the
internal FPGA resources such as logic array blocks (LABs), memory logic array blocks (MLABs), memory
types (RAM and ROM), DSP blocks, clock networks.
The Quartus Prime software supports the PR feature for the Altera Stratix® V device family and Cyclone®
V devices whose part number ends in "SC", for example, 5CGXFC9E6F35I8NSC.
Related Information
• Terminology on page 4-1
• An Example of a Partial Reconfiguration Design on page 4-4
• Partial Reconfiguration Design Flow on page 4-8
• Implementation Details for Partial Reconfiguration on page 4-20
• Example of a Partial Reconfiguration Design with an External Host on page 4-27
• Example Partial Reconfiguration with an Internal Host on page 4-29
• Partial Reconfiguration Project Management on page 4-30
• Programming Files for a Partial Reconfiguration Project on page 4-32
• Partial Reconfiguration Known Limitations on page 4-38
• mySupport
Terminology
The following terms are commonly used in this chapter.
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V1
4-2 Terminology 2015.11.02
• project: A Quartus Prime project contains the design files, settings, and constraints files required for
the compilation of your design.
• revision: In the Quartus Prime software, a revision is a set of assignments and settings for one version
of your design. A Quartus Prime project can have several revisions, and each revision has its own set of
assignments and settings. A revision helps you to organize several versions of your design into a single
project.
• incremental compilation: This is a feature of the Quartus Prime software that allows you to preserve
results of previous compilations of unchanged parts of the design, while changing the implementation
of the parts of your design that you have modified since your previous compilation of the project. The
key benefits include timing preservation and compile time reduction by only compiling the logic that
has changed.
• partition: You can partition your design along logical hierarchical boundaries. Each design partition is
independently synthesized and then merged into a complete netlist for further stages of compilation.
With the Quartus Prime incremental compilation flow, you can preserve results of unchanged
partitions at specific preservation levels. For example, you can set the preservation levels at post-
synthesis or post-fit, for iterative compilations in which some part of the design is changed. A partition
is only a logical partition of the design, and does not necessarily refer to a physical location on the
device. However, you may associate a partition with a specific area of the FPGA by using a floorplan
assignment.
For more information on design partitions, refer to the Best Practices for Incremental Compilation
Partitions andFloorplan Assignments chapter in the Quartus Prime Handbook.
• LogicLock region: A LogicLock region constrains the placement of logic in your design. You can
associate a design partition with a LogicLock region to constrain the placement of the logic in the
partition to a specific physical area of the FPGA.
For more information about LogicLock regions, refer to the Analyzing and Optimizing the Design
Floorplan with the Chip Planner chapter in the Quartus Prime Handbook.
• PR project: Any Quartus Prime design project that uses the PR feature.
• PR region: A design partition with an associated contiguous LogicLock region in a PR project. A PR
project can have one or more PR regions that can be partially reconfigured independently. A PR region
may also be referred to as a PR partition.
• static region: The region outside of all the PR regions in a PR project that cannot be reprogrammed
with partial reconfiguration (unless you reprogram the entire FPGA). This region is called the static
region, or fixed region.
• persona: A PR region has multiple implementations. Each implementation is called a persona. PR
regions can have multiple personas. In contrast, static regions have a single implementation or
persona.
• PR control block: Dedicated block in the FPGA that processes the PR requests, handshake protocols,
and verifies the CRC.
• PR IP Core: Altera soft IP that can be used to configure the PR control block in the FPGA to mange
the PR bitstream source.
Related Information
• Best Practices for Incremental Compilation Partitions and Floorplan Assignments on page 14-1
• Analyzing and Optimizing the Design Floorplan with the Chip Planner
Send Feedback
QPS5V1
2015.11.02 Determining Resources for Partial Reconfiguration 4-3
PLL
CLK
PLL
CLK
The following table describes the reconfiguration type supported by each FPGA resource block, which are shown
in the figure.
Hardware Resource Block Reconfiguration Mode
Send Feedback
QPS5V1
4-4 An Example of a Partial Reconfiguration Design 2015.11.02
The transceivers and PLLs in Altera FPGAs can be reconfigured using dynamic reconfiguration. For more
information on dynamic reconfiguration, refer to the Dynamic Reconfiguration in Stratix V Devices
chapter in the Stratix V Handbook.
Related Information
Dynamic Reconfiguration in Stratix V Devices
Chip_top PR Persona A1
PR Region A PR Persona A2
PR Persona A3
PR Region B PR Persona B1
Static
Region PR Persona B2
Send Feedback
QPS5V1
2015.11.02 Partial Reconfiguration Modes 4-5
SCRUB Mode
When using SCRUB mode in partial reconfiguration, the unchanging CRAM bits from the static region
are "scrubbed" back to their original values.
The static regions controlled by the CRAM bits from the same programming frame as the PR region
continue to operate. All the CRAM bits corresponding to a PR region are overwritten with new data,
regardless of what was previously contained in the region.
The SCRUB mode of partial reconfiguration involves re-writing all the bits in an entire LAB column of
the CRAM, including bits controlling any part of the static region above and below the PR region
boundary being reconfigured. You can choose to scrub the values of the CRAM bits to 0, and then rewrite
them by turning on the Use clear/set method along with Enable SCRUB mode. The Use clear/set
method is the more reliable option, but can increase the size of your bitstream. You can also choose to
simply Enable SCRUB mode.
Note: You must turn on Enable SCRUB mode to use Use clear/set method.
Figure 4-3: Enable SCRUB mode and Use clear/set method
If there are more than one PR regions along a LAB column, and you are trying to reconfigure one of the
PR regions, it is not not possible to correctly determine the bits associated with the PR region that is not
changing. For this reason, you can not use the SCRUB mode when you have two PR regions that have a
vertically overlapping column in the device. This restriction does not apply to the static bits because they
never change and you can rewrite them with the same value of the configuration bit.
Send Feedback
QPS5V1
4-6 AND/OR Mode 2015.11.02
If you turn on Enable SCRUB mode and do not turn on Use clear/set method, then the scrub is done in a
single pass, writing new values of the CRAM without clearing all the bits first. The advantage of using the
SCRUB mode is that the programming file size is much smaller than the AND/OR mode.
Figure 4-4: SCRUB Mode
This is the floorplan of a FPGA using SCRUB mode, with two PR regions, whose columns do not overlap.
Programming Frame(s)
(No Vertical Overlap)
PR1
Region
PR2
Region
AND/OR Mode
The AND/OR mode refers to how the bits are rewritten. Partial reconfiguration with AND/OR uses a
two-pass method.
Simplistically, this can be compared to bits being ANDed with a MASK, and ORed with new values,
allowing multiple PR regions to vertically overlap a single column. In the first pass, all the bits in the
CRAM frame for a column passing through a PR region are ANDed with '0's while those outside the PR
region are ANDed with '1's. After the first pass, all the CRAM bits corresponding to the PR region are
reset without modifying the static region. In the second pass for each CRAM frame, new data is ORed
with the current value of 0 inside the PR region, and in the static region, the bits are ORed with '0's so they
remain unchanged. The programming file size of a PR region using the AND/OR mode could be twice the
programming file size of the same PR region using SCRUB mode.
Send Feedback
QPS5V1
2015.11.02 Programming File Sizes for a Partial Reconfiguration Project 4-7
PR1
Region
PR2
Region
Note: If you have overlapping PR regions in your design, you must use AND/OR mode to program all PR
regions, including PR regions with no overlap. The Quartus Prime software will not permit the use
of SCRUB mode when there are overlapping regions. If none of your regions overlap, you can use
AND/OR, SCRUB, or a mixture of both.
The way the Fitter reserves routing for partial reconfiguration increases the effective size for small PR
regions from a bitstream perspective. PR bitstream sizes in designs with a single small PR region will not
match the file size computed by this equation.
Note: The PR bitstream size is approximately half of the size computed above when using single-pass
SCRUB mode. When you use the SCRUB mode with Use clear/set method turned on, the
bitstream size is comparable to the size calculated for the AND/OR mode.
You can limit expansion of the routing regions in the LogicLock Regions Properties dialog box. Alt+L
opens the LogicLock Regions Window, then right-click on a LogicLock region and click LogicLock
Region Properties.
Send Feedback
QPS5V1
4-8 Partial Reconfiguration Design Flow 2015.11.02
Turn on Partial reconfiguration, Reserved, Enabled, and Constrain routing to stay within region
boundaries.
You can also control expansion of the routing regions by adding the following two assignments to your
Quartus Prime Settings file (.qsf):
set_global_assignment -name LL_ROUTING_REGION Expanded -section_id <region name>
set_global_assignment -name LL_ROUTING_REGION_EXPANSION_SIZE 0 -section_id <region
name>
Adding these to your .qsf disables expansion and minimizes the bitstream size.
Send Feedback
QPS5V1
2015.11.02 Partial Reconfiguration Design Flow 4-9
FPGA. From the base revision, you create multiple revisions, which contain the static region and describe
the differences in the reconfigurable regions.
Two types of revisions are specific to partial reconfiguration: reconfigurable and aggregate. Both import
the persona for the static region from the base revision. A reconfigurable revision generates personas for
PR regions. An aggregate revision is used to combine personas from multiple reconfigurable revisions to
create a complete design suitable for timing analysis.
The design flow for partial reconfiguration also utilizes the Quartus Prime incremental compilation flow.
To take advantage of incremental compilation for partial reconfiguration, you must organize your design
into logical and physical partitions for synthesis and fitting. The partitions for which partial reconfigura‐
tion is enabled (PR partitions) must also have associated LogicLock assignments.
Revisions make use of personas, which are subsidiary archives describing the characteristics of both static
and reconfigurable regions, that contain unique logic which implements a specific set of functions to
reconfigure a PR region of the FPGA. Partial reconfiguration uses personas to pass this logic from one
revision to another.
Figure 4-7: Partial Reconfiguration Design Flow
no yes
Functionality is Program the Device
Verified?
The PR design flow requires more initial planning than a standard design flow. Planning requires setting
up the design logic for partitioning, and determining placement assignments to create a floorplan. Well-
Send Feedback
QPS5V1
4-10 Design Partitions for Partial Reconfiguration 2015.11.02
planned partitions can help improve design area utilization and performance, and make timing closure
easier. You should also decide whether your system requires partial reconfiguration to originate from the
FPGA pins or internally, and which mode you are using; the AND/OR mode or the SCRUB mode,
because this influences some of the planning steps described in this section.
You must structure your source code or design hierarchy to ensure that logic is grouped correctly for
optimization. Implementing the correct logic grouping early in the design cycle is more efficient than
restructuring the code later. The PR flow requires you to be more rigorous about following good design
practices. The guidelines for creating partitions for incremental compilation also include creating
partitions for partial reconfiguration.
Use the following best practice guidelines for designing in the PR flow, which are described in detail in
this section:
• Determining resources for partial reconfiguration
• Partitioning the design for partial reconfiguration
• Creating incremental compilation partitions for partial reconfiguration
• Instantiating the PR IP core in the design
• Creating wrapper logic for PR regions
• Creating freeze logic for PR regions
• Planning clocks and other global signals for the PR design
• Creating floorplan assignments for the PR design
Send Feedback
QPS5V1
2015.11.02 Partial Reconfiguration Controller Instantiation in the Design 4-11
• Register all partition boundaries; register all inputs and outputs of each partition when possible. This
practice prevents any delay penalties on signals that cross partition boundaries and keeps each register-
to-register timing path within one partition for optimization.
• Minimize the number of paths that cross partition boundaries.
• Minimize the timing-critical paths passing in or out of PR regions. If there are timing-critical paths
that cross PR region boundaries, rework the PR regions to avoid these paths.
• The Quartus Prime software can optimize some types of paths between design partitions for non-PR
designs. However, for PR designs, such inter-partition paths are strictly not optimized.
For more information about incremental compilation, refer to the following chapter in the Quartus Prime
Handbook.
Related Information
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design on page 3-1
Related Information
Example of a Partial Reconfiguration Design with an External Host on page 4-27
For more information about using partial reconfiguration with and external host.
Send Feedback
QPS5V1
4-12 Component Declaration of the PR Control Block and CRC Block in VHDL 2015.11.02
component stratixv_prblock is
port(
corectl: in STD_LOGIC ;
prrequest: in STD_LOGIC ;
data: in STD_LOGIC_VECTOR(15 downto 0);
error: out STD_LOGIC ;
ready: out STD_LOGIC ;
done: out STD_LOGIC
);
end component;
component stratixv_crcblock is
port(
shiftnld: in STD_LOGIC ;
clk: in STD_LOGIC ;
crcerror: out STD_LOGIC
);
end component;
The following rules apply when connecting the PR control block to the rest of your design:
• The corectl signal must be set to ‘1’ (when using partial reconfiguration from core) or to ‘0’ (when
using partial reconfiguration from pins).
• The corectl signal has to match the Enable PR pins option setting in the Device and Pin Options
dialog box on the Setting page; if you have turned on Enable PR pins, then the corectl signal on the
PR control block instantiation must be toggled to ‘0’.
• When performing partial reconfiguration from pins the Quartus Prime software automatically assigns
the PR unassigned pins. If you so choose, you can make pin assignments to all the dedicated PR pins in
Pin Planner or Assignment Editor.
• When performing partial reconfiguration from core, you can connect the prblock signals to either
core logic or I/O pins, excluding the dedicated programming pin such as DCLK.
m_pr : stratixv_prblock
port map(
Send Feedback
QPS5V1
2015.11.02 Instantiating the PR Control Block and CRC Block in Verilog HDL 4-13
For more information on port connectivity for reading the Error Message Register (EMR), refer to the
following application note.
Related Information
AN539: Test Methodology of Error Detection and Recovery using CRC in Altera FPGA Devices
module Chip_Top (
//User I/O signals (excluding PR related signals)
..
..
//PR interface & configuration signals
pr_request,
pr_ready,
pr_done,
crc_error,
dclk,
pr_data,
init_done
);
stratixv_prblock stratixv_prblock_inst
(
.clk (dclk),
.corectl (1'b0),
.prrequest(pr_request),
.data (pr_data),
.error (pr_error),
Send Feedback
QPS5V1
4-14 Wrapper Logic for PR Regions 2015.11.02
.ready (pr_ready),
.done (pr_done)
);
stratixv_crcblock stratixv_crcblock_inst
(
.clk (clk),
.shiftnld (1'b1),
.crcerror (crc_error)
);
endmodule
For more information on port connectivity for reading the Error Message Register (EMR), refer to the
following application note.
Related Information
AN539: Test Methodology of Error Detection and Recovery using CRC in Altera FPGA Devices
The Quartus Prime software automatically instantiates a wire-LUT for each port of the PR region to lock
down the same location for all instances of the PR persona.
If one persona of your PR region has a different number of ports than others, then you must create a
wrapper so that the static region always communicates with this wrapper. In this wrapper, you can create
dummy ports to ensure that all of the PR personas of a PR region have the same connection to the static
region.
The sample code below each create two personas; persona_1 and persona_2 are different functions of
one PR region. Note that one persona has a few dummy ports. The first example creates partial reconfigu‐
ration wrapper logic in Verilog HDL:
Send Feedback
QPS5V1
2015.11.02 Wrapper Logic for PR Regions 4-15
);
reg [3:0] p, q;
always@(a or b)
begin
p = a + b ;
end
always@(a or b or c or p)
begin
q = (p*a - b*c )
end
endmodule
process (a, b, c, p)
begin
q <= (p*a - b*c);
end process;
end synth;
Send Feedback
QPS5V1
4-16 Freeze Logic for PR Regions 2015.11.02
Hardware-Generated
Freeze
Data1 “1”
PR Region
Data2
User PR_in_freeze
Global
Clocks
During partial reconfiguration, the static region logic should not depend on the outputs from PR regions
to be at a specific logic level for the continued operation of the static region.
The easiest way to control the inputs to PR regions is by creating a wrapper around the PR region in RTL.
In addition to freezing all inputs high, you can also drive the outputs from the PR block to a specific value,
if required by your design. For example, if the output drives a signal that is active high, then your wrapper
could freeze the output to GND. The idea is to make sure the static region will not stall or go to indetermi‐
nate state, when the PR region is getting a new persona through PR.
Send Feedback
QPS5V1
2015.11.02 Freeze Logic for PR Regions 4-17
The following example implements a freeze wrapper in Verilog HDL, on a module named pr_module.
module freeze_wrapper
(
input reset, // global reset signal
input freeze, // PR process active, generated by user logic
input clk1, // global clock signal
input clk2, // non-global clock signal
input [3:0] control_mode,
input [3:0] framer_ctl,
output [15:0] data_out
);
wire [3:0]control_mode_wr, framer_ctl_wr;
wire clk2_to_wr;
//instantiate pr_module
pr_module pr_module
(
.reset (reset), //input
.clk1 (clk1), //input, global clock
.clk2 (clk2_to_wr), // input, non-global clock
.control_mode (control_mode_wr), //input
.framer_ctl (framer_ctl_wr), //input
.pr_module_out (data_out) // collection of outputs from pr_module
);
endmodule
The following example implements a freeze wrapper in VHDL, on a module named pr_module.
entity freeze_wrapper is
port(
reset:in STD_LOGIC; -- global reset signal
freeze:in STD_LOGIC;
clk1: in STD_LOGIC; -- global signal
clk2: in STD_LOGIC; -- non-global signal
control_mode: in STD_LOGIC_VECTOR (3 downto 0);
framer_ctl: in STD_LOGIC_VECTOR (3 downto 0);
data_out: out STD_LOGIC_VECTOR (15 downto 0)
);
end freeze_wrapper;
component pr_module
port(
reset:in STD_LOGIC;
clk1:in STD_LOGIC;
clk2:in STD_LOGIC;
control_mode:in STD_LOGIC_VECTOR (3 downto 0);
framer_ctl:in STD_LOGIC_VECTOR (3 downto 0);
pr_module_out:out STD_LOGIC_VECTOR (15 downto 0)
);
end component
Send Feedback
QPS5V1
4-18 Clocks and Other Global Signals for a PR Design 2015.11.02
begin
data_out(15 downto 0) <= data_out_temp(15 downto 0);
m_pr_module: pr_module
port map (
reset => reset,
clk1 => clk1,
clk2 => clk2_to_wr,
control_mode =>control_mode_wr,
framer_ctl => framer_ctl_wr,
pr_module_out => data_out_temp);
-- freeze all inputs
end architecture;
Table 4-2: Supported Signal Types for Driving Clock Networks in a PR Region
Send Feedback
QPS5V1
2015.11.02 Floorplan Assignments for PR Designs 4-19
Note: PR regions are allowed to contain output ports that are used outside of the PR region as global
signals.
• If a global signal feeds both static and reconfigurable logic, the restrictions in the table also
apply to destinations in the static region. For example, the same global signal cannot be used as
an SCLR in the static region and an ACLR in the PR region.
• A global signal used for a PR region should only feed core blocks inside and outside the PR
region. In particular you should not use a clock source for a PR region and additionally connect
the signal to an I/O register on the top or bottom of the device. Doing so may cause the
Assembler to give an error because it is unable to create valid programming mask files.
Send Feedback
QPS5V1
4-20 Implementation Details for Partial Reconfiguration 2015.11.02
on making design floorplan assignments with LogicLock regions, refer to the Best Practices for
Incremental Compilation Partitions and Floorplan Floorplan Assignments chapter in the Quartus Prime
Handbook.
Related Information
• Quartus Prime Incremental Compilation for Hierarchical and Team-Based Floorplan on page 3-1
• Best Practices for Incremental Compilation Partitions and Floorplan on page 14-1
PR Bitstream PR Bitstream
file (.rbf) in file (.rbf) in
external memory external memory
PR Control
PR Block (CB)
IP Core External
Host
PR PR
Region Region
Send Feedback
QPS5V1
2015.11.02 Partial Reconfiguration Pins 4-21
The PR mode is independent of the full chip programming mode. You can use any of the supported full
chip configuration modes for configuring the full FPGA for your PR design.
If you are creating your own custom logic for implementing a PR internal host, you can use any interface
to load the PR bitstream data to the FPGA; for example, from a serial or a parallel flash device; and then
format the PR bitstream data to match the FPPx16 interface on the PR Control Block.
When using an external host, you must implement the control logic for managing system aspects of
partial reconfiguration on an external device. To use the external host for your design, turn on the Enable
PR Pins option in the Device and Pin Options dialog box in the Quartus Prime software when you
compile your design. If this setting is turned off, then you must use an internal host. Also, you must tie the
corectl port on the PR control block instance in the top-level of the design to the appropriate level for
the selected mode.
Related Information
Partial Reconfiguration Pins on page 4-21
Partial Reconfiguration Dedicated Pins Table
Send Feedback
QPS5V1
4-22 PR Control Signals Interface 2015.11.02
For more information on different configuration modes for Stratix V devices, and specifically about
FPPx16 mode, refer to the Configuration, Design Security, and Remote System Upgrades in Stratix V
Devices chapter of the Stratix V Handbook.
Related Information
Configuration, Design Security, and Remote System Upgrades in Stratix V Devices
Send Feedback
QPS5V1
2015.11.02 Reconfiguring a PR Region 4-23
signals are within the core of the FPGA. When using the PR IP core as an internal host, connect the
signals on the PR IP core appropirately as described in the Partial Reconfiguration IP Core User Guide
and follow the instructions to start the PR process on the FPGA. If you are not using the PR IP core, make
sure you understand these PR interface signals.
Figure 4-11: Partial Reconfiguration Interface Signals
These handshaking control signals are used for partial reconfiguration.
PR_Data[15:0]
PR_done
From Pins or PR_ready
FPGA Core CRC_error
PR_error
PR_request
Clk
• PR_DATA: The configuration bitstream is sent on PR_ DATA[ 15:0], synchronous to the Clk.
• PR_DONE: Sent from CB to control logic indicating the PR process is complete.
• PR_READY: Sent from CB to control logic indicating the CB is ready to accept PR data from the control
logic.
• CRC_Error: The CRC_Error generated from the device’s CRC block, is used to determine whether to
partially reconfigure a region again, when encountering a CRC_Error.
• PR_ERROR: Sent from CB to control logic indicating an error during partial reconfiguration.
• PR_REQUEST: Sent from your control logic to CB indicating readiness to begin the PR process.
• corectl: Determines whether partial reconfiguration is performed internally or through pins.
Reconfiguring a PR Region
The figure below shows an internal host for PR, where the PR IP core is implemented inside the FPGA.
However, these principles are also applicable for partial reconfiguration with an external host.
The PR control block (CB) represents the Stratix V PR controller inside the FPGA. PR1 and PR2 are two
PR regions in a user design. In addition to the four control signals (PR_REQUEST, PR_READY, PR_DONE, PR
_ERROR) and the data/clock signals interfacing with the PR control block, your PR Control IP should also
send a control signal (PR_CONTROL) to each PR region. This signal implements the freezing and unfreezing
of the PR Interface signals. This is necessary to avoid contention on the FPGA routing fabric. In a case
such as this, you need to add some decoding logic in the design, in addition to instantiating the PR IP
core.
Send Feedback
QPS5V1
4-24 Reconfiguring a PR Region 2015.11.02
Static Region
PR1 PR2
Region Region
PR1_Control PR2_Control
PR_Request
PR Control PR with additional
Block (CB) user logic
PR_Ready, PR_Error,
PR_Done, CRC_Error Partial Reconfiguration
Data/Clock via FPPx16
After the FPGA device has been configured with a full chip configuration at least once, the INIT_DONE
signal is released, and the signal is asserted high due to the external resistor on this pin. The INIT_DONE
signal must be assigned to a pin to monitor it externally. When a full chip configuration is complete, and
the device is in user mode, the following steps describe the PR sequence:
1. Begin a partial reconfiguration process from your PR Control logic, which initiates the PR process for
one or more of the PR regions (asserting PR1_Control or PR2_Control in the figure). The wrapper
HDL described earlier freezes (pulls high) all non-global inputs of the PR region before the PR process.
2. If you are using the PR IP core, use the PR_START signal to start reconfiguring the PR region. When
you are not using the PR IP core, your control logic should send the PR_REQUEST signal from your
control logic to the PR Control Block (CB). If your design uses an external controller, monitor
INIT_DONE to verify that the chip is in user mode before asserting the PR_START or PR_REQUEST signal.
The CB initializes itself to accept the PR data and clock stream. After that, the CB asserts a PR_READY
signal to indicate it can accept PR data. If you are using the PR IP, the timing relationsips between the
control and data signals is managed by the IP core. Data and clock signals are sent to the PR control
block to partially reconfigure the PR region interface.
Note: If you write your own controller logic, specify that exactly four clock-cycles must occur before
sending the PR data to make sure the PR process progresses correctly.
Send Feedback
QPS5V1
2015.11.02 Partial Reconfiguration Cycle Waveform 4-25
• When there are multiple PR personas for the PR region, your control logic must determine the
programming file data for partial reconfiguration and specify the correct file.
• When there are multiple PR regions in the design, then your control logic determines which
regions require reconfiguration based on system requirements.
• At the end of the PR process, the PR control block asserts a PR_DONE signal and deasserts the
PR_READY signal. The Altera PR IP core further processes these signals to assert a 3-bit status signal.
If you are not using the Altera PR IP, your design must take approcpriate action as defined by the
timing diagrams when PR_DONE is asserted.
• If you want to suspend sending data, you can implement logic to pause the clock at any point.
3. When you are not using the PR IP core, your custom control logic must deassert the PR_REQUEST
signal within eight clock cycles after the PR_DONE signal goes high. If your logic does not deassert the
PR_REQUEST signal within eight clock cycles, a new PR cycle starts.
4. If your design includes additional PR regions, repeat steps 2 – 3 for each region. Otherwise, proceed to
step 5.
5. When you are not using the PR IP core, your custom control logic must deassert the PR_CONTROL
signal(s) to the PR region. The freeze wrapper releases all input signals of the PR region, thus the PR
region is ready for normal user operation.
6. You must perform a reset cycle to the PR region to bring all logic in the region to a known state. After
partial reconfiguration is complete for a PR region, the states in which the logic in the region come up
is unknown.
The PR event is now complete, and you can resume operation of the FPGA with the newly configured PR
region.
At any time after the start of a partial reconfiguration cycle, the PR host can suspend sending the PR_DATA,
but the host must suspend sending the PR_CLK at the same time. If the PR_CLK is suspended after a PR
process, there must be at least 20 clock cycles after the PR_DONE or PR_ERROR signal is asserted to prevent
incorrect behavior.
For an overview of different reset schemes in Altera devices, refer to the Recommended Design Practices
chapter in the Quartus Prime Handbook.
Related Information
• Partial Reconfiguration Cycle Waveform on page 4-25
For more information on clock requirements for partial reconfiguration.
• Recommended Design Practices on page 11-1
Send Feedback
QPS5V1
4-26 Partial Reconfiguration Cycle Waveform 2015.11.02
DONE_to_REQ_low
PR_REQUEST
PR_CLK
READY_to_FIRST_DATA
PR_DATA[15:0] D0LSW D0MSW D1LSW D1MSW Dn-1MSW DnLSW DnLSW
DONE_to_LAST_CLK
PR_READY
PR_DONE
PR_ERROR
CRC_ERROR
If there is an error encountered during partial reconfiguration, the FPGA device asserts the PR_ERROR
signal high and de-asserts the PR_READY signal low.
Whenever either of these two signals are asserted, the host must de-assert PR_REQUEST within eight
PR_CLK cycles. As a response to PR_ERROR error, the host can optionally request another partial reconfigu‐
ration or perform a full FPGA configuration.
To prevent incorrect behavior, the PR_CLK signal must be active a minimum of twenty clock cycles after
PR_DONE or PR_ERROR signal is asserted high. Once PR_DONE is asserted, PR_REQUEST must be de-asserted
within eight clock cycles. PR_DONE is de-asserted by the device within twenty PR_CLK cycles. The host can
assert PR_REQUEST again after the 20 clocks after PR_DONE is de-asserted.
DONE_to_REQ_low 8 (maximum)
Send Feedback
QPS5V1
2015.11.02 Example of a Partial Reconfiguration Design with an External Host 4-27
At any time during partial reconfiguration, to pause sending PR_DATA, the PR host can stop toggling
PR_CLK. The clock can be stopped either high or low.
At any time during partial reconfiguration, the PR host can terminate the process by de-asserting the PR
request. A partially completed PR process results in a PR error. You can have the PR host restart the PR
process after a failed process by sending out a new PR request 20 cycles later.
If you terminate a PR process before completion, and follow it up with a full FPGA configuration by
asserting nConfig, then you must toggle PR_CLK for an additional 20 clock cycles prior to asserting
nConfig to flush the PR_CONTROL_BLOCK and avoid lock up.
During these steps, the PR control block might assert a PR_ERROR or a CRC_ERROR signal to indicate that
there was an error during the partial reconfiguration process. Assertion of PR_ERROR indicates that the PR
bitstream data was corrupt, and the assertion of CRC error indicates a CRAM CRC error either during or
after completion of PR process. If the PR_ERROR or CRC_ERROR signals are asserted, you must plan whether
to reconfigure the PR region or reconfigure the whole FPGA, or leave it unconfigured.
Important: The PR_CLK signal has different a nominal maximum frequency for each device. Most Stratix
V devices have a nominal maximum frequency of at least 62.5 MHz.
Send Feedback
QPS5V1
4-28 Example of Using an External Host with Multiple Devices 2015.11.02
The connection setup for partial reconfiguration with an external host in the FPPx16 configuration
scheme.
10 K W 10 K W 10 K W
Stratix V Device
CONF_DONE MSEL[4:0]
nSTATUS
External Host nCONFIG
(MAX V Device or nCE
Microprocessor)
DATA[15:0]
DCLK
PR_REQUEST
PR_DONE
PR_READY
PR_ERROR
PR_CONTROL
PR_RESET
CRC_ERROR
Note: If you don't care to write an external host controller, you can implement an external host with the
Partial Reconfiguration IP core on a MAX 10 or other FPGA device.
Related Information
Partial Reconfiguration IP Core User Guide
Send Feedback
QPS5V1
2015.11.02 Example Partial Reconfiguration with an Internal Host 4-29
DATA[15:0]
nCE
Memory
Address DATA[7:0] PR_REQUEST
PR_DONE
PR_READY
PR_ERROR FPGA1
External
DATA[15:0] DATA[15:0]
Host nCE
PR_REQUEST1
PR_DONE1
PR_READY1 PR_REQUEST
PR_ERROR1 PR_DONE
PR_READY
PR_ERROR FPGA2
PR_REQUEST2
PR_DONE2
PR_READY2
PR_ERROR2
DATA[15:0]
nCE
PR_REQUEST5 PR_REQUEST
PR_DONE5 PR_DONE
PR_READY5 PR_READY
PR_ERROR5 PR_ERROR FPGA5
Send Feedback
QPS5V1
4-30 Partial Reconfiguration Project Management 2015.11.02
In the following figure, the programming bitstream for partial reconfiguration is received through the PCI
Express link, and your logic converts the data to the FPPx16 mode.
Figure 4-16: Connecting to an Internal Host
An example of the configuration setup when performing partial reconfiguration using the internal host.
10 KW 10 KW 10 KW
Stratix V Device
nSTATUS MSEL[4:0]
CONF_DONE
nCONFIG
nCE
EPCS
DATA AS_DATA1
DCLK DCLK PR
nCS nCSO IP Core
ASDI ASDO
Send Feedback
QPS5V1
2015.11.02 Compiling Reconfigurable Revisions 4-31
Send Feedback
QPS5V1
4-32 Programming Files for a Partial Reconfiguration Project 2015.11.02
DONE_to_REQ_low 8 (maximum)
Related Information
• Enable Partial Reconfiguration Bitstream Decompression when Configuring Base Design SOF file
in JTAG mode on page 4-37
• Enable Bitstream Decryption Option on page 4-37
• Generate PR Programming Files with the Convert Programming Files Dialog Box on page 4-35
Send Feedback
QPS5V1
2015.11.02 Programming Files for a Partial Reconfiguration Project 4-33
Base pr_region.msf
Revision with static.msf
Persona a base.sof
Partial
Reconfiguration Revision b b.sof
Design b.msf
Revision c c.sof
c.msf
When these individual revisions are compiled in the Quartus Prime software, the assembler produces
Masked SRAM Object Files (.msf) and the SRAM Object Files ( .sof) for each revision. The .sof files are
created as before (for non-PR designs). Additionally, .msf files are created specifically for partial reconfi‐
guration, one for each revision. The pr_region.mfsf file is the one of interest for generating the PR
bitstream. It contains the mask bits for the PR region. Similarly, the static.msf file has the mask bits for
the static region. The .sof files have the information on how to configure the static region as well as the
corresponding PR region. The pr_region.msf file is used to mask out the static region so that the bitstream
can be computed for the PR region. The default file name of the pr region .msf corresponds to the
LogicLock region name, unless the name is not alphanumeric. In the case of a non-alphanumeric region
name, the .msf file is named after the location of the lower left most coordinate of the region.
Note: Altera recommends naming all LogicLock regions to enhance documenting your design.
Send Feedback
QPS5V1
4-34 Programming Files for a Partial Reconfiguration Project 2015.11.02
The .msf file helps determine the PR region from each of the .sof files during the PR bitstream computa‐
tion.
Once all the .pmsf files are created, process the PR bitstreams by running the quartus_cpf -o command
to produce the raw binary .rbf files for reconfiguration.
If one wishes to partially reconfigure the PR region with persona a, use the a.rbf bitstream file, and so on
for the other personas.
Figure 4-19: Generating PR Bitstreams
This figure shows how three bitstreams can be created to partially reconfigure the region with persona a,
persona b, or persona c as desired.
In the Quartus Prime software, the Convert Programming Files window supports the generation of the
required programming bitstreams. When using the quartus_cpf from the command line, the following
options for generating the programming files are read from an option text file, for example, option.txt.
• If you want to use SCRUB mode, before generating the bitstreams create an option text file, with the
following line:
use_scrub=on
• If you have initialized M20K blocks in the PR region (ROM/Initialized RAM), then add the following
line in the option text file, before generating the bitstreams:
write_block_memory_contents=on
• If you want to compress the programming bitstream files, add the following line in the option text file.
This option is available when converting base .sof to any supported programming file types, such
as .rbf, .pof and JTAG Indirect Configuration File (. jic).
bitstream_compression=on
Send Feedback
QPS5V1
2015.11.02 Generating Required Programming Files 4-35
Related Information
Generate PR Programming Files with the Convert Programming Files Dialog Box on page 4-35
for example:
quartus_cpf -p x7y48.msf switchPRBS.sof x7y48_new.pmsf
3. Convert the .pmsf file for every PR region in your design to .rbf file format. The .rbf format is used to
store the bitstream in an external flash memory. This command should be run in the same directory
where the files are located:
quartus_cpf -o scrub.txt -c <pr_revision >.pmsf <pr_revision>.rbf
for example:
quartus_cpf -o scrub.txt -c x7y48_new.pmsf x7y48.rbf
When you do not have an option text file such as scrub.txt, the files generated would be for AND/OR
mode of PR, rather than SCRUB mode.
Generate PR Programming Files with the Convert Programming Files Dialog Box
In the Quartus Prime software, the flow to generate PR programming files is supported in the Convert
Programming Files dialog box. You can specify how the Quartus Prime software processes file types such
as .msf, .pmsf, and .sof to create .rbf and merged .msf and .pmsf files.
You can create
• A .pmsf output file, from .msf and .sof input files
• A .rbf output file from a .pmsf input file
• A merged .msf file from two or more .msf input files
• A merged .pmsf file from two or more .pmsf input files
Convert Programming Files dialog box also allows you to enable the option bit for bitstream decompres‐
sion during partial reconfiguration, when converting the base .sof (full design .sof) to any supported file
type.
For additional details, refer to the Quartus Prime Programmer chapter in the Quartus Prime Handbook.
Related Information
Quartus Prime Programmer
Send Feedback
QPS5V1
4-36 Generating a .pmsf File from a .msf and .sof Input File 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Generating a Merged .pmsf File from Multiple .pmsf Files 4-37
To merge two or more .msf files from the command line, type:
quartus_cpf --merge_msf=<number of merged files> <msf_input_file_1>
<msf_input_file_2> <msf_input_file_etc> <msf_output_file>
To merge two or more .pmsf files from the command line, type:
quartus_cpf --merge_pmsf=<number of merged files> <pmsf_input_file_1>
<pmsf_input_file_2> <pmsf_input_file_etc> <pmsf_output_file>
The merge operation checks for any bit conflict on the input files, and the operation fails with error
message if a bit conflict is detected. In most cases, a successful file merge operation indicates input files do
not have any bit conflict.
Enable Partial Reconfiguration Bitstream Decompression when Configuring Base Design SOF file
in JTAG mode
In the Quartus Prime software, the Convert Programming Files window provides the option in the .sof
file properties to enable bitstream decompression during partial reconfiguration.
This option is available when converting base .sof to any supported programming file types, such
as .rbf, .pof, and .jic.
In order to view this option, the base .sof must be targeted on Stratix V devices in the .sof File Properties.
This option must be turned on if you turned on the Compression option during .pmsf to .rbf file
generation.
Send Feedback
QPS5V1
4-38 On-Chip Debug for PR Designs 2015.11.02
The base .sof must have partial reconfiguration enabled and the base .sof generated from a design that has
a PR Control Block instantiated, to view this option in the .sof File Properties. This option must be
turned on if you wants to turn on the Generate encrypted bitstream option during .pmsf to .rbf file
generation.
You can instantiate the SignalTap II block in the static region of the design and probe the signals you want
to monitor.
Static Region
SignalTap II PR Region
Module with Signals to
Be Probed
Brought Out
on the Ports
You can use other on-chip debug features in the Quartus Prime software, such as the In-System Sources
and Probes or SignalProbe, to debug a PR design. As in the case of SignalTap, In-System Sources and
Probes can only be instantiated within the static region of a PR design. If you have to probe any signal
inside the PR region, you must bring those signals to the ports of the PR region in order to monitor them
within the static region of the design.
Send Feedback
QPS5V1
2015.11.02 M20K RAM Blocks in PR Designs 4-39
Related Information
Implementing Memories with Initialized Content on page 4-42
If your design requires initialized memory content either as a ROM or a RAM inside a PR region, you
must follow these guidelines.
Stratix V Device
PR Static
Region Region
No Restrictions for RAM/ROM
Implementation in These M20K Columns
If the functionality of the static region depends on any data read out from M20K RAMs in the static
region, the design will malfunction.
Use one of the following workarounds, which are applicable to both AND/OR and SCRUB modes of
partial reconfiguration:
• Do not use ROMs or RAMs with initialized content inside PR regions.
• If this is not possible for your design, you can program the memory content for M20K blocks with
a .mif using the suggested workarounds.
• Make sure your PR region extends vertically all the way through the device, in such a way that the
M20K column lies entirely inside a PR region.
Send Feedback
QPS5V1
4-40 Limitations When Using Stratix V Production Devices 2015.11.02
Stratix V Device
M20K as Uninitialized RAM
M20K as Initialized RAM/ROM
PR Static
Region Region
•
Figure 4-23: Alternative Workaround for Using M20Ks in PR Region
Using Reserved LogicLock Regions, block all the M20K columns that are not inside a PR region, but that
are in columns above or below a PR region. In this case, you may choose to under-utilize M20K resources,
in order to gain ROM functionality within the PR region.
Stratix V Device
Send Feedback
QPS5V1
2015.11.02 MLAB Blocks in PR designs 4-41
For more information including a list of the Stratix V production devices, refer to the Errata Sheet for
Stratix V Devices.
Related Information
Errata Sheet for Stratix V Devices
If your design does not use any MLAB blocks as RAMs, the following discussion does not apply. The
restrictions listed below are the result of hardware limitations in specific devices.
Limitations with Stratix V Production Devices
When using SCRUB mode:
• LUT-RAMs without initialized content, LUT-RAMs with initialized content, and LUT-ROMs can be
implemented in MLABs within PR regions without any restriction.
Send Feedback
QPS5V1
4-42 Implementing Memories with Initialized Content 2015.11.02
Related Information
Errata Sheet for Stratix V Devices
Production Devices
Mode
AND/OR SCRUB
(4)
Use the circuit shown in the M20K/LUTRAM figure to create clock enable logic to safely exit partial
reconfiguration without spurious writes.
Send Feedback
QPS5V1
2015.11.02 Implementing Memories with Initialized Content 4-43
Production Devices
Mode
AND/OR SCRUB
M20K/LUTRAM
CLR Q
1 D SET Q D SET Q
CLR Q CLR Q
Clear Signal to
Safely Exit PR
The circuit depends on an active- high clear signal from the static region. Before entering PR, freeze this
signal in the same manner as all PR inputs. Your host control logic should de-assert the clear signal as the
final step in the PR process.
(5)
Double partial reconfiguration is described in Initializing M20K Blocks with a Double PR Cycle
Send Feedback
QPS5V1
4-44 Initializing M20K Blocks with a Double PR Cycle 2015.11.02
Related Information
Initializing M20K Blocks with a Double PR Cycle on page 4-44
Send Feedback
QPS5V1
2015.11.02 Document Revision History 4-45
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2016.05.03
Creating a System With Qsys
5
QPS5V1 Subscribe Send Feedback
Qsys is a system integration tool included as part of the Quartus Prime software. Qsys simplifies the task
of defining and integrating customized IP Components (IP Cores) into your designs.
Qsys facilitates design reuse by packaging and integrating your custom IP components with Altera and
third-party IP components. Qsys automatically creates interconnect logic from the high-level connectivity
that you specify, which eliminates the error-prone and time-consuming task of writing HDL to specify
system-level connections.
is a more powerful tool if you design your custom IP components using standard interfaces available in
the Qsys IP Catalog. Standard interfaces inter-operate efficiently with the Altera IP components, and you
can take advantage of bus functional models (BFMs), monitors, and other verification IP to verify your
systems.
Qsys supports Avalon®, AMBA® AXI3™ (version 1.0), AMBA AXI4™ (version 2.0), AMBA AXI4-Lite™
(version 2.0), AMBA AXI4-Stream (version 1.0), and AMBA APB™3 (version 1.0) interface specifications.
Qsys provides the following advantages:
• Simplifies the process of customizing and integrating IP components into systems
• Generates an IP core variation for use in your Quartus Prime software projects
• Supports up to 64-bit addressing
• Supports modular system design
• Supports visualization of systems
• Supports optimization of interconnect and pipelining within the system
• Supports auto-adaptation of different data widths and burst characteristics
• Supports inter-operation between standard protocols, such as Avalon and AXI
• Fully integrated with the Quartus Prime software
Note: For information on how to define and generate stand-alone IP cores for use in your Quartus Prime
software projects, refer to Introduction to Altera IP Cores and Managing Quartus Prime Projects.
Related Information
• Introduction to Altera IP Cores
• Managing Quartus Prime Projects on page 1-1
• Avalon Interface Specifications
• AMBA Protocol Specifications
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V1
5-2 Interface Support in Qsys 2016.05.03
Memory-Mapped Connects memory-referencing master devices with slave memory devices. Master
devices may be processors and DMAs, while slave memory devices may be RAMs,
ROMs, and control registers. Data transfers between master and slave may be uni-
directional (read only or write only), or bi-directional (read and write).
Streaming Connects Avalon Streaming (Avalon-ST) sources and sinks that stream unidirec‐
tional data, as well as high-bandwidth, low-latency IP components. Streaming
creates datapaths for unidirectional traffic, including multichannel streams, packets,
and DSP data. The Avalon-ST interconnect is flexible and can implement on-chip
interfaces for industry standard telecommunications and data communications
cores, such as Ethernet, Interlaken, and video. You can define bus widths, packets,
and error conditions.
Clocks Connects clock output interfaces with clock input interfaces. Clock outputs can fan-
out without the use of a bridge. A bridge is required only when a clock from an
external (exported) source connects internally to more than one source.
Resets Connects reset sources with reset input interfaces. If your system requires a
particular positive-edge or negative-edge synchronized reset, Qsys inserts a reset
controller to create the appropriate reset signal. If you design a system with multiple
reset inputs, the reset controller ORs all reset inputs and generates a single reset
output.
Conduits Connects point-to-point conduit interfaces, or represent signals that are exported
from the Qsys system. Qsys uses conduits for component I/O signals that are not
part of any supported standard interface. You can connect two conduits directly
within a Qsys system as a point-to-point connection, or conduit interfaces can be
exported and brought to the top-level of the system as top-level system I/O. You can
use conduits to connect to external devices, for example external DDR SDRAM
memory, and to FPGA logic defined outside of the Qsys system.
Send Feedback
QPS5V1
2016.05.03 Introduction to the Qsys IP Catalog 5-3
Related Information
Introduction to Altera IP Cores
Installation directory
ip - Contains the Altera IP Library
altera - Contains the Altera IP Library source code
altera_hdmi - Contains the HDMI IP core files
Send Feedback
QPS5V1
5-4 Adding IP Cores to IP Catalog 2016.05.03
components, third-party IP components, custom IP components that you provide, and previously
generated Qsys systems.
You can use the IP Search Path option (Tools > Options) to include custom and third-party IP
components in the IP Catalog. The IP Catalog displays all IP cores in the IP search path.
Figure 5-2: Specifying IP Search Locations
The Quartus Prime software searches the directories listed in the IP search path for the following IP core
files:
• Component Description File (_hw.tcl)—Defines a single IP core.
• IP Index File (.ipx)—Each .ipx file indexes a collection of available IP cores. This file can specify the
relative path of directories to search for IP cores. In general, .ipx files facilitate faster searches.
The Quartus Prime software searches some directories recursively and other directories only to a specific
depth. When the search is recursive, the search stops at any directory that contains a _hw.tcl or .ipx file.
In the following list of search locations, ** indicates a recursive descent.
Send Feedback
QPS5V1
2016.05.03 General Settings for IP 5-5
Location Description
PROJECT_DIR/* Finds IP components and index files in the Quartus Prime project directory.
PROJECT_DIR/ip/**/* Finds IP components and index files in any subdirectory of the /ip subdirectory
of the Quartus Prime project directory.
If the Quartus Prime software recognizes two IP cores with the same name, the following search path
precedence rules determine the resolution of files:
1. Project directory.
2. Project database directory.
3. Project IP search path specified in IP Search Locations, or with the SEARCH_PATH assignment for the
current project revision.
4. Global IP search path specified in IP Search Locations, or with the SEARCH_PATH assignment in the
quartus2.ini file.
5. Quartus software libraries directory, such as <Quartus Installation>\libraries.
Note: If you add a component to the search path, you must update the IP Catalog by clicking Refresh IP
Catalog in the drop-down list. In Qsys, click File > Refresh System to update the IP Catalog.
Tools > Options > IP • Specify additional project and global IP search locations. The Quartus
Catalog Search Locations Prime software searches for IP cores in the project directory, in the Altera
Or installation directory, and in the IP search path.
Send Feedback
QPS5V1
5-6 Set up the IP Index File (.ipx) to Search for IP Components 2016.05.03
<library>
<path path="…<user directory>" />
<path path="…<user directory>" />
…
<component … file="…<user directory>" />
…
</library>
A <component> element in an .ipx file contains several attributes to define a component. If you provide
the required details for each component in an .ipx file, the startup time for Qsys is less than if Qsys must
discover the files in a directory. The example below shows two <component> elements. Note that the
paths for file names are specified relative to the .ipx file.
<library>
<component
name="A Qsys Component"
displayName="Qsys FIR Filter Component"
version="2.1"
file="./components/qsys_filters/fir_hw.tcl"
/>
<component
name="rgb2cmyk_component"
displayName="RGB2CMYK Converter(Color Conversion Category!)"
version="0.9"
file="./components/qsys_converters/color/rgb2cmyk_hw.tcl"
/>
</library>
Send Feedback
QPS5V1
2016.05.03 Integrate Third-Party IP Components into the Qsys IP Catalog 5-7
Note: You can verify that IP components are available with the ip-catalog command.
Related Information
Create an .ipx File with ip-make-ipx on page 5-81
Related Information
Intellectual Property & Reference Designs
Related Information
• Creating Qsys Components on page 6-1
• Component Interface Tcl Reference on page 9-1
Send Feedback
QPS5V1
5-8 Add IP Components (IP Cores) to a Qsys System 2016.05.03
The Quartus Prime software always uses the device specified in the Quartus Prime project settings, even if
you have already generated your Qsys system with the Qsys-selected device.
Note: Qsys generates a warning message if the Qsys device family and device do not match the Quartus
Prime project settings. Also, when you open Qsys from within the Quartus Prime software, the
Quartus Prime project device settings apply.
Send Feedback
QPS5V1
2016.05.03 Connect IP Components in Your Qsys System 5-9
Send Feedback
QPS5V1
5-10 Create Connections Between Masters and Slaves 2016.05.03
When you finish adding connections, you can deselect Allow Connection Editing in the right-click
menu. This option sets the Connections column to read-only and hides the possible connections.
Related Information
Connecting Components
Send Feedback
QPS5V1
2016.05.03 View Your Qsys System 5-11
By default, when you open Qsys, the IP Catalog and Hierarchy tab display to the left of the main frame.
The System Contents, Address Map, Interconnect Requirements, and Device Family tabs display in the
main frame.
The Messages tab displays in the lower portion of Qsys. Double-clicking a message in the Messages tab
changes focus to the associated element in the relevant tab to facilitate debugging. When the Messages tab
is closed or not open in your workspace, error and warning message counts continue to display in the
status bar of the Qsys window.
You can dock tabs in the main frame as a group, or individually by clicking the tab control in the upper-
right corner of the main frame. You can arrange your workspace by dragging and dropping, and then
grouping tabs in an order appropriate to your design development, or close or dock tabs that you are not
using. Tool tips on the upper-right corner of the tab describe possible workspace arrangements, for
example, restoring or disconnecting a tab to or from your workspace. When you save your system, Qsys
also saves the current workspace configuration. When you re-open a saved system, Qsys restores the last
saved workspace.
The Reset to System Layout command on the View menu restores the workspace to its default configura‐
tion for Qsys system design. The Reset to IP Layout command restores the workspace to its default
configuration for defining and generating single IP cores.
Note: Qsys contains some tabs which are not documented and appear on the View menu as "Beta". The
purpose in presenting these tabs is to allow you to explore their usefulness in Qsys system develop‐
ment.
Send Feedback
QPS5V1
5-12 Manage Qsys Window Views with Layouts 2016.05.03
Send Feedback
QPS5V1
2016.05.03 Manage Qsys Window Views with Layouts 5-13
5. To manage your saved custom layouts, click View > Custom Layouts.
The Manage Custom Layouts dialog box opens and allows you to apply a variety of functions that
facilitate custom layout management. Foe example, you can import or export a layout from or to a
different directory.
Send Feedback
QPS5V1
5-14 Filter the Display of the System Contents Tab 2016.05.03
The shortcut, Ctrl-3, for example, allows you to quickly change your Qsys window view with a quick
keystroke.
Send Feedback
QPS5V1
2016.05.03 Display Details About a Component or Parameter 5-15
Related Information
Filters Dialog Box
Send Feedback
QPS5V1
5-16 View a Schematic of Your Qsys System 2016.05.03
Related Information
Edit a Qsys Subsystem on page 5-36
Send Feedback
QPS5V1
2016.05.03 Navigate Your Qsys System 5-17
Send Feedback
QPS5V1
5-18 Specify IP Component Parameters 2016.05.03
The Hierarchy tab displays a unique icon for each element in the system. Context sensitivity between tabs
facilitates design development and debugging. For example, when you select an element in the Hierarchy
tab, Qsys selects the same element in other open tabs. This allows you to interact with your system in
more detail. In the example below, the ram_master selection appears selected in both the System
Contents and Hierarchy tabs.
Related Information
Create and Manage Hierarchical Qsys Systems on page 5-34
Send Feedback
QPS5V1
2016.05.03 Specify IP Component Parameters 5-19
align with the requirements of your design.. If you create your own IP components, use the Hardware
Component Description File (_hw.tcl) to specify configurable parameters.
With the Parameters tab open, when you select an element in the Hierarchy tab, Qsys shows the same
element in the Parameters tab. You can then make changes to the parameters that appear in the
parameter editor, including changing the name for top-level instance that appears in the System Contents
tab. Changes that you make in the Parameters tab affect your entire system and appear dynamically in
other open tabs in your workspace.
In the parameter editor, the Documentation button provides information about a component's
parameters, including the version.
At the top of the parameter editor, Qsys shows the hierarchical path for the component and its elements.
This feature is useful when you navigate deep within your system with the Hierarchy tab.
The Parameters tab also allows you to review the timing for an interfac and displays the read and write
waveforms at the bottom of the Parameters tab.
Figure 5-12: Avalon-MM Write Master Timing Waveforms in the Parameters Tab
Send Feedback
QPS5V1
5-20 Configure Your IP Component with a Pre-Defined Set of Parameters 2016.05.03
Send Feedback
QPS5V1
2016.05.03 Define Qsys Instance Parameters 5-21
Send Feedback
QPS5V1
5-22 Create an Instance Parameter Script in Qsys 2016.05.03
If you create hierarchical Qsys systems, each Qsys system in the hierarchy can include instance
parameters to pass parameter values through multiple levels of hierarchy.
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 compose {} {
# Get the pio_width parameter value from this Qsys system and
# pass the value to the width parameter of the pio_0 instance
Related Information
Component Interface Tcl Reference on page 9-1
Send Feedback
QPS5V1
2016.05.03 Supported Tcl Commands for Qsys Instance Parameter Scripts 5-23
get_instance_parameter_value
Description
Returns the value of a parameter in a child instance.
Usage
get_instance_parameter_value <instance> <parameter>
Returns
The value of the parameter.
Arguments
instance
The name of the child instance.
parameter
The name of the parameter in the instance.
Example
Send Feedback
QPS5V1
5-24 get_instance_parameters 2016.05.03
get_instance_parameters
Description
Returns the names of all parameters on a child instance that can be manipulated by the parent. It omits
parameters that are derived and those that have the SYSTEM_INFO parameter property set.
Usage
get_instance_parameters <instance>
Returns
A list of parameters in the instance.
Arguments
instance
The name of the child instance.
Example
get_instance_parameters instance
Send Feedback
QPS5V1
2016.05.03 get_parameter_value 5-25
get_parameter_value
Description
Returns the current value of a parameter defined previously with the add_parameter command.
Usage
get_parameter_value <parameter>
Returns
The value of the parameter.
Arguments
parameter
The name of the parameter whose value is being retrieved.
Example
get_parameter_value fifo_width
Send Feedback
QPS5V1
5-26 get_parameters 2016.05.03
get_parameters
Description
Returns the names of all the parameters in the component.
Usage
get_parameters
Returns
A list of parameter names.
Arguments
No arguments.
Example
get_parameters
Send Feedback
QPS5V1
2016.05.03 send_message 5-27
send_message
Description
Sends a message to the user of the component. The message text is normally interpreted as HTML. The
<b> element can be used to provide emphasis. If you do not want the message text to be interpreted as
HTML, then pass a list like { Info Text } as the message level
Usage
send_message <level> <message>
Returns
No return value.
Arguments
level
The following message levels are supported:
• ERROR--Provides an error message.
• WARNING--Provides a warning message.
• INFO--Provides an informational message.
• PROGRESS--Provides a progress message.
• DEBUG--Provides a debug message when debug mode is enabled.
message
The text of the message.
Example
Send Feedback
QPS5V1
5-28 set_instance_parameter_value 2016.05.03
set_instance_parameter_value
Description
Sets the value of a parameter for a child instance. Derived parameters and SYSTEM_INFO parameters for
the child instance may not be set using this command.
Usage
set_instance_parameter_value <instance> <parameter> <value>
Returns
No return value.
Arguments
instance
The name of the child instance.
parameter
The name of the parameter.
value
The new parameter value.
Example
Send Feedback
QPS5V1
2016.05.03 set_module_property 5-29
set_module_property
Description
Used to specify the Tcl procedure invoked to evaluate changes in Qsys system instance parameters.
Usage
set_module_property <property> <value>
Returns
No return value.
Arguments
property
The name of the property. Refer to Module Properties.
value
The new value of the property.
Example
Send Feedback
QPS5V1
5-30 Create a Custom IP Component (_hw.tcl) 2016.05.03
The Qsys system design flow describes how to create a custom IP component using the Qsys Component
Editor. You can optionally manually create a _hw_tcl file. The flow shows the simulation your custom IP,
and at what point you can integrate it with other IP components to create a Qsys system and complete
Quartus Prime project.
Create Component
Using Component Editor, or
1 by Manually Creating the
_hw.tcl File
2
Simulation at Unit-Level,
Possibly Using BFMs
Does
Simulation Give Yes
Expected Results?
No
3
Debug Design
6 9
Perform System-Level Download .sof to PCB
Simulation with FPGA
Does Does
Simulation Give HW Testing Give Yes
Expected Results? Qsys System Complete
Expected Results?
No No
7 10 Modify Design or
Debug Design
Constraints
Note: For information on how to define and generate single IP cores for use in your Quartus Prime
software projects, refer to Introduction to Altera IP Cores.
Send Feedback
QPS5V1
2016.05.03 Upgrade Outdated IP Components in Qsys 5-31
Related Information
• Creating Qsys Components on page 6-1
• Introduction to Altera IP Cores
• Managing Quartus Prime Projects on page 1-1
The <qsys_file> variable accepts a path to the .qsys file. You do not need to run this command in
the same directory as the .qsys file. Qsys reports the start and finish of the command-line upgrade,
but does not name the particular IP component(s) upgraded.
For device migration information, refer to Introduction to Altera IP Cores.
Related Information
• Introduction to the Qsys IP Catalog on page 5-3
• Introduction to Altera IP Cores
Send Feedback
QPS5V1
5-32 Troubleshooting IP or Qsys System Upgrade 2016.05.03
During automatic or manual upgrade, the Messages window dynamically displays upgrade information
for each IP core or Qsys system. You can use the following information to help you resolve any upgrade
errors following upgrade or migration.
Click to open
upgrade report Upgrade details
Upgrade failed
Upgrade in editor
(no auto-upgrade)
Send Feedback
QPS5V1
2016.05.03 Troubleshooting IP or Qsys System Upgrade 5-33
Use the following techniques to resolve errors if your Altera IP core or Qsys system "Failed" to upgrade
versions or migrate to another device. Review and implement the instructions in the Description field,
including one or more of the following:
1. If the current version of the software does not support the IP variant, right-click the component and
click Remove IP Component from Project. Replace this IP core or Qsys system with the one
supported in the current version of the software.
2. If the current target device does not support the IP variant, select a supported device family for the
project, or replace the IP variant with a suitable replacement that supports your target device.
3. If an upgrade or migration fails, click Failed in the Regeneration Status field to display and review
details of the IP Upgrade Report. Click the Release Notes link for the latest known issues about the
Altera IP core. Use this information to determine the nature of the upgrade or migration failure and
make corrections before upgrade.
Figure 5-16: IP Upgrade Report
Reports on failed
IP upgrades
Report summary
4. Run Perform Automatic Upgrade to automatically generate an IP Ports Diff report for each IP core
or Qsys system that fails upgrade. Review the reports to determine any port differences between the
Send Feedback
QPS5V1
5-34 Create and Manage Hierarchical Qsys Systems 2016.05.03
current and previous IP core version. Click Upgrade in Editor to make specific port changes and
regenerate your IP core or Qsys system.
5. If your IP core or Qsys system does not support Perform Automatic Upgrade, click Upgrade in
Editor to resolve errors and regenerate the component in the parameter editor.
Send Feedback
QPS5V1
2016.05.03 Drill into a Qsys Subsystem to Explore its Contents 5-35
Send Feedback
QPS5V1
5-36 Edit a Qsys Subsystem 2016.05.03
1. In the System Contents or Schematic tabs, use the hierarchy widget to navigate to the top-level
system, up one level, or down one level (drill into a system).
Send Feedback
QPS5V1
2016.05.03 Change the Hierarchy Level of a Qsys Component 5-37
Related Information
View a Schematic of Your Qsys System on page 5-16
Send Feedback
QPS5V1
5-38 Create an IP Component Based on a Qsys System 2016.05.03
Send Feedback
QPS5V1
2016.05.03 Add Qsys Instance Parameters 5-39
Figure 5-19: On-Chip Memory Component System and Instance Parameters (memory_system.qsys)
Send Feedback
QPS5V1
5-40 Add Qsys Instance Parameters 2016.05.03
8. In the Instance Script section, type the commands that control how Qsys passes parameters to an
instance from the higher-level system. For example, in the script below, the onchip_memory_0 instance
receives its dataWidth and memorySize parameter values from the instance parameters that you
define.
proc compose {} {
# manipulate parameters in here
set_instance_parameter_value onchip_memory_0 dataWidth [get_parameter_value
component_data_width]
set_instance_parameter_value onchip_memory_0 memorySize
[get_parameter_value component_memory_size]
Send Feedback
QPS5V1
2016.05.03 Create a Qsys Instantiating Memory System 5-41
Send Feedback
QPS5V1
5-42 Apply Instance Parameters at a Higher-Level Qsys System and Pass the... 2016.05.03
Apply Instance Parameters at a Higher-Level Qsys System and Pass the Parameters to the
Instantiated Lower-Level System
This procedure shows you how to use Qsys instance parameters to control the implementation of an on-
chip memory component as part of a hierarchical instance parameter example.
1. In the instantiating_memory_system.qsys system, in the Hierarchy tab, click and expand system_0
(memory_system.qsys).
2. Click View > Parameters.
The instance paramters for the memory_system.qsys display in the parameter editor.
Send Feedback
QPS5V1
2016.05.03 Apply Instance Parameters at a Higher-Level Qsys System and Pass the... 5-43
3. On the Parameters tab, change the value of memory_data_width to 16, and memory_memory_size
to 2048.
4. In the Hierarchy tab, under system_0 (memory_system.qsys), click onchip_memory_0.
When you select onchip_memory_0, the new parameter values for Data width and Total memory size
size are displayed.
Send Feedback
QPS5V1
5-44 View and Filter Clock and Reset Domains in Your Qsys System 2016.05.03
View and Filter Clock and Reset Domains in Your Qsys System
The Qsys clock and reset domains tabs allow you to see clock domains and reset domains in your Qsys
system. Qsys determines clock and reset domains by the associated clocks and resets, which are displayed
in tooltips for each interface in your system. You can filter your system to display particular components
or interfaces within a selected clock or reset domain. The clock and reset domain tabs also provide quick
access to performance bottlenecks by indicating connection points where Qsys automatically inserts clock
crossing adapters and reset synchronizers during system generation. With these tools, you can more easily
create optimal connections between interfaces.
Click View > Clock Domains, or View > Reset Domains to open the respective tabs in your workspace.
The domain tools display as a tree with the current system at the root. You can select each clock or reset
domain in the list to view associated interfaces.
When you select an element in the Clock Domains tab, the corresponding selection appears in the
System Contents tab. You can select single or multiple interface(s) and module(s). Mouse over tooltips in
the System Contents tab to provide detailed information for all elements and connections. Colors that
appear for the clocks and resets in the domain tools correspond to the colors in the System Contents and
Schematic tabs.
Clock and reset control tools at the bottom on the System Contents tab allow you to toggle between
highlighting clock or reset domains. You can further filter your view with options in the Filters dialog
Send Feedback
QPS5V1
2016.05.03 View Clock Domains in Your Qsys System 5-45
box, which is accessible by clicking the filter icon at the bottom of the System Contents tab. In the Filters
dialog box, you can choose to view a single interface, or to hide clock, reset, or interrupt interfaces.
Clock and reset domain tools respond to global selection and edits, and help to provide answers to the
following system design questions:
• How many clock and reset domains do you have in your Qsys system?
• What interfaces and modules does each clock or reset domain contain?
• Where do clock or reset crossings occur?
• At what connection points does Qsys automatically insert clock or reset adapters?
• Where do you have to manually insert a clock or reset adapter?
Figure 5-25: Qsys Clock and Reset Domains
Send Feedback
QPS5V1
5-46 View Clock Domains in Your Qsys System 2016.05.03
1. To view clock domain interfaces and their connections in your Qsys system, click View > Clock
Domains to open the Clock Domains tab.
2. To enables and disable highlighting of the clock domains in the System Contents tab, click the clock
control tool at the bottom of the System Contents tab.
Figure 5-26: Clock Control Tool
3. To view a single clock domain, or multiple clock domains and their modules and connections, click the
clock name(s) in the Clock Domains tab.
The modules for the selected clock domain(s) and their connections appear highlighted in the System
Contents tab. Detailed information for the current selection appears in the clock domain details pane.
Red dots in the Connections column indicate auto insertions by Qsys during system generation, for
example, a reset synchronizer or clock crossing adapter.
Figure 5-27: Clock Domains
4. To view interfaces that cross clock domains, expand the Clock Domain Crossings icon in the Clock
Domains tab, and select each element to view its details in the System Contents tab.
Qsys lists the interfaces that cross clock domain under Clock Domain Crossings. As you click through
the elements, detailed information appears in the clock domain details pane. Qsys also highlights the
selection in the System Contents tab.
If a connection crosses a clock domain, the connection circle appears as a red dot in the System
Contents tab. Mouse over tooltips at the red dot connections provide details about the connection, as
well as what adapter type Qsys automatically inserts during system generation.
Send Feedback
QPS5V1
2016.05.03 View Reset Domains in Your Qsys System 5-47
3. To view a single reset domain, or multiple reset domains and their modules and connections, click the
reset name(s) in the Reset Domain tab.
Qsys displays your selection according to the following rules:
Send Feedback
QPS5V1
5-48 Filter Qsys Clock and Reset Domains in the System Contents Tab 2016.05.03
• When you select multiple reset domains, the System Contents tab shows interfaces and modules in
both reset domains.
• When you select a single reset domain, the other reset domain(s) are grayed out, unless the two
domains have interfaces in common.
• Reset interfaces appear black when connected to multiple reset domains.
• Reset interfaces appear gray when they are not connected to all of the selected reset domains.
• If an interface is contained in multiple reset domains, the interface is grayed out.
Detailed information for your selection appears in the reset domain details pane.
Note: Red dots in the Connections column between reset sinks and sources indicate auto insertions
by Qsys during system generation, for example, a reset synchronizer. Qsys decides when to
display a red dot with the following protocol, and ends the decision process at first match.
• Multiple resets fan into a common sink.
• Reset inputs are associated with different clock domains.
• Reset inputs have different synchronicity.
Figure 5-30: Reset Domains
Filter Qsys Clock and Reset Domains in the System Contents Tab
You can filter the display of your Qsys clock and reset domains in the System Contents tab.
1. To filter the display in the System Contents tab to view only a particular interface and its connections,
or to choose to hide clock, reset, or interrupt interfaces, click the Filters icon in the clock and reset
control tool to open the Filters dialog box.
The selected interfaces appear in the System Contents tab.
Send Feedback
QPS5V1
2016.05.03 Specify Qsys Interconnect Requirements 5-49
2. To clear all clock and reset filters in the System Contents tab and show all interfaces, click the Filters
icon with the red "x" in the clock and reset control tool.
Figure 5-32: Show All Interfaces
Option Description
Limit interconnect pipeline Specifies the maximum number of pipeline stages that Qsys may insert in
stages to each command and response path to increase the fMAX at the expense of
additional latency. You can specify between 0–4 pipeline stages, where 0
means that the interconnect has a combinational data path. Choosing 3 or
4 pipeline stages may significantly increase the logic utilization of the
system. This setting is specific for each Qsys system or subsystem,
meaning that each subsystem can have a different setting. Additional
latency is added once on the command path, and once on the response
path. You can manually adjust this setting in the Memory-Mapped
Interconnect tab. Access this tab by clicking Show System With Qsys
Interconnect command on the System menu.
Send Feedback
QPS5V1
5-50 Specify Qsys Interconnect Requirements 2016.05.03
Option Description
Clock crossing adapter type Specifies the default implementation for automatically inserted clock
crossing adapters:
• Handshake—This adapter uses a simple hand-shaking protocol to
propagate transfer control signals and responses across the clock
boundary. This methodology uses fewer hardware resources because
each transfer is safely propagated to the target domain before the next
transfer can begin. The Handshake adapter is appropriate for systems
with low throughput requirements.
• FIFO—This adapter uses dual-clock FIFOs for synchronization. The
latency of the FIFO-based adapter is a couple of clock cycles more than
the handshaking clock crossing component. However, the FIFO-based
adapter can sustain higher throughput because it supports multiple
transactions at any given time. FIFO-based clock crossing adapters
require more resources. The FIFO adapter is appropriate for
memory-mapped transfers requiring high throughput across clock
domains.
• Auto—If you select Auto, Qsys specifies the FIFO adapter for bursting
links, and the Handshake adapter for all other links.
Automate default slave Specifies whether you want Qsys to automatically insert a default slave for
insertion undefined memory region accesses during system generation.
Enable instrumentation Allows you to choose the converter type that Qsys applies to each burst.
•
• Generic converter (slower, lower area)—Default. Controls all burst
conversions with a single converter that is able to adapt incoming
burst types. This results in an adapter that has lower fmax, but smaller
area.
• Per-burst-type converter (faster, higher area)—Controls incoming
bursts with a particular converter, depending on the burst type. This
results in an adapter that has higher fmax, but higher area. This setting
is useful when you have AXI masters or slaves and you want a higher
fmax.
Burst Adapter Implementa‐ Allows you to choose the converter type that Qsys applies to each burst.
tion
• Generic converter (slower, lower area)—Default. Controls all burst
conversions with a single converter that is able to adapt incoming
burst types. This results in an adapter that has lower fmax, but smaller
area.
• Per-burst-type converter (faster, higher area)—Controls incoming
bursts with a particular converter, depending on the burst type. This
results in an adapter that has higher fmax, but higher area. This setting
is useful when you have AXI masters or slaves and you want a higher
fmax.
Send Feedback
QPS5V1
2016.05.03 Manage Qsys System Security 5-51
Option Description
Enable ECC protection Specifies the default implementation for ECC protection for memory
elements. Currently supports only Read Data FIFO (rdata_FIFO)
instances..
• FALSE—Default. ECC protection is disabled for memory elements in
the Qsys interconnect.
• TRUE—ECC protection is enabled for memory elements. Qsys
interconnect sends ECC errors that cannot be corrected as
DECODEERROR (DECERR) on the Avalon response bus. This setting may
increase logic utilization and cause lower fMax, but provides additional
protection against data corruption.
Note: For more information about Error Correction Coding (ECC),
refer to Error Correction Coding in Qsys Interconnect.
You can apply the following interconnect requirements when you select a component interface as the Identifier in
the Interconnect Requirements tab, in the All Requirements table.
Option Value Description
Security • Non-secure After you establish connections between the
• Secure masters and slaves, allows you to set the
• Secure ranges security options, as needed, for each master
• TrustZone-aware and slave in your system.
Note: You can also set these values in the
Security column in the System
Contents tab.
Secure address ranges Accepts valid address Allows you to type in any valid address range.
range.
For more information about HPS, refer to the Cyclone V Device Handbook in volume 3 of the Hard
Processor System Technical Reference Manual.
Related Information
Error Correction Coding in Qsys Interconnect
Send Feedback
QPS5V1
5-52 Configure Qsys Security Settings Between Interfaces 2016.05.03
secure. Determining the security of a transaction while sending or receiving a transaction is a run-time
protocol.
The Avalon specification does not include a protection signal as part of its specification. When an Avalon
master sends a command, it has no embedded security and Qsys recognizes the command as non-secure.
When an Avalon slave receives a command, it also has no embedded security, and the slave always accepts
the command and responds.
AXI masters and slaves can be TrustZone-aware. All other master and slave interfaces, such as Avalon-
MM interfaces, are non-TrustZone-aware. You can set compile-time security support for all components
(except AXI masters, including AXI3, AXI4,and AXI4-Lite) in the Security column in the System
Contents tab, or in the Interconnect Requirements tab under the Identifier column for the master or
slave interface. To begin creating a secure system, you must first add masters and slaves to your system,
and the connections between them. After you establish connections between the masters and slaves, you
can then set the security options, as needed
An example of when you may need to specify compile-time security support is when an Avalon master
needs to communicate with a secure AXI slave, and you can specify whether the connection point is
secure or non-secure. You can specify a compile-time secure address ranges for a memory slave if an
interface-level security setting is not sufficient.
Related Information
• Qsys Interconnect on page 7-1
• Qsys System Design Components on page 10-1
The AXI AxPROT signal specifies a transaction as secure or non-secure at runtime when a master sends a
transaction. Qsys identifies AXI master interfaces as TrustZone-aware. You can configure AXI slaves as
Trustzone-aware, secure, non-secure, or secure ranges.
For non-TrustZone-aware components, compile-time security support options are available in Qsys on the
System Contents tab, or on the Interconnect Requirements tab.
Compile-Time Security Options Description
Non-secure Master sends only non-secure transactions, and the slave receives
any transaction, secure or non-secure.
Secure Master sends only secure transactions, and the slave receives only
secure transactions.
Secure ranges Applies to only the slave interface. The specified address ranges
within the slave's address span are secure, all other address ranges
are not. The format is a comma-separated list of inclusive-low and
inclusive-high addresses, for example, 0x0:0xfff,
0x2000:0x20ff.
After setting compile-time security options for non-TrustZone-aware master and slave interfaces, you
must identify those masters that require a default slave before generation. To designate a slave interface as
Send Feedback
QPS5V1
2016.05.03 Specify a Default Slave in a Qsys System 5-53
the default slave, turn on Default Slave in the System Contents tab. A master can have only one default
slave.
Note: The Security and Default Slave columns in the System Contents tab are hidden by default. Right-
click the System Contents header to select which columns you want to display.
The following are descriptions of security support for master and slave interfaces. These description can
guide you in your design decisions when you want to create secure systems that have mixed secure and
non-TrustZone-aware components:
• All AXI, AXI4, and AXI4-Lite masters are TrustZone-aware.
• You can set AXI, AXI4, and AXI4-Lite slaves as Trust-Zone-aware, secure, non-secure, or secure range
ranges.
• You can set non-AXI master interfaces as secure or non-secure.
• You can set non-AXI slave interfaces as secure, non-secure, or secure address ranges.
Table 5-8: Secure and Non-Secure Access Between Master, Slave, and Memory Components
TrustZone-aware OK OK OK
slave/memory
Non-TrustZone-aware OK OK OK
slave (non-secure)
Send Feedback
QPS5V1
5-54 Access Undefined Memory Regions 2016.05.03
Non-TrustZone-aware OK OK OK
memory (non-secure
region)
Related Information
Qsys System Design Components on page 10-1
Send Feedback
QPS5V1
2016.05.03 Integrate a Qsys System and the Quartus Prime Software With the .qsys... 5-55
If you want file generation to occur as part of the Quartus Prime software's compilation, you should
include the .qsys file in your Quartus Prime project. If you want to manually control file generation
outside of the Quartus Prime software, you should include the .qip file in your Quartus Prime project.
Note: The Quartus Prime software generates an error message during compilation if you add both
the .qsys and .qip files to your Quartus Prime project.
Integrate a Qsys System and the Quartus Prime Software With the .qsys File
Use the following steps to integrate your Qsys system and your Quartus Prime project using the .qsys file:
1. In Qsys, create and save a Qsys system.
2. To automatically include the .qsys file in the your Quartus Prime project during compilation, in the
Quartus Prime software, select Tools > Options > IP Settings, and turn on Automatically add
Quartus Prime IP files to all projects.
3. When the Automatically add Quartus Prime IP files to all projects option is not checked, when you
exit Qsys, the Quartus Prime software displays a dialog box asking whether you want to add the .qsys
file to your Quartus Prime project. Click Yes to add the .qsys file to your Quartus Prime project.
4. In the Quartus Prime software, select Processing > Start Compilation.
Integrate a Qsys System and the Quartus Prime Software With the .qip File
Use the following steps to integrate your Qsys system and your Quartus Prime project using the .qip file:
Send Feedback
QPS5V1
5-56 Manage IP Settings in the Quartus Prime Software 2016.05.03
Setting Description
Maximum Qsys memory usage Allows you to increase memory usage for Qsys if
you experience slow processing for large systems, or
if Qsys reports an Out of Memory error.
IP generation HDL preference The Quartus Prime software uses this setting when
the .qsys file appears in the Files list for the current
project in the Settings dialog box and you run
Analysis & Synthesis. Qsys uses this setting when
you generate HDL files.
Automatically add Quartus Prime IP files to all The Quartus Prime software uses this setting when
projects you create an IP core file variation with options in
the Quartus Prime IP Catalog and parameter editor.
When turned on, the Quartus Prime software adds
the IP variation files to the project currently open.
IP Catalog Search Locations The Quartus Prime software uses the settings that
you specify for global and project search paths
under IP Search Locations, in addition to the IP
Search Path in Qsys (Tools > Options), to populate
the Quartus Prime software IP Catalog.
Qsys uses the uses the settings that you specify for
global search paths under IP Search Locations to
populate the Qsys IP Catalog, which appears in
Qsys (Tools > Options). Qsys uses the project
search path settings to populate the Qsys IP Catalog
when you open Qsys from within the Quartus
Prime software (Tools > Qsys), but not when you
open Qsys from the command-line.
Note: You can also access IP Settings by clicking Assignments > Settings > IP Settings. This access is
available only when you have a Quartus Prime project open. This allows you access to IP Settings
Send Feedback
QPS5V1
2016.05.03 Opening Qsys with Additional Memory 5-57
when you want to create IP cores independent of a Quartus Prime project. Settings that you apply
or create in either location are shared.
qsys-edit --jvm-max-heap-size=1g
Send Feedback
QPS5V1
5-58 Generate a Qsys System 2016.05.03
For the case of a single clock input signal called clk, and one PLL with a single output, you can use the
following commands in your Synopsys Design Constraint (.sdc) file:
Related Information
The Quartus Prime TimeQuest Timing Analyzer
Send Feedback
QPS5V1
2016.05.03 Set the Generation ID 5-59
Note: If you cannot find the memory interface generated by Qsys when you use EMIF (External Memory
Interface Debug Toolkit), verify that the .sopcinfo file appears in your Qsys project folder.
Related Information
• Avalon Verification IP Suite User Guide
• Mentor Verification IP (VIP) Altera Edition (AE)
• External Memory Interface Debug Toolkit
Option Description
Create HDL design files for synthesis Generates Verilog HDL or VHDL design files for
the system's top-level definition and child instances
for the selected target language. Synthesis file
generation is optional.
Send Feedback
QPS5V1
5-60 Files Generated for Altera IP Cores and Qsys Systems 2016.05.03
Option Description
Create timing and resource estimates for third- Generates a non-functional Verilog Design File (.v)
party EDA synthesis tools for use by some third-party EDA synthesis tools.
Estimates timing and resource usage for your IP
component. The generated netlist file name is
<your_ip_component_name>_syn.v.
Create Block Symbol File (.bsf) Allows you to optionally create a (.bsf) file to use in
a schematic Block Diagram File (.bdf).
Create simulation model Allows you to optionally generate Verilog HDL or
VHDL simulation model files, and simulation
scripts.
Allow mixed-language simulation Generates a simulation model that contains both
Verilog and VHDL as specified by the individual IP
cores. Using this option, each IP core produces their
HDL using it's native implementation, which results
in simulation HDL that is easier to understand and
faster to simulate. You must have a simulator that
supports mixed language simulation.
Clear output directories for selected generation Clears previous generation attempts for current
targets synthesis or simulation.
Related Information
Simulating Altera Designs
Send Feedback
QPS5V1
2016.05.03 Files Generated for Altera IP Cores and Qsys Systems 5-61
<Project Directory>
<your_ip>.qip or .qsys - System or IP integration file
<your_ip>.sopcinfo - Software tool-chain integration file
<your_ip> - IP core variation files
<your_ip>.bsf - Block symbol schematic file
<your_ip>.cmp - VHDL component declaration
<your_ip>.debuginfo - Post-generation debug data
<your_ip>.html - Memory map data
<your_ip>.ppf - XML I/O pin information file
<your_ip>.qip - Lists files for IP core synthesis
<your_ip>.sip - NativeLink simulation integration file
<your_ip>.spd - Combines individual simulation startup scripts 1
<your_ip>_bb.v - Verilog HDL black box EDA synthesis file
<your_ip>_generation.rpt - IP generation report
<your_ip>_inst.v or .vhd - Lists file for IP core synthesis
sim - IP simulation files
<your_ip>.v or vhd - Top-level simulation file
<simulator vendor> - Simulator setup scripts
<simulator_setup_scripts>
synth - IP synthesis files
<your_ip>.v or .vhd - Top-level IP synthesis file
<IP Submodule> - IP Submodule Library
sim- IP submodule 1 simulation files
<HDL files>
synth - IP submodule 1 synthesis files
<HDL files>
<your_ip>_tb - IP testbench system 1
<your_testbench>_tb.qsys - testbench system file
<your_ip>_tb - IP testbench files
<your_testbench>_tb.csv or .spd - testbench file
sim - IP testbench simulation files
1. If supported and enabled for your IP core variation.
Send Feedback
QPS5V1
5-62 Files Generated for Altera IP Cores and Qsys Systems 2016.05.03
<my_ip>.cmp The VHDL Component Declaration (.cmp) file is a text file that
contains local generic and port definitions that you can use in VHDL
design files.
<my_ip>.html A report that contains connection information, a memory map
showing the slave address with respect to each master that the slave
connects to, and parameter assignments.
<my_ip>.bsf A Block Symbol File (.bsf) representation of the IP variation for use
in Quartus Prime Block Diagram Files (.bdf).
<my_ip>.ppf The Pin Planner File (.ppf) stores the port and node assignments for
IP components created for use with the Pin Planner.
<my_ip>_bb.v You can use the Verilog blackbox (_bb.v) file as an empty module
declaration for use as a blackbox.
<my_ip>.sip Contains information required for NativeLink simulation of IP
components. You must add the .sip file to your Quartus project to
enable NativeLink for Arria II, Arria V, Cyclone IV, Cyclone V, MAX
10, MAX II, MAX V, Stratix IV, and Stratix V devices. The Quartus
Prime Pro Edition does not support NativeLink simulation.
<my_ip>_inst.v or _inst.vhd HDL example instantiation template. You can copy and paste the
contents of this file into your HDL file to instantiate the IP variation.
Send Feedback
QPS5V1
2016.05.03 Generate Files for a Testbench Qsys System 5-63
<my_ip>.v <my_ip>.vhd HDL files that instantiate each submodule or child IP core for
synthesis or simulation.
mentor/ Contains a ModelSim script msim_setup.tcl to set up and run a
simulation.
/cadence Contains a shell script ncsim_setup.sh and other setup files to set up
and run an NCSIM simulation.
Send Feedback
QPS5V1
5-64 Files Generated for Qsys Testbench 2016.05.03
By default, the path of the generation output directory is fixed relative to the .qsys file. You can change the
default directory in the Generation dialog box for legacy devices. For standard devices, the generation
directory is fixed to the Qsys project directory.
The following options are available for generating a Qsys testbench system:
Option Description
Create testbench Qsys system • Standard, BFMs for standard Qsys Interconnect—Creates
a testbench Qsys system with BFM IP components attached
to exported Avalon and AXI3/AXI4 interfaces. Includes any
simulation partner modules specified by IP components in
the system. The testbench generator supports AXI interfaces
and can connect AXI3/AXI4 interfaces to Mentor Graphics
AXI3/AXI4 master/slave BFMs. However, BFMs support
address widths only up to 32-bits.
• Simple, BFMs for clocks and resets—Creates a testbench
Qsys system with BFM IP components driving only clock
and reset interfaces. Includes any simulation partner
modules specified by IP components in the system.
Create testbench simulation model Creates Verilog HDL or VHDL simulation model files and
simulation scripts for the testbench Qsys system currently open
in your workspace. Use this option if you do not need to
modify the Qsys-generated testbench before running the
simulation.
Allow mixed-language simulation Generates a simulation model that contains both Verilog and
VHDL as specified by the individual IP cores. Using this
option, each IP core produces their HDL using it's native
implementation, which results in simulation HDL that is easier
to understand and faster to simulate. You must have a
simulator that supports mixed language simulation.
Send Feedback
QPS5V1
2016.05.03 Files Generated for Qsys Testbench 5-65
<system>_tb.v The top-level testbench file that connects BFMs to the top-level
or interfaces of <system>_tb.qsys.
<system>_tb.vhd
<system>_tb.spd Required input file for ip-make-simscript to generate simulation
scripts for supported simulators. The .spd file contains a list of files
generated for simulation and information about memory that you can
initialize.
<system>.html A system report that contains connection information, a memory map
showing the address of each slave with respect to each master to which
and
it is connected, and parameter assignments.
<system>_tb.html
<system>_generation.rpt Qsys generation log file. A summary of the messages that Qsys issues
during testbench system generation.
<system>.ipx The IP Index File (.ipx) lists the available IP components, or a
reference to other directories to search for IP components.
<system>.svd Allows HPS System Debug tools to view the register maps of
peripherals connected to HPS within a Qsys system.
Similarly, during synthesis the .svd files for slave interfaces visible to
System Console masters are stored in the .sof file in the debug section.
System Console reads this section, which Qsys can query for register
map information. For system slaves, Qsys can access the registers by
name.
/cadence Contains a shell script ncsim_setup.sh and other setup files to set up
and run an NCSIM simulation.
/submodules Contains HDL files for the submodule of the Qsys testbench system.
<child IP cores>/ For each generated child IP core directory, Qsys testbench generates /
synth and /sim subdirectories.
Send Feedback
QPS5V1
5-66 Qsys Testbench Simulation Standard and Legacy Device Output Directories 2016.05.03
<system>.qsys <system>.qsys
<system>.sopcinfo <system>.sopcinfo
<system>_tb <system>_tb.csv
<system>.html <system>_tb.spd
<system>.ipx <system>
<system>.regmap <system>.html
<system>_generation.rpt <system>_generation.rpt
<system>_tb.html <system>_tb.html
<system>_tb.qsys testbench/
<system>_tb <system>.ipx
<system>_tb.csv <system>_tb.qsys
<system>_tb.spd <system>_tb
sim simulation
<HDL files> <HDL files>
aldec submodules
cadence <HDL files>
mentor aldec
synopsys cadence
<Child IP core> mentor
sim synopsys
<HDL files>
Send Feedback
QPS5V1
2016.05.03 Qsys Simulation Scripts 5-67
The simulation scripts provide variables that allow flexibility in your simulation environment.
Variable Description
TOP_LEVEL_NAME If the testbench Qsys system is not the top-level instance in your
simulation environment because you instantiate the Qsys testbench
within your own top-level simulation file, set the TOP_LEVEL_NAME
variable to the top-level hierarchy name.
QSYS_SIMDIR If the simulation files generated by Qsys are not in the simulation
working directory, use the QSYS_SIMDIR variable to specify the
directory location of the Qsys simulation files.
QUARTUS_INSTALL_DIR Points to the Quartus installation directory that contains the device
family library.
module top();
pattern_generator_tb tb();
test_program pgm();
endmodule
Note: The VHDL version of the Altera Tristate Conduit BFM is not supported in Synopsys VCS, NCSim,
and Riviera-PRO in the Quartus Prime software version 14.0. These simulators do not support the
VHDL protected type, which is used to implement the BFM. For a workaround, use a simulator
that supports the VHDL protected type.
Send Feedback
QPS5V1
5-68 Generating a Combined Simulator Setup Script 2016.05.03
3. To incorporate the generated simulator setup script into your top-level simulation script, refer to the
template section in the generated simulator setup script as a guide to creating a top-level script:
a. Copy the specified template sections from the simulator-specific generated scripts and paste them
into a new top-level file.
b. Remove the comments at the beginning of each line from the copied template sections.
c. Specify the customizations required to match your design simulation requirements, for example:
Send Feedback
QPS5V1
2016.05.03 Simulating Software Running on a Nios II Processor 5-69
• Specify the TOP_LEVEL_NAME variable to the design’s simulation top-level file. The top-level
entity of your simulation is often a testbench that instantiates your design, and then your design
instantiates IP cores and/or Qsys systems. Set the value of TOP_LEVEL_NAME to the top-level
entity.
• If necessary, set the QSYS_SIMDIR variable to point to the location of the generated IP simulation
files.
• Compile the top-level HDL file (e.g. a test program) and all other files in the design.
• Specify any other changes, such as using the grep command-line utility to search a transcript file
for error signatures, or e-mail a report.
4. Re-run Tools > Generate Simulator Setup Script for IP (or ip-setup-simulation) after regenera‐
tion of an IP variation.
Utility Syntax
ip-setup-simulation generates a combined,
ip-setup-simulation
version-independent simulation script for all Altera --quartus-project=<my proj>
IP cores in your project, and automates regenera‐ --output-directory=<my_dir>
tion of the script after upgrading software or IP --use-relative-paths
--compile-to-work
versions. Use the compile-to-work option to
compile all simulation files into a single work --use-relative-paths and --compile-to-work
library if your simulation environment requires that are optional. For command-line help listing all
structure. Use the --use-relative-paths option options for these executables, type: <utility name> --
to use relative paths whenever possible. help.
Note: Generate Simulator Script for IP is also available by clicking Project > Upgrade IP
Components.
The following sections provide step-by-step instructions for sourcing each simulator setup script in your
top-level simulation script.
Send Feedback
QPS5V1
5-70 Add Assertion Monitors for Simulation 2016.05.03
6. To simulate, right-click the application project in Eclipse, and then click Run as > Nios II ModelSim.
Sets up the ModelSim simulation environment, and compiles and loads the Nios II software
simulation.
7. To run the simulation in ModelSim, type run -all in the ModelSim transcript window.
8. Set the ModelSim settings and select the Qsys Testbench Simulation Package Descriptor (.spd) file, <
system > _tb.spd. The .spd file is generated with the testbench simulation model for Nios II designs
and specifies the files required for Nios II simulation.
Related Information
Nios II Gen2 Software Developer's Handbook
Refer to the "Getting Started with the Graphical User Interface" and "Getting Started from the Command
Line" chapters.
This example demonstrates the use of a monitor with an Avalon-MM monitor between the
pcie_compiler bar1_0_Prefetchable Avalon-MM master interface, and the
dma_0 control_port_slave Avalon-MM slave interface.
Similarly, you can insert an Avalon-ST monitor between Avalon-ST source and sink interfaces.
Related Information
Introduction to Altera IP Cores
Send Feedback
QPS5V1
2016.05.03 Generate Header Files 5-71
The .svd (or CMSIS-SVD) file format is an XML schema specified as part of the Cortex Microcontroller
Software Interface Standard (CMSIS) provided by ARM. The .svd file allows HPS system debug tools
(such as the DS-5 Debugger) to view the register maps of peripherals connected to HPS in a Qsys system.
Related Information
• Component Interface Tcl Reference on page 9-1
• CMSIS - Cortex Microcontroller Software
Option Description
<sopc> Path to Qsys .sopcinfo file, or the file directory. If you omit this
option, the path defaults to the current directory. If you specify a
directory path, you must make sure that there is a .sopcinfo file in
the directory.
--separate-masters Does not combine a module's masters that are in the same address
space.
--output-dir[=<dirname>] Allows you to specify multiple header files in dirname. The default
output directory is '.'
--module[=<moduleName>] Specifies the module name when creating a single header file.
--master[=<masterName>] Specifies the master name when creating a single header file.
--format[=<type>] Specifies the header file format. Default file format is .h.
Send Feedback
QPS5V1
5-72 Explore and Manage Qsys Interconnect 2016.05.03
By default, the sopc-create-header-files command creates multiple header files. There is one header
file for the entire system, and one header file for each master group in each module. A master group is a
set of masters in a module in the same address space. In general, a module may have multiple master
groups. Addresses and available devices are a function of the master group.
Alternatively, you can use the --single option to create one header file for one master group. If there is
one CPU module in the Qsys system with one master group, the command generates a header file for that
CPU's master group. If there are no CPU modules, but there is one module with one master group, the
command generates the header file for that module's master group.
You can use the --module and --master options to override these defaults. If your module has multiple
master groups, use the --master option to specify the name of a master in the desired master group.
Note: You can use the sopc-create-header-files command when you want to generate C macro files
for DMAs that have access to memory that the Nios II does not have access to.
Send Feedback
QPS5V1
2016.05.03 Manually Controlling Pipelining in the Qsys Interconnect 5-73
The System with Qsys Interconnect window has the following tabs:
• System Contents—Displays the original instances in your system, as well as the inserted interconnect
instances. Connections between interfaces are replaced by connections to interconnect where
applicable.
• Hierarchy—Displays a system hierarchical navigator, expanding the system contents to show modules,
interfaces, signals, contents of subsystems, and connections.
• Parameters—Displays the parameters for the selected element in the Hierarchy tab.
• Memory-Mapped Interconnect—Allows you to select a memory-mapped interconnect module and
view its internal command and response networks. You can also insert pipeline stages to achieve
timing closure.
The System Contents, Hierarchy, and Parameters tabs are read-only. Edits that you apply on the
Memory-Mapped Interconnect tab are automatically reflected on the Interconnect Requirements tab.
The Memory-Mapped Interconnect tab in the System with Qsys Interconnect window displays a
graphical representation of command and response data paths in your system. Data paths allow you
precise control over pipelining in the interconnect. Qsys displays separate figures for the command and
response data paths. You can access the data paths by clicking their respective tabs in the Memory-
Mapped Interconnect tab.
Each node element in a figure represents either a master or slave that communicates over the intercon‐
nect, or an interconnect sub-module. Each edge is an abstraction of connectivity between elements, and
its direction represents the flow of the commands or responses.
Click Highlight Mode (Path, Successors, Predecessors) to identify edges and data paths between
modules. Turn on Show Pipeline Locations to add greyed-out registers on edges where pipelining is
allowed in the interconnect.
Note: You must select more than one module to highlight a path.
Send Feedback
QPS5V1
5-74 Implement Performance Monitoring 2016.05.03
Related Information
Bus Analyzer Toolkit
Send Feedback
QPS5V1
2016.05.03 Qsys 64-Bit Addressing Support 5-75
Related Information
Qsys System Design Components on page 10-1
Send Feedback
QPS5V1
5-76 Qsys Command-Line Utilities 2016.05.03
The Example Design button does not appear in the parameter editor if there is no example. For some IP
components, you can click Generate > Example Designs to access an example design.
The following Qsys system example designs demonstrate various design features and flows that you can
replicate in your Qsys system.
Related Information
• NIOS II Qsys Example Design
• PCI Express Avalon-ST Qsys Example Design
• Triple Speed Ethernet Qsys Example Design
For command-line help listing of all the options for any executable, type the following command:
<Quartus Prime installation directory>\quartus\sopc_builder\bin\<executable name> --
help
Note: You must add $QUARTUS_ROOTDIR/sopc_builder/bin/ to the PATH variable to access command-
line utilities. Once you add this PATH variable, you can launch the utility from any directory
location.
--part[=<value>] Optional Sets the device part number. If set, this option
overrides the --family option.
Send Feedback
QPS5V1
2016.05.03 Scripting IP Core Generation 5-77
--jvm-max-heap-size=<value> Optional The maximum memory size that Qsys uses when
running qsys-edit. You specify this value as
<size><unit>, where unit is m (or M) for
multiples of megabytes, or g (or G) for multiples
of gigabytes. The default value is 512m.
qsys-script --script=<script_file>.tcl
Note: Creating an IP generation script is an advanced feature that requires access to special IP core
parameters. For more information about creating an IP generation script, contact your Altera sales
representative.
Send Feedback
QPS5V1
5-78 Scripting IP Core Generation 2016.05.03
Send Feedback
QPS5V1
2016.05.03 Scripting IP Core Generation 5-79
Send Feedback
QPS5V1
5-80 Display Available IP Components with ip-catalog 2016.05.03
Send Feedback
QPS5V1
2016.05.03 Create an .ipx File with ip-make-ipx 5-81
--output=<file> Optional Specifies the name of the index file to generate. The
default name is /component.ipx. Set as
--output=<""> to print the output to the console.
--thorough-descent Optional If you set this option, Qsys searches all the
component files, without skipping the sub-directo‐
ries.
Send Feedback
QPS5V1
5-82 Generate Simulation Scripts 2016.05.03
Related Information
Set up the IP Index File (.ipx) to Search for IP Components on page 5-6
--spd[=<file>] Required/ The SPD files describe the list of files that
Repeatable require compilation, and memory models
hierarchy. This argument can either be a single
path to an SPD file or a comma-separated list of
paths of SPD files. For instance, --spd=ipcore_
1.spd,ipcore_2.spd
Send Feedback
QPS5V1
2016.05.03 Generate a Qsys System with qsys-script 5-83
qsys-script --script=my_script.tcl \
--system-file=fancy.qsys my_script.tcl contains:
package require -exact qsys 16.0
# get all instance names in the system and print one by one
set instances [ get_instances ]
foreach instance $instances {
send_message Info "$instance"
}
You can use the following options with the qsys-script utility:
--script=<file> Optional A file that contains Tcl scripting commands that you
can use to create or manipulate a Qsys system. If you
specify both --cmd and --script, Qsys runs the --cmd
commands before the script specified by --script.
--cmd=<value> Optional A string that contains Tcl scripting commands that you
can use to create or manipulate a Qsys system. If you
specify both --cmd and --script, Qsys runs the --cmd
commands before the script specified by --script.
Send Feedback
QPS5V1
5-84 Generate a Qsys System with qsys-script 2016.05.03
--quartus-project=<value> Optional Specifies the path to a .qpf Quartus Prime project file.
Utilizes the specified Quartus Prime project to add the
file saved using save_system command. If you omit
this command, Qsys uses the default revision as the
project name.
--new-quartus- Optional Specifies the name of the new Quartus Prime project.
project=<value> Creates a new Quartus Prime project at the specified
path and adds the file saved using save_system
command to the project. If you omit this command,
Qsys uses the Quartus Prime project revision as the new
Quartus Prime project name.
--rev=<value> Optional Allows you to specify the name of the Quartus Prime
project revision.
--jvm-max-heap-size=<value> Optional The maximum memory size that the qsys-script tool
uses. You specify this value as <size><unit>, where
unit is m (or M) for multiples of megabytes, or g (or G)
for multiples of gigabytes.
Related Information
Altera Wiki Qsys Scripts
Send Feedback
QPS5V1
2016.05.03 Qsys Scripting Command Reference 5-85
Send Feedback
QPS5V1
5-86 Qsys Scripting Command Reference 2016.05.03
Send Feedback
QPS5V1
2016.05.03 Qsys Scripting Command Reference 5-87
Send Feedback
QPS5V1
5-88 add_connection 2016.05.03
add_connection
Description
Connects the named interfaces using an appropriate connection type. Both interface names consist of a
child instance name, followed by the name of an interface provided by that module. For example,
mux0.out is the interface named on the instance named mux0. Be careful to connect the start to the end,
and not the reverse.
Usage
add_connection <start> [<end>]
Returns
No return value.
Arguments
start
The start interface that is connected, in <instance_name>.<interface_name> format. If
the end argument is omitted, the connection must be of the form
<instance1>.<interface>/<instance2>.<interface>.
end (optional)
The end interface that is connected, <instance_name>.<interface_name>.
Example
Related Information
• get_connection_parameter_value on page 5-107
• get_connection_property on page 5-110
• get_connections on page 5-111
• remove_connection on page 5-147
• set_connection_parameter_value on page 5-153
Send Feedback
QPS5V1
2016.05.03 add_instance 5-89
add_instance
Description
Adds an instance of a component, referred to as a child or child instance, to the system.
Usage
add_instance <name> <type> [<version>]
Returns
No return value.
Arguments
name
Specifies a unique local name that you can use to manipulate the instance. Qsys uses this
name in the generated HDL to identify the instance.
type
Refers to a kind of instance available in the IP Catalog, for example altera_avalon_uart.
version (optional)
The required version of the specified instance type. If no version is specified, Qsys uses the
latest version.
Example
Related Information
• get_instance_parameter_value on page 5-126
• get_instance_property on page 5-130
• get_instances on page 5-131
• remove_instance on page 5-149
• set_instance_parameter_value on page 5-154
Send Feedback
QPS5V1
5-90 add_interface 2016.05.03
add_interface
Description
Adds an interface to your system, which Qsys uses to export an interface from within the system. You
specify the exported internal interface with set_interface_property <interface> EXPORT_OF
instance.interface.
Usage
add_interface <name> <type> <direction>.
Returns
No return value.
Arguments
name
The name of the interface that Qsys exports from the system.
type
The type of interface.
direction
The interface direction.
Example
Related Information
• get_interface_ports on page 5-135
• get_interface_properties on page 5-136
• get_interface_property on page 5-137
• set_interface_property on page 5-157
Send Feedback
QPS5V1
2016.05.03 apply_preset 5-91
apply_preset
Description
Applies the settings in a preset to the specified instance.
Usage
apply_preset <instance> <preset_name>
Returns
No return value.
Arguments
instance
The name of the instance.
preset_name
The name of the preset.
Example
Send Feedback
QPS5V1
5-92 auto_assign_base_addresses 2016.05.03
auto_assign_base_addresses
Description
Assigns base addresses to all memory mapped interfaces on an instance in the system. Instance interfaces
that are locked with lock_avalon_base_address keep their addresses during address auto-assignment.
Usage
auto_assign_base_addresses <instance>
Returns
No return value.
Arguments
instance
The name of the instance with memory mapped interfaces.
Example
auto_assign_base_addresses sdram
Related Information
• auto_assign_system_base_addresses on page 5-93
• lock_avalon_base_address on page 5-146
• unlock_avalon_base_address on page 5-162
Send Feedback
QPS5V1
2016.05.03 auto_assign_system_base_addresses 5-93
auto_assign_system_base_addresses
Description
Assigns legal base addresses to all memory mapped interfaces on all instances in the system. Instance
interfaces that are locked with lock_avalon_base_address keep their addresses during address auto-
assignment.
Usage
auto_assign_system_base_addresses
Returns
No return value.
Arguments
No arguments.
Example
auto_assign_system_base_addresses
Related Information
• auto_assign_base_addresses on page 5-92
• lock_avalon_base_address on page 5-146
• unlock_avalon_base_address on page 5-162
Send Feedback
QPS5V1
5-94 auto_assign_irqs 2016.05.03
auto_assign_irqs
Description
Assigns interrupt numbers to all connected interrupt senders on an instance in the system.
Usage
auto_assign_irqs <instance>
Returns
No return value.
Arguments
instance
The name of the instance with an interrupt sender.
Example
auto_assign_irqs uart_0
Send Feedback
QPS5V1
2016.05.03 auto_connect 5-95
auto_connect
Description
Creates connections from an instance or instance interface to matching interfaces in other instances in the
system. For example, Avalon-MM slaves connect to Avalon-MM masters.
Usage
auto_connect <element>
Returns
No return value.
Arguments
element
The name of the instance interface, or the name of an instance.
Example
auto_connect sdram
auto_connect uart_0.s1
Related Information
add_connection on page 5-88
Send Feedback
QPS5V1
5-96 create_system 2016.05.03
create_system
Description
Replaces the current system with a new system with the specified name.
Usage
create_system [<name>]
Returns
No return value.
Arguments
name (optional)
The name of the new system.
Example
create_system my_new_system_name
Related Information
• load_system on page 5-145
• save_system on page 5-151
Send Feedback
QPS5V1
2016.05.03 export_hw_tcl 5-97
export_hw_tcl
Description
Allows you to save the currently open system as an _hw.tcl file in the project directory. The saved systems
appears under the System category in the IP Category.
Usage
export_hw_tcl
Returns
No return value.
Arguments
No arguments
Example
export_hw_tcl
Send Feedback
QPS5V1
5-98 get_composed_connection_parameter_value 2016.05.03
get_composed_connection_parameter_value
Description
Returns the value of a parameter in a connection in a child instance containing a subsystem.
Usage
get_composed_connection_parameter_value <instance> <child_connection> <parameter>
Returns
The parameter value.
Arguments
instance
The child instance that contains a subsystem
child_connection
The name of the connection in the subsystem
parameter
The name of the parameter to query on the connection.
Example
Related Information
• get_composed_connection_parameters on page 5-99
• get_composed_connections on page 5-100
Send Feedback
QPS5V1
2016.05.03 get_composed_connection_parameters 5-99
get_composed_connection_parameters
Description
Returns a list of all connections in the subsystem, for an instance that contains a subsystem.
Usage
get_composed_connection_parameters <instance> <child_connection>
Returns
A list of parameter names.
Arguments
instance
The child instance containing a subsystem.
child_connection
The name of the connection in the subsystem.
Example
Related Information
• get_composed_connection_parameter_value on page 5-98
• get_composed_connections on page 5-100
Send Feedback
QPS5V1
5-100 get_composed_connections 2016.05.03
get_composed_connections
Description
For an instance that contains a subsystem of the Qsys system, returns a list of all connections found in a
subsystem.
Usage
get_composed_connections <instance>
Returns
A list of connection names in the subsystem. These connection names are not qualified with the instance
name.
Arguments
instance
The child instance containing a subsystem.
Example
get_composed_connections subsystem_0
Related Information
• get_composed_connection_parameter_value on page 5-98
• get_composed_connection_parameters on page 5-99
Send Feedback
QPS5V1
2016.05.03 get_composed_instance_assignment 5-101
get_composed_instance_assignment
Description
For an instance that contains a subsystem of the Qsys system, returns the value of an assignment found on
the instance in the subsystem.
Usage
get_composed_instance_assignment <instance> <child_instance> <assignment>
Returns
The value of the assignment.
Arguments
instance
The child instance containing a subsystem.
child_instance
The name of a child instance found in the subsystem.
assignment
The assignment key.
Example
Related Information
• get_composed_instance_assignments on page 5-102
• get_composed_instances on page 5-105
Send Feedback
QPS5V1
5-102 get_composed_instance_assignments 2016.05.03
get_composed_instance_assignments
Description
For an instance that contains a subsystem of the Qsys system, returns a list of assignments found on the
instance in the subsystem.
Usage
get_composed_instance_assignments <instance> <child_instance>
Returns
A list of assignment names.
Arguments
instance
The child instance containing a subsystem.
child_instance
The name of a child instance found in the subsystem.
Example
Related Information
• get_composed_instance_assignment on page 5-101
• get_composed_instances on page 5-105
Send Feedback
QPS5V1
2016.05.03 get_composed_instance_parameter_value 5-103
get_composed_instance_parameter_value
Description
For an instance that contains a subsystem of the Qsys system, returns the value of a parameters found on
the instance in the subsystem.
Usage
get_composed_instance_parameter_value <instance> <child_instance> <parameter>
Returns
The value of a parameter on the instance in the subsystem.
Arguments
instance
The child instance containing a subsystem.
child_instance
The name of a child instance found in the subsystem.
parameter
The name of the parameter to query on the instance in the subsystem.
Example
Related Information
• get_composed_instance_parameters on page 5-104
• get_composed_instances on page 5-105
Send Feedback
QPS5V1
5-104 get_composed_instance_parameters 2016.05.03
get_composed_instance_parameters
Description
For an instance that contains a subsystem of the Qsys system, returns a list of parameters found on the
instance in the subsystem.
Usage
get_composed_instance_parameters <instance> <child_instance>
Returns
A list of parameter names.
Arguments
instance
The child instance containing a subsystem.
child_instance
The name of a child instance found in the subsystem.
Example
Related Information
• get_composed_instance_parameter_value on page 5-103
• get_composed_instances on page 5-105
Send Feedback
QPS5V1
2016.05.03 get_composed_instances 5-105
get_composed_instances
Description
For an instance that contains a subsystem of the Qsys system, returns a list of child instances found in the
subsystem.
Usage
get_composed_instances <instance>
Returns
A list of instance names found in the subsystem.
Arguments
instance
The child instance containing a subsystem.
Example
get_composed_instances subsystem_0
Related Information
• get_composed_instance_assignment on page 5-101
• get_composed_instance_assignments on page 5-102
• get_composed_instance_parameter_value on page 5-103
• get_composed_instance_parameters on page 5-104
Send Feedback
QPS5V1
5-106 get_connection_parameter_property 2016.05.03
get_connection_parameter_property
Description
Returns the value of a property on a parameter in a connection. Parameter properties are metadata about
how Qsys uses the parameter.
Usage
get_connection_parameter_property <connection> <parameter> <property>
Returns
The value of the parameter property.
Arguments
connection
The connection to query.
parameter
The name of the parameter.
property
The property of the connection. Refer to Parameter Properties.
Example
Related Information
• get_connection_parameter_value on page 5-107
• get_connection_property on page 5-110
• get_connections on page 5-111
• get_parameter_properties on page 5-141
• Parameter Properties on page 5-176
Send Feedback
QPS5V1
2016.05.03 get_connection_parameter_value 5-107
get_connection_parameter_value
Description
Returns the value of a parameter on the connection. Parameters represent aspects of the connection that
you can modify, such as the base address for an Avalon-MM connection.
Usage
get_connection_parameter_value <connection> <parameter>
Returns
The value of the parameter.
Arguments
connection
The connection to query.
parameter
The name of the parameter.
Example
Related Information
• get_connection_parameters on page 5-108
• get_connections on page 5-111
• set_connection_parameter_value on page 5-153
Send Feedback
QPS5V1
5-108 get_connection_parameters 2016.05.03
get_connection_parameters
Description
Returns a list of parameters found on a connection.
Usage
get_connection_parameters <connection>
Returns
A list of parameter names.
Arguments
connection
The connection to query.
Example
get_connection_parameters cpu.data_master/dma0.csr
Related Information
• get_connection_parameter_property on page 5-106
• get_connection_parameter_value on page 5-107
• get_connection_property on page 5-110
Send Feedback
QPS5V1
2016.05.03 get_connection_properties 5-109
get_connection_properties
Description
Returns a list of properties found on a connection.
Usage
get_connection_properties
Returns
A list of connection properties.
Arguments
No arguments.
Example
get_connection_properties
Related Information
• get_connection_property on page 5-110
• get_connections on page 5-111
Send Feedback
QPS5V1
5-110 get_connection_property 2016.05.03
get_connection_property
Description
Returns the value of a property found on a connection. Properties represent aspects of the connection that
you can modify, such as the type of connection.
Usage
get_connection_property <connection> <property>
Returns
The value of a connection property.
Arguments
connection
The connection to query.
property
The name of the connection. property. Refer to Connection Properties.
Example
Related Information
• get_connection_properties on page 5-109
• Connection Properties on page 5-168
Send Feedback
QPS5V1
2016.05.03 get_connections 5-111
get_connections
Description
Returns a list of all connections in the system if no element is specified. If you specify a child instance, for
example cpu, Qsys returns all connections to any interface on the instance. If specify an interface on a
child instance, for example cpu.instruction_master, Qsys returns all connections to that interface.
Usage
get_connections [<element>]
Returns
A list of connections.
Arguments
element (optional)
The name of a child instance, or the qualified name of an interface on a child instance.
Example
get_connections
get_connections cpu
get_connections cpu.instruction_master
Related Information
• add_connection on page 5-88
• remove_connection on page 5-147
Send Feedback
QPS5V1
5-112 get_instance_assignment 2016.05.03
get_instance_assignment
Description
Returns the value of an assignment on a child instance. Qsys uses assignments to transfer information
about hardware to embedded software tools and applications.
Usage
get_instance_assignment <instance> <assignment>
Returns
The value of the specified assignment.
Arguments
instance
The name of the child instance.
assignment
The assignment key to query.
Example
Related Information
get_instance_assignments on page 5-113
Send Feedback
QPS5V1
2016.05.03 get_instance_assignments 5-113
get_instance_assignments
Description
Returns a list of assignment keys for any assignments defined for the instance.
Usage
get_instance_assignments <instance>
Returns
A list of assignment keys.
Arguments
instance
The name of the child instance.
Example
get_instance_assignments sdram
Related Information
• get_instance_assignment on page 5-112
• get_instance_assignment on page 5-112
Send Feedback
QPS5V1
5-114 get_instance_documentation_links 2016.05.03
get_instance_documentation_links
Description
Returns a list of all documentation links provided by an instance.
Usage
get_instance_documentation_links <instance>
Returns
A list of documentation links.
Arguments
instance
The name of the child instance.
Example
get_instance_documentation_links cpu_0
Notes
The list of documentation links includes titles and URLs for the links. For instance, a component with a
single data sheet link may return:
Send Feedback
QPS5V1
2016.05.03 get_instance_interface_assignment 5-115
get_instance_interface_assignment
Description
Returns the value of an assignment on an interface of a child instance. Qsys uses assignments to transfer
information about hardware to embedded software tools and applications.
Usage
get_instance_interface_assignment <instance> <interface> <assignment>
Returns
The value of the specified assignment.
Arguments
instance
The name of the child instance.
interface
The name of an interface on the child instance.
assignment
The assignment key to query.
Example
Related Information
get_instance_interface_assignments on page 5-116
Send Feedback
QPS5V1
5-116 get_instance_interface_assignments 2016.05.03
get_instance_interface_assignments
Description
Returns a list of assignment keys for any assignments defined for an interface of a child instance.
Usage
get_instance_interface_assignments <instance> <interface>
Returns
A list of assignment keys.
Arguments
instance
The name of the child instance.
interface
The name of an interface on the child instance.
Example
get_instance_interface_assignments sdram s1
Related Information
get_instance_interface_assignment on page 5-115
Send Feedback
QPS5V1
2016.05.03 get_instance_interface_parameter_property 5-117
get_instance_interface_parameter_property
Description
Returns the value of a property on a parameter in an interface of a child instance. Parameter properties
are metadata about how Qsys uses the parameter.
Usage
get_instance_interface_parameter_property <instance> <interface> <parameter>
<property>
Returns
The value of the parameter property.
Arguments
instance
The name of the child instance.
interface
The name of an interface on the child instance.
parameter
The name of the parameter on the interface.
property
The name of the property on the parameter. Refer to Parameter Properties.
Example
Related Information
• get_instance_interface_parameters on page 5-119
• get_instance_interfaces on page 5-124
• get_parameter_properties on page 5-141
• Parameter Properties on page 5-176
Send Feedback
QPS5V1
5-118 get_instance_interface_parameter_value 2016.05.03
get_instance_interface_parameter_value
Description
Returns the value of a parameter of an interface in a child instance.
Usage
get_instance_interface_parameter_value <instance> <interface> <parameter>
Returns
The value of the parameter.
Arguments
instance
The name of the child instance.
interface
The name of an interface on the child instance.
parameter
The name of the parameter on the interface.
Example
Related Information
• get_instance_interface_parameters on page 5-119
• get_instance_interfaces on page 5-124
Send Feedback
QPS5V1
2016.05.03 get_instance_interface_parameters 5-119
get_instance_interface_parameters
Description
Returns a list of parameters for an interface in a child instance.
Usage
get_instance_interface_parameters <instance> <interface>
Returns
A list of parameter names for parameters in the interface.
Arguments
instance
The name of the child instance.
interface
The name of an interface on the uart_0 s0.
Example
Related Information
• get_instance_interface_parameter_value on page 5-118
• get_instance_interfaces on page 5-124
Send Feedback
QPS5V1
5-120 get_instance_interface_port_property 2016.05.03
get_instance_interface_port_property
Description
Returns the value of a property of a port found in the interface of a child instance.
Usage
get_instance_interface_port_property <instance> <interface> <port> <property>
Returns
The value of the port property.
Arguments
instance
The name of the child instance.
interface
The name of an interface on the child instance.
port
The name of the port in the interface.
property
The name of the property of the port. Refer to Port Properties.
Example
Related Information
• get_instance_interface_ports on page 5-121
• get_port_properties on page 5-142
• Port Properties on page 5-181
Send Feedback
QPS5V1
2016.05.03 get_instance_interface_ports 5-121
get_instance_interface_ports
Description
Returns a list of ports found in an interface of a child instance.
Usage
get_instance_interface_ports <instance> <interface>
Returns
A list of port names found in the interface.
Arguments
instance
The name of the child instance.
interface
The name of an interface on the child instance.
Example
get_instance_interface_ports uart_0 s0
Related Information
• get_instance_interface_port_property on page 5-120
• get_instance_interfaces on page 5-124
Send Feedback
QPS5V1
5-122 get_instance_interface_properties 2016.05.03
get_instance_interface_properties
Description
Returns a list of properties that can be queried for an interface in a child instance.
Usage
get_instance_interface_properties
Returns
A list of property names.
Arguments
No arguments.
Example
get_instance_interface_properties
Related Information
• get_instance_interface_property on page 5-123
• get_instance_interfaces on page 5-124
Send Feedback
QPS5V1
2016.05.03 get_instance_interface_property 5-123
get_instance_interface_property
Description
Returns the value of a property for an interface in a child instance.
Usage
get_instance_interface_property <instance> <interface> <property>
Returns
The value of the property.
Arguments
instance
The name of the child instance.
interface
The name of an interface on the child instance.
property
The name of the property of the interface. Refer to Element Properties.
Example
Related Information
• get_instance_interface_properties on page 5-122
• get_instance_interfaces on page 5-124
• Element Properties on page 5-171
Send Feedback
QPS5V1
5-124 get_instance_interfaces 2016.05.03
get_instance_interfaces
Description
Returns a list of interfaces found in a child instance
Usage
get_instance_interfaces <instance>
Returns
A list of interface names.
Arguments
instance
The name of the child instance.
Example
get_instance_interfaces uart_0
Related Information
• get_instance_interface_ports on page 5-121
• get_instance_interface_properties on page 5-122
• get_instance_interface_property on page 5-123
Send Feedback
QPS5V1
2016.05.03 get_instance_parameter_property 5-125
get_instance_parameter_property
Description
Returns the value of a property on a parameter in a child instance. Parameter properties are metadata
about how Qsys uses the parameter.
Usage
get_instance_parameter_property <instance> <parameter> <property>
Returns
The value of the parameter property.
Arguments
instance
The name of the child instance.
parameter
The name of the parameter in the instance.
property
The name of the property of the parameter. Refer to Parameter Properties.
Example
Related Information
• get_instance_parameters on page 5-127
• get_parameter_properties on page 5-141
• Parameter Properties on page 5-176
Send Feedback
QPS5V1
5-126 get_instance_parameter_value 2016.05.03
get_instance_parameter_value
Description
Returns the value of a parameter in a child instance.
Usage
get_instance_parameter_value <instance> <parameter>
Returns
The value of the parameter.
Arguments
instance
The name of the child instance.
parameter
The name of the parameter in the instance.
Example
Related Information
• get_instance_parameters on page 5-127
• set_instance_parameter_value on page 5-154
Send Feedback
QPS5V1
2016.05.03 get_instance_parameters 5-127
get_instance_parameters
Description
Returns a list of parameters in a child instance.
Usage
get_instance_parameters <instance>
Returns
A list of parameters in the instance.
Arguments
instance
The name of the child instance.
Example
get_instance_parameters uart_0
Related Information
• get_instance_parameter_property on page 5-125
• get_instance_interface_parameter_value on page 5-118
• set_instance_parameter_value on page 5-154
Send Feedback
QPS5V1
5-128 get_instance_port_property 2016.05.03
get_instance_port_property
Description
Returns the value of a property of a port contained by an interface in a child instance.
Usage
get_instance_port_property <instance> <port> <property>
Returns
The value of the property for the port.
Arguments
instance
The name of the child instance.
port
The name of a port in one of the interfaces on the child instance.
property
The name of a property found on the port. Refer to Port Properties.
Example
Related Information
• get_instance_interface_ports on page 5-121
• get_port_properties on page 5-142
• Port Properties on page 5-181
Send Feedback
QPS5V1
2016.05.03 get_instance_properties 5-129
get_instance_properties
Description
Returns a list of properties for a child instance.
Usage
get_instance_properties
Returns
A list of property names for the child instance.
Arguments
No arguments.
Example
get_instance_properties
Related Information
get_instance_property on page 5-130
Send Feedback
QPS5V1
5-130 get_instance_property 2016.05.03
get_instance_property
Description
Returns the value of a property for a child instance.
Usage
get_instance_property <instance> <property>
Returns
The value of the property.
Arguments
instance
The name of the child instance.
property
The name of a property found on the instance. Refer to Element Properties.
Example
Related Information
• get_instance_properties on page 5-129
• Element Properties on page 5-171
Send Feedback
QPS5V1
2016.05.03 get_instances 5-131
get_instances
Description
Returns a list of the instance names for all child instances in the system.
Usage
get_instances
Returns
A list of child instance names.
Arguments
No arguments.
Example
get_instances
Related Information
• add_instance on page 5-89
• remove_instance on page 5-149
Send Feedback
QPS5V1
5-132 get_interconnect_requirement 2016.05.03
get_interconnect_requirement
Description
Returns the value of an interconnect requirement for a system or interface on a child instance.
Usage
get_interconnect_requirement <element_id> <requirement>
Returns
The value of the interconnect requirement.
Arguments
element_id
{$system} for the system, or the qualified name of the interface of an instance, in
<instance>.<interface> format. In Tcl, the system identifier is escaped, for example,
{$system}.
requirement
The name of the requirement.
Example
Send Feedback
QPS5V1
2016.05.03 get_interconnect_requirements 5-133
get_interconnect_requirements
Description
Returns a list of all interconnect requirements in the system.
Usage
get_interconnect_requirements
Returns
A flattened list of interconnect requirements. Every sequence of three elements in the list corresponds to
one interconnect requirement. The first element in the sequence is the element identifier. The second
element is the requirement name. The third element is the value. You can loop over the returned list with
a foreach loop, for example:
Arguments
No arguments.
Example
get_interconnect_requirements
Send Feedback
QPS5V1
5-134 get_interface_port_property 2016.05.03
get_interface_port_property
Description
Returns the value of a property of a port contained by one of the top-level exported interfaces
Usage
get_interface_port_property <interface> <port> <property>
Returns
The value of the property.
Arguments
interface
The name of a top-level interface on the system.
port
The name of a port found in the interface.
property
The name of a property found on the port. Refer to Port Properties.
Example
Related Information
• get_interface_ports on page 5-135
• get_port_properties on page 5-142
• Port Properties on page 5-181
Send Feedback
QPS5V1
2016.05.03 get_interface_ports 5-135
get_interface_ports
Description
Returns the names of all of the ports that have been added to a given interface.
Usage
get_interface_ports <interface>
Returns
A list of port names.
Arguments
interface
The name of a top-level interface on the system.
Example
get_interface_ports export_clk_out
Related Information
• get_interface_port_property on page 5-134
• get_interfaces on page 5-138
Send Feedback
QPS5V1
5-136 get_interface_properties 2016.05.03
get_interface_properties
Description
Returns the names of all the available interface properties common to all interface types.
Usage
get_interface_properties
Returns
A list of interface properties.
Arguments
No arguments.
Example
get_interface_properties
Related Information
• get_interface_property on page 5-137
• set_interface_property on page 5-157
Send Feedback
QPS5V1
2016.05.03 get_interface_property 5-137
get_interface_property
Description
Returns the value of a single interface property from the specified interface.
Usage
get_interface_property <interface> <property>
Returns
The property value.
Arguments
interface
The name of a top-level interface on the system.
property
The name of the property. Refer to Interface Properties.
Example
Related Information
• get_interface_properties on page 5-136
• set_interface_property on page 5-157
• Interface Properties on page 5-173
Send Feedback
QPS5V1
5-138 get_interfaces 2016.05.03
get_interfaces
Description
Returns a list of top-level interfaces in the system.
Usage
get_interfaces
Returns
A list of the top-level interfaces exported from the system.
Arguments
No arguments.
Example
get_interfaces
Related Information
• add_interface on page 5-90
• get_interface_ports on page 5-135
• get_interface_property on page 5-137
• remove_interface on page 5-150
• set_interface_property on page 5-157
Send Feedback
QPS5V1
2016.05.03 get_module_properties 5-139
get_module_properties
Description
Returns the properties that you can manage for top-level module of the Qsys system.
Usage
get_module_properties
Returns
A list of property names.
Arguments
No arguments.
Example
get_module_properties
Related Information
• get_module_property on page 5-140
• set_module_property on page 5-158
Send Feedback
QPS5V1
5-140 get_module_property 2016.05.03
get_module_property
Description
Returns the value of a top-level system property.
Usage
get_module_property <property>
Returns
The value of the property.
Arguments
property
The name of the property to query. Refer to Module Properties.
Example
get_module_property NAME
Related Information
• get_module_properties on page 5-139
• set_module_property on page 5-158
Send Feedback
QPS5V1
2016.05.03 get_parameter_properties 5-141
get_parameter_properties
Description
Returns a list of properties that you can query for any parameters, for example parameters on instances,
interfaces, instance interfaces, and connections.
Usage
get_parameter_properties
Returns
A list of parameter properties.
Arguments
No arguments.
Example
get_parameter_properties
Related Information
• get_connection_parameter_property on page 5-106
• get_instance_interface_parameter_property on page 5-117
• get_instance_parameter_property on page 5-125
Send Feedback
QPS5V1
5-142 get_port_properties 2016.05.03
get_port_properties
Description
Returns a list of properties that you can query for ports.
Usage
get_port_properties
Returns
A list of port properties.
Arguments
No arguments.
Example
get_port_properties
Related Information
• get_instance_interface_port_property on page 5-120
• get_instance_interface_ports on page 5-121
• get_instance_port_property on page 5-128
• get_interface_port_property on page 5-134
• get_interface_ports on page 5-135
Send Feedback
QPS5V1
2016.05.03 get_project_properties 5-143
get_project_properties
Description
Returns a list of properties that you can query for properties pertaining to the Quartus Prime project.
Usage
get_project_properties
Returns
A list of project properties.
Arguments
No arguments
Example
get_project_properties
Related Information
• get_project_property on page 5-144
• set_project_property on page 5-159
Send Feedback
QPS5V1
5-144 get_project_property 2016.05.03
get_project_property
Description
Returns the value of a Quartus Prime project property. Not all Quartus Prime project properties are
available.
Usage
get_project_property <property>
Returns
The value of the property.
Arguments
property
The name of the project property. Refer to Project properties.
Example
get_project_property DEVICE_FAMILY
Related Information
• get_module_properties on page 5-139
• get_module_property on page 5-140
• set_module_property on page 5-158
Send Feedback
QPS5V1
2016.05.03 load_system 5-145
load_system
Description
Loads a Qsys system from a file, and uses the system as the current system for scripting commands.
Usage
load_system <file>
Returns
No return value.
Arguments
file
The path to a .qsys file.
Example
load_system example.qsys
Related Information
• create_system on page 5-96
• save_system on page 5-151
Send Feedback
QPS5V1
5-146 lock_avalon_base_address 2016.05.03
lock_avalon_base_address
Description
Prevents the memory-mapped base address from being changed for connections to the specified interface
on an instance when Qsys runs the auto_assign_base_addresses or
auto_assign_system_base_addresses commands.
Usage
lock_avalon_base_address <instance.interface>
Returns
No return value.
Arguments
instance.interface
The qualified name of the interface of an instance, in <instance>.<interface> format.
Example
lock_avalon_base_address sdram.s1
Related Information
• auto_assign_base_addresses on page 5-92
• auto_assign_system_base_addresses on page 5-93
• unlock_avalon_base_address on page 5-162
Send Feedback
QPS5V1
2016.05.03 remove_connection 5-147
remove_connection
Description
This command removes a connection from the system.
Usage
remove_connection <connection>
Returns
no return value
Arguments
connection
The name of the connection to remove
Example
remove_connection cpu.data_master/sdram.s0
Related Information
• add_connection on page 5-88
• get_connections on page 5-111
Send Feedback
QPS5V1
5-148 remove_dangling_connections 2016.05.03
remove_dangling_connections
Description
Removes connections where both end points of the connection no longer exist in the system.
Usage
remove_dangling_connections
Returns
No return value.
Arguments
No arguments.
Example
remove_dangling_connections
Send Feedback
QPS5V1
2016.05.03 remove_instance 5-149
remove_instance
Description
Removes a child instance from the system.
Usage
remove_instance <instance>
Returns
No return value.
Arguments
instance
The name of the child instance to remove.
Example
remove_instance cpu
Related Information
• add_instance on page 5-89
• get_instances on page 5-131
Send Feedback
QPS5V1
5-150 remove_interface 2016.05.03
remove_interface
Description
Removes an exported top-level interface from the system.
Usage
remove_interface <interface>
Returns
No return value.
Arguments
interface
The name of the exported top-level interface.
Example
remove_interface clk_out
Related Information
• add_interface on page 5-90
• get_interfaces on page 5-138
Send Feedback
QPS5V1
2016.05.03 save_system 5-151
save_system
Description
Saves the current system to the named file. If you do not specify the file, Qsys saves the system to the same
file that was opened with the load_system command. You can specify the file as an absolute or relative
path. Relative paths are relative to directory of the most recently loaded system, or relative to the working
directory if no systems are loaded.
Usage
save_system <file>
Returns
No return value.
Arguments
file
If available, the path of the .qsys file to save.
Example
save_system
save_system file.qsys
Send Feedback
QPS5V1
5-152 send_message 2016.05.03
send_message
Description
Sends a message to the user of the script. The message text is normally interpreted as HTML. You can use
the <b> element to provide emphasis.
Usage
send_message <level> <message>
Returns
No return value.
Arguments
level
The following message levels are supported:
• ERROR--Provides an error message.
• WARNING--Provides a warning message.
• INFO--Provides an informational message.
• PROGRESS--Provides a progress message.
• DEBUG--Provides a debug message when debug mode is enabled. Refer to Message Levels
Properties.
message
The text of the message.
Example
Related Information
Message Levels Properties on page 5-174
Send Feedback
QPS5V1
2016.05.03 set_connection_parameter_value 5-153
set_connection_parameter_value
Description
Sets the value of a parameter for a connection.
Usage
set_connection_parameter_value <connection> <parameter> <value>
Returns
No return value.
Arguments
connection
The name if the connection.
parameter
The name of the parameter.
value
The new parameter value.
Example
Related Information
• get_connection_parameter_value on page 5-107
• get_connection_parameters on page 5-108
Send Feedback
QPS5V1
5-154 set_instance_parameter_value 2016.05.03
set_instance_parameter_value
Description
Set the value of a parameter for a child instance. You cannot set derived parameters and SYSTEM_INFO
parameters for the child instance with this command.
Usage
set_instance_parameter_value <instance> <parameter> <value>
Returns
No return value.
Arguments
instance
The name of the child instance.
parameter
The name of the parameter.
value
The new parameter value.
Example
Related Information
• get_instance_parameter_value on page 5-126
• get_instance_parameter_property on page 5-125
Send Feedback
QPS5V1
2016.05.03 set_instance_property 5-155
set_instance_property
Description
Sets the value of a property of a child instance. Most instance properties are read-only and can only be set
by the instance itself. The primary use for this command is to update the ENABLED parameter, which
includes or excludes a child instance when generating Qsys interconnect.
Usage
set_instance_property <instance> <property> <value>
Returns
No return value.
Arguments
instance
The name of the child instance.
property
The name of the property. Refer to Instance Properties.
value
The new property value.
Example
Related Information
• get_instance_parameters on page 5-127
• get_instance_property on page 5-130
• Instance Properties on page 5-172
Send Feedback
QPS5V1
5-156 set_interconnect_requirement 2016.05.03
set_interconnect_requirement
Description
Sets the value of an interconnect requirement for a system or an interface on a child instance.
Usage
set_interconnect_requirement <element_id> <requirement> <value>
Returns
No return value.
Arguments
element_id
{$system} for the system, or qualified name of the interface of an instance, in
<instance>.<interface> format. In Tcl, the system identifier is escaped, for example,
{$system}.
requirement
The name of the requirement.
value
The new requirement value.
Example
Send Feedback
QPS5V1
2016.05.03 set_interface_property 5-157
set_interface_property
Description
Sets the value of a property on an exported top-level interface. You use this command to set the
EXPORT_OF property to specify which interface of a child instance is exported via this top-level interface.
Usage
set_interface_property <interface> <property> <value>
Returns
No return value.
Arguments
interface
The name of an exported top-level interface.
property
The name of the property. Refer to Interface Properties.
value
The new property value.
Example
Related Information
• add_interface on page 5-90
• get_interface_properties on page 5-136
• get_interface_property on page 5-137
• Interface Properties on page 5-173
Send Feedback
QPS5V1
5-158 set_module_property 2016.05.03
set_module_property
Description
Sets the value of a system property, such as the name of the system using the NAME property.
Usage
set_module_property <property> <value>
Returns
No return value.
Arguments
property
The name of the property. Refer to Module Properties.
value
The new property value.
Example
Related Information
• get_module_properties on page 5-139
• get_module_property on page 5-140
• Module Properties on page 5-175
Send Feedback
QPS5V1
2016.05.03 set_project_property 5-159
set_project_property
Description
Sets the value of a project property, such as the device family.
Usage
set_project_property <property> <value>
Returns
No return value.
Arguments
property
The name of the property. Refer to Project Properties.
value
The new property value.
Example
Related Information
• get_project_properties on page 5-143
• set_project_property on page 5-159
• Project Properties on page 5-182
• get_project_properties on page 5-143
• get_project_property on page 5-144
• Project Properties on page 5-182
Send Feedback
QPS5V1
5-160 set_use_testbench_naming_pattern 2016.05.03
set_use_testbench_naming_pattern
Description
Use this command to create testbench systems so that the generated file names for the test system match
the system's original generated file names. Without setting this, the generated file names for the test
system receive the top-level testbench system name.
Usage
set_use_testbench_naming_pattern <value>
Returns
No return value.
Arguments
value
True or false.
Example
set_use_testbench_naming_pattern true
Notes
Use this command only to create testbench systems.
Send Feedback
QPS5V1
2016.05.03 set_validation_property 5-161
set_validation_property
Description
Sets a property that affects how and when validation is run. To disable system validation after each
scripting command, set AUTOMATIC_VALIDATION to False.
Usage
set_validation_property <property> <value>
Returns
No return value.
Arguments
property
The name of the property. Refer to Validation Properties.
value
The new property value.
Example
Related Information
• validate_system on page 5-166
• Validation Properties on page 5-186
Send Feedback
QPS5V1
5-162 unlock_avalon_base_address 2016.05.03
unlock_avalon_base_address
Description
Allows the memory-mapped base address to change for connections to the specified interface on an
instance when Qsys runs the auto_assign_base_addresses or auto_assign_system_base_addresses
commands.
Usage
unlock_avalon_base_address <instance.interface>
Returns
No return value.
Arguments
instance.interface
The qualified name of the interface of an instance, in <instance>.<interface> format.
Example
unlock_avalon_base_address sdram.s1
Related Information
• auto_assign_base_addresses on page 5-92
• auto_assign_system_base_addresses on page 5-93
• lock_avalon_base_address on page 5-146
Send Feedback
QPS5V1
2016.05.03 validate_connection 5-163
validate_connection
Description
Validates the specified connection and returns validation messages.
Usage
validate_connection <connection>
Returns
A list of messages produced during validation.
Arguments
connection
The name of the connection to validate.
Example
validate_connection cpu.data_master/sdram.s1
Related Information
• validate_instance on page 5-164
• validate_instance_interface on page 5-165
• validate_system on page 5-166
Send Feedback
QPS5V1
5-164 validate_instance 2016.05.03
validate_instance
Description
Validates the specified child instance and returns validation messages.
Usage
validate_instance <instance>
Returns
A list of messages produced during validation.
Arguments
instance
The name of the child instance to validate.
Example
validate_instance cpu
Related Information
• validate_connection on page 5-163
• validate_instance_interface on page 5-165
• validate_system on page 5-166
Send Feedback
QPS5V1
2016.05.03 validate_instance_interface 5-165
validate_instance_interface
Description
Validates an interface on a child instance and returns validation messages.
Usage
validate_instance_interface <instance> <interface>
Returns
A list of messages produced during validation.
Arguments
instance
The name of a child instance.
interface
The name of the interface on the child instance to validate.
Example
Related Information
• validate_connection on page 5-163
• validate_instance on page 5-164
• validate_system on page 5-166
Send Feedback
QPS5V1
5-166 validate_system 2016.05.03
validate_system
Description
Validates the system and returns validation messages.
Usage
validate_system
Returns
A list of validation messages produced during validation.
Arguments
No arguments.
Example
validate_system
Related Information
• validate_connection on page 5-163
• validate_instance on page 5-164
• validate_instance_interface on page 5-165
Send Feedback
QPS5V1
2016.05.03 Qsys Scripting Property Reference 5-167
Send Feedback
QPS5V1
5-168 Connection Properties 2016.05.03
Connection Properties
Send Feedback
QPS5V1
2016.05.03 Design Environment Type Properties 5-169
Description
IP cores use the design environment to identify what sort of interfaces are most appropriate to connect in
the parent system.
Name Description
NATIVE The design environment supports native IP interfaces.
QSYS The design environment supports standard Qsys interfaces.
Send Feedback
QPS5V1
5-170 Direction Properties 2016.05.03
Direction Properties
Name Description
BIDIR The direction for a bidirectional signal.
INOUT The direction for an input signal.
OUTPUT The direction for an output signal.
Send Feedback
QPS5V1
2016.05.03 Element Properties 5-171
Element Properties
Description
Element properties are, with the exception of ENABLED and NAME, read-only properties of the types of
instances, interfaces, and connections. These read-only properties represent metadata that does not vary
between copies of the same type. ENABLED and NAME properties are specific to particular instances,
interfaces, or connections.
Send Feedback
QPS5V1
5-172 Instance Properties 2016.05.03
Instance Properties
Send Feedback
QPS5V1
2016.05.03 Interface Properties 5-173
Interface Properties
Send Feedback
QPS5V1
5-174 Message Levels Properties 2016.05.03
Name Description
COMPONENT_INFO Reports an informational message only during component editing.
DEBUG Provides messages when debug mode is turned on.
ERROR Provides an error message.
INFO Provides an informational message.
PROGRESS Reports progress during generation.
TODOERROR Provides an error message that indicates the system is incomplete.
WARNING Provides a warning message.
Send Feedback
QPS5V1
2016.05.03 Module Properties 5-175
Module Properties
Send Feedback
QPS5V1
5-176 Parameter Properties 2016.05.03
Parameter Properties
Send Feedback
QPS5V1
2016.05.03 Parameter Properties 5-177
String DISPLAY_NAME The GUI label that appears to the left of this parameter.
String DISPLAY_UNITS The GUI label that appears to the right of the parameter.
Boolean ENABLED When False, the parameter is turned off. It displays in the parameter
editor but is grayed out, indicating that you cannot edit this
parameter.
String GROUP Controls the layout of parameters in the GUI.
Boolean HDL_PARAMETER When True, Qsys passes the parameter to the HDL component
description. The default value is False.
String LONG_DESCRIPTION A user-visible description of the parameter. Similar to DESCRIPTION,
but allows a more detailed explanation.
String NEW_INSTANCE_VALUE Changes the default value of a parameter without affecting older
components that do not explicitly set a parameter value, and use the
DEFAULT_VALUE property. Oder instances continue to use
DEFAULT_VALUE for the parameter and new instances use the value
assigned by NEW_INSTANCE_VALUE.
String[] SYSTEM_INFO Allows you to assign information about the instantiating system to a
parameter that you define. SYSTEM_INFO requires an argument
specifying the type of information for example,
SYSTEM_INFO <info-type>
String SYSTEM_INFO_ARG Defines an argument to pass to SYSTEM_INFO. For example, the name
of a reset interface.
(various) SYSTEM_INFO_TYPE Specifies the types of system information that you can query. Refer to
System Info Type Properties.
(various) TYPE Specifies the type of the parameter. Refer to Parameter Type
Properties.
(various) UNITS Sets the units of the parameter. Refer to Units Properties.
Boolean VISIBLE Indicates whether or not to display the parameter in the parameter
editor.
Send Feedback
QPS5V1
5-178 Parameter Properties 2016.05.03
Related Information
• System Info Type Properties on page 5-183
• Parameter Type Properties on page 5-180
• Units Properties on page 5-185
Send Feedback
QPS5V1
2016.05.03 Parameter Status Properties 5-179
Send Feedback
QPS5V1
5-180 Parameter Type Properties 2016.05.03
Name Description
BOOLEAN A boolean parameter set to true or false.
FLOAT A signed 32-bit floating point parameter. (Not supported for HDL parameters.)
INTEGER A signed 32-bit integer parameter.
INTEGER_LIST A parameter that contains a list of 32-bit integers. (Not supported for HDL
parameters.)
LONG A signed 64-bit integer parameter. (Not supported for HDL parameters.)
NATURAL A 32-bit number that contains values 0 to 2147483647 (0x7fffffff).
POSITIVE A 32-bit number that contains values 1 to 2147483647 (0x7fffffff).
STD_LOGIC A single bit parameter set to 0 or 1.
STD_LOGIC_VECTOR An arbitrary-width number. The parameter property WIDTH determines the size of
the logic vector.
STRING A string parameter.
STRING_LIST A parameter that contains a list of strings. (Not supported for HDL parameters.)
Send Feedback
QPS5V1
2016.05.03 Port Properties 5-181
Port Properties
Send Feedback
QPS5V1
5-182 Project Properties 2016.05.03
Project Properties
Send Feedback
QPS5V1
2016.05.03 System Info Type Properties 5-183
Send Feedback
QPS5V1
5-184 System Info Type Properties 2016.05.03
Related Information
• Design Environment Type Properties on page 5-169
• Avalon Interface Specifications
• Qsys Interconnect on page 7-1
Send Feedback
QPS5V1
2016.05.03 Units Properties 5-185
Units Properties
Name Description
ADDRESS A memory-mapped address.
BITS Memory size in bits.
BITSPERSECOND Rate in bits per second.
BYTES Memory size in bytes.
CYCLES A latency or count in clock cycles.
GIGABITSPERSECOND Rate in gigabits per second.
GIGABYTES Memory size in gigabytes.
GIGAHERTZ Frequency in GHz.
HERTZ Frequency in Hz.
KILOBITSPERSECOND Rate in kilobits per second.
KILOBYTES Memory size in kilobytes.
KILOHERTZ Frequency in kHz.
MEGABITSPERSECOND Rate, in megabits per second.
MEGABYTES Memory size in megabytes.
MEGAHERTZ Frequency in MHz.
MICROSECONDS Time in microseconds.
MILLISECONDS Time in milliseconds.
NANOSECONDS Time in nanoseconds.
NONE Unspecified units.
PERCENT A percentage.
PICOSECONDS Time in picoseconds.
SECONDS Time in seconds.
Send Feedback
QPS5V1
5-186 Validation Properties 2016.05.03
Validation Properties
Send Feedback
QPS5V1
2016.05.03 Document Revision History 5-187
August 2014 14.0a10.0 • Added distinction between legacy and standard device
generation.
• Updated: Upgrading Outdated IP Components.
• Updated: Generating a Qsys System.
• Updated: Integrating a Qsys System with the Quartus Prime
Software.
• Added screen shot: Displaying Your Qsys System.
Send Feedback
QPS5V1
5-188 Document Revision History 2016.05.03
November 2011 11.1.0 • Added Synopsys VCS and VCS MX Simulation Shell Script.
• Added Cadence Incisive Enterprise (NCSIM) Simulation
Shell Script.
• Added Using Instance Parameters and Example Hierarchical
System Using Parameters.
May 2011 11.0.0 • Added simulation support in Verilog HDL and VHDL.
• Added testbench generation support.
• Updated simulation and file generation sections.
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
Creating Qsys Components
6
QPS5V1 Subscribe Send Feedback
In order to describe and package IP components for use in a Qsys system, you must create a Hardware
Component Definition File (_hw.tcl) which will describes your component, its interfaces and HDL files.
Qsys provides the Component Editor to help you create a simple _hw.tcl file.
The Demo AXI Memory example on the Qsys Design Examples page of the Altera web site provides the
full code examples that appear in the following topics.
Qsys supports Avalon, AMBA AXI3 (version 1.0), AMBA AXI4 (version 2.0), AMBA AXI4-Lite (version
2.0), AMBA AXI4-Stream (version 1.0), and AMBA APB3 (version 1.0) interface specifications.
Related Information
• Avalon Interface Specifications
• AMBA Protocol Specifications
• Demo AXI Memory Example
Qsys Components
A Qsys component includes the following elements:
• Information about the component type, such as name, version, and author.
• HDL description of the component’s hardware, including SystemVerilog, Verilog HDL, or VHDL files
• Constraint files (Synopsys Design Constraints File (.sdc) and/or Quartus Prime IP File (.qip)) that
define the component for synthesis and simulation.
• A component’s interfaces, including I/O signals.
• The parameters that configure the operation of the component.
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V1
6-2 Component Structure 2015.11.02
Memory-Mapped Connects memory-referencing master devices with slave memory devices. Master
devices may be processors and DMAs, while slave memory devices may be RAMs,
ROMs, and control registers. Data transfers between master and slave may be uni-
directional (read only or write only), or bi-directional (read and write).
Streaming Connects Avalon Streaming (Avalon-ST) sources and sinks that stream unidirec‐
tional data, as well as high-bandwidth, low-latency IP components. Streaming
creates datapaths for unidirectional traffic, including multichannel streams, packets,
and DSP data. The Avalon-ST interconnect is flexible and can implement on-chip
interfaces for industry standard telecommunications and data communications
cores, such as Ethernet, Interlaken, and video. You can define bus widths, packets,
and error conditions.
Clocks Connects clock output interfaces with clock input interfaces. Clock outputs can fan-
out without the use of a bridge. A bridge is required only when a clock from an
external (exported) source connects internally to more than one source.
Resets Connects reset sources with reset input interfaces. If your system requires a
particular positive-edge or negative-edge synchronized reset, Qsys inserts a reset
controller to create the appropriate reset signal. If you design a system with multiple
reset inputs, the reset controller ORs all reset inputs and generates a single reset
output.
Conduits Connects point-to-point conduit interfaces, or represent signals that are exported
from the Qsys system. Qsys uses conduits for component I/O signals that are not
part of any supported standard interface. You can connect two conduits directly
within a Qsys system as a point-to-point connection, or conduit interfaces can be
exported and brought to the top-level of the system as top-level system I/O. You can
use conduits to connect to external devices, for example external DDR SDRAM
memory, and to FPGA logic defined outside of the Qsys system.
Component Structure
Altera provides components automatically installed with the Quartus Prime software. You can obtain a
list of Qsys-compliant components provided by third-party IP developers on Altera's Intellectual
Property & Reference Designs page by typing: qsys certified in the Search box, and then selecting IP
Core & Reference Designs. Components are also provided with Altera development kits, which are listed
on the All Development Kits page.
Send Feedback
QPS5V1
2015.11.02 Component File Organization 6-3
Every component is defined with a < component_name >_hw.tcl file, a text file written in the Tcl scripting
language that describes the component to Qsys. When you design your own custom component, you can
create the _hw.tcl file manually, or by using the Qsys Component Editor.
The Component Editor simplifies the process of creating _hw.tcl files by creating a file that you can edit
outside of the Component Editor to add advanced procedures. When you edit a previously saved _hw.tcl
file, Qsys automatically backs up the earlier version as _hw.tcl~.
You can move component files into a new directory, such as a network location, so that other users can
use the component in their systems. The _hw.tcl file contains relative paths to the other files, so if you
move an _hw.tcl file, you should also move all the HDL and other files associated with it.
There are three component types:
• Static— Static components always generate the same output, regardless of their parameterization.
Components that instantiate static components must have only static children.
• Generated—A generated component's fileset callback allows an instance of the component to create
unique HDL design files based on the instance's parameter values.
• Composed—Composed components are subsystems constructed from instances of other components.
You can use a composition callback to manage the subsystem in a composed component.
Related Information
• Create a Composed Component or Subsystem on page 6-28
• Add Component Instances to a Static or Generated Component on page 6-31
• Intellectual Property & Reference Designs
Related Information
Nios II Software Developer’s Handbook
Refer to the "Nios II Software Build Tools" and "Overview of the Hardware Abstraction Layer" chapters.
Component Versions
Qsys systems support multiple versions of the same component within the same system; you can create
and maintain multiple versions of the same component.
Send Feedback
QPS5V1
6-4 Upgrade IP Components to the Latest Version 2015.11.02
If you have multiple _hw.tcl files for components with the same NAME module properties and different
VERSION module properties, both versions of the component are available.
If multiple versions of the component are available in the IP Catalog, you can add a specific version of a
component by right-clicking the component, and then selecting Add version <version_number>.
Related Information
Upgrade IP Components Dialog Box
Send Feedback
QPS5V1
2015.11.02 Create IP Components in the Qsys Component Editor 6-5
• Elaboration—During the elaboration phase, Qsys queries the component for its interface information.
Elaboration is triggered when an instance of a component is added to a system, when its parameters
are changed, or when a system property changes. You can use callback procedures that run during the
elaboration phase to dynamically control interfaces, signals, and HDL files based on the values of
parameters. For example, interfaces defined with static declarations can be enabled or disabled during
elaboration. When elaboration is complete, the component's interfaces and design logic must be
completely defined.
• Composition—During the composition phase, a component can manipulate the instances in the
component's subsystem. The _hw.tcl file uses a callback procedure to provide parameterization and
connectivity of sub-components.
• Generation—During the generation phase, Qsys generates synthesis or simulation files for each
component in the system into the appropriate output directories, as well as any additional files that
support associated tools.
Send Feedback
QPS5V1
6-6 Save an IP Component and Create the _hw.tcl File 2015.11.02
Example 6-1: Qsys Creates an _hw.tcl File from Entries in the Component Editor
#
# connection point clock
#
add_interface clock clock end
set_interface_property clock clockRate 0
set_interface_property clock ENABLED true
#
# connection point reset
#
add_interface reset reset end
set_interface_property reset associatedClock clock
set_interface_property reset synchronousEdges DEASSERT
set_interface_property reset ENABLED true
#
# connection point streaming
#
add_interface streaming avalon_streaming start
set_interface_property streaming associatedClock clock
set_interface_property streaming associatedReset reset
set_interface_property streaming dataBitsPerSymbol 8
set_interface_property streaming errorDescriptor ""
set_interface_property streaming firstSymbolInHighOrderBits true
set_interface_property streaming maxChannel 0
set_interface_property streaming readyLatency 0
set_interface_property streaming ENABLED true
#
# connection point slave
#
add_interface slave axi end
set_interface_property slave associatedClock clock
set_interface_property slave associatedReset reset
set_interface_property slave readAcceptanceCapability 1
set_interface_property slave writeAcceptanceCapability 1
set_interface_property slave combinedAcceptanceCapability 1
set_interface_property slave readDataReorderingDepth 1
set_interface_property slave ENABLED true
Related Information
Component Interface Tcl Reference on page 9-1
Send Feedback
QPS5V1
2015.11.02 Edit an IP Component with the Qsys Component Editor 6-7
Altera recommends that you move _hw.tcl files and their associated files to an ip/ directory within your
Quartus Prime project directory. You can use IP components with other applications, such as the C
compiler and a board support package (BSP) generator.
Refer to Creating a System with Qsys for information on how to search for and add components to the IP
Catalog for use in your designs.
Related Information
• Publishing Component Information to Embedded Software (Nios II Software Developer’s
Handbook)
• Creating a System with Qsys on page 5-1
Send Feedback
QPS5V1
6-8 Specify IP Component Type Information 2015.11.02
The Display name, Group, Description, Created By, Icon, and Documentation entries are optional.
When you use the Component Editor to create a component, it writes this basic component information
in the _hw.tcl file. The package require command specifies the Quartus Prime software version that
Qsys uses to create the _hw.tcl file, and ensures compatibility with this version of the Qsys API in future
ACDS releases.
Send Feedback
QPS5V1
2015.11.02 Create an HDL File in the Qsys Component Editor 6-9
Example 6-2: _hw.tcl Created from Entries in the Component Type Tab
The component defines its basic information with various module properties using the
set_module_property command. For example, set_module_property NAME specifies the name
of the component, while set_module_property VERSION allows you to specify the version of the
component. When you apply a version to the _hw.tcl file, it allows the file to behave exactly the
same way in future releases of the Quartus Prime software.
# demo_axi_memory
set_module_property DESCRIPTION \
"Demo AXI-3 memory with optional Avalon-ST port"
Related Information
Component Interface Tcl Reference on page 9-1
Related Information
Specify Synthesis and Simulation Files in the Qsys Component Editor on page 6-11
Send Feedback
QPS5V1
6-10 Create an HDL File Using a Template in the Qsys Component Editor 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Specify Synthesis and Simulation Files in the Qsys Component Editor 6-11
8. Verify the <component_name>.v file appears in the Synthesis Files table on the Files tab.
Related Information
Specify Synthesis and Simulation Files in the Qsys Component Editor on page 6-11
Send Feedback
QPS5V1
6-12 Specify HDL Files for Synthesis in the Qsys Component Editor 2015.11.02
If you already an HDL files that describe the behavior and structure of your component, you can specify
those files on the Files tab.
If you do not yet have an HDL file, you can specify the signals, interfaces, and parameters of the
component in the Component Editor, and then use the Create Synthesis File from Signals option on the
Files tab to create the top-level HDL file. The Component Editor generates the _hw.tcl commands to
specify the files.
Note: After you analyze the component's top-level HDL file (on the Files tab), you cannot add or remove
signals or change the signal names on the Signals & Interfaces tab. If you need to edit signals, edit
your HDL source, and then click Create Synthesis File from Signals on the Files tab to integrate
your changes.
A component uses filesets to specify the different sets of files that you can generate for an instance of the
component. The supported fileset types are: QUARTUS_SYNTH, for synthesis and compilation in the Quartus
Prime software, SIM_VERILOG, for Verilog HDL simulation, and SIM_VHDL, for VHDL simulation.
In an _hw.tcl file, you can add a fileset with the add_fileset command. You can then list specific files
with the add_fileset_file command. The add_fileset_property command allows you to add
properties such as TOP_LEVEL.
You can populate a fileset with a a fixed list of files, add different files based on a parameter value, or even
generate an HDL file with a custom HDL generator function outside of the _hw.tcl file.
Related Information
• Create an HDL File in the Qsys Component Editor on page 6-9
• Create an HDL File Using a Template in the Qsys Component Editor on page 6-9
Send Feedback
QPS5V1
2015.11.02 Analyze Synthesis Files in the Qsys Component Editor 6-13
In the Synthesis Files section on the Files tab in the Qsys Component Editor, the demo_axi_memory.sv
file should be selected as the top-level file for the component.
Example 6-3: _hw.tcl Created from Entries in the Files tab in the Synthesis Files Section
# file sets
add_fileset_file demo_axi_memory.sv
SYSTEM_VERILOG PATH demo_axi_memory.sv
Send Feedback
QPS5V1
6-14 Name HDL Signals for Automatic Interface and Type Recognition in the... 2015.11.02
Related Information
• Specify HDL Files for Synthesis in the Qsys Component Editor on page 6-12
• Component Interface Tcl Reference on page 9-1
Name HDL Signals for Automatic Interface and Type Recognition in the Qsys
Component Editor
If you create the component's top-level HDL file before using the Component Editor, the Component
Editor recognizes the interface and signal types based on the signal names in the source HDL file. This
auto-recognition feature eliminates the task of manually assigning each interface and signal type in the
Component Editor.
To enable auto-recognition, you must create signal names using the following naming convention:
<interface type prefix>_<interface name>_<signal type>
Specifying an interface name with <interface name> is optional if you have only one interface of each type
in the component definition. For interfaces with only one signal, such as clock and reset inputs, the
<interface type prefix> is also optional.
When the Component Editor recognizes a valid prefix and signal type for a signal, it automatically assigns an
interface and signal type to the signal based on the naming convention. If no interface name is specified for a
signal, you can choose an interface name on the Signals & Interfaces tab in the Component Editor.
Interface Prefix Interface Type
coe Conduit
Send Feedback
QPS5V1
2015.11.02 Specify Files for Simulation in the Component Editor 6-15
Refer to the Avalon Interface Specifications or the AMBA Protocol Specification for the signal types
available for each interface type.
Related Information
• Avalon Interface Specifications
• AMBA Protocol Specification
Send Feedback
QPS5V1
6-16 Specify Files for Simulation in the Component Editor 2015.11.02
Figure 6-3: Specifying the Simulation Output Files on the Files Tab
You specify the simulation files in a similar way as the synthesis files with the fileset commands in a
_hw.tcl file. The code example below shows SIM_VERILOG and SIM_VHDL filesets for Verilog and VHDL
simulation output files. In this example, the same Verilog files are used for both Verilog and VHDL
outputs, and there is one additional System Verilog file added. This method works for designers of
Verilog IP to support users who want to generate a VHDL top-level simulation file when they have a
mixed-language simulation tool and license that can read the Verilog output for the component.
Example 6-4: _hw.tcl Created from Entries in the Files tab in the Simulation Files Section
Send Feedback
QPS5V1
2015.11.02 Include an Internal Register Map Description in the .svd for Slave... 6-17
Related Information
Component Interface Tcl Reference on page 9-1
Include an Internal Register Map Description in the .svd for Slave Interfaces
Connected to an HPS Component
Qsys supports the ability for IP component designers to specify register map information on their slave
interfaces. This allows components with slave interfaces that are connected to an HPS component to
include their internal register description in the generated .svd file.
To specify their internal register map, the IP component designer must write and generate their own .svd
file and attach it to the slave interface using the following command:
set_interface_property <slave interface> CMSIS_SVD_FILE <file path>
The CMSIS_SVD_VARIABLES interface property allows for variable substitution inside the .svd file. You can
dynamically modify the character data of the .svd file by using the CMSIS_SVD_VARIABLES property.
Related Information
• Component Interface Tcl Reference on page 9-1
• CMSIS - Cortex Microcontroller Software
Send Feedback
QPS5V1
6-18 Specify Parameters in the Qsys Component Editor 2015.11.02
6. To move signals between interfaces, select the signal, and then drag it to another interface.
7. To rename a nsignal or interface, select the element, and then press F2.
8. To remove a signal or interface, right-click the element, and then click Remove.
Alternatively, to remove an signal or interface, you can select the element, and then press Delete.
When you remove an interface, Qsys also removes all of its associated signals.
Figure 6-4: Qsys Signals & Interfaces tab
Send Feedback
QPS5V1
2015.11.02 Specify Parameters in the Qsys Component Editor 6-19
If you used the Component Editor to create a top-level template HDL file for synthesis, you can remove
the newly-created file from the Synthesis Files list on the Files tab, make your parameter changes, and
then re-analyze the top-level synthesis file.
You can use the Parameters table to specify the following information about each parameter:
• Name—Specifies the name of the parameter.
• Default Value—Sets the default value used in new instances of the component.
• Editable—Specifies whether or not the user can edit the parameter value.
• Type—Defines the parameter type as string, integer, boolean, std_logic, logic vector, natural, or
positive.
• Group—Allows you to group parameters in parameter editor.
• Tooltip—Allows you to add a description of the parameter that appears when the user of the
component points to the parameter in the parameter editor.
Send Feedback
QPS5V1
6-20 Specify Parameters in the Qsys Component Editor 2015.11.02
On the Parameters tab, you can click Preview the GUI at any time to see how the declared parameters
appear in the parameter editor. Parameters with their default values appear with checks in the Editable
column, indicating that users of this component are allowed to modify the parameter value. Editable
parameters cannot contain computed expressions. You can group parameters under a common heading
or section in the parameter editor with the Group column, and a tooltip helps users of the component
understand the function of the parameter. Various parameter properties allow you to customize the
component’s parameter editor, such as using radio buttons for parameter selections, or displaying an
image.
Send Feedback
QPS5V1
2015.11.02 Valid Ranges for Parameters in the _hw.tcl File 6-21
Note: If a parameter <n> defines the width of a signal, the signal width must follow the
format: <n-1>:0.
#
# parameters
#
add_parameter AXI_ID_W INTEGER 4 "Width of ID fields"
set_parameter_property AXI_ID_W DEFAULT_VALUE 4
set_parameter_property AXI_ID_W DISPLAY_NAME AXI_ID_W
set_parameter_property AXI_ID_W TYPE INTEGER
set_parameter_property AXI_ID_W UNITS None
set_parameter_property AXI_ID_W DESCRIPTION "Width of ID fields"
set_parameter_property AXI_ID_W HDL_PARAMETER true
add_parameter AXI_ADDRESS_W INTEGER 12
set_parameter_property AXI_ADDRESS_W DEFAULT_VALUE 12
Note: If an AXI slave's ID bit width is smaller than required for your system, the AXI slave response may
not reach all AXI masters. The formula of an AXI slave ID bit width is calculated as follows:
maximum_master_id_width_in_the_interconnect + log2
(number_of_masters_in_the_same_interconnect)
For example, if an AXI slave connects to three AXI masters and the maximum AXI master ID
length of the three masters is 5 bits, then the AXI slave ID is 7 bits, and is calculated as follows:
5 bits + 2 bits (log2(3 masters)) = 7
readIssuingCapability readAcceptanceCapability
writeIssuingCapability writeAcceptanceCapability
combinedIssuingCapability combinedAcceptanceCapability
readDataReorderingDepth
Related Information
Component Interface Tcl Reference on page 9-1
Send Feedback
QPS5V1
6-22 Types of Qsys Parameters 2015.11.02
Qsys validation checks each parameter value against the ALLOWED_RANGES property. If the values specified
are outside of the allowed ranges, Qsys displays an error message. Specifying choices for the allowed
values enables users of the component to choose the parameter value from a drop-down list or radio
button in the parameter editor GUI instead of entering a value.
The ALLOWED_RANGES property is a list of valid ranges, where each range is a single value, or a range of
values defined by a start and end value.
1, 2, 4, 8, or 16
{1 2 4 8 16}
1 through 3, inclusive.
{1:3}
Related Information
Declare Parameters with Custom _hw.tcl Commands on page 6-23
Related Information
Declare Parameters with Custom _hw.tcl Commands on page 6-23
Send Feedback
QPS5V1
2015.11.02 Qsys System Information Parameters 6-23
You then set the name of the clock interface as the SYSTEM_INFO argument:
set_parameter_property <param> SYSTEM_INFO_ARG <clkname>
Related Information
Declare Parameters with Custom _hw.tcl Commands on page 6-23
Send Feedback
QPS5V1
6-24 Declare Parameters with Custom _hw.tcl Commands 2015.11.02
AXI_NUMBYTES parameter value is not editable, because its value is based on another parameter
value.
...
Send Feedback
QPS5V1
2015.11.02 Validate Parameter Values with a Validation Callback 6-25
Related Information
• Control Interfaces Dynamically with an Elaboration Callback on page 6-26
• Component Interface Tcl Reference on page 9-1
Related Information
• Component Interface Tcl Reference on page 9-1
• Demo AXI Memory Example
Send Feedback
QPS5V1
6-26 Control Interfaces Dynamically with an Elaboration Callback 2015.11.02
Example 6-9: Avalon-ST Source Interface Optionally Included in a Component Specified with an
Elaboration Callback
proc elaborate {} {
Related Information
• Declare Parameters with Custom _hw.tcl Commands on page 6-23
• Validate Parameter Values with a Validation Callback on page 6-25
• Component Interface Tcl Reference on page 9-1
Example 6-10: Fileset Callback Using Parameters to Control Filesets in Two Different Ways
The RAM_VERSION parameter chooses between two different source files to control the implemen‐
tation of a RAM block. For the top-level source file, a custom Tcl routine generates HDL that
Send Feedback
QPS5V1
2015.11.02 Control File Generation Dynamically with Parameters and a Fileset... 6-27
optionally includes control and status registers, depending on the value of the CSR_ENABLED
parameter.
During the generation phase, Qsys creates a a top-level Qsys system HDL wrapper module to
instantiate the component top-level module, and applies the component's parameters, for any
parameter whose parameter property HDL_PARAMETER is set to true.
if {$ram == 1} {
add_fileset_file single_clk_ram1.v VERILOG PATH \
single_clk_ram1.v
} else {
add_fileset_file single_clk_ram2.v VERILOG PATH \
single_clk_ram2.v
}
Send Feedback
QPS5V1
6-28 Create a Composed Component or Subsystem 2015.11.02
Related Information
• Specify Synthesis and Simulation Files in the Qsys Component Editor on page 6-11
• Component Interface Tcl Reference on page 9-1
A composition callback replaces the validation and elaboration phases. HDL for the subsystem is
generated by generating all of the sub-components and the top-level that combines them.
To connect instances of your component, you must define the component's interfaces. Unlike an HDL-
based component, a composed component does not directly specify the signals that are exported. Instead,
interfaces of submodules are chosen as the external interface, and each internal interface's ports are
connected through the exported interface.
Exporting an interface means that you are making the interface visible from the outside of your
component, instead of connecting it internally. You can set the EXPORT_OF property of the externally
visible interface from the main program or the composition callback, to indicate that it is an exported
view of the submodule's interface.
Exporting an interface is different than defining an interface. An exported interface is an exact copy of the
subcomponent’s interface, and you are not allowed to change properties on the exported interface. For
example, if the internal interface is a 32-bit or 64-bit master without bursting, then the exported interface
is the same. An interface on a subcomponent cannot be exported and also connected within the
subsystem.
When you create an exported interface, the properties of the exported interface are copied from the
subcomponent’s interface without modification. Ports are copied from the subcomponent’s interface with
only one modification; the names of the exported ports on the composed component are chosen to ensure
that they are unique.
Send Feedback
QPS5V1
2015.11.02 Create a Composed Component or Subsystem 6-29
my_component
altera
reset reset
bridge
altera
clk
clock
bridge
slave pins
my_regs_microcore my_phy_microcore
proc composed_component {} {
add_instance clk altera_clock_bridge
add_instance reset altera_reset_bridge
add_instance regs my_regs_microcore
add_instance phy my_phy_microcore
Send Feedback
QPS5V1
6-30 Create an IP Component with Qsys a System View Different from the... 2015.11.02
Related Information
Component Interface Tcl Reference on page 9-1
Example 6-12: Structural Composition Callback and .qxp File as the Generated Output
To specify a structural representation of the component for Qsys, connect components or
generate a hardware Tcl description of the Qsys system, and then insert the Tcl commands into a
structural composition callback. To invoke the structural composition callback use the command:
set_module_property STRUCTURAL_COMPOSITION_CALLBACK structural_hierarchy
set_module_property STRUCTURAL_COMPOSITION_CALLBACK \
structural_hierarchy
Send Feedback
QPS5V1
2015.11.02 Add Component Instances to a Static or Generated Component 6-31
proc structural_hierarchy {} {
# the simulation files should have the same name for ports as
# exported in structural_hierarchy
Related Information
Create a Composed Component or Subsystem on page 6-28
When you instantiate multiple nested components, you must create a unique variation name for each
component with the add_hdl_instance command. Prefixing a variation name with the parent
Send Feedback
QPS5V1
6-32 Static Components 2015.11.02
component name prevents conflicts in a system. The variation name can be the same across multiple
parent components if the generated parameterization of the nested component is exactly the same.
Note: If you do not adhere to the above naming variation guidelines, Qsys validation-time errors occur,
which are often difficult to debug.
Related Information
• Static Components on page 6-32
• Generated Components on page 6-33
Static Components
Static components always generate the same output, regardless of their parameterization. Components
that instantiate static components must have only static children.
A design file that is static between all parameterizations of a component can only instantiate other static
design files. Since static IPs always render the same HDL regardless of parameterization, Qsys generates
static IPs only once across multiple instantiations, meaning they have the same top-level name set.
Example 6-13: Typical Usage of the add_hdl_instance Command for Static Components
proc elab {} {
# Actual API to instantiate an IP Core
add_hdl_instance emif_instance_name altera_mem_if_ddr3_emif
Example 6-14: Top-Level HDL Instance and Wrapper File Created by Qsys
In this example, Qsys generates a wrapper file for the instance name specified in the _hw.tcl file.
emif_instance_name fixed_name_instantiation_in_top_level(
.pll_ref_clk (input_wire), // pll_ref_clk.clk
Send Feedback
QPS5V1
2015.11.02 Generated Components 6-33
`timescale 1 ps / 1 ps
module emif_instance_name (
input wire pll_ref_clk, // pll_ref_clk.clk
input wire global_reset_n, // global_reset.reset_n
input wire soft_reset_n, // soft_reset.reset_n
output wire afi_clk, // afi_clk.clk
...
...);
example_addhdlinstance_system
_add_hdl_instance_example_0_emif_instance
_name_emif_instance_name emif_instance_name (
Generated Components
A generated component's fileset callback allows an instance of the component to create unique HDL
design files based on the instance's parameter values. For example, you can write a fileset callback to
include a control and status interface based on the value of a parameter. The callback overcomes a
limitation of HDL languages, which do not allow run-time parameters.
Generated components change their generation output (HDL) based on their parameterization. If a
component is generated, then any component that may instantiate it with multiple parameter sets must
also be considered generated, since its HDL changes with its parameterization. This case has an effect that
propagates up to the top-level of a design.
Since generated components are generated for each unique parameterized instantiation, when
implementing the add_hdl_instance command, you cannot use the same fixed name (specified using
instance_name) for the different variants of the child HDL instances. To facilitate unique naming for the
wrapper of each unique parameterized instantiation of child HDL instances, you must use the following
command so that Qsys generates a unique name for each wrapper. You can then access this unique
wrapper name with a fileset callback so that the instances are instantiated inside the component's top-level
HDL.
Send Feedback
QPS5V1
6-34 Generated Components 2015.11.02
Note: You can only use this command with a generated component in the global context, or in an
elaboration callback.
• To obtain auto-generated fixed name with a fileset callback, use the command:
Note: You can only use this command with a fileset callback. This command returns the value of the
auto-generated fixed name, which you can then use to instantiate inside the top-level HDL.
Example 6-15: Typical Usage of the add_hdl_instance Command for Generated Components
Qsys generates a wrapper file for the instance name specified in the _hw.tcl file.
proc elaborate {} {
# replace the top level entity name with the name provided
# during generation
Send Feedback
QPS5V1
2015.11.02 Generated Components 6-35
Example 6-16: Top-Level HDL Instance and Wrapper File Created By Qsys
substitute_autogenerated_emifinstancename_here
fixed_name_instantiation_in_top_level (
.pll_ref_clk (input_wire), // pll_ref_clk.clk
.global_reset_n (input_wire), // global_reset.reset_n
.soft_reset_n (input_wire), // soft_reset.reset_n
...
... );
endmodule
`timescale 1 ps / 1 ps
module generated_toplevel_component_0_emif_instance_name (
input wire pll_ref_clk, // pll_ref_clk.clk
input wire global_reset_n, // global_reset.reset_n
input wire soft_reset_n, // soft_reset.reset_n
output wire afi_clk, // afi_clk.clk
...
...);
example_addhdlinstance_system_add_hdl_instance_example_0_emif
_instance_name_emif_instance_name emif_instance_name (
Related Information
Control File Generation Dynamically with Parameters and a Fileset Callback on page 6-26
Send Feedback
QPS5V1
6-36 Design Guidelines for Adding Component Instances 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Document Revision History 6-37
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
Qsys Interconnect
7
QPS5V1 Subscribe Send Feedback
Qsys interconnect is a high-bandwidth structure that allows you to connect IP components to other IP
components with various interfaces.
Qsys supports Avalon, AMBA AXI3 (version 1.0), AMBA AXI4 (version 2.0), AMBA AXI4-Lite (version
2.0), AMBA AXI4-Stream (version 1.0), and AMBA APB3 (version 1.0) interface specifications.
Note: The video, AMBA AXI and Altera Avalon Interoperation Using Qsys, describes seamless integration
of IP components using the AMBA AXI interface, and the Altera Avalon interface.
Related Information
• Avalon Interface Specifications
• AMBA Specifications
• Creating a System with Qsys on page 5-1
• Creating Qsys Components on page 6-1
• Qsys System Design Components on page 10-1
• AMBA AXI and Altera Avalon Interoperation Using Qsys
Memory-Mapped Interfaces
Qsys supports the implementation of memory-mapped interfaces for Avalon, AXI, and APB protocols.
Qsys interconnect transmits memory-mapped transactions between masters and slaves in packets. The
command network transports read and write packets from master interfaces to slave interfaces. The
response network transports response packets from slave interfaces to master interfaces.
For each component interface, Qsys interconnect manages memory-mapped transfers and interacts with
signals on the connected interface. Master and slave interfaces can implement different signals based on
interface parameterizations, and Qsys interconnect provides any necessary adaptation between them. In
the path between master and slaves, Qsys interconnect may introduce registers for timing synchroniza‐
tion, finite state machines for event sequencing, or nothing at all, depending on the services required by
the interfaces.
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V1
7-2 Memory-Mapped Interfaces 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Memory-Mapped Interfaces 7-3
Figure 7-1: Qsys interconnect for an Avalon-MM System with Multiple Masters
In this example, there are two components mastering the system, a processor and a DMA controller, each
with two master interfaces. The masters connect through the Qsys interconnect to several slaves in the
Qsys system. The dark blue blocks represent interconnect components. The dark grey boxes indicate
items outside of the Qsys system and the Quartus Prime software design, and show how component
interfaces can be exported and connected to external devices.
PCB
Qsys Design S
Processor
in Altera FPGA Control
Instruction Data DMA Controller
M M Read Write
M M
S S S S S
Send Feedback
QPS5V1
7-4 Qsys Packet Format 2015.11.02
The fields of the Qsys packet format are of variable length to minimize resource usage. However, if the majority of
components in a design have a single data width, for example 32-bits, and a single component has a data width of
64-bits, Qsys inserts a width adapter to accommodate 64-bit transfers.
Command Description
Address Specifies the byte address for the lowest byte in the current cycle. There are no
restrictions on address alignment.
Address Sideband Carries “address” sideband signals. The interconnect passes this field from
master to slave. This field is valid for each beat in a packet, even though it is only
produced and consumed by an address cycle.
Up to 8-bit sideband signals are supported for both read and write address
channels.
Data For command packets, carries the data to be written. For read response packets,
carries the data that has been read.
Send Feedback
QPS5V1
2015.11.02 Qsys Packet Format 7-5
Command Description
Byteenable Specifies which symbols are valid. AXI can issue or accept any byteenable
pattern. For compatibility with Avalon, Altera recommends that you use the
following legal values for 32-bit data transactions between Avalon masters and
slaves:
• 1111—Writes full 32 bits
• 0011—Writes lower 2 bytes
• 1100—Writes upper 2 bytes
• 0001—Writes byte 0 only
• 0010—Writes byte 1 only
• 0100—Writes byte 2 only
• 1000—Writes byte 3 only
Source_ID The ID of the master or slave that initiated the command or response.
Destination_ID The ID of the master or slave to which the command or response is directed.
Byte count The number of bytes remaining in the transaction, including this beat. Number
of bytes requested by the packet.
Send Feedback
QPS5V1
7-6 Qsys Packet Format 2015.11.02
Command Description
Burstwrap The burstwrap value specifies the wrapping behavior of the current burst. The
burstwrap value is of the form 2<n> -1. The following types are defined:
• Variable wrap–Variable wrap bursts can wrap at any integer power of 2 value.
When the burst reaches the wrap boundary, it wraps back to the previous
burst boundary so that only the low order bits are used for addressing. For
example, a burst starting at address 0x1C, with a burst wrap boundary of 32
bytes and a burst size of 20 bytes, would write to addresses 0x1C, 0x0, 0x4,
0x8, and 0xC.
• For a burst wrap boundary of size <m>, Burstwrap = <m> - 1, or for this
case Burstwrap = (32 - 1) = 31 which is 25 -1.
• For AXI masters, the burstwrap boundary value (m) is based on the different
AXBURST:
• Burstwrap set to all 1’s. For example, for a 6-bit burstwrap, burstwrap is
6'b111111.
• For WRAP bursts, burstwrap = AXLEN * size – 1.
• For FIXED bursts, burstwrap = size – 1.
• Sequential bursts increment the address for each transfer in the burst. For
sequential bursts, the Burstwrap field is set to all 1s. For example, with a
6-bit Burstwrap field, the value for a sequential burst is 6'b111111 or 63,
which is 26 - 1.
For Avalon masters, Qsys adaptation logic sets a hardwired value for the
burstwrap field, according the declared master burst properties. For example, for
a master that declares sequential bursting, the burstwrap field is set to ones.
Similarly, masters that declare burst have their burstwrap field set to the
appropriate constant value.
AXI masters choose their burst type at run-time, depending on the value of the
AW or ARBURST signal. The interconnect calculates the burstwrap value at run-
time for AXI masters.
Protection Access level protection. When the lowest bit is 0, the packet has normal access.
When the lowest bit is 1, the packet has privileged access. For Avalon-MM
interfaces, this field maps directly to the privileged access signal, which allows an
memory-mapped master to write to an on-chip memory ROM instance. The
other bits in this field support AXI secure accesses and uses the same encoding,
as described in the AXI specification.
QoS QoS (Quality of Service Signaling) is a 4-bit field that is part of the AXI4
interface that carries QoS information for the packet from the AXI master to the
AXI slave.
Transactions from AXI3 and Avalon masters have the default value 4'b0000,
that indicates that they are not participating in the QoS scheme. QoS values are
dropped for slaves that do not support QoS.
Send Feedback
QPS5V1
2015.11.02 Transaction Types for Memory-Mapped Interfaces 7-7
Command Description
Data sideband Carries data sideband signals for the packet. On a write command, the data
sideband directly maps to WUSER. On a read response, the data sideband directly
maps to RUSER. On a write response, the data sideband directly maps to BUSER.
The table below describes the information that each bit transports in the packet format's transaction field.
Bit Name Definition
Qsys Transformations
The memory-mapped master and slave components connect to network interface modules that
encapsulate the transaction in Avalon-ST packets. The memory-mapped interfaces have no information
about the encapsulation or the function of the layer transporting the packets. The interfaces operate in
accordance with memory-mapped protocol and use the read and write signals and transfers.
Send Feedback
QPS5V1
7-8 Interconnect Domains 2015.11.02
Figure 7-2: Transformation when Generating a System with Memory-Mapped and Slave Components
Related Information
• Master Network Interfaces on page 7-11
• Slave Network Interfaces on page 7-13
Interconnect Domains
An interconnect domain is a group of connected memory-mapped masters and slaves that share the same
interconnect. The components in a single interconnect domain share the same packet format.
Send Feedback
QPS5V1
2015.11.02 Using One Domain with Width Adaptation 7-9
Figure 7-3: One Domain with 1:4 and 4:1 Width Adapters
In this system example, there are two 64-bit masters that access two 64-bit slaves. It also includes one 16-
bit master, that accesses two 16-bit slaves and two 64-bit slaves. The 16-bit Avalon master connects
through a 1:4 adapter, then a 4:1 adapter to reach its 16-bit slaves.
1:4 4:1
S S
16-Bit 16-Bit
Avalon-MM Avalon-MM
Slave Slave
S S
64-Bit 64-Bit
Avalon-MM Avalon-MM
Slave Slave
Send Feedback
QPS5V1
7-10 Using Two Separate Domains 2015.11.02
In this system example, Qsys uses two separate domains. The first domain includes two 64-bit masters
connected to two 64-bit slaves. A second domain includes one 16-bit master connected to two 16-bit
slaves. Because the interfaces in Domain 1 and Domain 2 do not share any connections, Qsys can
optimize the packet format for the two separate domains. In this example, the first domain uses a 64-bit
data width and the second domain uses 16-bit data.
Component 1 Component 2
Domain 1 Domain 2
S S S S
64-bit 64-bit 16-bit 16-bit
Avalon-MM Avalon-MM Avalon-MM Avalon-MM
Slave Slave Slave Slave
Send Feedback
QPS5V1
2015.11.02 Master Network Interfaces 7-11
Avalon network interfaces drive default values for the QoS and BUSER, WUSER, and RUSER packet fields in
the master agent, and drop the packet fields in the slave agent.
Note: The response signal from the Limiter to the Agent is optional.
An AXI4 master supports INCR bursts up to 256 beats, QoS signals, and data sideband signals.
Read Command
Router
Avalon-ST
Limiter Network
Write Command
AXI Router (Command)
Master AXI
Master Write Response
Interface Translator
Agent
Read Response
Avalon-ST
Limiter
Network
(Response)
Note: For a complete definition of the optional read response signal, refer to Avalon Memory-Mapped
Interface Signal Types in the Avalon Interface Specifications.
Related Information
• Read and Write Responses on page 7-27
• Avalon Interface Specifications
• Creating a System with Qsys on page 5-1
Send Feedback
QPS5V1
7-12 Avalon-MM Master Agent 2015.11.02
Related Information
Qsys Packet Format on page 7-4
AXI Translator
AXI4 allows some signals to be omitted from interfaces. The translator bridges between these
“incomplete” AXI4 interfaces and the “complete” AXI4 interface on the network interfaces.
The AXI translator is inserted for both AXI4 masters and slaves and performs the following functions:
• Matches ID widths between the master and slave in 1x1 systems.
• Drives default values as defined in the AMBA Protocol Specifications for missing signals.
• Performs lock transaction bit conversion when an AXI3 master connects to an AXI4 slave in 1x1
systems.
Related Information
AMBA Protocol Specifications
Send Feedback
QPS5V1
2015.11.02 APB Translator 7-13
APB Translator
An APB peripheral does not require pslverr signals to support additional signals for the APB debug
interface.
The APB translator is inserted for both the master and slave and performs the following functions:
• Sets the response value default to OKAY if the APB slave does not have a pslverr signal.
• Turns on or off additional signals between the APB debug interface, which is used with HPS (Altera
SoC’s Hard Processor System).
Memory-Mapped Router
The Memory-Mapped Router routes command packets from the master to the slave, and response packets
from the slave to the master. For master command packets, the router uses the address to set the
Destination_ID and Avalon-ST channel. For the slave response packet, the router uses the
Destination_ID to set the Avalon-ST channel. The demultiplexers use the Avalon-ST channel to route
the packet to the correct destination.
Avalon-ST
Overflow Error
Network
(Command) Command
Waitrequest
Slave
Agent Translator
Interface
Response
Avalon-ST
Network
(Response)
Send Feedback
QPS5V1
7-14 Avalon-MM Slave Translator 2015.11.02
An AXI4 slave supports up to 256 beat INCR bursts, QoS signals, and data sideband signals.
Network Interface
Related Information
Slave Network Interfaces on page 7-13
AXI Translator
AXI4 allows some signals to be omitted from interfaces. The translator bridges between these
“incomplete” AXI4 interfaces and the “complete” AXI4 interface on the network interfaces.
The AXI translator is inserted for both AXI4 master and slave, and performs the following functions:
• Matches ID widths between master and slave in 1x1 systems.
• Drives default values as defined in the AMBA Protocol Specifications for missing signals.
• Performs lock transaction bit conversion when an AXI3 master connects to an AXI4 slave in 1x1
systems.
Send Feedback
QPS5V1
2015.11.02 Wait State Insertion 7-15
Wait state insertion logic is a small finate-state machine that translates control signal sequencing between
the slave side and the master side. Qsys interconnect can force a master to wait for the wait state needs of
a slave. For example, arbitration logic in a multi-master system. Qsys generates wait state insertion logic
based on the properties of all slaves in the system.
Wait-State
Insertion
read/write read/write
Logic
wait request
Master Slave
Port address Port
data
Arbitration
When multiple masters contend for access to a slave, Qsys automatically inserts arbitration logic, which
grants access in fairness-based, round-robin order. You can alternatively choose to designate a slave as a
fixed priority arbitration slave, and then manually assign priorities in the Qsys GUI.
Round-Robin Arbitration
When multiple masters contend for access to a slave, Qsys automatically inserts arbitration logic which
grants access in fairness-based, round-robin order.
In a fairness-based arbitration protocol, each master has an integer value of transfer shares with respect to
a slave. One share represents permission to perform one transfer. The default arbitration scheme is equal
Send Feedback
QPS5V1
7-16 Fairness-Based Shares 2015.11.02
share round-robin that grants equal, sequential access to all requesting masters. You can change the
arbitration scheme to weighted round-robin by specifying a relative number of arbitration shares to the
masters that access a particular slave. AXI slaves have separate arbitration for their independent read and
write channels, and the Arbitration Shares setting affects both the read and write arbitration. To display
arbitration settings, right-click an instance on the System Contents tab, and then click Show Arbitration
Shares.
Figure 7-10: Arbitration Shares in the Connections Column
Fairness-Based Shares
In a fairness-based arbitration scheme, each master-to-slave connection provides a transfer share count.
This count is a request for the arbiter to grant a specific number of transfers to this master before giving
control to a different master. One share represents permission to perform one transfer.
Send Feedback
QPS5V1
2015.11.02 Round-Robin Scheduling 7-17
Consider a system with two masters connected to a single slave. Master 1 has its arbitration shares set to
three, and Master 2 has its arbitration shares set to four. Master 1 and Master 2 continuously attempt to
perform back-to-back transfers to the slave. The arbiter grants Master 1 access to the slave for three
transfers, and then grants Master 2 access to the slave for four transfers. This cycle repeats indefinitely.
The figure below describes the waveform for this scenario.
clk
M1_transfer_request
M1_waitrequest
M2_transfer_request
M2_waitrequest
If a master stops requesting transfers before it exhausts its shares, it forfeits all of its remaining shares, and
the arbiter grants access to another requesting master. After completing one transfer, Master 2 stops
requesting for one clock cycle. As a result, the arbiter grants access back to Master 1, which gets a
replenished supply of shares.
clk
M1_transfer_request
M1_waitrequest
M2_transfer_request
M2_waitrequest
Round-Robin Scheduling
When multiple masters contend for access to a slave, the arbiter grants shares in round-robin order. Qsys
includes only requesting masters in the arbitration for each slave transaction.
Send Feedback
QPS5V1
7-18 Designate a Qsys Slave to Use Fixed Priority Arbitration 2015.11.02
connected to a fixed priority slave in the System Contents tab, where the highest numeric value receives
the highest priority. When multiple masters request access to a fixed priority arbitrated slave, the arbiter
gives the master with the highest priority first access to the slave.
For example, when a fixed priority slave receives requests from three masters on the same cycle, the
arbiter grants the master with highest assigned priority first access to the slave, and backpreasures the
other two masters.
Note: When you connect an AXI master to an Avalon-MM slave designated to use a fixed priority
arbitrator, the interconnect instantiates a command-path intermediary round-robin multiplexer in
front of the designated slave.
Send Feedback
QPS5V1
2015.11.02 Fixed Priority Arbitration with AXI Masters and Avalon-MM Slaves 7-19
7. In the System Contents tab, right-click the designated fixed priority slave, and then select Show
Arbitration Shares.
8. For each master connected to the fixed priory arbitration slave, type a numerical arbitration priority in
the box that appears in place of the connection circle.
Figure 7-14: Arbitration Priorities in the Qsys System Contents Tab
9. Right click the designated fixed priority slave and uncheck Show Arbitration Shares to return to the
connection circles.
Send Feedback
QPS5V1
7-20 Memory-Mapped Arbiter 2015.11.02
The red circles indicate placement of the intermediary multiplexer between the AXI master and Avalon-
MM slave due to the separate read and write channels of the AXI master.
Figure 7-15: Intermediary Multiplexer Between AXI Master and Avalon-MM Slave
Memory-Mapped Arbiter
The input to the Memory-Mapped Arbiter is the command packet for all masters requesting access to a
particular slave. The arbiter outputs the channel number for the selected master. This channel number
controls the output of a multiplexer that selects the slave device. The figure below illustrates this logic.
Send Feedback
QPS5V1
2015.11.02 Memory-Mapped Arbiter 7-21
In this example, four Avalon-MM masters connect to four Avalon-MM slaves. In each cycle, an arbiter
positioned in front of each Avalon-MM slave selects among the requesting Avalon-MM masters.
Logic included in the Avalon-ST Command Network
Master 0
Command
Arbiter
packet for
for
master 0
slave 0
Master 1
Command
packet for
master 1 Selected request
Arbiter
Arbiter
for
for
slave
slave 11
Selected request
Master 2
Command Arbiter
packet for for
master 2 slave 2
Master 3
Command
packet for Selected request
master 3
Arbiter
for
slave 3
Selected request
Note: If you specify a Limit interconnect pipeline stages to parameter greater than zero, the output of
the Arbiter is registered. Registering this output reduces the amount of combinational logic
between the master and the interconnect, increasing the fMAX of the system.
Note: You can use the Memory-Mapped Arbiter for both round-robin and fixed priority arbitration.
Send Feedback
QPS5V1
7-22 Datapath Multiplexing Logic 2015.11.02
readdata1
Slave
address Port 1
Data
readdata Master writedata
Path
Multiplexer Port
control
Slave
Port 2
readdata2
Width Adaptation
Qsys width adaptation converts between Avalon memory-mapped master and slaves with different data
and byte enable widths, and manages the run-time size requirements of AXI. Width adaptation for AXI to
Avalon interfaces is also supported.
Send Feedback
QPS5V1
2015.11.02 AXI Wide-to-Narrow Adaptation 7-23
This adapter assumes that the field ordering of the input and output packets is the same, with the only
difference being the width of the data and accompanying byte enable fields. When the width adapter
converts from wide data to narrow data, the narrower data is transmitted over several beats. The first
output beat contains the lowest addressed segment of the input data and byte enables.
clock
addr_in[7:0] 08
Adapter
Input
byteenable_in[3:0] C
wide_data[31:0] AABBCCDD
addr_out[7:0] 08 09 0A 0B
Adapter byteenable_out[3:0] 0 0 1 1
Output
narrow_data[7:0] DD CC BB AA
write
Incrementing If the transaction size is less than or equal to the output width, the burst is unmodified.
Otherwise, it is converted to an incrementing burst with a larger length and size equal
to the output width.
If the resulting burst is unsuitable for the slave, the burst is converted to multiple
sequential bursts of the largest allowable lengths. For example, for a 2:1 downsizing
ratio, an INCR9 burst is converted into INCR16 + INCR2 bursts. This is true if the
maximum burstcount a slave can accept is 16, which is the case for AXI3 slaves.
Avalon slaves have a maximum burstcount of 64.
Send Feedback
QPS5V1
7-24 AXI Narrow-to-Wide Adaptation 2015.11.02
Wrapping If the transaction size is less than or equal to the output width, the burst is unmodified.
Otherwise, it is converted to a wrapping burst with a larger length, with a size equal to
the output width.
If the resulting burst is unsuitable for the slave, the burst is converted to multiple
sequential bursts of the largest allowable lengths; respecting wrap boundaries. For
example, for a 2:1 downsizing ratio, a WRAP16 burst is converted into two or three INCR
bursts, depending on the address.
Fixed If the transaction size is less than or equal to the output width, the burst is unmodified.
Otherwise, it is converted into repeated sequential bursts over the same addresses. For
example, for a 2:1 downsizing ratio, a FIXED single burst is converted into an INCR2
burst.
Incrementing The burst (and its response) passes through unmodified. Data and write strobes are
placed in the correct output segment.
Burst Adapter
Qsys interconnect uses the memory-mapped burst adapter to accommodate the burst capabilities of each
interface in the system, including interfaces that do not support burst transfers.
The maximum burst length for each interface is a property of the interface and is independent of other
interfaces in the system. Therefore, a particular master may be capable of initiating a burst longer than a
slave’s maximum supported burst length. In this case, the burst adapter translates the large master burst
into smaller bursts, or into individual slave transfers if the slave does not support bursting. Until the
master completes the burst, arbiter logic prevents other masters from accessing the target slave. For
example, if a master initiates a burst of 16 transfers to a slave with maximum burst length of 8, the burst
adapter initiates 2 bursts of length 8 to the slave.
Avalon-MM and AXI burst transactions allow a master uninterrupted access to a slave for a specified
number of transfers. The master specifies the number of transfers when it initiates the burst. Once a burst
begins between a master and slave, arbiter logic is locked until the burst completes. For burst masters, the
length of the burst is the number of cycles that the master has access to the slave, and the selected arbitra‐
tion shares have no effect.
Note: AXI masters can issue burst types that Avalon cannot accept, for example, fixed bursts. In this case,
the burst adapter converts the fixed burst into a sequence of transactions to the same address.
Send Feedback
QPS5V1
2015.11.02 Burst Adapter Implementation Options 7-25
Note: For AXI4 slaves, Qsys allows 256-beat INCR bursts. You must ensure that 256-beat narrow-sized
INCR bursts are shortened to 16-beat narrow-sized INCR bursts for AXI3 slaves.
Avalon-MM masters always issue addresses that are aligned to the size of the transfer. However, when
Qsys uses a narrow-to-wide width adaptation, the resulting address may be unaligned. For unaligned
addresses, the burst adapter issues the maximum sized bursts with appropriate byte enables. This brings
the burst-in-progress up to an aligned slave address. Then, it completes the burst on aligned addresses.
The burst adapter supports variable wrap or sequential burst types to accommodate different properties of
memory-mapped masters. Some bursting masters can issue more than one burst type.
Burst adaptation is available for Avalon to Avalon, Avalon to AXI, and AXI to Avalon, and AXI to AXI
connections. For information about AXI-to-AXI adaptation, refer to AXI Wide-to-Narrow Adaptation
Note: For AXI4 to AXI3 connections, Qsys follows an AXI4 256 burst length to AXI3 16 burst length.
• Generic converter (slower, lower area)—Default. Controls all burst conversions with a single
converter that is able to adapt incoming burst types. This results in an adapter that has lower fmax, but
smaller area.
• Per-burst-type converter (faster, higher area)—Controls incoming bursts with a particular converter,
depending on the burst type. This results in an adapter that has higher fmax, but higher area. This
setting is useful when you have AXI masters or slaves and you want a higher fmax.
Note: For more information about the Interconnect Requirements tab, refer to Creating a System with
Qsys.
Related Information
Creating a System with Qsys on page 5-1
Send Feedback
QPS5V1
7-26 Burst Adaptation: AXI to Avalon 2015.11.02
Entries specify the behavior when converting between AXI and Avalon burst types.
Burst Type Behavior
Fixed Fixed bursts are converted to sequential bursts of length 1 that repeatedly access
the same address.
Narrow All narrow-sized bursts are broken into multiple bursts of length 1.
Entries specify the behavior when converting between Avalon and AXI burst types.
Burst Type Definition
Sequential Bursts of length greater than16 are converted to multiple INCR bursts of a length
less than or equal to16. Bursts of length less than or equal to16 are not converted.
Send Feedback
QPS5V1
2015.11.02 Read and Write Responses 7-27
Wrapping Only Avalon masters with alwaysBurstMaxBurst = true are supported. The
WRAP burst is passed through if the length is less than or equal to16. Otherwise,
it is converted to two or more INCR bursts that respect the transaction's wrap
boundary.
GENERIC_CONVERTER Controls all burst conversions with a single converter that is able to adapt all
incoming burst types. This results in an adapter that has smaller area, but lower
fMax.
Adaptation between a master with write responses and a slave without write responses can be costly,
especially if there are multiple slaves, or the slave supports bursts. To minimize the cost of logic between
slaves, consider placing the slaves that do not have write responses behind a bridge so that the write
response adaptation logic cost is only incurred once, at the bridge’s slave interface.
The following table describes what happens when there is a mismatch in response support between the
master and slave.
Figure 7-19: Mismatched Master and Slave Response Support
Master without Master ignores responses from No need for responses. Master,
Response the slave. slave, and interconnect operate
without response support.
Note: If there is a bridge between the master and the endpoint slave, and the responses must come from
the endpoint slave, ensure that the bridge passes the appropriate response signals through from the
endpoint slave to the master.
If the bridge does not support responses, then the responses are generated by the interconnect at
the slave interface of the bridge, and responses from the endpoint slave are ignored.
Send Feedback
QPS5V1
7-28 Qsys Address Decoding 2015.11.02
For the response case where the transaction violates security settings or uses an illegal address, the
interconnect routes the transactions to the default slave. For information about Qsys system security and
how to specify a default slave, refer to Creating a System with Qsys.
Note: Avalon-MM slaves without a response signal are not able to notify a connected master that a
transaction has not completed successfully. As a result, Qsys interconnect generates an OKAY
response on behalf of the Avalon-MM slave.
Related Information
• Master Network Interfaces on page 7-11
• Error Correction Coding (ECC) in Qsys Interconnect on page 7-69
• Avalon-MM Interface Signal Roles
• Interface Properties
In this example, Qsys generates separate address decoding logic for each master in a system. The address
decoding logic processes the difference between the master address width (<M> ) and the individual slave
address widths (<S >) and (<T >). The address decoding logic also maps only the necessary master address
bits to access words in each slave’s address space.
read/write
Slave
address [M..0] Address address [S..0]
Port 1
Master Decoding (8-bit)
Port Logic
read/write
Slave
address [T..2] Port 2
(32-bit)
Send Feedback
QPS5V1
2015.11.02 Avalon Streaming Interfaces 7-29
Qsys controls the base addresses with the Base setting of active components on the System Contents tab.
The base address of a slave component must be a multiple of the address span of the component. This
restriction is part of the Qsys interconnect to allow the address decoding logic to be efficient, and to
achieve the best possible fMAX.
Send Feedback
QPS5V1
7-30 Avalon Streaming Interfaces 2015.11.02
ready ready
Data
Data valid Data Data valid Data
Source
Source channel Sink Source channel Sink
data data
Send Feedback
QPS5V1
2015.11.02 Avalon-ST Adapters 7-31
This source-sink pair includes only the data signal. The sink must be able to receive data as soon as the
source interface comes out of reset.
data
Data Source Data Sink
Figure 7-24: Signals Indicating the Start and End of Packets, Channel Numbers, Error Conditions, and
Backpressure
All data transfers using Avalon-ST interconnect occur synchronously on the rising edge of the associated
clock interface. Throughput and frequency of a system depends on the components and how they are
connected.
ready
valid
channel
startof packet
Data Source endofpacket
Data Sink
empty
error
data
The IP Catalog includes a number of Avalon-ST components that you can use to create datapaths,
including datapaths whose input and output streams have different properties. Generated systems that
include memory-mapped master and slave components may also use these Avalon-ST components
because Qsys generation creates interconnect with a structure similar to a network topology, as described
in Qsys Transformations. The following sections introduce the Avalon-ST components.
Related Information
• Avalon-ST Adapters on page 7-31
• Qsys Transformations on page 7-7
• Avalon Interface Specification
Avalon-ST Adapters
Qsys automatically adds Avalon-ST adapters between two components during system generation when it
detects mismatched interfaces. If you connect mismatched Avalon-ST sources and sinks, for example, a
Send Feedback
QPS5V1
7-32 Avalon-ST Adapter 2015.11.02
32-bit source and an 8-bit sink, Qsys inserts the appropriate adapter type to connect the mismatched
interfaces.
After generation, you can view the inserted adapters with the Show System With Qsys Interconnect
command in the System menu. For each mismatched source-sink pair, Qsys inserts an Avalon-ST
Adapter. The adapter instantiates the necessary adaptation logic as sub-components. You can review the
logic for each adapter instantiation in the Hierarchy view by expanding each adapter's source and sink
interface and comparing the relevant ports. For example, to determine why a channel adapter is inserted,
expand the channel adapter's sink and source interfaces and review the channel port properties for each
interface.
You can turn off the auto-inserted adapters feature by adding the
qsys_enable_avalon_streaming_transform=off command to the quartus.ini file. When you turn off
the auto-inserted adapters feature, if mismatched interfaces are detected during system generation, Qsys
does not insert adapters and reports the mismatched interface with validation error message.
Note: The auto-inserted adapters feature does not work for video IP core connections.
Avalon-ST Adapter
The Avalon-ST adapter combines the logic of the channel, error, data format, and timing adapters. The
Avalon-ST adapter provides adaptations between interfaces that have mismatched Avalon-ST endpoints.
Based on the source and sink interface parameterizations for the Avalon-ST adapter, Qsys instantiates the
necessary adapter logic (channel, error, data format, or timing) as hierarchal sub-components.
Table 7-7: Avalon-ST Adapter Parameters Common to Source and Sink Interfaces
Send Feedback
QPS5V1
2015.11.02 Avalon-ST Adapter Downstream Sink Interface Parameters 7-33
Source Uses Ready Port Indicates whether the sink interface uses the ready port, and if set,
configures the source interface to use the ready port.
Source Ready Latency Specifies what ready latency to expect from the source interface
connected to the adapter's sink interface.
Sink Uses Empty Port Indicates whether the sink interface connected to the source interface
uses the empty port, and whether the source interface should also use
the empty port.
Sink Empty Port Width Indicates the bit width of the empty port on the sink interface
connected to the source interface, and configures a corresponding
empty port on the source interface.
Sink Uses Valid Port Indicates whether the sink interface connected to the source interface
uses the valid port, and if set, configures the source interface to use
the valid port.
Sink Uses Ready Port Indicates whether the ready port on the sink interface is connected to
the source interface , and if set, configures the sink interface to use the
ready port.
Send Feedback
QPS5V1
7-34 Channel Adapter 2015.11.02
Channel Adapter
The channel adapter provides adaptations between interfaces that have different channel signal widths.
The source uses channels, but the sink does not. Qsys gives a warning at generation time. The
adapter provides a simulation error and signals an
error for data for any channel from the source other
than 0.
The sink has channel, but the source does not. Qsys gives a warning at generation time, and the
channel inputs to the sink are all tied to a logical 0.
The source and sink both support channels, and the The source's channel is connected to the sink's
source's maximum channel number is less than the channel unchanged. If the sink's channel signal has
sink's maximum channel number. more bits, the higher bits are tied to a logical 0.
The source and sink both support channels, but the The source’s channel is connected to the sink’s
source's maximum channel number is greater than channel unchanged. If the source’s channel signal
the sink's maximum channel number. has more bits, the higher bits are left unconnected.
Qsys gives a warning that channel information may
be lost.
An adapter provides a simulation error message and
an error indication if the value of channel from the
source is greater than the sink's maximum number
of channels. In addition, the valid signal to the sink
is deasserted so that the sink never sees data for
channels that are out of range.
Channel Signal Width (bits) Width of the input channel signal in bits
Send Feedback
QPS5V1
2015.11.02 Avalon-ST Channel Adapter Output Interface Parameters 7-35
Channel Signal Width (bits) Width of the output channel signal in bits.
Table 7-13: Avalon-ST Channel Adapter Common to Input and Output Interface Parameters
Data Bits Per Symbol Number of bits for each symbol in a transfer.
Support Backpreasure with the ready signal Indicates whether a ready signal is required.
Ready Latency Specifies the ready latency to expect from the sink
connected to the module's source interface.
Error Signal Description A list of strings that describes what each bit of the
error signal represents.
Send Feedback
QPS5V1
7-36 Data Format Adapter 2015.11.02
The source and sink’s bits per The connection cannot be made.
symbol parameters are different.
The source and sink have a The adapter converts the source's width to the sink’s width.
different number of symbols per
If the adaptation is from a wider to a narrower interface, a beat of data
beat.
at the input corresponds to multiple beats of data at the output. If the
input error signal is asserted for a single beat, it is asserted on output
for multiple beats.
If the adaptation is from a narrow to a wider interface, multiple input
beats are required to fill a single output beat, and the output error is
the logical OR of the input error signal.
The source uses the empty signal, Qsys cannot make the connection.
but the sink does not use the
empty signal.
Send Feedback
QPS5V1
2015.11.02 Avalon-ST Data Format Adapter Input Interface Parameters 7-37
In this example, the data format adapter allows a connection between a 128-bit output data stream and
three 32-bit input data streams.
Data
128 Bits 32 Bits 32-Bit TX
Format
Adapter Interface
Send Feedback
QPS5V1
7-38 Avalon-ST Data Format Adapter Common to Input and Output Interface... 2015.11.02
Avalon-ST Data Format Adapter Common to Input and Output Interface Parameters
Table 7-17: Avalon-ST Data Format Adapter Common to Input and Output Interface Parameters
Data Bits Per Symbol Number of bits for each symbol in a transfer.
Include Packet Support When the Avalon-ST Data Format adapter supports
packets, Qsys uses startofpacket, endofpacket, and
empty signals.
Channel Signal Width (bits) Width of the output channel signal in bits.
Read Latency Specifies the ready latency to expect from the sink
connected to the module's source interface.
Error Signal Width (bits) Width of the error signal output in bits.
Error Signal Description A list of strings that describes what each bit of the error
signal represents.
Error Adapter
The error adapter ensures that per-bit-error information provided by the source interface is correctly
connected to the sink interface’s input error signal. Error conditions that both the source and sink are able
to process are connected. If the source has an error signal representing an error condition that is not
supported by the sink, the signal is left unconnected; the adapter provides a simulation error message and
an error indication if the error is asserted. If the sink has an error condition that is not supported by the
source, the sink's input error bit corresponding to that condition is set to 0.
Note: The output interface error signal descriptor accepts an error set with an other descriptor. Qsys
assigns the bit-wise ORing of all input error bits that are unmatched, to the output interface error
bits set with the other descriptor.
Error Signal Width (bits) The width of the error signal. Valid values are 0–256 bits. Type 0 if the
error signal is not used.
Error Signal Description The description for each of the error bits. If scripting, separate the
description fields by commas. For a successful connection, the descrip‐
tion strings of the error bits in the source and sink must match and are
case sensitive.
Send Feedback
QPS5V1
2015.11.02 Avalon-ST Error Adapter Output Interface Parameters 7-39
Error Signal Width (bits) The width of the error signal. Valid values are 0–256 bits.
Type 0 if you do not need to send error values.
Error Signal Description The description for each of the error bits. Separate the
description fields by commas. For successful connection, the
description of the error bits in the source and sink must
match, and are case sensitive.
Table 7-20: Avalon-ST Error Adapter Common to Input and Output Interface Parameters
Support Backpressure with the ready signal Turn on this option to add the backpressure function‐
ality to the interface.
Ready Latency When the ready signal is used, the value for ready_
latency indicates the number of cycles between
when the ready signal is asserted and when valid data
is driven.
Channel Signal Width (bits) The width of the channel signal. A channel width of 4
allows up to 16 channels. The maximum width of the
channel signal is eight bits. Set to 0 if channels are
not used.
Include Empty Signal Turn this option on if the cycle that includes the
endofpacket signal can include empty symbols. This
signal is not necessary if the number of symbols per
beat is 1.
Send Feedback
QPS5V1
7-40 Timing Adapter 2015.11.02
Timing Adapter
The timing adapter allows you to connect component interfaces that require a different number of cycles
before driving or receiving data. This adapter inserts a FIFO buffer between the source and sink to buffer
data or pipeline stages to delay the back pressure signals. You can also use the timing adapter to connect
interfaces that support the ready signal, and those that do not. The timing adapter treats all signals other
than the ready and valid signals as payload, and simply drives them from the source to the sink.
Condition Adaptation
The source has ready, but the sink does not. In this case, the source can respond to backpres-
sure, but the sink never needs to apply it. The
ready input to the source interface is connected
directly to logical 1.
The source does not have ready, but the sink does. The sink may apply backpressure, but the source is
unable to respond to it. There is no logic that the
adapter can insert that prevents data loss when the
source asserts valid but the sink is not ready. The
adapter provides simulation time error messages if
data is lost. The user is presented with a warning,
and the connection is allowed.
The source and sink both support backpressure, but The source responds to ready assertion or deasser‐
the sink’s ready latency is greater than the source's. tion faster than the sink requires it. A number of
pipeline stages equal to the difference in ready
latency are inserted in the ready path from the sink
back to the source, causing the source and the sink
to see the same cycles as ready cycles.
The source and sink both support backpressure, but The source cannot respond to ready assertion or
the sink’s ready latency is less than the source's. deassertion in time to satisfy the sink. A FIFO
whose depth is equal to the difference in ready
latency is inserted to compensate for the source’s
inability to respond in time.
Support Backpreasure with the ready signal Indicates whether a ready signal is required.
Read Latency Specifies the ready latency to expect from the sink
connected to the module's source interface.
Send Feedback
QPS5V1
2015.11.02 Avalon-ST Timing Adapter Output Interface Parameters 7-41
Include Valid Signal Indicates whether the sink interface requires a valid
signal.
Support Backpreasure with the ready signal Indicates whether a ready signal is required.
Read Latency Specifies the ready latency to expect from the sink
connected to the module's source interface.
Include Valid Signal Indicates whether the sink interface requires a valid
signal.
Table 7-24: Avalon-ST Timing Adapter Common to Input and Output Interface Parameters
Data Bits Per Symbol Number of bits for each symbol in a transfer.
Include Empty Signal Turn this option on if the cycle that includes the
endofpacket signal can include empty symbols. This
signal is not necessary if the number of symbols per
beat is 1.
Channel Signal Width (bits) Width of the output channel signal in bits.
Error Signal Width (bits) Width of the output error signal in bits.
Send Feedback
QPS5V1
7-42 Interrupt Interfaces 2015.11.02
Interrupt Interfaces
Using individual requests, the interrupt logic can process up to 32 IRQ inputs connected to each interrupt
receiver. With this logic, the interrupt sender connected to interrupt receiver_0 is the highest priority
with sequential receivers being successively lower priority. You can redefine the priority of interrupt
senders by instantiating the IRQ mapper component. For more information refer to IRQ Mapper.
You can define the interrupt sender interface as asynchronous with no associated clock or reset interfaces.
You can also define the interrupt receiver interface as asynchronous with no associated clock or reset
interfaces. As a result, the receiver does its own synchronization internally. Qsys does not insert interrupt
synchronizers for such receivers.
For clock crossing adaption on interrupts, Qsys inserts a synchronizer, which is clocked with the interrupt
end point interface clock when the corresponding starting point interrupt interface has no clock or a
different clock (than the end point). Qsys inserts the adapter if there is any kind of mismatch between the
start and end points. Qsys does not insert the adapter if the interrupt receiver does not have an associated
clock.
Related Information
IRQ Mapper on page 7-44
Send Feedback
QPS5V1
2015.11.02 Assigning IRQs in Qsys 7-43
IRQs simultaneously, the receiver logic determines which IRQ has highest priority, and then responds
appropriately.
Figure 7-26: Interrupt Controller Mapping IRQs
Using individual requests, the interrupt controller can process up to 32 IRQ inputs. The interrupt
controller generates a 32-bit signal irq[31:0] to the receiver, and maps slave IRQ signals to the bits of
irq[31:0]. Any unassigned bits of irq[31:0] are disabled.
Sender irq
1
Interrupt
Controller
irq0
Sender irq
irq1
2
irq2
irq3
irq4 Receiver
irq5
Sender irq
irq6
3
irq31
Sender irq
4
IRQ Bridge
The IRQ Bridge allows you to route interrupt wires between Qsys subsystems.
Send Feedback
QPS5V1
7-44 IRQ Mapper 2015.11.02
The peripheral subsystem example below has three interrupt senders that are exported to the to- level of
the subsystem. The interrupts are then routed to the CPU subsystem using the IRQ bridge.
3-bit bus
IR export
IRQ Bridge
export export export
IS
IS IS IS Interrupt
Sender 4
Interrupt Interrupt Interrupt IS
Sender 1 Sender 2 Sender 3
Peripheral Subsystem
4-bit bus
IR
Nios II
Processor
CPU Subsystem
Note: Nios II BSP tools support the IRQ Bridge. Interrupts connected via an IRQ Bridge appear in the
generated system.h file. You can use the following properties with the IRQ Bridge, which do not
effect Qsys interconnect generation. Qsys uses these properties to generate the correct IRQ
information for downstream tools:
• set_interface_property <sender port> bridgesToReceiver <receiver port>—The <sender
port> of the IP generates a signal that is received on the IP's <receiver port>. Sender ports are
single bits. Receivers ports can be multiple bits. Qsys requires the bridgedReceiverOffset
property to identify the <receiver port> bit that the <sender port> sends.
• set_interface_property <sender port> bridgedReceiverOffset <port number>—
Indicates the <port number> of the receiver port that the <sender port> sends.
IRQ Mapper
Qsys inserts the IRQ Mapper automatically during generation. The IRQ Mapper converts individual
interrupt wires to a bus, and then maps the appropriate IRQ priority number onto the bus.
Send Feedback
QPS5V1
2015.11.02 IRQ Clock Crosser 7-45
By default, the interrupt sender connected to the receiver0 interface of the IRQ mapper is the highest
priority, and sequential receivers are successively lower priority. You can modify the interrupt priority of
each IRQ wire by modifying the IRQ priority number in Qsys under the IRQ column. The modified
priority is reflected in the IRQ_MAP parameter for the auto-inserted IRQ Mapper.
Figure 7-28: IRQ Column in Qsys
Circled in the IRQ column are the default interrupt priorities allocated for the CPU subsystem.
Related Information
IRQ Bridge on page 7-43
Clock Interfaces
Clock interfaces define the clocks used by a component. Components can have clock inputs, clock
outputs, or both. To update the clock frequency of the component, use the Parameters tab for the clock
source.
Send Feedback
QPS5V1
7-46 (High Speed Serial Interface) HSSI Clock Interfaces 2015.11.02
The Clock Source parameters allows you to set the following options:
• Clock frequency—The frequency of the output clock from this clock source.
• Clock frequency is known— When turned on, the clock frequency is known. When turned off, the
frequency is set from outside the system.
Note: If turned off, system generation may fail because the components do not receive the necessary
clock information. For best results, turn this option on before system generation.
• Reset synchronous edges
• None—The reset is asserted and deasserted asynchronously. You can use this setting if you have
internal synchronization circuitry that matches the reset required for the IP in the system.
• Both—The reset is asserted and deasserted synchronously.
• Deassert—The reset is deasserted synchronously and asserted asynchronously.
For more information about synchronous design practices, refer to Recommended Design Practices
Related Information
Recommended Design Practices on page 11-1
You can connect the HSSI Serial Clock Source to multiple HSSI Serial Clock Sinks because the HSSI Serial
Clock Source supports multiple fan-outs. This Interface has a single clk port role limited to a 1 bit width,
and a clockRate parameter, which is the frequency of the clock driven by the HSSI Serial Clock Source
interface.
An unconnected and unexported HSSI Serial Source is valid and does not generate error messages.
Send Feedback
QPS5V1
2015.11.02 HSSI Serial Clock Sink 7-47
You can connect the HSSI Serial Clock Sink interface to a single HSSI Serial Clock Source interface; you
cannot connect it to multiple sources. This Interface has a single clk port role limited to a 1 bit width, and
a clockRate parameter, which is the frequency of the clock driven by the HSSI Serial Clock Source
interface.
An unconnected and unexported HSSI Serial Sink is invalid and generates error messages.
Send Feedback
QPS5V1
7-48 HSSI Serial Clock Example 2015.11.02
proc elaborate {} {
# declaring HSSI Serial Clock Source
add_interface my_clock_start hssi_serial_clock start
set_interface_property my_clock_start ENABLED true
Send Feedback
QPS5V1
2015.11.02 HSSI Bonded Clock Interface 7-49
You can connect the HSSI Bonded Clock Source to multiple HSSI Bonded Clock Sinks because the HSSI
Serial Clock Source supports multiple fanouts. This Interface has a single clk port role limited to a width
range of 1 to 1024 bits. The HSSI Bonded Clock Source interface has two parameters: clockRate and
serialzationFactor. clockRate is the frequency of the clock driven by the HSSI Bonded Clock Source
interface, and the serializationFactor is the parallel data width that operates the HSSI TX serializer. The
serialization factor determines the required frequency and phases of the individual clocks within the HSSI
Bonded Clock interface
An unconnected and unexported HSSI Bonded Source is valid and does not generate error messages.
serialization long 0 No The serialization factor is the parallel data width that
operates the HSSI TX serializer. The serialization factor
determines the necessary frequency and phases of the
individual clocks within the HSSI Bonded Clock
interface.
You can connect the HSSI Bonded Clock Sink interface to a single HSSI Bonded Clock Source interface;
you cannot connect it to multiple sources. This Interface has a single clk port role limited to a width range
of 1 to 1024 bits. The HSSI Bonded Clock Source interface has two parameters: clockRate and serialza‐
Send Feedback
QPS5V1
7-50 HSSI Bonded Clock Connection 2015.11.02
tionFactor. clockRate is the frequency of the clock driven by the HSSI Bonded Clock Source interface,
and the serialization factor is the parallel data width that operates the HSSI TX serializer. The serialization
factor determines the required frequency and phases of the individual clocks within the HSSI Bonded
Clock interface
An unconnected and unexported HSSI Bonded Sink is invalid and generates error messages.
serialization long 0 No The serialization factor is the parallel data width that
operates the HSSI TX serializer. The serialization factor
determines the necessary frequency and phases of the
individual clocks within the HSSI Bonded Clock
interface.
Send Feedback
QPS5V1
2015.11.02 HSSI Bonded Clock Example 7-51
proc elaborate {} {
add_interface my_clock_start hssi_bonded_clock start
set_interface_property my_clock_start ENABLED true
If you use the components in a hierarchy, for example, instantiated in a composed component, you can
declare the connections as illustrated in this example.
Send Feedback
QPS5V1
7-52 Reset Interfaces 2015.11.02
Reset Interfaces
Reset interfaces provide both soft and hard reset functionality. Soft reset logic typically re-initializes
registers and memories without powering down the device. Hard reset logic initializes the device after
power-on. You can define separate reset sources for each clock domain, a single reset source for all clocks,
or any combination in between.
You can choose to create a single global reset domain by selecting Create Global Reset Network on the
System menu. If your design requires more than one reset domain, you can implement your own reset
logic and connectivity. The IP Catalog includes a reset controller, reset sequencer, and a reset bridge to
implement the reset functionality. You can also design your own reset logic.
Note: If you design your own reset circuitry, you must carefully consider situations which may result in
system lockup. For example, if an Avalon-MM slave is reset in the middle of a transaction, the
Avalon-MM master may lockup.
Reset Controller
Qsys automatically inserts a reset controller block if the input reset source does not have a reset request,
but the connected reset sink requires a reset request.
The Reset Controller has the following parameters that you can specify to customize its behavior:
• Number of inputs— Indicates the number of individual reset interfaces the controller ORs to create a
signal reset output.
• Output reset synchronous edges—Specifies the level of synchronization. You can select one the
following options:
• None—The reset is asserted and deasserted asynchronously. You can use this setting if you have
designed internal synchronization circuitry that matches the reset style required for the IP in the
system.
• Both—The reset is asserted and deasserted synchronously.
• Deassert—The reset is deasserted synchronously and asserted asynchronously.
• Synchronization depth—Specifies the number of register stages the synchronizer uses to eliminate the
propagation of metastable events.
• Reset request—Enables reset request generation, which is an early signal that is asserted before reset
assertion. The reset request is used by blocks that require protection from asynchronous inputs, for
example, M20K blocks.
Send Feedback
QPS5V1
2015.11.02 Reset Bridge 7-53
Reset Bridge
The Reset Bridge allows you to use a reset signal in two or more subsystems of your Qsys system. You can
connect one reset source to local components, and export one or more to other subsystems, as required.
The Reset Bridge parameters are used to describe the incoming reset and include the following options:
• Active low reset—When turned on, reset is asserted low.
• Synchronous edges—Specifies the level of synchronization and includes the following options:
• None—The reset is asserted and deasserted asynchronously. Use this setting if you have internal
synchronization circuitry.
• Both—The reset is asserted and deasserted synchronously.
• Deassert—The reset is deasserted synchronously, and asserted asynchronously.
• Number of reset outputs—The number of reset interfaces that are exported.
Note: Qsys supports multiple reset sink connections to a single reset source interface. However, there are
situations in composed systems where an internally generated reset must be exported from the
composed system in addition to being used to connect internal components. In this situation, you
must declare one reset output interface as an export, and use another reset output to connect
internal components.
Reset Sequencer
The Reset Sequencer allows you to control the assertion and de-assertion sequence for Qsys system resets.
The Parameter Editor displays the expected assertion and de-assertion sequences based on the current
settings. You can connect multiple reset sources to the reset sequencer, and then connect the output of the
reset sequencer to components in the system.
Send Feedback
QPS5V1
7-54 Reset Sequencer Parameters 2015.11.02
Reset Sequencer
Avalon CSR_MASK/PVR
Interface CSR_CONTROL(csr_*)
CSR
reset_logging
Parameter:
Sync ASRT_DELAY(0:N)
Sync
Sync
Sync assrt_en
reset_in0 enable set_reset[ N :0] reset_out0
reset_in1 Reset reset_in_sync Main ASRT SEQ reset_out1
done
reset_in2 enable RESET_OUT reset_out2
Controller FSM DSRT SEQ
reset_in M done reset_out N
dr_reset[ N :0]
reset_dsrt_qual0
reset_dsrt_qual1 Deglitch
reset_dsrt_qual2 Deglitch
Deglitch
reset_dsrt_qual N Deglitch
Parameter Description
Number of reset outputs Sets the number of output resets to be sequenced, which is the
number of output reset signals defined in the component with a
range of 2 to 10.
Number of reset inputs Sets the number of input reset signals to be sequenced, which is
the number of input reset signals defined in the component with a
range of 1 to 10.
Minimum reset assertion time Specifies the minimum assertion cycles between the assertion of
the last sequenced reset, and the de-assertion of the first
sequenced reset. The range is 0 to 1023.
Send Feedback
QPS5V1
2015.11.02 Reset Sequencer Parameters 7-55
Parameter Description
Enable Reset Sequencer CSR Enables CSR functionality of the Reset Sequencer through an
Avalon interface.
reset_out# Lists the reset output signals. Set the parameters in the other
columns for each reset signal in the table.
ASRT Seq# Determines the order of reset assertion. Enter the values 1, 2, 3,
etc. to specify the required non-overlapping assertion order. This
value determines the ASRT_REMAP value in the component HDL.
ASRT Cycle# Number of cycles to wait before assertion of the reset. The value
set here corresponds to the ASRT_DELAY value in the component
HDL.The range is 0 to1023.
DSRT Seq# Determines the reset order of reset de-assertion. Enter the values
1, 2, 3, etc .to specify the required non-overlapping de-assertion
order. This value determines the DSRT_REMAP value in the
component HDL.
DSRT Cycle#/Deglitch# Number of cycles to wait before de-asserting or de-glitching the
reset. If the USE_DRST_QUAL parameter is set to 0, specifies the
number of cycles to wait before de-asserting the reset. If USE_
DSRT_QUAL is set to1, specifies the number of cycles to deglitch
the input reset_dsrt_qual signal. This value determines either
the DSRT_DELAY, or the DSRT_QUALCNT value in the component
HDL, depending on the USE_DSRT_QUAL parameter setting.
The range is 0 to 1023.
USE_DSRT_QUAL If you set USE_DSRT_QUAL to 1, the de-assertion sequence
waits for an external input signal for sequence qualification
instead of waiting for a fixed delay count. To use a fixed delay
count for de-assertion, set this parameter to 0.
Send Feedback
QPS5V1
7-56 Reset Sequencer Timing Diagrams 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Reset Sequencer Status Register Offset 0x00 7-57
The CSR registers on the reset sequencer provide the following functionality:
• Supports reset logging
• Ability to identify which reset is asserted.
• Ability to determine whether any reset is currently active.
• Supports software triggered resets
• Ability to generate reset by writing to the register.
• Ability to disable assertion or de-assertion sequence.
• Supports software sequenced reset
• Ability for the software to fully control the assertion/de-assertion sequence by writing to registers
and stepping through the sequence.
• Support reset override
• Ability to assert a particular component reset through software.
30 RW1C 0 Reset Asserted and waiting for SW to proceed:—Set when there is an active
reset assertion, and the next sequence is waiting for the software to proceed.
Only valid when the Enable SW sequenced reset entry option is turned on.
28:26 RO 0 Reserved.
25:16 RW1C 0 Reset de-assertion input qualification signal reset_dsrt_qual [9:0] status—
Indicates that the reset de-assertion's input signal qualification signal is set. This
bit is set on the detection of assertion of the signal.
15:12 RO 0 Reserved.
11 RW1C 0 reset_in9 was triggered—Indicates that resetin9 triggered the reset. Cleared
by software by writing 1 to this bit location.
Send Feedback
QPS5V1
7-58 Reset Sequencer Interrupt Enable Register Offset 0x04 2015.11.02
9 RW1C 0 reset_in7 was triggered—Indicates that reset_in7 triggered the reset. Cleared
by software by writing 1 to this bit location.
8 RW1C 0 reset_in6 was triggered—Indicates that reset_in6 triggered the reset. Cleared
by software by writing 1 to this bit location.
7 RW1C 0 reset_in5 was triggered—Indicates that reset_in5 triggered the reset. Cleared
by software by writing 1 to this bit location.
6 RW1C 0 reset_in4 was triggered—Indicates that reset_in4 triggered the reset. Cleared
by software by writing 1 to this bit location.
5 RW1C 0 reset_in3 was triggered—Indicates that reset_in3 triggered the reset. Cleared
by software by writing 1 to this bit location.
4 RW1C 0 reset_in2 was triggered—Indicates that reset_in2 triggered the reset. Cleared
by software by writing 1 to this bit location.
3 RW1C 0 reset_in1 was triggered—Indicates that reset_in1 triggered the reset. Cleared
by software by writing 1 to this bit location.
1 RW1C 0 Software triggered reset—Indicates that the software triggered reset is set by
the software, and triggering a reset.
Table 7-35: Values for the Interrupt Enable Register at Offset 0x04
Send Feedback
QPS5V1
2015.11.02 Reset Sequencer Interrupt Enable Register Offset 0x04 7-59
28:26 RO 0 Reserved.
25:16 RW 0 Interrupt on Reset de-assertion input qualification signal reset_dsrt_qual_
[9:0] status— When set, the IRQ is set when the reset_dsrt_qual[9:0] status
bit (per bit enable) is set.
15:12 RO 0 Reserved.
11 RW 0 Interrupt on reset_in9 Enable—When set, the IRQ is set when the reset_in9
trigger status bit is set.
10 RW 0 Interrupt on reset_in8 Enable—When set, the IRQ is set when the reset_in8
trigger status bit is set.
9 RW 0 Interrupt on reset_in7 Enable—When set, the IRQ is set when the reset_in7
trigger status bit is set.
8 RW 0 Interrupt on reset_in6 Enable—When set, the IRQ is set when the reset_in6
trigger status bit is set.
7 RW 0 Interrupt on reset_in5 Enable—When set, the IRQ is set when the reset_in5
trigger status bit is set.
6 RW 0 Interrupt on reset_in4 Enable—When set, the IRQ is set when the reset_in4
trigger status bit is set.
5 RW 0 Interrupt on reset_in3 Enable—When set, the IRQ is set when the reset_in3
trigger status bit is set.
4 RW 0 Interrupt on reset_in2 Enable—When set, the IRQ is set when the reset_in2
trigger status bit is set.
3 RW 0 Interrupt on reset_in1 Enable—When set, the IRQ is set when the reset_in1
trigger status bit is set.
2 RW 0 Interrupt on reset_in0 Enable—When set, the IRQ is set when the reset_in0
trigger status bit is set.
Send Feedback
QPS5V1
7-60 Reset Sequencer Control Register Offset 0x08 2015.11.02
Reset Sequencer Software Sequenced Reset Entry Control Register Offset 0x0C
You can program the Reset Sequencer Software Sequenced Reset Entry Control register to control the
reset entry sequence of the sequencer.
When the corresponding enable bit is set, the sequencer stops when the desired reset asserts, and then sets
the Reset Asserted and waiting for SW to proceed bit. The Reset Sequencer proceeds only after the Reset
Asserted and waiting for SW to proceed bit is cleared.
Table 7-37: Values for the Reset Sequencer Software Sequenced Reset Entry Controls Register at Offset
0x0C
Send Feedback
QPS5V1
2015.11.02 Reset Sequencer Software Sequenced Reset Bring Up Control Register... 7-61
Reset Sequencer Software Sequenced Reset Bring Up Control Register Offset 0x10
You can program the Software Sequenced Reset Bring Up Control register to control the reset bring up
sequence of the sequencer.
When the corresponding enable bit is set, the sequencer stops when the desired reset asserts, and then sets
the Reset De-asserted and waiting for SW to proceed bit. The Reset Sequencer proceeds only after the
Reset De-asserted and waiting for SW to proceed bit is cleared..
Table 7-38: Values for the Reset Sequencer Software Sequenced Bring Up Control Register at Offset 0x10
Table 7-39: Values for the Software Direct Controlled Resets at Offset 0x14
Send Feedback
QPS5V1
7-62 Reset Sequencer Software Reset Masking Offset 0x18 2015.11.02
Table 7-40: Values for the Reset Sequencer Software Reset Masking at Offset 0x18
Send Feedback
QPS5V1
2015.11.02 Reset Sequencer Software Flows 7-63
IRQ yes
Asserted? Software waits for the IRQ.
no
Send Feedback
QPS5V1
7-64 Reset Entry Flow 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Reset Entry (Software-Sequenced) Flow 7-65
Setup is complete.
Related Information
Reset Entry (Software-Sequenced) Flow on page 7-65
Send Feedback
QPS5V1
7-66 Conduits 2015.11.02
Conduits
You can use the conduit interface type for interfaces that do not fit any of the other interface types, and to
group any arbitrary collection of signals. Like other interface types, you can export or connect conduit
interfaces. The PCI Express-to-Ethernet example in Creating a System with Qsys is an example of using a
conduit interface for export. You can declare an associated clock interface for conduit interfaces in the
same way as memory-mapped interfaces with the associatedClock.
To connect two conduit interfaces inside Qsys, the following conditions must be met:
• The interfaces must match exactly with the same signal roles and widths.
• The interfaces must be the opposite directions.
• Clocked conduit connections must have matching associatedClocks on each of their endpoint
interfaces.
Note: To connect a conduit output to more than one input conduit interface, you can create a custom
component. The custom component could have one input that connects to two outputs, and you
can use this component between other conduits that you want to connect. For information about
the Avalon Conduit interface, refer to the Avalon Interface Specifications
Related Information
• Avalon Interface Specifications
• Creating a System with Qsys on page 5-1
Interconnect Pipelining
If you set the Limit interconnect pipeline stages to parameter to a value greater than 0 on the Project
Settings tab, Qsys automatically inserts Avalon-ST pipeline stages when you generate your design. The
pipeline stages increase the fMAX of your design by reducing the combinational logic depth. The cost is
additional latency and logic.
The insertion of pipeline stages depends upon the existence of certain interconnect components. For
example, in a single-slave system, no multiplexer exists; therefore multiplexer pipelining does not occur.
In an extreme case, of a single-master to single-slave system, no pipelining occurs, regardless of the value
of theLimit interconnect pipeline stages to option.
Send Feedback
QPS5V1
2015.11.02 Interconnect Pipelining 7-67
The example below shows the possible placement of up to four potential pipeline stages, which could be,
before the input to the demultiplexer, at the output of the multiplexer, between the arbiter and the
multiplexer, and at the outputs of the demultiplexer.
Logic included in the Avalon-ST Command Network
Master 0
Command
Arbiter
packet for
for
master 0
slave 0
Master 1
Command
packet for
master 1 Selected request
Arbiter
Arbiter
for
for
slave
slave 11
Selected request
Master 2
Command Arbiter
packet for for
master 2 slave 2
Master 3
Command
packet for Selected request
master 3
Arbiter
for
slave 3
Selected request
Note: For more information about manually inserting and removing pipelines from your system, refer to
Creating a System With Qsys. Refer to Optimizing Qsys System Performance for more information
about pipelined Avalon-MM Interfaces.
Related Information
Creating a System With Qsys on page 5-1
Send Feedback
QPS5V1
7-68 Manually Controlling Pipelining in the Qsys Interconnect 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Error Correction Coding (ECC) in Qsys Interconnect 7-69
As transistors become smaller, computer hardware is more susceptible to data corruption. Data
corruption causes Single Event Upsets (SEUs) and increases the probability of Failures in Time (FIT) rates
in computer systems. SEU events without error notification can cause the system to be stuck in an
unknown response state, and increase the probability of FIT rates.
ECC encodes the data bus with a Hamming code before it writes it to the memory device, and then
decodes and performs error checking on the data on output.
Note: Qsys sends uncorrectable errors in memeory elements as a DECERR on the response bus. This
feature is currently only supported for rdata_FIFO instances when back pressure occurs on the
wait_request signal.
Related Information
• Read and Write Responses on page 7-27
• Specify Qsys Interconnect Requirements
Related Information
AMBA 3 Protocol Specifications
Channels
Qsys 14.0 has the following support and restrictions for AXI3 channels.
Send Feedback
QPS5V1
7-70 Write Data, Write Response, and Read Data Channels 2015.11.02
Cache Support
AWCACHE and ARCACHE are passed to an AXI slave unmodified.
Bufferable
Qsys interconnect treats AXI transactions as non-bufferable. All responses must come from the terminal
slave.
When connecting to Avalon-MM slaves, since they do not have write responses, the following exceptions
apply:
• For Avalon-MM slaves, the write response are generated by the slave agent once the write transaction
is accepted by the slave. The following limitation exists for an Avalon bridge:
• For an Avalon bridge, the response is generated before the write reaches the endpoint; users must be
aware of this limitation and avoid multiple paths past the bridge to any endpoint slave, or only
perform bufferable transactions to an Avalon bridge.
Cacheable (Modifiable)
Qsys interconnect acknowledges the cacheable (modifiable) attribute of AXI transactions.
It does not change the address, burst length, or burst size of non-modifiable transactions, with the
following exceptions:
• Qsys considers a wide transaction to a narrow slave as modifiable because the size requires reduction.
• Qsys may consider AXI read and write transactions as modifiable when the destination is an Avalon
slave. The AXI transaction may be split into multiple Avalon transactions if the slave is unable to
accept the transaction. This may occur because of burst lengths, narrow sizes, or burst types.
Qsys ignores all other bits, for example, read allocate or write allocate because the interconnect does not
perform caching. By default, Qsys considers Avalon master transactions as non-bufferable and non-
cacheable, with the allocate bits tied low. Qsys provides compile-time options to control the cache
behavior of Avalon transactions on a per-master basis.
Send Feedback
QPS5V1
2015.11.02 Security Support 7-71
Security Support
TrustZone refers to the security extension of the ARM architecture, which includes the concept of "secure"
and "non-secure" transactions, and a protocol for processing between the designations.
The interconnect passes the AWPROT and ARPROT signals to the endpoint slave without modification. It
does not use or modify the PROT bits.
Refer to Creating a System with Qsys for more information about secure systems and the TrustZone
feature.
Related Information
Creating a System with Qsys on page 5-1
Atomic Accesses
Exclusive accesses are supported for AXI slaves by passing the lock, transaction ID, and response signals
from master to slave, with the limitation that slaves that do not reorder responses. Avalon slaves do not
support exclusive accesses, and always return OKAY as a response. Locked accesses are also not supported.
Response Signaling
Full response signaling is supported. Avalon slaves always return OKAY as a response.
Ordering Model
Qsys interconnect provides responses in the same order as the commands are issued.
To prevent reordering, for slaves that accept reordering depths greater than 0, Qsys does not transfer the
transaction ID from the master, but provides a constant transaction ID of 0. For slaves that do not
reorder, Qsys allows the transaction ID to be transferred to the slave. To avoid cyclic dependencies, Qsys
supports a single outstanding slave scheme for both reads and writes. Changing the targeted slave before
all responses have returned stalls the master, regardless of transaction ID.
Data Buses
Narrow bus transfers are supported. AXI write strobes can have any pattern that is compatible with the
address and size information. Altera recommends that transactions to Avalon slaves follow Avalon
byteenable limitations for maximum compatibility.
Note: Byte 0 is always bits [7:0] in the interconnect, following AXI's and Avalon's byte (address)
invariance scheme.
Send Feedback
QPS5V1
7-72 Avalon and AXI Transaction Support 2015.11.02
AXI masters to the correct data width. Qsys must preserve commands issued by AXI masters when
passing the commands to AXI slaves.
Note: Unaligned transfers are aligned if downsizing occurs. For example, when downsizing to a bus
width narrower than that required by the transaction size, AWSIZE or ARSIZE, the transaction must
be modified.
Related Information
AMBA APB Protocol Specifications
Bridges
With APB, you cannot use bridge components that use multiple PSELx in Qsys. As a workaround, you can
group PSELx, and then send the packet to the slave directly.
Altera recommends as an alternative that you instantiate the APB bridge and all the APB slaves in Qsys.
You should then connect the slave side of the bridge to any high speed interface and connect the master
Send Feedback
QPS5V1
2015.11.02 Burst Adaptation 7-73
side of the bridge to the APB slaves. Qsys creates the interconnect on either side of the APB bridge and
creates only one PSEL signal.
Alternatively, you can connect a bridge to the APB bus outside of Qsys. Use an Avalon/AXI bridge to
export the Avalon/AXI master to the top-level, and then connect this Avalon/AXI interface to the slave
side of the APB bridge. Alternatively, instantiate the APB bridge in Qsys and export APB master to the
top- level, and from there connect to APB bus outside of Qsys.
Burst Adaptation
APB is a non-bursting interface. Therefore, for any AXI or Avalon master with bursting support, a burst
adapter is inserted before the slave interface and the burst transaction is translated into a series of non-
bursting transactions before reaching the APB slave.
Width Adaptation
Qsys allows different data width connections with APB. When connecting a wider master to a narrower
APB slave, the width adapter converts the wider transactions to a narrower transaction to fit the APB
slave data width. APB does not support Write Strobe. Therefore, when you connect a narrower
transaction to a wider APB slave, the slave cannot determine which byte lane to write. In this case, the
slave data may be overwritten or corrupted.
Error Response
Error responses are returned to the master. Qsys performs error mapping if the master is an AXI3 or
AXI4 master, for example, RRESP/BRESP= SLVERR. For the case when the slave does not use SLVERR
signal, an OKAY response is sent back to master by default.
Burst Support
Qsys supports INCR bursts up to 256 beats. Qsys converts long bursts to multiple bursts in a packet with
each burst having a length less than or equal to MAX_BURST when going to AXI3 or Avalon slaves.
For narrow-sized transfers, bursts with Avalon slaves as destinations are shortened to multiple non-
bursting transactions in order to transmit the correct address to the slaves, since Avalon slaves always
perform full-sized datawidth transactions.
Bursts with AXI3 slaves as destinations are shortened to multiple bursts, with each burst length less than
or equal to 16. Bursts with AXI4 slaves as destinations are not shortened.
QoS
Qsys routes 4-bit QoS signals (Quality of Service Signaling) on the read and write address channels
directly from the master to the slave.
Transactions from AXI3 and Avalon masters have a default value of 4'b0000, which indicates that the
transactions are not part of the QoS flow. QoS values are not used for slaves that do not support QoS.
Send Feedback
QPS5V1
7-74 Regions 2015.11.02
For Qsys 14.0, there are no programmable QoS registers or compile-time QoS options for a master that
overrides its real or default value.
Regions
For Qsys 14.0, there is no support for the optional regions feature. AXI4 slaves with AXREGION signals are
allowed. AXREGION signals are driven with the default value of 0x0, and are limited to one entry in a
master's address map.
Related Information
AMBA Protocol Specifications
Ordering Model
Out of order support is not implemented in Qsys, version 14.0. Qsys processes AXI slaves as device non-
bufferable memory types.
The following describes the required behavior for the device non-bufferable memory type:
• Write response must be obtained from the final destination.
• Read data must be obtained from the final destination.
• Transaction characteristics must not be modified.
• Reads must not be pre-fetched. Writes must not be merged.
• Non-modifiable read and write transactions.
(AWCACHE[1] = 0 or ARCACHE[1] = 0) from the same ID to the same slave must remain ordered. The
interconnect always provides responses in the same order as the commands issued. Slaves that support
reordering provide a constant transaction ID to prevent reordering. AXI slaves that do not reorder are
provided with transaction IDs, which allows exclusive accesses to be used for such slaves.
Send Feedback
QPS5V1
2015.11.02 Read and Write Allocate 7-75
Locked Transactions
Locked transactions are not supported for Qsys, version 14.0.
Memory Types
For AXI4, Qsys processes transactions as though the endpoint is a device memory type. For device
memory types, using non-bufferable transactions to force previous bufferable transactions to finish is
irrelevant, because Qsys interconnect always identifies transactions as being non-bufferable.
Mismatched Attributes
There are rules for how multiple masters issue cache values to a shared memory region. The interconnect
meets requirements as long as cache signals are not modified.
Signals
Qsys supports up to 64-bits for the BUSER, WUSER and RUSER sideband signals. AXI4 allows some signals to
be omitted from interfaces by aligning them with the default values as defined in the AMBA Protocol
Specifications on the ARM website.
Related Information
AMBA Protocol Specifications
Connection Points
Qsys allows you to connect an AXI4 stream interface to another AXI4 stream interface.
The connection is point-to-point without adaptation and must be between an axi4stream_master and
axi4stream_slave. Connected interfaces must have the same port roles and widths.
Non matching master to slave connections, and multiple masters to multiple slaves connections are not
supported.
Send Feedback
QPS5V1
7-76 AXI4 Streaming Connection Point Signals 2015.11.02
Adaptation
AXI4 stream adaptation support is not available. AXI4 stream master and slave interface signals and
widths must match.
AXI4-Lite Signals
Qsys supports all AXI4-Lite interface signals. All signals are required.
(6)
integer in mutiple of bytes
(7)
maximum 8-bits
(8)
maximum 4-bits
(9)
number of bits in multiple of the number of bytes of tdata
Send Feedback
QPS5V1
2015.11.02 AXI4-Lite Bus Width 7-77
Global Write Address Write Data Write Read Address Read Data Channel
Channel Channel Response Channel
Channel
ACLK AWVALID WVALID BVALID ARVALID RVALID
AXI4-Lite IDs
AXI4-Lite does not support IDs. Qsys performs ID reflection inside the slave agent.
Send Feedback
QPS5V1
7-78 Port Roles (Interface Signal Types) 2015.11.02
Send Feedback
QPS5V1
2015.11.02 AXI Slave Interface Signal Types 7-79
Send Feedback
QPS5V1
7-80 AXI4 Master Interface Signal Types 2015.11.02
Send Feedback
QPS5V1
2015.11.02 AXI4 Master Interface Signal Types 7-81
Send Feedback
QPS5V1
7-82 AXI4 Slave Interface Signal Types 2015.11.02
Send Feedback
QPS5V1
2015.11.02 AXI4 Slave Interface Signal Types 7-83
Send Feedback
QPS5V1
7-84 AXI4 Stream Master and Slave Interface Signal Types 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Avalon Memory-Mapped Interface Signal Roles 7-85
This specification does not require all signals to exist in an Avalon-MM interface. There is no one signal
that is always required. The minimum requirements for an Avalon-MM interface are readdata for a read-
only interface, or writedata and write for a write-only interface.
byteenable 2, 4, 8, 16, 32, Master → Slave Enables specific byte lane(s) during transfers on
64, 128 interfaces of width greater than 8 bits. Each bit
byteenable_n
in byteenable corresponds to a byte in
writedata and readdata. The master bit <n>
of byteenable indicates whether byte <n> is
being written to. During writes, byteenables
specify which bytes are being written to. Other
bytes should be ignored by the slave. During
reads, byteenables indicate which bytes the
master is reading. Slaves that simply return
readdata with no side effects are free to ignore
byteenables during reads. If an interface does
not have a byteenable signal, the transfer
proceeds as if all byteenables are asserted.
When more than one bit of the byteenable
signal is asserted, all asserted lanes are adjacent.
The number of adjacent lines must be a power
of 2. The specified bytes must be aligned on an
address boundary for the size of the data. For
Send Feedback
QPS5V1
7-86 Avalon Memory-Mapped Interface Signal Roles 2015.11.02
readdata 8,16, 32, 64,128, Slave → Master The readdata driven from the slave to the
256, 512, 1024 master in response to a read transfer.
Send Feedback
QPS5V1
2015.11.02 Avalon Memory-Mapped Interface Signal Roles 7-87
response [1:0] 2 Slave → Master The response signal is an optional signal that
carries the response status.
Note: Because the signal is shared, an
interface cannot issue or accept a
write response and a read response
in the same clock cycle.
• 00: OKAY—Successful response for a
transaction.
• 01: RESERVED—Encoding is reserved.
• 10: SLAVEERROR—Error from an endpoint
slave. Indicates an unsuccessful transaction.
• 11: DECODEERROR—Indicates attempted
access to an undefined location.
For read responses:
• One response is sent with each readdata. A
read burst length of N results in N responses.
It is not valid to produce fewer responses,
even in the event of an error. It is valid for
the response signal value to be different for
each readdata in the burst.
• The interface must have read control
signals. Pipeline support is possible with the
readdatavalid signal.
• On read errors, the corresponding readdata
is "don't care".
For write responses:
• The interface must have write control
signals. Qsys completes all write commands
with write responses if the write signal is
present. The interface must have a
writeresponsevalid signal.
• One write response must be sent for each
write command. A write burst results in
only one response, which must be sent after
the final write transfer in the burst is
accepted.
writedata 8,16, 32, 64, Master → Slave Data for write transfers. The width must be the
128, 256, 512, same as the width of readdata if both are
1024 present.
Wait-State Signals
lock 1 Master → Slave lock ensures that once a master wins arbitra‐
tion, it maintains access to the slave for
Send Feedback
QPS5V1
7-88 Avalon Memory-Mapped Interface Signal Roles 2015.11.02
Pipeline Signals
Send Feedback
QPS5V1
2015.11.02 Avalon Memory-Mapped Interface Signal Roles 7-89
Send Feedback
QPS5V1
7-90 Avalon Streaming Interface Signal Roles 2015.11.02
data 1 – 4,096 Source → Sink The data signal from the source to the sink,
typically carries the bulk of the information being
transferred.
The contents and format of the data signal is
further defined by parameters.
error 1 – 256 Source → Sink A bit mask used to mark errors affecting the data
being transferred in the current cycle. A single bit
in error is used for each of the errors recognized
by the component, as defined by the errorDe-
scriptor property.
Send Feedback
QPS5V1
2015.11.02 Avalon Clock Source Signal Roles 7-91
valid 1 Source → Sink Asserted by the source to qualify all other source
to sink signals. The sink samples data and other
source-to-sink signals on ready cycles where
valid is asserted. All other cycles are ignored.
Send Feedback
QPS5V1
7-92 Avalon Conduit Signal Roles 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Avalon Tristate Conduit Signal Roles 7-93
Send Feedback
QPS5V1
7-94 Avalon Tri-State Slave Interface Signal Types 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Avalon Tri-State Slave Interface Signal Types 7-95
Note: All Avalon signals are active high. Avalon signals that can also be asserted low list both
versions in the Signal Role column.
Send Feedback
QPS5V1
7-96 Avalon Interrupt Sender Signal Roles 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Document Revision History 7-97
August 2014 14.0a10.0 • Updated Qsys Packet Format for Memory-Mapped Master
and Slave Interfaces table, Protection.
• Streaming Interface renamed to Avalon Streaming
Interfaces.
• Added Response Merging under Memory-Mapped Interfaces.
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
Optimizing Qsys System Performance
8
QPS5V1 Subscribe Send Feedback
You can optimize system interconnect performance for Altera designs that you create with the Qsys
®
Related Information
• Avalon Interface Specifications
• AMBA Protocol Specifications
• Creating a System with Qsys on page 5-1
• Creating Qsys Components on page 6-1
• Qsys Interconnect on page 7-1
Related Information
Creating Qsys Components on page 6-1
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V1
8-2 Designing Streaming Components 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Using Hierarchy in Systems 8-3
Avalon-MM
Slave Port Read Multiplexer
readdata[31:0] Q D
s
EN
read
address[1:0]
Register File
D Q
User
Logic
Decode EN
2:4
0
D Q
EN
1
address[1:0] D Q
EN
2
D Q
EN
write EN
3
writedata[31:0]
This slave component has write wait states and one read wait state. Alternatively, if you want high
throughput, you may set both the read and write wait states to zero, and then specify a read latency of one,
because the component also supports pipelined reads.
Send Feedback
QPS5V1
8-4 Using Hierarchy in Systems 2015.11.02
Hierarchy can simplify verification control of slaves connected to each master in a memory-mapped
system. Before you implement subsystems in your design, you should plan the system hierarchical blocks
at the top-level, using the following guidelines:
• Plan shared resources—Determine the best location for shared resources in the system hierarchy. For
example, if two subsystems share resources, add the components that use those resources to a higher-
level system for easy access.
• Plan shared address space between subsystems—Planning the address space ensures you can set
appropriate sizes for bridges between subsystems.
• Plan how much latency you may need to add to your system—When you add an Avalon-MM
Pipeline Bridge between subsystems, you may add latency to the overall system. You can reduce the
added latency by parameterizing the bridge with zero cycles of latency, and by turning off the pipeline
command and response signals.
Figure 8-2: Avalon-MM Pipeline Bridge
Send Feedback
QPS5V1
2015.11.02 Using Hierarchy in Systems 8-5
Top-Level System
Subsystem Subsystem
Nios II Nios II
Processor Processor
M M Pipeline Bridges M M
S S S S S S S S
In this example, two Nios II processor subsystems share resources for message passing. Bridges in each
subsystem export the Nios II data master to the top-level system that includes the mutex (mutual
exclusion component) and shared memory component (which could be another on-chip RAM, or a
controller for an off-chip RAM device).
Send Feedback
QPS5V1
8-6 Using Hierarchy in Systems 2015.11.02
Nios II
Processor
M M
Arbiter
S S S
You can also design systems that process multiple data channels by instantiating the same subsystem for
each channel. This approach is easier to maintain than a larger, non-hierarchical system. Additionally,
such systems are easier to scale mwh1409959480842 because you can mwh1409959275749 calculate the
required resources as a multiple of the subsystem requirements.
Related Information
Avalon-MM Pipeline Bridge
Send Feedback
QPS5V1
2015.11.02 Using Concurrency in Memory-Mapped Systems 8-7
Send Feedback
QPS5V1
8-8 Implementing Concurrency With Multiple Masters 2015.11.02
In this Avalon example, the DMA engine operates with Avalon-MM read and write masters. However, an
AXI DMA interface typically has only one master, because in the AXI standard, the write and read
channels on the master are independent and can process transactions simultaneously. The yellow lines
represent active simultaneously connections.
M M M M S M
Arbiter Arbiter
S S S S
Send Feedback
QPS5V1
2015.11.02 Implementing Concurrency With Multiple Slaves 8-9
In this example, the DMA engine operates with a single master, because in AXI, the write and read
channels on the master are independent and can process transactions simultaneously. There is
concurrency between the read and write channels, with the yellow lines representing concurrent data
paths.
M M M S M
Read Write
Arbiter Arbiter
S S S S
Send Feedback
QPS5V1
8-10 Implementing Concurrency with DMA Engines 2015.11.02
Channel Processor
Compute
Host 1 M Data Channel 1
Engine 1
Host 2 M Compute
Data Channel 2
Engine 2
Arbiter S
Compute
Host 4 M Data Channel 4
Engine 4
Host 1 Compute
M S Data Channel 1
Engine 1
Host 2 M Compute
S Data Channel 2
Engine 2
Compute
Host 4 M S Data Channel 4
Engine 4
In this example, there are two channel processing systems. In the first, four hosts must arbitrate for the
single slave interface of the channel processor. In the second, each host drives a dedicated slave interface,
allowing all master interfaces to simultaneously access the slave interfaces of the component. Arbitration
is not necessary when there is a single host and slave interface.
Send Feedback
QPS5V1
2015.11.02 Implementing Concurrency with DMA Engines 8-11
transfers data between a programmed start and end address without intervention, and the data
throughput is dictated by the components connected to the DMA. Factors that affect data throughput
include data width and clock frequency.
Figure 8-8: Single or Dual DMA Channels
DMA
Engine
M M
S S S S
DMA DMA
Engine 1 Engine 2
M M M M
S S S S
In this example, the system can sustain more concurrent read and write operations by including more
DMA engines. Accesses to the read and write buffers in the top system are split between two DMA
engines, as shown in the Dual DMA Channels at the bottom of the figure.
Send Feedback
QPS5V1
8-12 Inserting Pipeline Stages to Increase System Frequency 2015.11.02
The DMA engine operates with Avalon-MM write and read masters. An AXI DMA typically has only one
master, because in AXI, the write and read channels on the master are independent and can process
transactions simultaneously.
Related Information
Creating a System with Qsys on page 5-1
Using Bridges
You can use bridges to increase system frequency, minimize generated Qsys logic, minimize adapter logic,
and to structure system topology when you want to control where Qsys adds pipelining. You can also use
bridges with arbiters when there is concurrency in the system.
An Avalon bridge has an Avalon-MM slave interface and an Avalon-MM master interface. You can have
many components connected to the bridge slave interface, or many components connected to the bridge
master interface. You can also have a single component connected to a single bridge slave or master
interface.
You can configure the data width of the bridge, which can affect how Qsys generates bus sizing logic in
the interconnect. Both interfaces support Avalon-MM pipelined transfers with variable latency, and can
also support configurable burst lengths.
Transfers to the bridge slave interface are propagated to the master interface, which connects to
components downstream from the bridge. When you need greater control over interconnect pipelining,
you can use bridges instead of the Limit Interconnect Pipeline Stages to option.
Note: You can use Avalon bridges between AXI interfaces, and between Avalon domains. Qsys automati‐
cally creates interconnect logic between the AXI and Avalon interfaces, so you do not have to
explicitly instantiate bridges between these domains. For more discussion about the benefits and
disadvantages of shared and separate domains, refer to the Qsys Interconnect.
Related Information
• Creating a System with Qsys on page 5-1
• Qsys Interconnect on page 7-1
Send Feedback
QPS5V1
2015.11.02 Using Bridges to Increase System Frequency 8-13
D Q Master-to-Slave
Master-to-Slave D Q Signals
Signals
ENA
waitrequest Connects to an
Pipeline Avalon-MM
Wait Request Master Interface
waitrequest waitrequest
Logic
Connects to an Slave Master
Avalon-MM I/F I/F
Slave Interface
Slave-to-Master
Signals
D Q
Slave-to-Master
Signals Slave-to-Master
Pipeline
Send Feedback
QPS5V1
8-14 Implementing Response Pipelining (Slave-to-Master) 2015.11.02
single pipeline bridge does not provide enough pipelining, you can instantiate multiple instances of the
bridge in a tree structure to increase the pipelining and further reduce the width of the multiplexer at the
slave interface.
Figure 8-10: Tree of Bridges
M M M M
arb arb
S S
M M
arb
Read Data
S
Write Data &
Shared Control Signals
Slave
Send Feedback
QPS5V1
2015.11.02 Using Clock Crossing Bridges 8-15
The interconnect inserts a multiplexer for every read data path back to the master. As the number of
slaves supporting read transfers connecting to the master increases, the width of the read data multiplexer
also increases. If the performance increase is insufficient with one bridge, you can use multiple bridges in
a tree structure to improve fMAX.
Limiting Concurrency
The amount of logic generated for the interconnect often increases as the system becomes larger because
Qsys creates arbitration logic for every slave interface that is shared by multiple master interfaces. Qsys
inserts multiplexer logic between master interfaces that connect to multiple slave interfaces if both
support read data paths.
Send Feedback
QPS5V1
8-16 Limiting Concurrency 2015.11.02
Most embedded processor designs contain components that are either incapable of supporting high data
throughput, or do not need to be accessed frequently. These components can contain master or slave
interfaces. Because the interconnect supports concurrent accesses, you may want to limit concurrency by
inserting bridges into the data path to limit the amount of arbitration and multiplexer logic generated.
For example, if a system contains three master and three slave interfaces that are interconnected, Qsys
generates three arbiters and three multiplexers for the read data path. If these masters do not require a
significant amount of simultaneous throughput, you can reduce the resources that your design consumes
by connecting the three masters to a pipeline bridge. The bridge controls the three slave interfaces and
reduces the interconnect into a bus structure. Qsys creates one arbitration block between the bridge and
the three masters, and a single read data path multiplexer between the bridge and three slaves, and
prevents concurrency. This implementation is similar to a standard bus architecture.
You should not use this method for high throughput data paths to ensure that you do not limit overall
system performance.
Send Feedback
QPS5V1
2015.11.02 Using Bridges to Minimize Adapter Logic 8-17
Figure 8-11: Differences Between Systems With and Without a Pipeline Bridge
Concurrency No Concurrency
M M M M M M M
Arbiter
Bridge
S S S
Send Feedback
QPS5V1
8-18 Determining Effective Placement of Bridges 2015.11.02
Increased Latency
Adding a bridge to a design has an effect on the read latency between the master and the slave. Depending
on the system requirements and the type of master and slave, this latency increase may or may not be
acceptable in your design.
Send Feedback
QPS5V1
2015.11.02 Unacceptable Latency Increase 8-19
For example, if you use a pipelined read master such as a DMA controller to read data from a component
with a fixed read latency of four clock cycles, but only perform a single word transfer, the overhead is
three clock cycles out of the total of four. This is true when there is no additional pipeline latency in the
interconnect. The read throughput is only 25%.
Figure 8-12: Low-Efficiency Read Transfer
Overhead Overhead
clk
address A0 A1
read
waitrequest
readdata D0 D1
However, if 100 words of data are transferred without interruptions, the overhead is three cycles out of the
total of 103 clock cycles. This corresponds to a read efficiency of approximately 97% when there is no
additional pipeline latency in the interconnect. Adding a pipeline bridge to this read path adds two extra
clock cycles of latency. The transfer requires 105 cycles to complete, corresponding to an efficiency of
approximately 94%. Although the efficiency decreased by 3%, adding the bridge may increase the fMAX by
5%. For example, if the clock frequency can be increased, the overall throughput would improve. As the
number of words transferred increases, the efficiency increases to nearly 100%, whether or not a pipeline
bridge is present.
Figure 8-13: High Efficiency Read Transfer
Read Latency
Overhead
clk
read
waitrequest
readdatavalid
readdata D0 D1 D2 D3 D4 D5 D6 D7 D8
Send Feedback
QPS5V1
8-20 Limited Concurrency 2015.11.02
A Nios II processor instruction master has a cache memory with a read latency of four cycles, which is
eight sequential words of data return for each read. At 100 MHz, the first read takes 40 ns to complete.
Each successive word takes 10 ns so that eight reads complete in 110 ns.
Figure 8-14: Performance of a Nios II Processor and Memory Operating at 100 MHz
110 ns
40 ns
clk
address A0 A1 A2 A3 A4 A5 A6 A7
read
waitrequest
readdatavalid
readdata D0 D1 D2 D3 D4 D5 D6 D7
Adding a clock crossing bridge allows the memory to operate at 125 MHz. However, this increase in
frequency is negated by the increase in latency because if the clock crossing bridge adds six clock cycles of
latency at 100 MHz, then the memory continues to operate with a read latency of four clock cycles.
Consequently, the first read from memory takes 100 ns, and each successive word takes 10 ns because
reads arrive at the frequency of the processor, which is 100 MHz. In total, eight reads complete after 170
ns. Although the memory operates at a higher clock frequency, the frequency at which the master
operates limits the throughput.
Figure 8-15: Performance of a Nios II Processor and Eight Reads with Ten Cycles Latency
170 ns
100 ns
clk
address A0 A1 A2 A3 A4 A5 A6 A7
read
waitrequest
readdatavalid
readdata D0 D1 D2 D3 D4 D5 D6 D7
Limited Concurrency
Placing a bridge between multiple master and slave interfaces limits the number of concurrent transfers
your system can initiate. This limitation is the same when connecting multiple master interfaces to a
single slave interface. The slave interface of the bridge is shared by all the masters and, as a result, Qsys
Send Feedback
QPS5V1
2015.11.02 Limited Concurrency 8-21
creates arbitration logic. If the components placed behind a bridge are infrequently accessed, this
concurrency limitation may be acceptable.
Bridges can have a negative impact on system performance if you use them inappropriately. For example,
if multiple memories are used by several masters, you should not place the memory components behind a
bridge. The bridge limits memory performance by preventing concurrent memory accesses. Placing
multiple memory components behind a bridge can cause the separate slave interfaces to appear as one
large memory to the masters accessing the bridge; all masters must access the same slave interface.
Send Feedback
QPS5V1
8-22 Limited Concurrency 2015.11.02
Nios II
Processor DMA
M M M M
Arbiter Bottleneck
Qsys Subsystem
S
Bridge
S S S S
A memory subsystem with one bridge that acts as a single slave interface for the Avalon-MM Nios II and
DMA masters, which results in a bottleneck architecture. The bridge acts as a bottleneck between the two
masters and the memories.
If the fMAX of your memory interfaces is low and you want to use a pipeline bridge between subsystems,
you can place each memory behind its own bridge, which increases the fMAX of the system without
sacrificing concurrency.
Send Feedback
QPS5V1
2015.11.02 Address Space Translation 8-23
Subsystem
Nios II
Processor DMA
M M M M
Subsystem
S S S S
M M M M
S S S S
Send Feedback
QPS5V1
8-24 Address Coherency 2015.11.02
In this example, the Nios II processor connects to a bridge located at base address 0x1000, a slave connects
to the bridge master interface at an offset of 0x20, and the processor performs a write transfer to the
fourth 32-bit or 64-bit word within the slave. Nios II drives the address 0x102C to interconnect, which is
within the address range of the bridge. The bridge master interface drives 0x2C, which is within the
address range of the slave, and the transfer completes.
Address Coherency
To simplify the system design, all masters should access slaves at the same location. In many systems, a
processor passes buffer locations to other mastering components, such as a DMA controller. If the
processor and DMA controller do not access the slave at the same location, Qsys must compensate for the
differences.
Figure 8-19: Slaves at Different Addresses and Complicating the System
Nios II Processor
Peripheral
0x20
M 0x0 Address
Arbiter S
Decoder
Base = 0x20
Masters Drive
Different Addresses
DMA Bridge
0x1020 0x20 0x20
M S M
Base = 0x1000
Address Translation
Send Feedback
QPS5V1
2015.11.02 Increasing Transfer Throughput 8-25
A Nios II processor and DMA controller access a slave interface located at address 0x20. The processor
connects directly to the slave interface. The DMA controller connects to a pipeline bridge located at
address 0x1000, which then connects to the slave interface. Because the DMA controller accesses the
pipeline bridge first, it must drive 0x1020 to access the first location of the slave interface. Because the
processor accesses the slave from a different location, you must maintain two base addresses for the slave
device.
To avoid the requirement for two addresses, you can add an additional bridge to the system, set its base
address to 0x1000, and then disable all the pipelining options in the second bridge so that the bridge has
minimal impact on system timing and resource utilization. Because this second bridge has the same base
address as the original bridge, the processor and DMA controller access the slave interface with the same
address range.
Figure 8-20: Address Translation Corrected With Bridge
Address Translation
DMA Bridge
0x1020 0x20 0x20
M S M
Base = 0x1000
Address Translation
Send Feedback
QPS5V1
8-26 Using Pipelined Transfers 2015.11.02
master must wait for one request to finish before the next begins, such as with a processor, then the read
latency is very important to the overall throughput.
You can measure throughput and latency in simulation by observing the waveforms, or using the verifica‐
tion IP monitors.
Related Information
• Avalon Verification IP Suite User Guide
• Mentor Verification IP Altera Edition AMBA AXI3/4 User Guide
®
AXI masters declare how many outstanding writes and reads it can issue with the writeIssuingCapa-
bility and readIssuingCapability parameters. In the same way, a slave can declare how many reads it
can accept with the readAcceptanceCapability parameter. AXI masters with a read issuing capability
greater than one are pipelined in the same way as Avalon masters and the readdatavalid signal.
Send Feedback
QPS5V1
2015.11.02 Arbitration Shares and Bursts 8-27
hardware utilization. For these reasons, if you are not sure of the optimal value, you should overestimate
this value.
If your system includes a bridge, you must set the Maximum Pending Reads parameter on the bridge as
well. To allow maximum throughput, this value should be equal to or greater than the Maximum
Pending Reads value for the connected slave that has the highest value. You can limit the maximum
pending reads of a slave and reduce the buffer depth by reducing the parameter value on the bridge if the
high throughput is not required. If you do not know the Maximum Pending Reads value for all the slave
components, you can monitor the number of reads that are pending during system simulation while
running the hardware. To use this method, set the Maximum Pending Reads parameter to a high value
and use a master that issues read requests on every clock, such as a DMA. Then, reduce the number of
maximum pending reads of the bridge until the bridge reduces the performance of any masters accessing
the bridge.
Related Information
• Avalon Interface Specifications
• AMBA Protocol Specification
Arbitration Lock
When a master posts a burst transfer, the arbitration is locked for that master; consequently, the bursting
master should be capable of sustaining transfers for the duration of the locked period. If, after the fourth
Send Feedback
QPS5V1
8-28 Choosing Avalon-MM Interface Types 2015.11.02
write, the master deasserts the write signal (Avalon-MM write or AXI wvalid) for fifty cycles, all other
masters continue to wait for access during this stalled period.
To avoid wasted bandwidth, your master designs should wait until a full burst transfer is ready before
requesting access to a slave device. Alternatively, you can avoid wasted bandwidth by posting
burstcounts equal to the amount of data that is ready. For example, if you create a custom bursting write
master with a maximum burstcount of eight, but only three words of data are ready, you can present a
burstcount of three. This strategy does not result in optimal use of the system band width if the slave is
capable of handling a larger burst; however, this strategy prevents stalling and allows access for other
masters in the system.
Sequential Addressing
An Avalon-MM burst transfer includes a base address and a burstcount, which represents the number of
words of data that are transferred, starting from the base address and incrementing sequentially. Burst
transfers are common for processors, DMAs, and buffer processing accelerators; however, sometimes a
master must access non-sequential addresses. Consequently, a bursting master must set the burstcount
to the number of sequential addresses, and then reset the burstcount for the next location.
The arbitration share algorithm has no restrictions on addresses; therefore, your custom master can
update the address it presents to the interconnect for every read or write transaction.
Burst Adapters
Qsys allows you to create systems that mix bursting and non-bursting master and slave interfaces. This
design strategy allows you to connect bursting master and slave interfaces that support different
maximum burst lengths, with Qsys generating burst adapters when appropriate.
Qsys inserts a burst adapter whenever a master interface burst length exceeds the burst length of the slave
interface, or if the master issues a burst type that the slave cannot support. For example, if you connect an
AXI master to an Avalon slave, a burst adapter is inserted. Qsys assigns non-bursting masters and slave
interfaces a burst length of one. The burst adapter divides long bursts into shorter bursts. As a result, the
burst adapter adds logic to the address and burstcount paths between the master and slave interfaces.
Related Information
• Qsys Interconnect on page 7-1
• AMBA Protocol Specification
Send Feedback
QPS5V1
2015.11.02 Burst Avalon-MM Interfaces 8-29
higher throughput, even though the slave port may require one or more cycles of latency to return data
for each transfer.
In many systems, read throughput becomes inadequate if simple reads are used and pipelined transfers
can increase throughput. If you define a component with a fixed read latency, Qsys automatically provides
the pipelining logic necessary to support pipelined reads. You can use fixed latency pipelining as the
default design starting point for slave interfaces. If your slave interface has a variable latency response
time, use the readdatavalid signal to indicate when valid data is available. The interconnect implements
read response FIFO buffering to handle the maximum number of pending read requests.
To use components that support pipelined read transfers, and to use a pipelined system interconnect
efficiently, your system must contain pipelined masters. You can use pipelined masters as the default
starting point for new master components. Use the readdatavalid signal for these master interfaces.
Because master and slaves sometimes have mismatched pipeline latency, interconnect contains logic to
reconcile the differences.
Send Feedback
QPS5V1
8-30 Avalon-MM Burst Master Example 2015.11.02
You can use a burst-capable slave interface if you know that your component requires sequential transfers
to operate efficiently. Because SDRAM memories incur a penalty when switching banks or rows, perform‐
ance improves when SDRAM memories are accessed sequentially with bursts.
Architectures that use the same signals to transfer address and data also benefit from bursting. Whenever
an address is transferred over shared address and data signals, the throughput of the data transfer is
reduced. Because the address phase adds overhead, using large bursts increases the throughput of the
connection.
This example shows the architecture of a bursting write master that receives data from a FIFO and writes
the contents to memory. You can use a bursting master as a starting point for your own bursting
components, such as custom DMAs, hardware accelerators, or off-chip communication interfaces.
start_address[31:0]
d q 1 master_address[31:0]
go Up 0 s
load Counter
D Q
increment_address
count enable VCC
byteenable[3:0]
EN
done burst_begin
transfer_length[31:0] length[31:0]
d q
go Down master_burstcount[2:0]
load
Counter
increment_address burst_begin
count enable Tracking Logic/
State Machine burst_count[2:0]
fifo_used[] write
increment_address
waitrequest
user_data[31:0] d used[]
user_data_full full Look-Ahead FIFO writedata[31:0]
q
user_data_write write increment_address
read acknowledge
The master performs word accesses and writes to sequential memory locations. When go is asserted, the
start_address and transfer_length are registered. On the next clock cycle, the control logic asserts
burst_begin, which synchronizes the internal control signals in addition to the master_address and
Send Feedback
QPS5V1
2015.11.02 Reducing Logic Utilization 8-31
master_burstcount presented to the interconnect. The timing of these two signals is important because
during bursting write transfers, byteenable, and burstcount must be held constant for the entire burst.
To avoid inefficient writes, the master posts a burst when enough data is buffered in the FIFO. To
maximize the burst efficiency, the master should stall only when a slave asserts waitrequest. In this
example, the FIFO’s used signal tracks the number of words of data that are stored in the FIFO and
determines when enough data has been buffered.
The address register increments after every word transfer, and the length register decrements after every
word transfer. The address remains constant throughout the burst. Because a transfer is not guaranteed to
complete on burst boundaries, additional logic is necessary to recognize the completion of short bursts
and complete the transfer.
Related Information
Avalon Memory-Mapped Master Templates
Related Information
Limited Concurrency on page 8-20
Send Feedback
QPS5V1
8-32 Simplifying Address Decode Logic 2015.11.02
Related Information
Implementing Command Pipelining (Master-to-Slave) on page 8-13
Related Information
Using Concurrency in Memory-Mapped Systems on page 8-7
Consolidating Interfaces
In this example, we have a system with a mix of components, each having different burst capabilities: a
Nios II/e core, a Nios II/f core, and an external processor, which off-loads some processing tasks to the
Nios II/f core.
The Nios II/f core supports a maximum burst size of eight. The external processor interface supports a
maximum burst length of 64. The Nios II/e core does not support bursting. The memory in the system is
SDRAM with an Avalon maximum burst length of two.
Send Feedback
QPS5V1
2015.11.02 Consolidating Interfaces 8-33
M M M M M
8 8 64
8 8 8 8 64 8 8 64
B B B B B B B B
1 1 1 1 1 2 2 2
DDR
PIO System ID Timer Mutex
SDRAM
B Burst Adapter
8 Maximum Burst Count
Qsys automatically inserts burst adapters to compensate for burst length mismatches. The adapters reduce
bursts to a single transfer, or the length of two transfers. For the external processor interface connecting to
DDR SDRAM, a burst of 64 words is divided into 32 burst transfers, each with a burst length of two.
When you generate a system, Qsys inserts burst adapters based on maximum burstcount values;
consequently, the interconnect logic includes burst adapters between masters and slave pairs that do not
require bursting, if the master is capable of bursts.
In this example, Qsys inserts a burst adapter between the Nios II processors and the timer, system ID, and
PIO peripherals. These components do not support bursting and the Nios II processor performs a single
word read and write accesses to these components.
Send Feedback
QPS5V1
8-34 Reducing Logic Utilization With Multiple Clock Domains 2015.11.02
To reduce the number of adapters, you can add pipeline bridges. The pipeline bridge, between the Nios
II/f core and the peripherals that do not support bursts, eliminates three burst adapters from the previous
example. A second pipeline bridge between the Nios II/f core and the DDR SDRAM, with its maximum
burst size set to eight, eliminates another burst adapter, as shown below.
M M M M M
8 8 64
8
B 64 64
1 B B
8 8
1 2
S S
Bridge Bridge
M M
8
B
2
B Burst Adapter
8 Maximum Burst Count
Send Feedback
QPS5V1
2015.11.02 Reducing Logic Utilization With Multiple Clock Domains 8-35
Qsys generates Clock Domain Crossing Logic (CDC) that hides the details of interfacing components
operating in different clock domains. The interconnect supports the memory-mapped protocol with each
port independently, and therefore masters do not need to incorporate clock adapters in order to interface
to slaves on a different domain. Qsys interconnect logic propagates transfers across clock domain
boundaries automatically.
Clock-domain adapters provide the following benefits:
• Allows component interfaces to operate at different clock frequencies.
• Eliminates the need to design CDC hardware.
• Allows each memory-mapped port to operate in only one clock domain, which reduces design
complexity of components.
• Enables masters to access any slave without communication with the slave clock domain.
• Allows you to focus performance optimization efforts on components that require fast clock speed.
A clock domain adapter consists of two finite state machines (FSM), one in each clock domain, that use a
hand-shaking protocol to propagate transfer control signals (read_request, write_request, and the
master waitrequest signals) across the clock boundary.
Figure 8-24: Clock Crossing Adapter
CDC Logic
readdata
readdata
This example illustrates a clock domain adapter between one master and one slave. The synchronizer
blocks use multiple stages of flip flops to eliminate the propagation of meta-stable events on the control
signals that enter the handshake FSMs. The CDC logic works with any clock ratio.
Send Feedback
QPS5V1
8-36 Duration of Transfers Crossing Clock Domains 2015.11.02
The typical sequence of events for a transfer across the CDC logic is as follows:
• The master asserts address, data, and control signals.
• The master handshake FSM captures the control signals and immediately forces the master to wait.
The FSM uses only the control signals, not address and data. For example, the master simply holds the
address signal constant until the slave side has safely captured it.
• The master handshake FSM initiates a transfer request to the slave handshake FSM.
• The transfer request is synchronized to the slave clock domain.
• The slave handshake FSM processes the request, performing the requested transfer with the slave.
• When the slave transfer completes, the slave handshake FSM sends an acknowledge back to the master
handshake FSM. The acknowledge is synchronized back to the master clock domain.
• The master handshake FSM completes the transaction by releasing the master from the wait condition.
Transfers proceed as normal on the slave and the master side, without a special protocol to handle
crossing clock domains. From the perspective of a slave, there is nothing different about a transfer
initiated by a master in a different clock domain. From the perspective of a master, a transfer across clock
domains simply requires extra clock cycles. Similar to other transfer delay cases (for example, arbitration
delay or wait states on the slave side), the Qsys forces the master to wait until the transfer terminates. As a
result, pipeline master ports do not benefit from pipelining when performing transfers to a different clock
domain.
Qsys automatically determines where to insert CDC logic based on the system and the connections
between components, and places CDC logic to maintain the highest transfer rate for all components. Qsys
evaluates the need for CDC logic for each master and slave pair independently, and generates CDC logic
wherever necessary.
Related Information
Avalon Memory-Mapped Design Optimizations
Send Feedback
QPS5V1
2015.11.02 Reducing Power Consumption 8-37
Send Feedback
QPS5V1
8-38 Reducing Power Consumption With Multiple Clock Domains 2015.11.02
Figure 8-25: Reducing Power Utilization Using a Bridge to Separate Clock Domains
Nios II
Processor
M M
Arbiter Arbiter
Arbiter
S S
S S S S S S S S
Tristate
PIO UART System ID Timer PLL SPI EPCS
Conduit
Controller
M
Low-Frequency Components
S
Flash
Qsys automatically inserts clock crossing adapters between master and slave interfaces that operate at
different clock frequencies. You can choose the type of clock crossing adapter in the Qsys Project Settings
Send Feedback
QPS5V1
2015.11.02 Reducing Power Consumption by Minimizing Toggle Rates 8-39
tab. Adapters do not appear in the Connections column because you do not insert them. The following
clock crossing adapter types are available in Qsys:
• Handshake—Uses a simple handshaking protocol to propagate transfer control signals and responses
across the clock boundary. This adapter uses fewer hardware resources because each transfer is safely
propagated to the target domain before the next transfer begins. The Handshake adapter is appropriate
for systems with low throughput requirements.
• FIFO—Uses dual-clock FIFOs for synchronization. The latency of the FIFO adapter is approximately
two clock cycles more than the handshake clock crossing component, but the FIFO-based adapter can
sustain higher throughput because it supports multiple transactions simultaneously. The FIFO adapter
requires more resources, and is appropriate for memory-mapped transfers requiring high throughput
across clock domains.
• Auto—Qsys specifies the appropriate FIFO adapter for bursting links and the Handshake adapter for
all other links.
Because the clock crossing bridge uses FIFOs to implement the clock crossing logic, it buffers transfers
and data. Clock crossing adapters are not pipelined, so that each transaction is blocking until the transac‐
tion completes. Blocking transactions may lower the throughput substantially; consequently, if you want
to reduce power consumption without limiting the throughput significantly, you should use the clock
crossing bridge or the FIFO clock crossing adapter. However, if the design requires single read transfers, a
clock crossing adapter is preferable because the latency is lower.
The clock crossing bridge requires few logic resources other than on-chip memory. The number of on-
chip memory blocks used is proportional to the address span, data width, buffering depth, and bursting
capabilities of the bridge. The clock crossing adapter does not use on-chip memory and requires a
moderate number of logic resources. The address span, data width, and the bursting capabilities of the
clock crossing adapter determine the resource utilization of the device.
When you decide to use a clock crossing bridge or clock crossing adapter, you must consider the effects of
throughput and memory utilization in the design. If on-chip memory resources are limited, you may be
forced to choose the clock crossing adapter. Using the clock crossing bridge to reduce the power of a
single component may not justify using more resources. However, if you can place all of the low priority
components behind a single clock crossing bridge, you may reduce power consumption in the design.
Related Information
Power Optimization
Send Feedback
QPS5V1
8-40 Reducing Power Consumption by Minimizing Toggle Rates 2015.11.02
boundaries can improve operating frequency. When you register the signals at the interface level, you
must ensure that the component continues to operate within the interface standard specification.
Avalon-MM waitrequest is a difficult signal to synchronize when you add registers to your component.
The waitrequest signal must be asserted during the same clock cycle that a master asserts read or write
to in order to prolong the transfer. A master interface can read the waitrequest signal too early and post
more reads and writes prematurely.
Note: There is no direct AXI equivalent for waitrequest and burstcount, though the AMBA Protocol
Specification implies that the AXI ready signal cannot depend combinatorially on the AXI valid
signal. Therefore, Qsys typically buffers AXI component boundaries for the ready signal.
For slave interfaces, the interconnect manages the begintransfer signal, which is asserted during the
first clock cycle of any read or write transfer. If the waitrequest is one clock cycle late, you can logically
OR the waitrequest and the begintransfer signals to form a new waitrequest signal that is properly
synchronized. Alternatively, the component can assert waitrequest before it is selected, guaranteeing
that the waitrequest is already asserted during the first clock cycle of a transfer.
Figure 8-26: Variable Latency
Avalon-MM
Slave Port
writedata
write
Remaining
readdata Component
Logic
read
ready
waitrequest (synchronous)
begintransfer
Send Feedback
QPS5V1
2015.11.02 Reducing Power Consumption by Disabling Logic 8-41
you must determine if the masking causes the circuit to function differently. If masking causes a
functional failure, it may be possible to use a register stage to hold the combinational logic constant
between clock cycles.
Inserting Bridges
You can use bridges to reduce toggle rates, if you do not want to modify the component by using
boundary registers or clock enables. A bridge acts as a repeater where transfers to the slave interface are
repeated on the master interface. If the bridge is not accessed, the components connected to its master
interface are also not accessed. The master interface of the bridge remains idle until a master accesses the
bridge slave interface.
Bridges can also reduce the toggle rates of signals that are inputs to other master interfaces. These signals
are typically readdata, readdatavalid, and waitrequest. Slave interfaces that support read accesses
drive the readdata, readdatavalid, and waitrequest signals. A bridge inserts either a register or clock
crossing FIFO between the slave interface and the master to reduce the toggle rate of the master input
signals.
Related Information
• AMBA Protocol Specification
• Power Optimization
Send Feedback
QPS5V1
8-42 Reset Polarity and Synchronization in Qsys 2015.11.02
reset
Timeout Value d countq = 0?
Down
Counter
read
wake load count enable
write
waitrequest sleep_n
busy
This example provides a schematic for the hardware-controlled sleep mode. If restoring the component to
an active state takes a long time, use a long timeout value so that the component is not continuously
entering and exiting sleep mode. The slave interface must remain functional while the rest of the
component is in sleep mode. When the component exits sleep mode, the component must assert the
waitrequest signal until it is ready for read or write accesses.
Related Information
• Mutex Core
• Power Optimization
You can view the polarity status of a reset signal by selecting the signal in the Hierarchy tab, and then
view its expanded definition in the open Parameters and Block Symbol tabs. When you generate your
component, Qsys interconnect automatically inverts ploarities as needed.
Send Feedback
QPS5V1
2015.11.02 Reset Polarity and Synchronization in Qsys 8-43
Send Feedback
QPS5V1
8-44 Reset Polarity and Synchronization in Qsys 2015.11.02
Each Qsys component has its own requirements for reset synchronization. Some blocks have internal
synchronization and have no requirements, whereas other blocks require an externally synchronized
reset. You can define how resets are synchronized in your Qsys system with the Synchronous edges
parameter. In the clock source or reset bridge component, set the value of the Synchronous edges
parameter to one of the following, depending on how the reset is externally synchronized:
• None—There is no synchronization on this reset.
• Both—The reset is synchronously asserted and deasserted with respect to the input clock.
• Deassert—The reset is synchronously asserted with respect to the input clock, and asynchronously
deasserted.
Send Feedback
QPS5V1
2015.11.02 Reset Polarity and Synchronization in Qsys 8-45
When you generate your component, Qsys inserts adapters to synchronize or invert resets if there are
mismatches in polarity or synchronization between the source and destination. You can view inserted
Send Feedback
QPS5V1
8-46 Optimizing Qsys System Performance Design Examples 2015.11.02
adapters on the Memory-Mapped Interconnect tab with the System > System Show System with Qsys
Interconnect command.
Figure 8-32: Qsys Interconnect
Related Information
Avalon Interface Specifications
Send Feedback
QPS5V1
2015.11.02 Avalon Pipelined Read Master Example Design Requirements 8-47
Send Feedback
QPS5V1
8-48 Expected Throughput Improvement 2015.11.02
start_address[31:0] master_address[31:0]
d q
go Up
load Counter
increment_address VCC
count enable byteenable[3:0]
done
transfer_length[31:0] length[31:0]
d q
go Down read
load
Counter
increment_address increment_address
count enable Tracking Logic/
State Machine
readdatavalid
fifo_used[]
waitrequest
user_data[31:0] q used[]
user_data_empty empty Look-Ahead FIFO writedata[31:0]
d
user_data_read read acknowledge readdatavalid
write
This example shows a pipelined read master that stores data in a FIFO. The master performs word
accesses that are word-aligned and reads from sequential memory addresses. The transfer length is a
multiple of the word size.
When the go bit is asserted, the master registers the start_address and transfer_length signals. The
master begins issuing reads continuously on the next clock cycle until the length register reaches zero. In
this example, the word size is four bytes so that the address always increments by four, and the length
decrements by four. The read signal remains asserted unless the FIFO fills to a predetermined level. The
address register increments and the length register decrements if the length has not reached 0 and a read
is posted.
The master posts a read transfer every time the read signal is asserted and the waitrequest is deasserted.
The master issues reads until the entire buffer has been read or waitrequest is asserted. An optional
tracking block monitors the done bit. When the length register reaches zero, some reads are outstanding.
The tracking logic prevents assertion of done until the last read completes, and monitors the number of
Send Feedback
QPS5V1
2015.11.02 Multiplexer Examples 8-49
reads posted to the interconnect so that it does not exceed the space remaining in the readdata FIFO.
This example includes a counter that verifies that the following conditions are met:
• If a read is posted and readdatavalid is deasserted, the counter increments.
• If a read is not posted and readdatavalid is asserted, the counter decrements.
When the length register and the tracking logic counter reach zero, all the reads have completed and the
done bit is asserted. The done bit is important if a second master overwrites the memory locations that the
pipelined read master accesses. This bit guarantees that the reads have completed before the original data
is overwritten.
Multiplexer Examples
You can combine adapters with streaming components to create data paths whose input and output
streams have different properties. The following examples demonstrate datapaths in which the output
stream exhibits higher performance than the input stream.
The diagram below illustrates a data path that uses the dual clock version of the on-chip FIFO memory to
boost the frequency of input data from 100 MHz to 110 MHz by sampling two input streams at differen‐
tial rates. The on-chip FIFO memory has an input clock frequency of 100 MHz, and an output clock
frequency of 110 MHz. The channel multiplexer runs at 110 MHz and samples one input stream 27.3
percent of the time, and the second 72.7 percent of the time. You definitely need to know what the typical
and maximum input channel utilizations are before for this type of design. For example, if the first
channel hits 50% utilization, the output stream exceeds 100% utilization.
Figure 8-34: Data Path that Doubles the Clock Frequency
The diagram below illustrates a data path that uses a data format adapter and Avalon-ST channel
multiplexer to merge the 8-bit 100 MHz input from two streaming data sources into a single 16-bit
100MHz streaming output. This example shows an output with double the throughput of each interface
with a corresponding doubling of the data width.
Send Feedback
QPS5V1
8-50 Document Revision History 2015.11.02
Figure 8-35: Data Path to Double Data Width and Maintain Original Frequency
Data Source
Data Format
Input 8 Bits at 100 MHz 16 Bits at 100 MHz
Adapter
src sink src sink
src 16 Bits
Data Source at 100 MHz
Data Format
Input
8 Bits at 100 MHz Adapter 16 Bits at 100 MHz
src sink src sink
The diagram below illustrates a data path that uses the dual clock version of the on-chip FIFO memory
and Avalon-ST channel multiplexer to merge the 100 MHz input from two streaming data sources into a
single 200 MHz streaming output. This example shows an output with double the throughput of each
interface with a corresponding doubling of the clock frequency.
Figure 8-36: Data Path to Boost the Clock Frequency
src Output
Data Source On-Chip FIFO Memory 200 MHz
Dual Clock
Input
100 MHz 200 MHz
src sink src sink
Send Feedback
QPS5V1
2015.11.02 Document Revision History 8-51
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
Component Interface Tcl Reference
9
QPS5V1 Subscribe Send Feedback
Tcl commands allow you to perform a wide range of functions in Qsys. Command descriptions contain
the Qsys phases where you can use the command, for example, main program, elaboration, composition,
or fileset callback.
Qsys supports Avalon, AMBA AXI3 (version 1.0), AMBA AXI4 (version 2.0), AMBA AXI4-Lite (version
2.0), AMBA AXI4-Stream (version 1.0), and AMBA APB3 (version 1.0) interface specifications.
For more information about procedures for creating IP component _hw.tcl files in the Qsys Component
Editor, and supported interface standards, refer to Creating Qsys Components and Qsys Interconnect in
volume 1 of the Quartus Prime Handbook.
If you are developing an IP component to work with the Nios II processor, refer to Publishing Component
Information to Embedded Software in section 3 of the Nios II Software Developer's Handbook, which
describes how to publish hardware IP component information for embedded software tools, such as a C
compiler and a Board Support Package (BSP) generator.
Related Information
• Avalon Interface Specifications
• AMBA Protocol Specifications
• Creating Qsys Components on page 6-1
• Qsys Interconnect on page 7-1
• Publishing Component Information to Embedded Software
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V1
9-2 Interfaces and Ports 2015.11.02
Send Feedback
QPS5V1
2015.11.02 add_interface 9-3
add_interface
Description
Adds an interface to your module. An interface represents a collection of related signals that are managed
together in the parent system. These signals are implemented in the IP component's HDL, or exported
from an interface from a child instance. As the IP component author, you choose the name of the
interface.
Availability
Discovery, Main Program, Elaboration, Composition
Usage
add_interface <name> <type> <direction> [<associated_clock>]
Returns
No returns value.
Arguments
name
A name you choose to identify an interface.
type
The type of interface.
direction
The interface direction.
associated_clock (optional)
(deprecated) For interfaces requiring associated clocks, use: set_interface_property
<interface> associatedClock <clockInterface> For interfaces requiring associated
resets, use: set_interface_property <interface> associatedReset
<resetInterface>
Example
Notes
By default, interfaces are enabled. You can set the interface property ENABLED to false to disable an
interface. If an interface is disabled, it is hidden and its ports are automatically terminated to their default
values. Active high signals are terminated to 0. Active low signals are terminated to 1.
If the IP component is composed of child instances, the top-level interface is associated with a child
instance's interface with set_interface_property interface EXPORT_OF
child_instance.interface.
Send Feedback
QPS5V1
9-4 add_interface 2015.11.02
Related Information
• add_interface_port on page 9-5
• get_interface_assignments on page 9-9
• get_interface_properties on page 9-11
• get_interfaces on page 9-7
Send Feedback
QPS5V1
2015.11.02 add_interface_port 9-5
add_interface_port
Description
Adds a port to an interface on your module. The name must match the name of a signal on the top-level
module in the HDL of your IP component. The port width and direction must be set before the end of the
elaboration phase. You can set the port width as follows:
• In the Main program, you can set the port width to a fixed value or a width expression.
• If the port width is set to a fixed value in the Main program, you can update the width in the elabora‐
tion callback.
Availability
Main Program, Elaboration
Usage
add_interface_port <interface> <port> [<signal_type> <direction> <width_expression>]
Returns
Arguments
interface
The name of the interface to which this port belongs.
port
The name of the port. This name must match a signal in your top-level HDL for this IP
component.
signal_type (optional)
The type of signal for this port, which must be unique. Refer to the Avalon Interface
Specifications for the signal types available for each interface type.
direction (optional)
The direction of the signal. Refer to Direction Properties.
width_expression (optional)
The width of the port, in bits. The width may be a fixed value, or a simple arithmetic
expression of parameter values.
Example
fixed width:
add_interface_port mm_slave s0_rdata readdata output 32
width expression:
add_parameter DATA_WIDTH INTEGER 32
add_interface_port s0 rdata readdata output "DATA_WIDTH/2"
Related Information
• add_interface on page 9-3
• get_port_properties on page 9-13
• get_port_property on page 9-14
Send Feedback
QPS5V1
9-6 add_interface_port 2015.11.02
Send Feedback
QPS5V1
2015.11.02 get_interfaces 9-7
get_interfaces
Description
Returns a list of top-level interfaces.
Availability
Discovery, Main Program, Edit, Elaboration, Validation, Generation, Composition, Fileset Generation,
Parameter Upgrade
Usage
get_interfaces
Returns
A list of the top-level interfaces exported from the system.
Arguments
No arguments.
Example
get_interfaces
Related Information
add_interface on page 9-3
Send Feedback
QPS5V1
9-8 get_interface_assignment 2015.11.02
get_interface_assignment
Description
Returns the value of the specified assignment for the specified interface
Availability
Main Program, Elaboration, Validation, Composition
Usage
get_interface_assignment <interface> <assignment>
Returns
The value of the assignment.
Arguments
interface
The name of a top-level interface.
assignment
The name of an assignment.
Example
get_interface_assignment s1 embeddedsw.configuration.isFlash
Related Information
• add_interface on page 9-3
• get_interface_assignments on page 9-9
• get_interfaces on page 9-7
Send Feedback
QPS5V1
2015.11.02 get_interface_assignments 9-9
get_interface_assignments
Description
Returns the value of all interface assignments for the specified interface.
Availability
Main Program, Elaboration, Validation, Composition
Usage
get_interface_assignments <interface>
Returns
A list of assignment keys.
Arguments
interface
The name of the top-level interface whose assignment is being retrieved.
Example
get_interface_assignments s1
Related Information
• add_interface on page 9-3
• get_interface_assignment on page 9-8
• get_interfaces on page 9-7
Send Feedback
QPS5V1
9-10 get_interface_ports 2015.11.02
get_interface_ports
Description
Returns the names of all of the ports that have been added to a given interface. If the interface name is
omitted, all ports for all interfaces are returned.
Availability
Discovery, Main Program, Edit, Elaboration, Validation, Generation, Composition, Fileset Generation,
Parameter Upgrade
Usage
get_interface_ports [<interface>]
Returns
A list of port names.
Arguments
interface (optional)
The name of a top-level interface.
Example
get_interface_ports mm_slave
Related Information
• add_interface_port on page 9-5
• get_port_property on page 9-14
• set_port_property on page 9-18
Send Feedback
QPS5V1
2015.11.02 get_interface_properties 9-11
get_interface_properties
Description
Returns the names of all the interface properties for the specified interface as a space separated list
Availability
Discovery, Main Program, Edit, Elaboration, Validation, Generation, Composition, Fileset Generation,
Parameter Upgrade
Usage
get_interface_properties <interface>
Returns
A list of properties for the interface.
Arguments
interface
The name of an interface.
Example
get_interface_properties interface
Notes
The properties for each interface type are different. Refer to the Avalon Interface Specifications for more
information about interface properties.
Related Information
• get_interface_property on page 9-12
• set_interface_property on page 9-17
• Avalon Interface Specifications
Send Feedback
QPS5V1
9-12 get_interface_property 2015.11.02
get_interface_property
Description
Returns the value of a single interface property from the specified interface.
Availability
Discovery, Main Program, Elaboration, Composition, Fileset Generation
Usage
get_interface_property <interface> <property>
Returns
Arguments
interface
The name of an interface.
property
The name of the property whose value you want to retrieve. Refer to Interface Properties.
Example
Notes
The properties for each interface type are different. Refer to the Avalon Interface Specifications for more
information about interface properties.
Related Information
• get_interface_properties on page 9-11
• set_interface_property on page 9-17
• Avalon Interface Specifications
Send Feedback
QPS5V1
2015.11.02 get_port_properties 9-13
get_port_properties
Description
Returns a list of port properties.
Availability
Discovery, Main Program, Edit, Elaboration, Validation, Generation, Composition, Fileset Generation,
Parameter Upgrade
Usage
get_port_properties
Returns
A list of port properties. Refer to Port Properties.
Arguments
No arguments.
Example
get_port_properties
Related Information
• add_interface_port on page 9-5
• get_port_property on page 9-14
• set_port_property on page 9-18
• Port Properties on page 9-97
Send Feedback
QPS5V1
9-14 get_port_property 2015.11.02
get_port_property
Description
Returns the value of a property for the specified port.
Availability
Discovery, Main Program, Edit, Elaboration, Validation, Generation, Composition, Fileset Generation,
Parameter Upgrade
Usage
get_port_property <port> <property>
Returns
The value of the property.
Arguments
port
The name of the port.
property
The name of a port property. Refer to Port Properties.
Example
Related Information
• add_interface_port on page 9-5
• get_port_properties on page 9-13
• set_port_property on page 9-18
• Port Properties on page 9-97
Send Feedback
QPS5V1
2015.11.02 set_interface_assignment 9-15
set_interface_assignment
Description
Sets the value of the specified assignment for the specified interface.
Availability
Main Program, Elaboration, Validation, Composition
Usage
set_interface_assignment <interface> <assignment> [<value>]
Returns
No return value.
Arguments
interface
The name of the top-level interface whose assignment is being set.
assignment
The assignment whose value is being set.
value (optional)
The new assignment value.
Example
set_interface_assignment s1 embeddedsw.configuration.isFlash 1
Notes
Assignments for Nios II Software Build Tools
Interface assignments provide extra data for the Nios II Software Build Tools working with the generated
system.
Assignments for Qsys Tools
There are several assignments that guide behavior in the Qsys tools.
qsys.ui.export_name: If present, this interface should always be exported when an instance is
added to a Qsys system. The value is the requested name of the exported
interface in the parent system.
qsys.ui.connect: If present, this interface should be auto-connected when an instance is
added to a Qsys system. The value is a comma-separated list of other
interfaces on the same instance that should be connected with this
interface.
ui.blockdia- If present, the direction of this interface in the block diagram is set by the
gram.direction: user. The value is either "output" or "input".
Send Feedback
QPS5V1
9-16 set_interface_assignment 2015.11.02
Related Information
• add_interface on page 9-3
• get_interface_assignment on page 9-8
• get_interface_assignments on page 9-9
Send Feedback
QPS5V1
2015.11.02 set_interface_property 9-17
set_interface_property
Description
Sets the value of a property on an exported top-level interface. You can use this command to set the
EXPORT_OF property to specify which interface of a child instance is exported via this top-level interface.
Availability
Main Program, Elaboration, Composition
Usage
set_interface_property <interface> <property> <value>
Returns
No return value.
Arguments
interface
The name of an exported top-level interface.
property
The name of the property Refer to Interface Properties.
value
The new property value.
Example
Notes
The properties for each interface type are different. Refer to the Avalon Interface Specifications for more
information about interface properties.
Related Information
• get_interface_properties on page 9-11
• get_interface_property on page 9-12
• Interface Properties on page 9-90
• Avalon Interface Specifications
Send Feedback
QPS5V1
9-18 set_port_property 2015.11.02
set_port_property
Description
Sets a port property.
Availability
Main Program, Elaboration
Usage
set_port_property <port> <property> [<value>]
Returns
The new value.
Arguments
port
The name of the port.
property
One of the supported properties. Refer to Port Properties.
value (optional)
The value to set.
Example
Related Information
• add_interface_port on page 9-5
• get_port_properties on page 9-13
• set_port_property on page 9-18
Send Feedback
QPS5V1
2015.11.02 set_interface_upgrade_map 9-19
set_interface_upgrade_map
Description
Maps the interface name of an older version of an IP core to the interface name of the current IP core. The
interface type must be the same between the older and newer versions of the IP cores. This allows system
connections and properties to maintain proper functionality. By default, if the older and newer versions of
IP core have the same name and type, then Qsys maintains all properties and connections automatically.
Availability
Parameter Upgrade
Usage
Returns
No return value.
Arguments
{ <old_interface_name> <new_interface_name>}
List of mappings between between names of older and newer interfaces.
Example
Send Feedback
QPS5V1
9-20 Parameters 2015.11.02
Parameters
add_parameter on page 9-21
get_parameters on page 9-22
get_parameter_properties on page 9-23
get_parameter_property on page 9-24
get_parameter_value on page 9-25
get_string on page 9-26
load_strings on page 9-28
set_parameter_property on page 9-29
set_parameter_value on page 9-30
decode_address_map on page 9-31
Send Feedback
QPS5V1
2015.11.02 add_parameter 9-21
add_parameter
Description
Adds a parameter to your IP component.
Availability
Main Program
Usage
add_parameter <name> <type> [<default_value> <description>]
Returns
Arguments
name
The name of the parameter.
type
The data type of the parameter Refer to Parameter Type Properties.
default_value (optional)
The initial value of the parameter in a new instance of the IP component.
description (optional)
Explains the use of the parameter.
Example
Notes
Most parameter types have a single GUI element for editing the parameter value. string_list and
integer_list parameters are different, because they are edited as tables. A multi-column table can be
created by grouping multiple into a single table. To edit multiple list parameters in a single table, the
display items for the parameters must be added to a group with a TABLE hint:
add_parameter coefficients INTEGER_LIST add_parameter positions INTEGER_LIST
add_display_item "" "Table Group" GROUP TABLE add_display_item "Table Group"
coefficients PARAMETER add_display_item "Table Group" positions PARAMETER
Related Information
• get_parameter_properties on page 9-23
• get_parameter_property on page 9-24
• get_parameter_value on page 9-25
• set_parameter_property on page 9-29
• set_parameter_value on page 9-30
• Parameter Type Properties on page 9-95
Send Feedback
QPS5V1
9-22 get_parameters 2015.11.02
get_parameters
Description
Returns the names of all the parameters in the IP component.
Availability
Discovery, Main Program, Edit, Elaboration, Validation, Generation, Composition, Fileset Generation,
Parameter Upgrade
Usage
get_parameters
Returns
A list of parameter names
Arguments
No arguments.
Example
get_parameters
Related Information
• add_parameter on page 9-21
• get_parameter_property on page 9-24
• get_parameter_value on page 9-25
• get_parameters on page 9-22
• set_parameter_property on page 9-29
Send Feedback
QPS5V1
2015.11.02 get_parameter_properties 9-23
get_parameter_properties
Description
Returns a list of all the parameter properties as a list of strings. The get_parameter_property and
set_parameter_property commands are used to get and set the values of these properties, respectively.
Availability
Discovery, Main Program, Edit, Elaboration, Validation, Generation, Composition, Fileset Generation,
Parameter Upgrade
Usage
get_parameter_properties
Returns
A list of parameter property names. Refer to Parameter Properties.
Arguments
No arguments.
Example
Related Information
• add_parameter on page 9-21
• get_parameter_property on page 9-24
• get_parameter_value on page 9-25
• get_parameters on page 9-22
• set_parameter_property on page 9-29
• Parameter Properties on page 9-92
Send Feedback
QPS5V1
9-24 get_parameter_property 2015.11.02
get_parameter_property
Description
Returns the value of a property of a parameter.
Availability
Discovery, Main Program, Edit, Elaboration, Validation, Generation, Composition, Fileset Generation,
Parameter Upgrade
Usage
get_parameter_property <parameter> <property>
Returns
The value of the property.
Arguments
parameter
The name of the parameter whose property value is being retrieved.
property
The name of the property. Refer to Parameter Properties.
Example
Related Information
• add_parameter on page 9-21
• get_parameter_properties on page 9-23
• get_parameter_value on page 9-25
• get_parameters on page 9-22
• set_parameter_property on page 9-29
• set_parameter_value on page 9-30
• Parameter Properties on page 9-92
Send Feedback
QPS5V1
2015.11.02 get_parameter_value 9-25
get_parameter_value
Description
Returns the current value of a parameter defined previously with the add_parameter command.
Availability
Discovery, Edit, Elaboration, Validation, Generation, Composition, Fileset Generation, Parameter
Upgrade
Usage
get_parameter_value <parameter>
Returns
The value of the parameter.
Arguments
parameter
The name of the parameter whose value is being retrieved.
Example
Notes
If AFFECTS_ELABORATION is false for a given parameter, get_parameter_value is not available for that
parameter from the elaboration callback. If AFFECTS_GENERATION is false then it is not available from the
generation callback.
Related Information
• add_parameter on page 9-21
• get_parameter_property on page 9-24
• get_parameters on page 9-22
• set_parameter_property on page 9-29
• set_parameter_value on page 9-30
Send Feedback
QPS5V1
9-26 get_string 2015.11.02
get_string
Description
Returns the value of an externalized string previously loaded by the load_strings command.
Availability
Discovery, Main Program, Edit, Elaboration, Validation, Generation, Composition, Fileset Generation,
Parameter Upgrade
Usage
get_string <identifier>
Returns
The externalized string.
Arguments
identifier
The string identifer.
Example
hw.tcl:
load_strings test.properties
set_module_property NAME test
set_module_property VERSION [get_string VERSION]
set_module_property DISPLAY_NAME [get_string DISPLAY_NAME]
add_parameter firepower INTEGER 0 ""
set_parameter_property firepower DISPLAY_NAME [get_string PARAM_DISPLAY_NAME]
set_parameter_property firepower TYPE INTEGER
set_parameter_property firepower DESCRIPTION [get_string PARAM_DESCRIPTION]
test.properties:
DISPLAY_NAME = Trogdor!
VERSION = 1.0
PARAM_DISPLAY_NAME = Firepower
PARAM_DESCRIPTION = The amount of force to use when breathing fire.
Notes
Use uppercase words separated with underscores to name string identifiers. If you are externalizing
module properties, use the module property name for the string identifier:
If you are externalizing a parameter property, qualify the parameter property with the parameter name,
with uppercase format, if needed:
Send Feedback
QPS5V1
2015.11.02 get_string 9-27
If you use a string to describe a string format, end the identifier with _FORMAT.
Related Information
load_strings on page 9-28
Send Feedback
QPS5V1
9-28 load_strings 2015.11.02
load_strings
Description
Loads strings from an external .properties file.
Availability
Discovery, Main Program
Usage
load_strings <path>
Returns
No return value.
Arguments
path
The path to the properties file.
Example
hw.tcl:
load_strings test.properties
set_module_property NAME test
set_module_property VERSION [get_string VERSION]
set_module_property DISPLAY_NAME [get_string DISPLAY_NAME]
add_parameter firepower INTEGER 0 ""
set_parameter_property firepower DISPLAY_NAME [get_string PARAM_DISPLAY_NAME]
set_parameter_property firepower TYPE INTEGER
set_parameter_property firepower DESCRIPTION [get_string PARAM_DESCRIPTION]
test.properties:
DISPLAY_NAME = Trogdor!
VERSION = 1.0
PARAM_DISPLAY_NAME = Firepower
PARAM_DESCRIPTION = The amount of force to use when breathing fire.
Notes
Refer to the Java Properties File for properties file format. A .properties file is a text file with KEY=value
pairs. For externalized strings, the KEY is a string identifier and the value is the externalized string.
For example:
Related Information
• get_string on page 9-26
• Java Properties File
Send Feedback
QPS5V1
2015.11.02 set_parameter_property 9-29
set_parameter_property
Description
Sets a single parameter property.
Availability
Main Program, Edit, Elaboration, Validation, Composition
Usage
set_parameter_property <parameter> <property> <value>
Returns
Arguments
parameter
The name of the parameter that is being set.
property
The name of the property. Refer to Parameter Properties.
value
The new value for the property.
Example
Related Information
• add_parameter on page 9-21
• get_parameter_properties on page 9-23
• set_parameter_property on page 9-29
• Parameter Properties on page 9-92
Send Feedback
QPS5V1
9-30 set_parameter_value 2015.11.02
set_parameter_value
Description
Sets a parameter value. The value of a derived parameter can be updated by the IP component in the
elaboration callback or the edit callback. Any changes to the value of a derived parameter in the edit
callback will not be preserved.
Availability
Edit, Elaboration, Validation, Composition, Parameter Upgrade
Usage
set_parameter_value <parameter> <value>
Returns
No return value.
Arguments
parameter
The name of the parameter that is being set.
value
Specifies the new parameter value.
Example
Send Feedback
QPS5V1
2015.11.02 decode_address_map 9-31
decode_address_map
Description
Converts an XML–formatted address map into a list of Tcl lists. Each inner list is in the correct format for
conversion to an array. The XML code that describes each slave includes: its name, start address, and end
address.
Availability
Elaboration, Generation, Composition
Usage
decode_address_map <address_map_XML_string>
Returns
No return value.
Arguments
address_mapXML_string
An XML string that describes the address map of a master.
Example
In this example, the code describes the address map for the master that accesses the ext_ssram,
sys_clk_timer and sysid slaves. The format of the string may differ from the example below; it may
have different white space between the elements and include additional attributes or elements. Use the
decode_address_map command to decode the code that represents a master’s address map to ensure that
your code works with future versions of the address map.
<address-map>
<slave name='ext_ssram' start='0x01000000' end='0x01200000' />
<slave name='sys_clk_timer' start='0x02120800' end='0x02120820' />
<slave name='sysid' start='0x021208B8' end='0x021208C0' />
</address-map>
Note: Altera recommends that you use the code provided below to enumerate over the IP components
within an address map, rather than writing your own parser.
Send Feedback
QPS5V1
9-32 Display Items 2015.11.02
Display Items
add_display_item on page 9-33
get_display_items on page 9-35
get_display_item_properties on page 9-36
get_display_item_property on page 9-37
set_display_item_property on page 9-38
Send Feedback
QPS5V1
2015.11.02 add_display_item 9-33
add_display_item
Description
Specifies the following aspects of the IP component display:
• Creates logical groups for a IP component's parameters. For example, to create separate groups for the
IP component's timing, size, and simulation parameters. An IP component displays the groups and
parameters in the order that you specify the display items in the _hw.tcl file.
• Groups a list of parameters to create multi-column tables.
• Specifies an image to provide representation of a parameter or parameter group.
• Creates a button by adding a display item of type action. The display item includes the name of the
callback to run.
Availability
Main Program
Usage
add_display_item <parent_group> <id> <type> [<args>]
Returns
Arguments
parent_group
Specifies the group to which a display item belongs
id
The identifier for the display item. If the item being added is a parameter, this is the
parameter name. If the item is a group, this is the group name.
type
The type of the display item. Refer to Display Item Kind Properties.
args (optional)
Provides extra information required for display items.
Example
Send Feedback
QPS5V1
9-34 add_display_item 2015.11.02
Notes
The following examples illustrate further illustrate the use of arguments:
• add_display_item groupName id icon path-to-image-file
• add_display_item groupName parameterName parameter
• add_display_item groupName id text "your-text"
The your-text argument is a block of text that is displayed in the GUI. Some simple HTML formatting
is allowed, such as <b> and <i>, if the text starts with <html>.
• add_display_item parentGroupName childGroupName group [tab]
The tab is an optional parameter. If present, the group appears in separate tab in the GUI for the
instance.
• add_display_item parentGroupName actionName action buttonClickCallbackProc
Related Information
• get_display_item_properties on page 9-36
• get_display_item_property on page 9-37
• get_display_items on page 9-35
• set_display_item_property on page 9-38
• Display Item Kind Properties on page 9-101
Send Feedback
QPS5V1
2015.11.02 get_display_items 9-35
get_display_items
Description
Returns a list of all items to be displayed as part of the parameterization GUI.
Availability
Discovery, Main Program, Edit, Elaboration, Validation, Generation, Composition, Fileset Generation,
Parameter Upgrade
Usage
get_display_items
Returns
List of display item IDs.
Arguments
No arguments.
Example
get_display_items
Related Information
• add_display_item on page 9-33
• get_display_item_properties on page 9-36
• get_display_item_property on page 9-37
• set_display_item_property on page 9-38
Send Feedback
QPS5V1
9-36 get_display_item_properties 2015.11.02
get_display_item_properties
Description
Returns a list of names of the properties of display items that are part of the parameterization GUI.
Availability
Main Program
Usage
get_display_item_properties
Returns
A list of display item property names. Refer to Display Item Properties.
Arguments
No arguments.
Example
get_display_item_properties
Related Information
• add_display_item on page 9-33
• get_display_item_property on page 9-37
• set_display_item_property on page 9-38
• Display Item Properties on page 9-100
Send Feedback
QPS5V1
2015.11.02 get_display_item_property 9-37
get_display_item_property
Description
Returns the value of a specific property of a display item that is part of the parameterization GUI.
Availability
Main Program, Elaboration, Validation, Composition
Usage
get_display_item_property <display_item> <property>
Returns
The value of a display item property.
Arguments
display_item
The id of the display item.
property
The name of the property. Refer to Display Item Properties.
Example
Related Information
• add_display_item on page 9-33
• get_display_item_properties on page 9-36
• get_display_items on page 9-35
• set_display_item_property on page 9-38
• Display Item Properties on page 9-100
Send Feedback
QPS5V1
9-38 set_display_item_property 2015.11.02
set_display_item_property
Description
Sets the value of specific property of a display item that is part of the parameterization GUI.
Availability
Discovery, Main Program, Edit, Elaboration, Validation, Composition
Usage
set_display_item_property <display_item> <property> <value>
Returns
No return value.
Arguments
display_item
The name of the display item whose property value is being set.
property
The property that is being set. Refer to Display Item Properties.
value
The value to set.
Example
Related Information
• add_display_item on page 9-33
• get_display_item_properties on page 9-36
• get_display_item_property on page 9-37
• Display Item Properties on page 9-100
Send Feedback
QPS5V1
2015.11.02 Module Definition 9-39
Module Definition
add_documentation_link on page 9-40
get_module_assignment on page 9-41
get_module_assignments on page 9-42
get_module_ports on page 9-43
get_module_properties on page 9-44
get_module_property on page 9-45
send_message on page 9-46
set_module_assignment on page 9-47
set_module_property on page 9-48
add_hdl_instance on page 9-49
package on page 9-50
Send Feedback
QPS5V1
9-40 add_documentation_link 2015.11.02
add_documentation_link
Description
Allows you to link to documentation for your IP component.
Availability
Discovery, Main Program
Usage
add_documentation_link <title> <path>
Returns
No return value.
Arguments
title
The title of the document for use on menus and buttons.
path
A path to the IP component documentation, using a syntax that provides the entire URL,
not a relative path. For example: http://www.mydomain.com/
my_memory_controller.html or file:///datasheet.txt
Example
Send Feedback
QPS5V1
2015.11.02 get_module_assignment 9-41
get_module_assignment
Description
This command returns the value of an assignment. You can use the get_module_assignment and
set_module_assignment and the get_interface_assignment and set_interface_assignment
commands to provide information about the IP component to embedded software tools and applications.
Availability
Main Program, Elaboration, Validation, Composition
Usage
get_module_assignment <assignment>
Returns
The value of the assignment
Arguments
assignment
The name of the assignment whose value is being retrieved
Example
get_module_assignment embeddedsw.CMacro.colorSpace
Related Information
• get_module_assignments on page 9-42
• set_module_assignment on page 9-47
Send Feedback
QPS5V1
9-42 get_module_assignments 2015.11.02
get_module_assignments
Description
Returns the names of the module assignments.
Availability
Main Program, Elaboration, Validation, Composition
Usage
get_module_assignments
Returns
A list of assignment names.
Arguments
No arguments.
Example
get_module_assignments
Related Information
• get_module_assignment on page 9-41
• set_module_assignment on page 9-47
Send Feedback
QPS5V1
2015.11.02 get_module_ports 9-43
get_module_ports
Description
Returns a list of the names of all the ports which are currently defined.
Availability
Discovery, Main Program, Edit, Elaboration, Validation, Generation, Composition, Fileset Generation,
Parameter Upgrade
Usage
get_module_ports
Returns
A list of port names.
Arguments
No arguments.
Example
get_module_ports
Related Information
• add_interface on page 9-3
• add_interface_port on page 9-5
Send Feedback
QPS5V1
9-44 get_module_properties 2015.11.02
get_module_properties
Description
Returns the names of all the module properties as a list of strings. You can use the get_module_property
and set_module_property commands to get and set values of individual properties. The value returned
by this command is always the same for a particular version of Qsys
Availability
Discovery, Main Program, Edit, Elaboration, Validation, Generation, Composition, Fileset Generation,
Parameter Upgrade
Usage
get_module_properties
Returns
List of strings. Refer to Module Properties.
Arguments
No arguments.
Example
get_module_properties
Related Information
• get_module_property on page 9-45
• set_module_property on page 9-48
• Module Properties on page 9-103
Send Feedback
QPS5V1
2015.11.02 get_module_property 9-45
get_module_property
Description
Returns the value of a single module property.
Availability
Discovery, Main Program, Edit, Elaboration, Validation, Generation, Composition, Fileset Generation,
Parameter Upgrade
Usage
get_module_property <property>
Returns
Various.
Arguments
property
The name of the property, Refer to Module Properties.
Example
Related Information
• get_module_properties on page 9-44
• set_module_property on page 9-48
• Module Properties on page 9-103
Send Feedback
QPS5V1
9-46 send_message 2015.11.02
send_message
Description
Sends a message to the user of the IP component. The message text is normally interpreted as HTML. You
can use the <b> element to provide emphasis. If you do not want the message text to be interpreted as
HTML, then pass a list as the message level, for example, { Info Text }.
Availability
Discovery, Main Program, Edit, Elaboration, Validation, Generation, Composition, Fileset Generation,
Parameter Upgrade
Usage
send_message <level> <message>
Returns
No return value .
Arguments
level
The following message levels are supported:
• ERROR--Provides an error message. The Qsys system cannot be generated with existing
error messages.
• WARNING--Provides a warning message.
• INFO--Provides an informational message.
• PROGRESS--Reports progress during generation.
• DEBUG--Provides a debug message when debug mode is enabled.
message
The text of the message.
Example
Send Feedback
QPS5V1
2015.11.02 set_module_assignment 9-47
set_module_assignment
Description
Sets the value of the specified assignment.
Availability
Main Program, Elaboration, Validation, Composition
Usage
set_module_assignment <assignment> [<value>]
Returns
No return value.
Arguments
assignment
The assignment whose value is being set
value (optional)
The value of the assignment
Example
Related Information
• get_module_assignment on page 9-41
• get_module_assignments on page 9-42
Send Feedback
QPS5V1
9-48 set_module_property 2015.11.02
set_module_property
Description
Allows you to set the values for module properties.
Availability
Discovery, Main Program
Usage
set_module_property <property> <value>
Returns
No return value.
Arguments
property
The name of the property. Refer to Module Properties.
value
The new value of the property.
Example
Related Information
• get_module_properties on page 9-44
• get_module_property on page 9-45
• Module Properties on page 9-103
Send Feedback
QPS5V1
2015.11.02 add_hdl_instance 9-49
add_hdl_instance
Description
Adds an instance of a predefined module, referred to as a child or child instance. The HDL entity
generated from this instance can be instantiated and connected within this IP component's HDL.
Availability
Main Program, Elaboration, Composition
Usage
add_hdl_instance <entity_name> <ip_core_type> [<version>]
Returns
The entity name of the added instance.
Arguments
entity_name
Specifies a unique local name that you can use to manipulate the instance. This name is used
in the generated HDL to identify the instance.
ip_core_type
The type refers to a kind of instance available in the IP Catalog, for example
altera_avalon_uart.
version (optional)
The required version of the specified instance type. If no version is specified, the latest
version is used.
Example
Related Information
• get_instance_parameter_value on page 9-67
• get_instance_parameters on page 9-65
• get_instances on page 9-57
• set_instance_parameter_value on page 9-70
Send Feedback
QPS5V1
9-50 package 2015.11.02
package
Description
Allows you to specify a particular version of the Qsys software to avoid software compatibility issues, and
to determine which version of the _hw.tcl API to use for the IP component. You must use the package
command at the beginning of your _hw.tcl file.
Availability
Main Program
Usage
package require -exact qsys <version>
Returns
No return value
Arguments
version
The version of Qsys that you require, such as 14.1.
Example
Send Feedback
QPS5V1
2015.11.02 Composition 9-51
Composition
add_instance on page 9-52
add_connection on page 9-52
get_connections on page 9-54
get_connection_parameters on page 9-55
get_connection_parameter_value on page 9-56
get_instances on page 9-57
get_instance_interfaces on page 9-58
get_instance_interface_ports on page 9-59
get_instance_interface_properties on page 9-60
get_instance_property on page 9-61
set_instance_property on page 9-62
get_instance_properties on page 9-63
get_instance_interface_property on page 9-64
get_instance_parameters on page 9-65
get_instance_parameter_property on page 9-66
get_instance_parameter_value on page 9-67
get_instance_port_property on page 9-68
set_connection_parameter_value on page 9-69
set_instance_parameter_value on page 9-70
Send Feedback
QPS5V1
9-52 add_instance 2015.11.02
add_instance
Description
Adds an instance of an IP component, referred to as a child or child instance to the subsystem. You can
use this command to create IP components that are composed of other IP component instances. The HDL
for this subsystem will be generated; no custom HDL will need to be written for the IP component.
Availability
Main Program, Composition
Usage
add_instance <name> <type> [<version>]
Returns
No return value.
Arguments
name
Specifies a unique local name that you can use to manipulate the instance. This name is used
in the generated HDL to identify the instance.
type
The type refers to a type available in the IP Catalog, for example altera_avalon_uart.
version (optional)
The required version of the specified type. If no version is specified, the highest available
version is used.
Example
Related Information
• add_connection on page 9-52
• get_instance_interface_property on page 9-64
• get_instance_parameter_value on page 9-67
• get_instance_parameters on page 9-65
• get_instance_property on page 9-61
• get_instances on page 9-57
• set_instance_parameter_value on page 9-70
add_connection
Description
Connects the named interfaces on child instances together using an appropriate connection type. Both
interface names consist of a child instance name, followed by the name of an interface provided by that
Send Feedback
QPS5V1
2015.11.02 add_connection 9-53
module. For example, mux0.out is the interface named out on the instance named mux0. Be careful to
connect the start to the end, and not the other way around.
Availability
Main Program, Composition
Usage
add_connection <start> [<end> <kind> <name>]
Returns
The name of the newly added connection in start.point/end.point format.
Arguments
start
The start interface to be connected, in <instance_name>.<interface_name> format.
end (optional)
The end interface to be connected, <instance_name>.<interface_name>.
kind (optional)
The type of connection, such as avalon or clock.
name (optional)
A custom name for the connection. If unspecified, the name will be
<start_instance>.<interface>.<end_instance><interface>
Example
Related Information
• add_instance on page 9-52
• get_instance_interfaces on page 9-58
Send Feedback
QPS5V1
9-54 get_connections 2015.11.02
get_connections
Description
Returns a list of all connections in the composed subsystem.
Availability
Main Program, Composition
Usage
get_connections
Returns
A list of connections.
Arguments
No arguments.
Example
Related Information
add_connection on page 9-52
Send Feedback
QPS5V1
2015.11.02 get_connection_parameters 9-55
get_connection_parameters
Description
Returns a list of parameters found on a connection.
Availability
Main Program, Composition
Usage
get_connection_parameters <connection>
Returns
A list of parameter names
Arguments
connection
The connection to query.
Example
get_connection_parameters cpu.data_master/dma0.csr
Related Information
• add_connection on page 9-52
• get_connection_parameter_value on page 9-56
Send Feedback
QPS5V1
9-56 get_connection_parameter_value 2015.11.02
get_connection_parameter_value
Description
Returns the value of a parameter on the connection. Parameters represent aspects of the connection that
can be modified once the connection is created, such as the base address for an Avalon Memory Mapped
connection.
Availability
Composition
Usage
get_connection_parameter_value <connection> <parameter>
Returns
The value of the parameter.
Arguments
connection
The connection to query.
parameter
The name of the parameter.
Example
Related Information
• add_connection on page 9-52
• get_connection_parameters on page 9-55
Send Feedback
QPS5V1
2015.11.02 get_instances 9-57
get_instances
Description
Returns a list of the instance names for all child instances in the system.
Availability
Main Program, Elaboration, Validation, Composition
Usage
get_instances
Returns
A list of child instance names.
Arguments
No arguments.
Example
get_instances
Notes
This command can be used with instances created by either add_instance or add_hdl_instance.
Related Information
• add_hdl_instance on page 9-49
• add_instance on page 9-52
• get_instance_parameter_value on page 9-67
• get_instance_parameters on page 9-65
• set_instance_parameter_value on page 9-70
Send Feedback
QPS5V1
9-58 get_instance_interfaces 2015.11.02
get_instance_interfaces
Description
Returns a list of interfaces found in a child instance. The list of interfaces can change if the
parameterization of the instance changes.
Availability
Validation, Composition
Usage
get_instance_interfaces <instance>
Returns
A list of interface names.
Arguments
instance
The name of the child instance.
Example
get_instance_interfaces pixel_converter
Related Information
• add_instance on page 9-52
• get_instance_interface_ports on page 9-59
• get_instance_interfaces on page 9-58
Send Feedback
QPS5V1
2015.11.02 get_instance_interface_ports 9-59
get_instance_interface_ports
Description
Returns a list of ports found in an interface of a child instance.
Availability
Validation, Composition, Fileset Generation
Usage
get_instance_interface_ports <instance> <interface>
Returns
A list of port names found in the interface.
Arguments
instance
The name of the child instance.
interface
The name of an interface on the child instance.
Example
Related Information
• add_instance on page 9-52
• get_instance_interfaces on page 9-58
• get_instance_port_property on page 9-68
Send Feedback
QPS5V1
9-60 get_instance_interface_properties 2015.11.02
get_instance_interface_properties
Description
Returns the names of all of the properties of the specified interface
Availability
Validation, Composition
Usage
get_instance_interface_properties <instance> <interface>
Returns
List of property names.
Arguments
instance
The name of the child instance.
interface
The name of an interface on the instance.
Example
Related Information
• add_instance on page 9-52
• get_instance_interface_property on page 9-64
• get_instance_interfaces on page 9-58
Send Feedback
QPS5V1
2015.11.02 get_instance_property 9-61
get_instance_property
Description
Returns the value of a single instance property.
Availability
Main Program, Elaboration, Validation, Composition, Fileset Generation
Usage
get_instance_property <instance> <property>
Returns
Various.
Arguments
instance
The name of the instance.
property
The name of the property. Refer to Instance Properties.
Example
Related Information
• add_instance on page 9-52
• get_instance_properties on page 9-63
• set_instance_property on page 9-62
• Instance Properties on page 9-91
Send Feedback
QPS5V1
9-62 set_instance_property 2015.11.02
set_instance_property
Description
Allows a user to set the properties of a child instance.
Availability
Main Program, Elaboration, Validation, Composition
Usage
set_instance_property <instance> <property> <value>
Returns
Arguments
instance
The name of the instance.
property
The name of the property to set. Refer to Instance Properties.
value
The new property value.
Example
Related Information
• add_instance on page 9-52
• get_instance_properties on page 9-63
• get_instance_property on page 9-61
• Instance Properties on page 9-91
Send Feedback
QPS5V1
2015.11.02 get_instance_properties 9-63
get_instance_properties
Description
Returns the names of all the instance properties as a list of strings. You can use the
get_instance_property and set_instance_property commands to get and set values of individual
properties. The value returned by this command is always the same for a particular version of Qsys
Availability
Discovery, Main Program, Edit, Elaboration, Validation, Generation, Composition, Fileset Generation,
Parameter Upgrade
Usage
get_instance_properties
Returns
List of strings. Refer to Instance Properties.
Arguments
No arguments.
Example
get_instance_properties
Related Information
• add_instance on page 9-52
• get_instance_property on page 9-61
• set_instance_property on page 9-62
• Instance Properties on page 9-91
Send Feedback
QPS5V1
9-64 get_instance_interface_property 2015.11.02
get_instance_interface_property
Description
Returns the value of a property for an interface in a child instance.
Availability
Validation, Composition
Usage
get_instance_interface_property <instance> <interface> <property>
Returns
The value of the property.
Arguments
instance
The name of the child instance.
interface
The name of an interface on the child instance.
property
The name of the property of the interface.
Example
Related Information
• add_instance on page 9-52
• get_instance_interfaces on page 9-58
Send Feedback
QPS5V1
2015.11.02 get_instance_parameters 9-65
get_instance_parameters
Description
Returns a list of names of the parameters on a child instance that can be set using
set_instance_parameter_value. It omits parameters that are derived and those that have the
SYSTEM_INFO parameter property set.
Availability
Main Program, Elaboration, Validation, Composition
Usage
get_instance_parameters <instance>
Returns
A list of parameters in the instance.
Arguments
instance
The name of the child instance.
Example
Notes
You can use this command with instances created by either add_instance or add_hdl_instance.
Related Information
• add_hdl_instance on page 9-49
• add_instance on page 9-52
• get_instance_parameter_value on page 9-67
• get_instances on page 9-57
• set_instance_parameter_value on page 9-70
Send Feedback
QPS5V1
9-66 get_instance_parameter_property 2015.11.02
get_instance_parameter_property
Description
Returns the value of a property on a parameter in a child instance. Parameter properties are metadata
about how the parameter will be used by the Qsys tools.
Availability
Validation, Composition
Usage
get_instance_parameter_property <instance> <parameter> <property>
Returns
The value of the parameter property.
Arguments
instance
The name of the child instance.
parameter
The name of the parameter in the instance.
property
The name of the property of the parameter. Refer to Parameter Properties.
Example
Related Information
• add_instance on page 9-52
• Parameter Properties on page 9-92
Send Feedback
QPS5V1
2015.11.02 get_instance_parameter_value 9-67
get_instance_parameter_value
Description
Returns the value of a parameter in a child instance. You cannot use this command to get the value of
parameters whose values are derived or those that are defined using the SYSTEM_INFO parameter property.
Availability
Elaboration, Validation, Composition
Usage
get_instance_parameter_value <instance> <parameter>
Returns
The value of the parameter.
Arguments
instance
The name of the child instance.
parameter
Specifies the parameter whose value is being retrieved.
Example
Notes
You can use this command with instances created by either add_instance or add_hdl_instance.
Related Information
• add_hdl_instance on page 9-49
• add_instance on page 9-52
• get_instance_parameters on page 9-65
• get_instances on page 9-57
• set_instance_parameter_value on page 9-70
Send Feedback
QPS5V1
9-68 get_instance_port_property 2015.11.02
get_instance_port_property
Description
Returns the value of a property of a port contained by an interface in a child instance.
Availability
Validation, Composition, Fileset Generation
Usage
get_instance_port_property <instance> <port> <property>
Returns
The value of the property for the port.
Arguments
instance
The name of the child instance.
port
The name of a port in one of the interfaces on the child instance.
property
The property whose value is being retrieved. Only the following port properties can be
queried on ports of child instances: ROLE, DIRECTION, WIDTH, WIDTH_EXPR and VHDL_TYPE.
Refer to Port Properties.
Example
Related Information
• add_instance on page 9-52
• get_instance_interface_ports on page 9-59
• Port Properties on page 9-97
Send Feedback
QPS5V1
2015.11.02 set_connection_parameter_value 9-69
set_connection_parameter_value
Description
Sets the value of a parameter of the connection. The start and end are each interface names of the format
<instance>.<interface>. Connection parameters depend on the type of connection, for Avalon-MM
they include base addresses and arbitration priorities.
Availability
Main Program, Composition
Usage
set_connection_parameter_value <connection> <parameter> <value>
Returns
No return value.
Arguments
connection
Specifies the name of the connection as returned by the add_conectioncommand. It is of
the form start.point/end.point.
parameter
The name of the parameter.
value
The new parameter value.
Example
Related Information
• add_connection on page 9-52
• get_connection_parameter_value on page 9-56
Send Feedback
QPS5V1
9-70 set_instance_parameter_value 2015.11.02
set_instance_parameter_value
Description
Sets the value of a parameter for a child instance. Derived parameters and SYSTEM_INFO parameters for
the child instance can not be set with this command.
Availability
Main Program, Elaboration, Composition
Usage
set_instance_parameter_value <instance> <parameter> <value>
Returns
Vo return value.
Arguments
instance
Specifies the name of the child instance.
parameter
Specifies the parameter that is being set.
value
Specifies the new parameter value.
Example
Notes
You can use this command with instances created by either add_instance or add_hdl_instance.
Related Information
• add_hdl_instance on page 9-49
• add_instance on page 9-52
• get_instance_parameter_value on page 9-67
• get_instances on page 9-57
Send Feedback
QPS5V1
2015.11.02 Fileset Generation 9-71
Fileset Generation
add_fileset on page 9-72
add_fileset_file on page 9-73
set_fileset_property on page 9-74
get_fileset_file_attribute on page 9-75
set_fileset_file_attribute on page 9-76
get_fileset_properties on page 9-77
get_fileset_property on page 9-78
get_fileset_sim_properties on page 9-79
set_fileset_sim_properties on page 9-80
create_temp_file on page 9-81
Send Feedback
QPS5V1
9-72 add_fileset 2015.11.02
add_fileset
Description
Adds a generation fileset for a particular target as specified by the kind. Qsys calls the target (SIM_VHDL,
SIM_VERILOG, QUARTUS_SYNTH, or EXAMPLE_DESIGN) when the specified generation target is requested.
You can define multiple filesets for each kind of fileset. Qsys passes a single argument to the specified
callback procedure. The value of the argument is a generated name, which you must use in the top-level
module or entity declaration of your IP component. To override this generated name, you can set the
fileset property TOP_LEVEL.
Availability
Main Program
Usage
add_fileset <name> <kind> [<callback_proc> <display_name>]
Returns
No return value.
Arguments
name
The name of the fileset.
kind
The kind of fileset. Refer to Fileset Properties.
callback_proc (optional)
A string identifying the name of the callback procedure. If you add files in the global section,
you can then specify a blank callback procedure.
display_name (optional)
A display string to identify the fileset.
Example
Notes
If using the TOP_LEVEL fileset property, all parameterizations of the component must use identical HDL.
Related Information
• add_fileset_file on page 9-73
• get_fileset_property on page 9-78
• Fileset Properties on page 9-105
Send Feedback
QPS5V1
2015.11.02 add_fileset_file 9-73
add_fileset_file
Description
Adds a file to the generation directory. You can specify source file locations with either an absolute path,
or a path relative to the IP component's _hw.tcl file. When you use the add_fileset_file command in
a fileset callback, the Quartus Prime software compiles the files in the order that they are added.
Availability
Main Program, Fileset Generation
Usage
add_fileset_file <output_file> <file_type> <file_source> <path_or_contents> [<attributes>]
Returns
No return value.
Arguments
output_file
Specifies the location to store the file after Qsys generation
file_type
The kind of file. Refer to File Kind Properties.
file_source
Specifies whether the file is being added by path, or by file contents. Refer to File Source
Properties.
path_or_contents
When the file_source is PATH, specifies the file to be copied to output_file. When the
file_source is TEXT, specifies the text contents to be stored in the file.
attributes (optional)
An optional list of file attributes. Typically used to specify that a file is intended for use only
in a particular simulator. Refer to File Attribute Properties.
Example
Related Information
• add_fileset on page 9-72
• get_fileset_file_attribute on page 9-75
• File Kind Properties on page 9-109
• File Source Properties on page 9-110
• File Attribute Properties on page 9-108
Send Feedback
QPS5V1
9-74 set_fileset_property 2015.11.02
set_fileset_property
Description
Allows you to set the properties of a fileset.
Availability
Main Program, Elaboration, Fileset Generation
Usage
set_fileset_property <fileset> <property> <value>
Returns
No return value.
Arguments
fileset
The name of the fileset.
property
The name of the property to set. Refer to Fileset Properties.
value
The new property value.
Example
Notes
When a fileset callback is called, the callback procedure will be passed a single argument. The value of this
argument is a generated name which must be used in the top-level module or entity declaration of your IP
component. If set, the TOP_LEVEL specifies a fixed name for the top-level name of your IP component.
The TOP_LEVEL property must be set in the global section. It cannot be set in a fileset callback.
If using the TOP_LEVEL fileset property, all parameterizations of the IP component must use identical
HDL.
Related Information
• add_fileset on page 9-72
• Fileset Properties on page 9-105
Send Feedback
QPS5V1
2015.11.02 get_fileset_file_attribute 9-75
get_fileset_file_attribute
Description
Returns the attribute of a fileset file.
Availability
Main Program, Fileset Generation
Usage
get_fileset_file_attribute <output_file> <attribute>
Returns
Value of the fileset File attribute.
Arguments
output_file
Location of the output file.
attribute
Specifies the name of the attribute Refer to File Attribute Properties.
Example
Related Information
• add_fileset on page 9-72
• add_fileset_file on page 9-73
• get_fileset_file_attribute on page 9-75
• File Attribute Properties on page 9-108
• add_fileset on page 9-72
• add_fileset_file on page 9-73
• get_fileset_file_attribute on page 9-75
• File Attribute Properties on page 9-108
Send Feedback
QPS5V1
9-76 set_fileset_file_attribute 2015.11.02
set_fileset_file_attribute
Description
Sets the attribute of a fileset file.
Availability
Main Program, Fileset Generation
Usage
set_fileset_file_attribute <output_file> <attribute> <value>
Returns
The attribute value if it was set.
Arguments
output_file
Location of the output file.
attribute
Specifies the name of the attribute Refer to File Attribute Properties.
value
Value to set the attribute to.
Example
Send Feedback
QPS5V1
2015.11.02 get_fileset_properties 9-77
get_fileset_properties
Description
Returns a list of properties that can be set on a fileset.
Availability
Discovery, Main Program, Edit, Elaboration, Validation, Generation, Composition, Fileset Generation,
Parameter Upgrade
Usage
get_fileset_properties
Returns
A list of property names. Refer to Fileset Properties.
Arguments
No arguments.
Example
get_fileset_properties
Related Information
• add_fileset on page 9-72
• get_fileset_properties on page 9-77
• set_fileset_property on page 9-74
• Fileset Properties on page 9-105
Send Feedback
QPS5V1
9-78 get_fileset_property 2015.11.02
get_fileset_property
Description
Returns the value of a fileset property for a fileset.
Availability
Main Program, Elaboration, Fileset Generation
Usage
get_fileset_property <fileset> <property>
Returns
The value of the property.
Arguments
fileset
The name of the fileset.
property
The name of the property to query. Refer to Fileset Properties.
Example
Related Information
Fileset Properties on page 9-105
Send Feedback
QPS5V1
2015.11.02 get_fileset_sim_properties 9-79
get_fileset_sim_properties
Description
Returns simulator properties for a fileset.
Availability
Main Program, Fileset Generation
Usage
get_fileset_sim_properties <fileset> <platform> <property>
Returns
The fileset simulator properties.
Arguments
fileset
The name of the fileset.
platform
The operating system for that applies to the property. Refer to Operating System Properties.
property
Specifies the name of the property to set. Refer to Simulator Properties.
Example
Related Information
• add_fileset on page 9-72
• set_fileset_sim_properties on page 9-80
• Operating System Properties on page 9-117
• Simulator Properties on page 9-111
Send Feedback
QPS5V1
9-80 set_fileset_sim_properties 2015.11.02
set_fileset_sim_properties
Description
Sets simulator properties for a given fileset
Availability
Main Program, Fileset Generation
Usage
set_fileset_sim_properties <fileset> <platform> <property> <value>
Returns
The fileset simulator properties if they were set.
Arguments
fileset
The name of the fileset.
platform
The operating system that applies to the property. Refer to Operating System Properties.
property
Specifies the name of the property to set. Refer to Simulator Properties.
value
Specifies the value of the property.
Example
Related Information
• get_fileset_sim_properties on page 9-79
• Operating System Properties on page 9-117
• Simulator Properties on page 9-111
Send Feedback
QPS5V1
2015.11.02 create_temp_file 9-81
create_temp_file
Description
Creates a temporary file, which you can use inside the fileset callbacks of a _hw.tcl file. This temporary file
is included in the generation output if it is added using the add_fileset_file command.
Availability
Fileset Generation
Usage
create_temp_file <path>
Returns
The path to the temporary file.
Arguments
path
The name of the temporary file.
Example
Related Information
• add_fileset on page 9-72
• add_fileset_file on page 9-73
Send Feedback
QPS5V1
9-82 Miscellaneous 2015.11.02
Miscellaneous
check_device_family_equivalence on page 9-83
get_device_family_displayname on page 9-84
get_qip_strings on page 9-85
set_qip_strings on page 9-86
set_interconnect_requirement on page 9-87
Send Feedback
QPS5V1
2015.11.02 check_device_family_equivalence 9-83
check_device_family_equivalence
Description
Returns 1 if the device family is equivalent to one of the families in the device families lis., Returns 0 if the
device family is not equivalent to any families. This command ignores differences in capitalization and
spaces.
Availability
Discovery, Main Program, Edit, Elaboration, Validation, Composition, Fileset Generation, Parameter
Upgrade
Usage
check_device_family_equivalence <device_family> <device_family_list>
Returns
1 if equivalent, 0 if not equivalent.
Arguments
device_family
The device family name that is being checked.
device_family_list
The list of device family names to check against.
Example
Related Information
get_device_family_displayname on page 9-84
Send Feedback
QPS5V1
9-84 get_device_family_displayname 2015.11.02
get_device_family_displayname
Description
Returns the display name of a given device family.
Availability
Discovery, Main Program, Edit, Elaboration, Validation, Composition, Fileset Generation, Parameter
Upgrade
Usage
get_device_family_displayname <device_family>
Returns
The preferred display name for the device family.
Arguments
device_family
A device family name.
Example
Related Information
check_device_family_equivalence on page 9-83
Send Feedback
QPS5V1
2015.11.02 get_qip_strings 9-85
get_qip_strings
Description
Returns a Tcl list of QIP strings for the IP component.
Availability
Discovery, Main Program, Edit, Elaboration, Validation, Composition, Parameter Upgrade
Usage
get_qip_strings
Returns
A Tcl list of qip strings set by this IP component.
Arguments
No arguments.
Example
Related Information
set_qip_strings on page 9-86
Send Feedback
QPS5V1
9-86 set_qip_strings 2015.11.02
set_qip_strings
Description
Places strings in the Quartus Prime IP File (.qip) file, which Qsys passes to the command as a Tcl list. You
add the .qip file to your Quartus Prime project on the Files page, in the Settings dialog box. Successive
calls to set_qip_strings are not additive and replace the previously declared value.
Availability
Discovery, Main Program, Edit, Elaboration, Validation, Composition, Parameter Upgrade
Usage
set_qip_strings <qip_strings>
Returns
The Tcl list which was set.
Arguments
qip_strings
A space-delimited Tcl list.
Example
Notes
You can use the following macros in your QIP strings entry:
%entityName% The generated name of the entity replaces this macro when the string is written to
the .qip file.
%libraryName% The compilation library this IP component was compiled into is inserted in place of
this macro inside the .qip file.
%instanceName% The name of the instance is inserted in place of this macro inside the .qip file.
Related Information
get_qip_strings on page 9-85
Send Feedback
QPS5V1
2015.11.02 set_interconnect_requirement 9-87
set_interconnect_requirement
Description
Sets the value of an interconnect requirement for a system or an interface on a child instance.
Availability
Composition
Usage
set_interconnect_requirement <element_id> <name> <value>
Returns
No return value
Arguments
element_id
{$system} for system requirements, or qualified name of the interface of an instance, in
<instance>.<interface> format. Note that the system identifier has to be escaped in TCL.
name
The name of the requirement.
value
The new requirement value.
Example
Send Feedback
QPS5V1
9-88 Qsys _hw.tcl Property Reference 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Script Language Properties 9-89
Send Feedback
QPS5V1
9-90 Interface Properties 2015.11.02
Interface Properties
Name Description
CMSIS_SVD_FILE Specifies the connection point's associated CMSIS file.
CMSIS_SVD_VARIABLES Defines the variables inside a .svd file.
ENABLED Specifies whether or not interface is enabled.
EXPORT_OF For composed _hwl.tcl files, the EXPORT_OF property indicates which interface
of a child instance is to be exported through this interface. Before using this
command, you must have created the border interface using add_interface.
The interface to be exported is of the form <instanceName.interfaceName>.
Example: set_interface_property CSC_input EXPORT_OF my_colorSpace-
Converter.input_port
PORT_NAME_MAP A map of external port names to internal port names, formatted as a Tcl list.
Example: set_interface_property <interface name> PORT_NAME_MAP
"<new port name> <old port name> <new port name 2> <old port name
2>"
SVD_ADDRESS_GROUP Generates a CMSIS SVD file. Masters in the same SVD address group will write
register data of their connected slaves into the same SVD file
SVD_ADDRESS_OFFSET Generates a CMSIS SVD file. Slaves connected to this master will have their
base address offset by this amount in the SVD file.
Send Feedback
QPS5V1
2015.11.02 Instance Properties 9-91
Instance Properties
Name Description
HDLINSTANCE_GET_GENERATED_NAME Qsys uses this property to get the auto-generated fixed name when
the instance property HDLINSTANCE_USE_GENERATED_NAME is set to
true, and only applies to fileSet callbacks.
HDLINSTANCE_USE_GENERATED_NAME If true, instances added with the add_hdl_instance command are
instructed to use unique auto-generated fixed names based on the
parameterization.
SUPPRESS_ALL_INFO_MESSAGES If true, allows you to suppress all Info messages that originate
from a child instance.
SUPPRESS_ALL_WARNINGS If true, allows you to suppress alL warnings that originate from a
child instance
Send Feedback
QPS5V1
9-92 Parameter Properties 2015.11.02
Parameter Properties
Type Name Description
Boolean AFFECTS_ELABORATION Set AFFECTS_ELABORATION to false for parameters that do not affect
the external interface of the module. An example of a parameter that
does not affect the external interface is isNonVolatileStorage. An
example of a parameter that does affect the external interface is
width. When the value of a parameter changes, if that parameter has
set AFFECTS_ELABORATION=false, the elaboration phase (calling the
callback or hardware analysis) is not repeated, improving
performance. Because the default value of AFFECTS_ELABORATION is
true, the provided HDL file is normally re-analyzed to determine the
new port widths and configuration every time a parameter changes.
Boolean AFFECTS_GENERATION The default value of AFFECTS_GENERATION is false if you provide a
top-level HDL module; it is true if you provide a fileset callback. Set
AFFECTS_GENERATION to false if the value of a parameter does not
change the results of fileset generation.
Boolean AFFECTS_VALIDATION The AFFECTS_VALIDATION property marks whether a parameter's
value is used to set derived parameters, and whether the value affects
validation messages. When set to false, this may improve response
time in the parameter editor UI when the value is changed.
String[] ALLOWED_RANGES Indicates the range or ranges that the parameter value can have. For
integers, The ALLOWED_RANGES property is a list of ranges that the
parameter can take on, where each range is a single value, or a range
of values defined by a start and end value separated by a colon, such
as 11:15. This property can also specify legal values and display
strings for integers, such as {0:None 1:Monophonic 2:Stereo
4:Quadrophonic} meaning 0, 1, 2, and 4 are the legal values. You can
also assign display strings to be displayed in the parameter editor for
string variables. For example, ALLOWED_RANGES {"dev1:Cyclone IV
GX""dev2:Stratix V GT"}.
Send Feedback
QPS5V1
2015.11.02 Parameter Properties 9-93
String DISPLAY_NAME This is the GUI label that appears to the left of this parameter.
String DISPLAY_UNITS This is the GUI label that appears to the right of the parameter.
Boolean ENABLED When false, the parameter is disabled, meaning that it is displayed,
but greyed out, indicating that it is not editable on the parameter
editor.
String GROUP Controls the layout of parameters in GUI
Boolean HDL_PARAMETER When true, the parameter must be passed to the HDL IP component
description. The default value is false.
String LONG_DESCRIPTION A user-visible description of the parameter. Similar to DESCRIPTION,
but allows for a more detailed explanation.
String NEW_INSTANCE_VALUE This property allows you to change the default value of a parameter
without affecting older IP components that have did not explicitly set
a parameter value, and use the DEFAULT_VALUE property. The
practical result is that older instances will continue to use
DEFAULT_VALUE for the parameter and new instances will use the
value assigned by NEW_INSTANCE_VALUE.
String[] SYSTEM_INFO Allows you to assign information about the instantiating system to a
parameter that you define. SYSTEM_INFO requires an argument
specifying the type of information requested, <info-type>.
String SYSTEM_INFO_ARG Defines an argument to be passed to a particular SYSTEM_INFO
function, such as the name of a reset interface.
(various) SYSTEM_INFO_TYPE Specifies one of the types of system information that can be queried.
Refer to System Info Type Properties.
(various) TYPE Specifies the type of the parameter. Refer to Parameter Type
Properties.
(various) UNITS Sets the units of the parameter. Refer to Units Properties.
Boolean VISIBLE Indicates whether or not to display the parameter in the
parameterization GUI.
String WIDTH For a STD_LOGIC_VECTOR parameter, this indicates the width of the
logic vector.
Send Feedback
QPS5V1
9-94 Parameter Properties 2015.11.02
Related Information
• System Info Type Properties on page 9-113
• Parameter Type Properties on page 9-95
• Units Properties on page 9-116
Send Feedback
QPS5V1
2015.11.02 Parameter Type Properties 9-95
Send Feedback
QPS5V1
9-96 Parameter Status Properties 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Port Properties 9-97
Port Properties
Type Name Description
(various) DIRECTION The direction of the port from the IP component's perspective. Refer
to Direction Properties.
String DRIVEN_BY Indicates that this output port is always driven to a constant value or
by an input port. If all outputs on an IP component specify a
driven_by property, the HDL for the IP component will be generated
automatically.
String[] FRAGMENT_LIST This property can be used in 2 ways: First you can take a single RTL
signal and split it into multiple Qsys signals add_interface_port
<interface> foo <role> <direction> <width>
add_interface_port <interface> bar <role> <direction>
<width> set_port_property foo fragment_list
"my_rtl_signal(3:0)" set_port_property bar fragment_list
"my_rtl_signal(6:4)" Second you can take multiple RTL signals
and combine them into a single Qsys signal add_interface_port
<interface> baz <role> <direction> <width>
set_port_property baz fragment_list "rtl_signal_1(3:0)
rtl_signal_2(3:0)" Note: The listed bits in a port fragment must
match the declared width of the Qsys signal.
String ROLE Specifies an Avalon signal type such as waitrequest, readdata, or
read. For a complete list of signal types, refer to the Avalon Interface
Specifications.
Boolean TERMINATION When true, instead of connecting the port to the Qsys system, it is left
unconnected for output and bidir or set to a fixed value for input.
Has no effect for IP components that implement a generation callback
instead of using the default wrapper generation.
BigInteger TERMINATION_VALUE The constant value to drive an input port.
(various) VHDL_TYPE Indicates the type of a VHDL port. The default value, auto, selects
std_logic if the width is fixed at 1, and std_logic_vector
otherwise. Refer to Port VHDL Type Properties.
String WIDTH The width of the port in bits. Cannot be set directly. Any changes must
be set through the WIDTH_EXPR property.
String WIDTH_EXPR The width expression of a port. The width_value_expr property can
be set directly to a numeric value if desired. When
get_port_property is used width always returns the current integer
width of the port while width_expr always returns the unevaluated
width expression.
Integer WIDTH_VALUE The width of the port in bits. Cannot be set directly. Any changes must
be set through the WIDTH_EXPR property.
Related Information
• Direction Properties on page 9-99
Send Feedback
QPS5V1
9-98 Port Properties 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Direction Properties 9-99
Direction Properties
Name Description
Bidir Direction for a bidirectional signal.
Input Direction for an input signal.
Output Direction for an output signal.
Send Feedback
QPS5V1
9-100 Display Item Properties 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Display Item Kind Properties 9-101
Send Feedback
QPS5V1
9-102 Display Hint Properties 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Module Properties 9-103
Module Properties
Name Description
ANALYZE_HDL When set to false, prevents a call to the Quartus Prime mapper to
verify port widths and directions, speeding up generation time at
the expense of fewer validation checks. If this property is set to
false, invalid port widths and directions are discovered during
the Quartus Prime software compilation. This does not affect IP
components using filesets to manage synthesis files.
AUTHOR The IP component author.
COMPOSITION_CALLBACK The name of the composition callback. If you define a
composition callback, you cannot not define the generation or
elaboration callbacks.
DATASHEET_URL Deprecated. Use add_documentation_link to provide
documentation links.
DESCRIPTION The description of the IP component, such as "This IP
component puts the shizzle in the frobnitz."
DISPLAY_NAME The name to display when referencing the IP component, such as
"My Qsys IP Component".
EDITABLE Indicates whether you can edit the IP component in the
Component Editor.
ELABORATION_CALLBACK The name of the elaboration callback. When set, the IP
component's elaboration callback is called to validate and
elaborate interfaces for instances of the IP component.
GENERATION_CALLBACK The name for a custom generation callback.
GROUP The group in the IP Catalog that includes this IP component.
ICON_PATH A path to an icon to display in the IP component's parameter
editor.
INSTANTIATE_IN_SYSTEM_MODULE If true, this IP component is implemented by HDL provided by
the IP component. If false, the IP component will create exported
interfaces allowing the implementation to be connected in the
parent.
INTERNAL An IP component which is marked as internal does not appear in
the IP Catalog. This feature allows you to hide the sub-IP-
components of a larger composed IP component.
MODULE_DIRECTORY The directory in which the hw.tcl file exists.
MODULE_TCL_FILE The path to the hw.tcl file.
NAME The name of the IP component, such as my_qsys_component.
OPAQUE_ADDRESS_MAP For composed IP components created using a _hw.tcl file that
include children that are memory-mapped slaves, specifies
whether the children's addresses are visible to downstream
Send Feedback
QPS5V1
9-104 Module Properties 2015.11.02
Name Description
software tools. When true, the children's address are not visible.
When false, the children's addresses are visible.
PREFERRED_SIMULATION_LANGUAGE The preferred language to use for selecting the fileset for
simulation model generation.
REPORT_HIERARCHY null
STATIC_TOP_LEVEL_MODULE_NAME Deprecated.
STRUCTURAL_COMPOSITION_CALLBACK The name of the structural composition callback. This callback is
used to represent the structural hierarchical model of the IP
component and the RTL can be generated either with module
property COMPOSITION_CALLBACK or by ADD_FILESET with target
QUARTUS_SYNTH
Send Feedback
QPS5V1
2015.11.02 Fileset Properties 9-105
Fileset Properties
Name Description
ENABLE_FILE_OVERWRITE_MODE null
ENABLE_RELATIVE_INCLUDE_PATHS If true, HDL files can include other files using relative paths in the
fileset.
TOP_LEVEL The name of the top-level HDL module that the fileset generates. If
set, the HDL top level must match the TOP_LEVEL name, and the
HDL must not be parameterized. Qsys runs the generate callback
one time, regardless of the number of instances in the system.
Send Feedback
QPS5V1
9-106 Fileset Kind Properties 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Callback Properties 9-107
Callback Properties
Description
This list describes each type of callback. Each command may only be available in some callback contexts.
Name Description
ACTION Called when an ACTION display item's action is performed.
COMPOSITION Called during instance elaboration when the IP component contains a
subsystem.
EDITOR Called when the IP component is controlling the parameterization
editor.
ELABORATION Called to elaborate interfaces and signals after a parameter change. In
API 9.1 and later, validation is called before elaboration. In API 9.0
and earlier, elaboration is called before validation.
GENERATE_VERILOG_SIMULATION Called when the IP component uses a custom generator to generates
the Verilog simulation model for an instance.
GENERATE_VHDL_SIMULATION Called when the IP component uses a custom generator to generates
the VHDL simulation model for an instance.
GENERATION Called when the IP component uses a custom generator to generates
the synthesis HDL for an instance.
PARAMETER_UPGRADE Called when attempting to instantiate an IP component with a newer
version than the saved version. This allows the IP component to
upgrade parameters between released versions of the component.
STRUCTURAL_COMPOSITION Called during instance elaboration when an IP component is
represented by a structural hierarchical model which may be different
from the generated RTL.
VALIDATION Called to validate parameter ranges and report problems with the
parameter values. In API 9.1 and later, validation is called before
elaboration. In API 9.0 and earlier, elaboration is called before
validation.
Send Feedback
QPS5V1
9-108 File Attribute Properties 2015.11.02
Send Feedback
QPS5V1
2015.11.02 File Kind Properties 9-109
Send Feedback
QPS5V1
9-110 File Source Properties 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Simulator Properties 9-111
Simulator Properties
Name Description
ENV_ALDEC_LD_LIBRARY_PATH LD_LIBRARY_PATH when running riviera-pro
ENV_CADENCE_LD_LIBRARY_PATH LD_LIBRARY_PATH when running ncsim
ENV_MENTOR_LD_LIBRARY_PATH LD_LIBRARY_PATH when running modelsim
ENV_SYNOPSYS_LD_LIBRARY_PATH LD_LIBRARY_PATH when running vcs
OPT_ALDEC_PLI -pli option for riviera-pro
OPT_CADENCE_64BIT -64bit option for ncsim
OPT_CADENCE_PLI -loadpli1 option for ncsim
OPT_CADENCE_SVLIB -sv_lib option for ncsim
OPT_CADENCE_SVROOT -sv_root option for ncsim
OPT_MENTOR_64 -64 option for modelsim
OPT_MENTOR_CPPPATH -cpppath option for modelsim
OPT_MENTOR_LDFLAGS -ldflags option for modelsim
OPT_MENTOR_PLI -pli option for modelsim
OPT_SYNOPSYS_ACC +acc option for vcs
OPT_SYNOPSYS_CPP -cpp option for vcs
OPT_SYNOPSYS_FULL64 -full64 option for vcs
OPT_SYNOPSYS_LDFLAGS -LDFLAGS option for vcs
OPT_SYNOPSYS_LLIB -l option for vcs
OPT_SYNOPSYS_VPI +vpi option for vcs
Send Feedback
QPS5V1
9-112 Port VHDL Type Properties 2015.11.02
STD_LOGIC Indicates that the signal in not rendered in VHDL as a STD_LOGIC signal.
STD_LOGIC_VECTOR Indicates that the signal is rendered in VHDL as a STD_LOGIC_VECTOR signal.
Send Feedback
QPS5V1
2015.11.02 System Info Type Properties 9-113
Send Feedback
QPS5V1
9-114 System Info Type Properties 2015.11.02
Related Information
Design Environment Type Properties on page 9-115
Send Feedback
QPS5V1
2015.11.02 Design Environment Type Properties 9-115
Description
A design environment is used by IP to tell what sort of interfaces are most appropriate to connect in the
parent system.
Name Description
NATIVE Design environment prefers native IP interfaces.
QSYS Design environment prefers standard Qsys interfaces.
Send Feedback
QPS5V1
9-116 Units Properties 2015.11.02
Units Properties
Name Description
Address A memory-mapped address.
Bits Memory size, in bits.
BitsPerSecond Rate, in bits per second.
Bytes Memory size, in bytes.
Cycles A latency or count, in clock cycles.
GigabitsPerSecond Rate, in gigabits per second.
Gigabytes Memory size, in gigabytes.
Gigahertz Frequency, in GHz.
Hertz Frequency, in Hz.
KilobitsPerSecond Rate, in kilobits per second.
Kilobytes Memory size, in kilobytes.
Kilohertz Frequency, in kHz.
MegabitsPerSecond Rate, in megabits per second.
Megabytes Memory size, in megabytes.
Megahertz Frequency, in MHz.
Microseconds Time, in micros.
Milliseconds Time, in ms.
Nanoseconds Time, in ns.
None Unspecified units.
Percent A percentage.
Picoseconds Time, in ps.
Seconds Time, in s.
Send Feedback
QPS5V1
2015.11.02 Operating System Properties 9-117
Send Feedback
QPS5V1
9-118 Quartus.ini Type Properties 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Document Revision History 9-119
November 2012 12.1.0 • Added the demo_axi_memory example with screen shots and
example _hw.tcl code.
May 2011 11.0.0 • Revised section describing HDL and composed component
implementations.
• Separated reset and clock interfaces in example.
• Added: TRISTATECONDUIT_INFO, GENERATION_ID, UNIQUE_ID
SYSTEM_INFO.
• Added: WIDTH and SYSTEM_INFO_ARG parameter properties.
• Removed the doc_type argument from the add_documentation_
link command.
• Removed: get_instance_parameter_properties
• Added: add_fileset, add_fileset_file, create_temp_file.
• Updated Tcl examples to show separate clock and reset interfaces.
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2016.05.03
Qsys System Design Components
10
QPS5V1 Subscribe Send Feedback
You can use Qsys IP components to create Qsys systems. Qsys interfaces include components appropriate
for streaming high-speed data, reading and writing registers and memory, controlling off-chip devices,
and transporting data between components.
Qsys supports Avalon, AMBA AXI3 (version 1.0), AMBA AXI4 (version 2.0), AMBA AXI4-Lite (version
2.0), AMBA AXI4-Stream (version 1.0), and AMBA APB3 (version 1.0) interface specifications.
Related Information
• Avalon Interface Specifications
• AMBA Protocol Specifications
• Creating a System with Qsys on page 5-1
• Qsys Interconnect on page 7-1
• Embedded Peripherals IP User Guide
Bridges
Bridges affect the way Qsys transports data between components. You can insert bridges between master
and slave interfaces to control the topology of a Qsys system, which affects the interconnect that Qsys
generates. You can also use bridges to separate components into different clock domains to isolate clock
domain crossing logic.
A bridge has one slave interface and one master interface. In Qsys, one or more master interfaces from
other components connect to the bridge slave. The bridge master connects to one or more slave interfaces
on other components.
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V1
10-2 Bridges 2016.05.03
In this example, three masters have logical connections to three slaves, although physically each master
connects only to the bridge. Transfers initiated to the slave propagate to the master in the same order in
which the transfers are initiated on the slave.
M1 M2 M3
M M M
Bridge
S S S
S1 S2 S3
M Master
S Slave
Send Feedback
QPS5V1
2016.05.03 Clock Bridge 10-3
Clock Bridge
The Clock Bridge connects a clock source to multiple clock input interfaces. You can use the clock bridge
to connect a clock source that is outside the Qsys system. Create the connection through an exported
interface, and then connect to multiple clock input interfaces.
Clock outputs match fan-out performance without the use of a bridge. You require a bridge only when
you want a clock from an exported source to connect internally to more than one source.
Figure 10-2: Clock Bridge
CIn
Clock Bridge
COut
CIn S S M M CIn
PIO DMA
Qsys System
Send Feedback
QPS5V1
10-4 Avalon-MM Clock Crossing Bridge Example 2016.05.03
resets properly. Alternatively, you can drive both resets from the same reset source to guarantee
that the DC FIFO resets properly.
Note: The clock crossing bridge includes appropriate SDC constraints for its internal asynchronous
FIFOs. For these SDC constraints to work correctly, do not set false paths on the pointer crossings
in the FIFOs. You should also not split the bridge’s clocks into separate clock groups when you
declare SDC constraints; the split has the same effect as setting false paths.
Related Information
Creating a System with Qsys on page 5-1
Send Feedback
QPS5V1
2016.05.03 Avalon-MM Clock Crossing Bridge Example 10-5
CPU
S S
Avalon-MM Avalon-MM
Clock-Crossing Clock-Crossing
Bridge Bridge
M M
S S S S S S
Flash
Memory
S
S
DDR Avalon
SDRAM Tristate
Bridge
M
Send Feedback
QPS5V1
10-6 Avalon-MM Clock Crossing Bridge Parameters 2016.05.03
Master clock domain synchronizer depth 2, 3, 4, 5 bits The number of pipeline stages in the
clock crossing logic in the issuing
master to target slave direction.
Increasing this value leads to a larger
mean time between failures (MTBF).
You can determine the MTBF for a
design by running a TimeQuest
timing analysis.
Send Feedback
QPS5V1
2016.05.03 Avalon-MM Pipeline Bridge 10-7
Send Feedback
QPS5V1
10-8 Avalon-MM Unaligned Burst Expansion Bridge 2016.05.03
In this example, the bridge transfers commands received on its slave interface to its master port.
Exported to Embedded
Processor on PCB
XAUI PHY
Xcvr
S
Avalon-MM Interleave
Pipeline
Bridge (Qsys)
Interconnect
S PCS
S S S
Transceiver PMA
Low Latency
Reconfiguration Ch
Controller
Controller Cntl
Alt_PMA
Because the slave interface is exported to the pins of the device, having a single slave port, rather than
separate ports for each slave device, reduces the pin count of the FPGA.
Send Feedback
QPS5V1
2016.05.03 Using the Avalon-MM Unaligned Burst Expansion Bridge 10-9
64 bit Avalon-MM
Slave
Slave
You can use the Avalon Unaligned Burst Expansion Bridge to align read burst transactions from masters
that have narrower data widths than the target slaves. Using the bridge for this purpose improves
bandwidth utilization for the master-slave pair, and ensures that unaligned bursts are processed as single
transactions rather than multiple transactions.
Note: Do not use the Avalon-MM Unaligned Burst Expansion Bridge if any connected slave has read side
effects from reading addresses that are exposed to any connected master's address map. This bridge
can cause read side effects due to alignment modification to read burst transaction addresses.
Note: The Avalon-MM Unaligned Burst Expansion Bridge does not support VHDL simulation.
Related Information
Qsys Interconnect on page 7-1
Send Feedback
QPS5V1
10-10 Avalon-MM Unaligned Burst Expansion Bridge Parameters 2016.05.03
The bridge stores information about each aligned read burst command that it sends to slaves connected to
a master interface. When a read response is received on the master interface, the bridge determines if the
base address or burst length of the issued read burst command was altered.
If the bridge alters either the base address or the burst length of the issued read burst command, it receives
response words that the master did not request. The bridge suppresses words that it receives from the
aligned burst response that are not part of the original read burst command from the master.
Parameter Description
Data width Data width of the master connected to the bridge.
Address width (in WORDS) The address width of the master connected to the bridge.
Burstcount width The burstcount signal width of the master connected to the
bridge.
Send Feedback
QPS5V1
2016.05.03 Avalon-MM Unaligned Burst Expansion Bridge Example 10-11
Parameter Description
Maximum pending read transactions The Maximum pending read transactions parameter is the
maximum number of pending reads that the Avalon-MM
bridge can queue up. To determine the best value for this
parameter, review this same option for the bridge's
connected slaves and identify the highest value of the
parameter, and then add the internal buffering requirements
of the Avalon-MM bridge. In general, the value should be
between 4 and 32. The limit for maximum queued transac‐
tions is 64.
Width of slave to optimize for The data width of the connected slave. Supported values are:
16, 32, 64, 128, 256, 512, 1024, 2048, and 4096 bits.
Note: If you connect multiple slaves, all slaves must
have the same data width.
Pipeline command signals When turned on, the command path is pipelined,
minimizing the bridge's critical path at the expense of
increased logic usage and latency.
The example below shows an unaligned read burst command from a master that the Avalon-MM
Unaligned Burst Expansion Bridge converts to an aligned request for a connected slave, and the
suppression of words due to the aligned read burst command. In this example, a 32-bit master requests an
8-beat burst of 32-bit words from a 64-bit slave with a start address that is not 64-bit aligned.
Without Avalon-MM Unaligned Burst Expansion Bridge With Avalon-MM Unaligned Burst Expansion Bridge
0 0, 1 X Transaction 1 0 0, 1 X* X
1 X 2, 3 X X Transaction 2 1 X 2, 3 X X
2 X 4, 5 X X Transaction 3 2 X Bridge 4, 5 X X Transaction 1
Alignment
3 X 6, 7 X X Transaction 4 3 X 6, 7 X X
4 X 8, 9 X Transaction 5 4 X 8, 9 X X*
Transaction 1 Transaction 1
5 X A, B 5 X A, B
6 X C, D 6 X C, D
7 X E, F 7 X E, F
8 X 8 X Note: the bridge suppresses
9 9 X* response words
A A
B B
C C
Because the target slave has a 64-bit data width, address 1 is unaligned in the slave's address space. As a
result, several smaller burst transactions are needed to request the data associated with the master's read
burst command.
Send Feedback
QPS5V1
10-12 Bridges Between Avalon and AXI Interfaces 2016.05.03
With an Avalon-MM Unaligned Burst Expansion Bridge in place, the bridge issues a new read burst
command to the target slave beginning at address 0 with burst length 10, which requests data up to the
word stored at address 9.
When the bridge receives the word corresponding to address 0, it suppresses it from the master, and then
delivers the words corresponding to addresses 1 through 8 to the master. When the bridge receives the
word corresponding to address 9, it suppresses that word from the master.
Using an explicit Avalon-MM bridge to separate the AXI and Avalon domains reduces the amount of
bridging logic in the interconnect at the expense of concurrency.
AXI Avalon-MM
AXI Network Avalon-MM
Avalon-MM AXI
AXI Bridge
With an AXI bridge, you can influence the placement of resource-intensive components, such as the
width and burst adapters. Depending on its use, an AXI bridge may reduce throughput and concurrency,
in return for higher fMax and less logic.
You can use an AXI bridge to group different parts of your Qsys system. Then, other parts of the system
connect to the bridge interface instead of to multiple separate master or slave interfaces. You can also use
an AXI bridge to export AXI interfaces from Qsys systems.
The example below shows a system with a single AXI master and three AXI slaves. It also has various
interconnect components, such as routers, demultiplexers and multiplexer. Two of the slaves have a
narrower data width than the master; 16-bit slaves versus a 32-bit master. In this system, Qsys intercon‐
nect creates four width adapters and four burst adapters to access the two slaves. You could improve
Send Feedback
QPS5V1
2016.05.03 AXI Bridge 10-13
resource usage by adding an AXI bridge. Then, Qsys needs to add only two width adapters and two burst
adapters; one pair for the read channels, and another pair for the write channel.
Figure 10-9: AXI Example Without a Bridge: Adding a Bridge Can Reduce the Number of Adapters
Command
AXI Master AXI Master Mux_1
Agent
The example below shows the same system with an AXI bridge component, and the decrease in the
number of width and burst adapters. Qsys creates only two width adapters and two burst adapters, as
compared to the four width adapters and four burst adapters in the previous example. The system
includes more components, but the overall system performance improves because there are fewer
resource-intensive width and burst adapters.
Send Feedback
QPS5V1
10-14 AXI Bridge 2016.05.03
Figure 10-10: Width and Burst Adapters Added to a System With a Bridge
Router_0 Command
Demux_0
Interconnect_0 Command
Mux_2
AXI Slave AXI
Agent_1 Slave_2
AXI Master AXI Master Command
Agent Mux_1 By inserting an AXI bridge, the
interconnect Is divided into two
domains (interconnect_0 and
Router_1 Command interconnect_1). Notice the
Demux_1 reduction in the number of width
adapters from 4 to 2 after the
bridge insertion. The same
process applies for burst adapters.
Command Width Burst
Mux_3 Adapter_3 Adapter_3
Send Feedback
QPS5V1
2016.05.03 AXI Bridge Signal Types 10-15
Table 10-3: Sets of Signals for the AXI Bridge Based on the Protocol
Send Feedback
QPS5V1
10-16 AXI Bridge Parameters 2016.05.03
Send Feedback
QPS5V1
2016.05.03 AXI Bridge Slave and Master Interface Parameters 10-17
ARUSER Width integer 1-64 bits Controls the width of the read address
channel sideband signals of the master
and slave interfaces.
WUSER Width integer 1-64 bits Controls the width of the write data
channel sideband signals of the master
and slave interfaces.
RUSER Width integer 1-16 bits Controls the width of the read data
channel sideband signals of the master
and slave interfaces.
BUSER Width integer 1-16 bits Controls the width of the write response
channel sideband signals of the master
and slave interfaces.
Parameter Description
ID Width Controls the width of the thread ID of the master
and slave interfaces.
Write/Read/Combined Acceptance Capability Controls the depth of the FIFO that Qsys needs in
the interconnect agents based on the maximum
pending commands that the slave interface accepts.
Write/Read/Combined Issuing Capability Controls the depth of the FIFO that Qsys needs in
the interconnect agents based on the maximum
pending commands that the master interface issues.
Issuing capability must follow acceptance capability
to avoid unnecessary creation of FIFOs in the
bridge.
Note: Maximum acceptance/issuing capability is a model-only parameter and does not influence the
bridge HDL. The bridge does not backpressure when this limit is reached. Downstream
components and/or the interconnect must apply backpreasure.
Send Feedback
QPS5V1
10-18 AXI Timeout Bridge 2016.05.03
For a domain with multiple masters and slaves, placement of an AXI Timeout Bridge in your design may
be beneficial in the following scenarios:
• To recover from a hang, place the bridge near the slave. If the master attempts to communicate with a
slave that hangs, the AXI Timeout Bridge frees the master by generating error responses. The master is
then able to communicate with another slave.
• When debugging your system, place the AXI Timeout Bridge near the master. This placement enables
you to identify the origin of the burst and to obtain the full address from the master. Additionally,
placing an AXI Timeout Bridge near the master enables you to identify the target slave for the burst.
Note: If you put the bridge at the slave's side and you have multiple slaves connected to the same
master, you do not get the full address.
Send Feedback
QPS5V1
2016.05.03 AXI Timeout Bridge Stages 10-19
M0 S0
Interconnect
M1 S1
Simplest Form
Send Feedback
QPS5V1
10-20 AXI Timeout Bridge Stages 2016.05.03
A
No more A read/write
outstanding times out
commands
C B
Send Feedback
QPS5V1
2016.05.03 AXI Timeout Bridge Stages 10-21
• When a timeout occurs, the AXI Timeout Bridge asserts an interrupt and reports the burst that caused
the timeout to the Configuration and Status Register (CSR).
• The bridge then generates error responses back to the master on behalf of the unresponsive slave. This
stage frees the master and certifies the unresponsive slave as dysfunctional.
• The AXI Timeout Bridge accepts subsequent write addresses, write data and read addresses to the
dysfunctional slave. The bridge does not accept outstanding write responses, and read data from the
dysfunctional slave are not passed through to the master.
• The awvalid, wvalid, bready, arvalid, and rready ports are held low at the master interface of the
bridge.
Note: After a timeout, awvalid, wvalid and arvalid may be dropped before they are accepted by
awready at the master interface. While the behavior violates the AXI specification, it occurs only
on an interface connected to the slave which has been certified dysfunctional by the AXI Timeout
Bridge.
Write channel refers to the AXI write address, data and response channels. Similarly, read channel refers
to the AXI read address and data channels. AXI write and read channels are independent of each other.
However, when a timeout occurs on either channel, the bridge generates error responses on both
channels.
Table 10-6: Burst Start and End Definitions for the AXI Timeout Bridge
Read When an address is issued. First cycle of When the last data is issued. First cycle
arvalid. of rvalid and rlast.
The AXI Timeout Bridge has four required interfaces: Master, Slave, Configuration and Status Register
(CSR) (AXI4-Lite), and Interrupt. Qsys allows the AXI Timeout bridge to connect to any AXI3, AXI4, or
Avalon master or slave interface. Avalon masters must utilize the bridge’s interrupt output to detect a
timeout.
The bridge slave interface accepts write addresses, write data, and read addresses, and then generates the
SLVERR response at the write response and read data channels. You should not expect to use buser, rdata
and ruser at this stage of processing.
To resume normal operation, the dysfunctional slave must be reset and the bridge notified of the change
in status via the CSR. Once the CSR notifies the bridge that the slave is ready, the bridge does not accept
new commands until all outstanding bursts are responded to with an error response.
The CSR has a 4-bit address width, and a 32-bit data width. The CSR reports status and address informa‐
tion when the bridge asserts an interrupt.
Send Feedback
QPS5V1
10-22 AXI Timeout Bridge Parameters 2016.05.03
Table 10-7: CSR Interrupt Status Information for the AXI Timeout Bridge
0x4 read-only Timed out operation The operation of the burst that caused the
timeout. 1 for a write; 0 for a read.
0x8 through 0xf read-only Timed out address The address of the burst that caused the
timeout. For an address width greater than
32-bits, CSR reads addresses 0x8 and 0xc to
obtain the complete address.
Parameter Description
ID width The width of awid, bid, arid, or rid.
Send Feedback
QPS5V1
2016.05.03 CTRL Register Layout 10-23
2^M
2^M
2^N
Addess Span 2^N
Addess Span
Extender
Extender
Slave
Slave
Potential 2^M
Potential 2^M
0x0000 addess spans Register Z
Master 0x0000 addess spans
(64-bits) Master
Slave
Slave
Register
Register 0
(64-bits)
(64-bits)
0x0000
0x0000
where N < M, and the number of sub-windows = 1 where N < M, and the number of sub-windows = Z + 1
If a processor can address only 2GB of an address span, and your system contains 4GB of memory, the
address span extender can provide two, 2GB windows in the 4GB memory address space. This issue
sometimes occurs with Altera SoC devices. For example, an HPS subsystem in an SoC device can address
only 1GB of an address span within the FPGA, using the HPS-to-FPGA bridge. The address span extender
enables the SoC device to address all of the address space in the FPGA using multiple 1GB windows.
Parameter Description
Datapath Width Data path width of the downstream slave and the upstream master that
attach to the address span extender.
Expanded Master Byte Address Width of the master byte address port. That is, the address span size of
Width all the downstream slaves that attach to the address span extender.
Slave Word Address Width Width of the slave word address port. That is, the address span size of
the downstream slaves that the upstream master accesses.
Burstcount Width Burst count port width of the downstream slave and the upstream
master that attach to the address span extender.
Send Feedback
QPS5V1
10-24 Calculating the Address Span Extender Slave Address 2016.05.03
Parameter Description
Number of sub-windows The slave port can represent one or more windows in the master
address span. You can subdivide the slave address span into N equal
spans in N sub-windows. A remapping register in the CSR slave
represents each sub-window that you create. The remapping register in
the CSR slave configures the base address that each sub-window
remaps to. The address span extender replaces the upper address bits of
the addresses that pass through this bridge with the stored index value
in the remapping register before the master initiates a transaction.
Enable Slave Control Port Dictates run-time control over the sub-window indices. If you can
define static re-mappings that do not need any change, you do not
need to enable this CSR slave.
Send Feedback
QPS5V1
2016.05.03 Using the Address Span Extender 10-25
28-bit Slave
Word Address
[27:26] [25:0]
Control 1 0x00000000_08000000
Port 2 0x00000000_0C000000
3 0x00000000_00000000
38-bit Master
Byte Address
Send Feedback
QPS5V1
10-26 Using the Address Span Extender 2016.05.03
4GB SDRAM
Address Span
Extender
32-bit Address
Master
Peripherals
(LED and UART)
Avalon MM/AXI
Avalon ST
In the above design, a 32-bit master shares 4GB SDRAM with an external streaming interface. The master
has the path to access streaming data from the SDRAM DDR memory. However, if you connect the whole
32-bit address bus of the master to the SDRAM DDR memory, you cannot connect the master to
peripherals such as LED or UART. To avoid this situation, you can implement the address span extender
between the master and DDR memory. The address span extender allows the master to access the
SDRAM DDR memory and the peripherals at the same time.
To implement address span extender for the above example, you can divide the address window of the
address span extender into two sub-windows of 512MB each. The sub-window 0 is for the master
program area. You can dynamically map the sub-window 1 to any area other than the program area.
You can change the offset of the address window by setting the base address of sub-window 1 to the
control register of the address span extender. However, you must make sure that the sub-window address
span masks the base address. You can choose any arbitrary base address. If you set the value 0xa000_0000
to the control register, Qsys maps the sub-window 1 to 0xa000_0000.
Address Data
0x8000_0000 0x0000_0000
0x8000_0008 0xa000_0000
Send Feedback
QPS5V1
2016.05.03 Using the Address Span Extender 10-27
0xFFFF_FFFF
Peripherals
Sub-window 1
0xa000_0000
Address: 0x8000_0008
0xa0000_0000
CSR Area
0x8000_0000 Streaming Data
0x3FFF_FFFF
Address Span Extender
0x2000_0000
Extended Master Area Sub-window 0
0x0000_0000
The table below indicates the Qsys parameter settings for this address span extender example.
Table 10-11: Parameter Settings for the Address Span Extender Example
Datapath Width 32 bits The CPU has 32-bits data width and the SDRAM
DDR memory has 512-bits data width. Since the
transaction between the master and SDRAM DDR
memory is minimal, set the data path width to align
with the upstream master.
Expanded Master Byte Address 32 bits The address span extender has a 4GB address span.
Slave Word Address Width 18 bits There are two 512MB sub-windows in reserve for
the master. The number of bytes over the data word
width in the Data Path Properties (4 Bytes for this
example) accounts for the slave address.
Send Feedback
QPS5V1
10-28 Alternate Options for the Address Span Extender 2016.05.03
Enable Slave Control Port true The address span extender component must have
control to change the base address of the sub-
window.
Maximum Pending Reads 4 This number is the same as SDRAM DDR memory
burst count.
Note: You can view the address span extender connections in the System Contents tab. The windowed
slave port and control port connect to the master. The expanded master port connects to the
SDRAM DDR memory.
Send Feedback
QPS5V1
2016.05.03 NIOS II Support 10-29
If Burstcount Width is greater than 1, Qsys processes the read burst in a single cycle, and assumes all
byteenables are asserted on every cycle.
NIOS II Support
If the address span extender window is fixed, for example, the Disable Slave Control Port option is
turned on, then the address span extender performs as a bridge. Components on the slave side of the
address span extender that are within the window are visible to the NIOS II processor. Components
partially within a window appear to NIOS II as if they have a reduced span. For example, a memory
partially within a window appears as having a smaller size.
You can also use the address span extender to provide a window for the Nios II processor so that the HPS
memory map is visible to NIOS II. In this way it is possible for the Nios II to communicate with HPS
peripherals.
In the example below, a NIOS II processor has an address span extender from address 0x40000 to
0x80000. There is a window within the address span extender starting at 0x100000. Within the address
span extender's address space there is a slave at base address 0x1100000. The slave appears to NIOS II as
being at address:
0x140000
0x120000
Nios II
0x80000 Address Span Avalon-MM
Extender Slave
0x40000
0x110000
Effective Slave Base Address =
0x110000 - 0x100000 + 0x040000
0x100000
= 0x050000
If the address span extender window is dynamic. For example, when the Disable Slave Control Port
option is turned off, the NIOS II processor is unable to see components on the slave side of the address
span extender.
Send Feedback
QPS5V1
10-30 AXI Default Slave 2016.05.03
Related Information
Creating a System with Qsys on page 5-1
Send Feedback
QPS5V1
2016.05.03 AXI Default Slave Parameters 10-31
AXI address width 8-64 bits Determines the address width for error logging.
This value also affects the overall address width
of the system, and should not exceed the
maximum address width required in the system.
AXI data width 32, 64, Determines the data width for error logging.
or128 bits
Enable CSR Support (for error logging) On or Off When turned on, instantiates an Avalon CSR
interface for error logging.
Send Feedback
QPS5V1
10-32 CSR Registers 2016.05.03
Register Avalon CSR inputs On or Off When turned on, controls debug access to the
CSR interface.
CSR Registers
When an access violation occurs, and the CSR port is enabled, the AXI Default Slave generates an
interrupt and transfers the transaction information into the error log FIFO.
The error log count continues until the nth log, where n is the log depth. When Qsys responds to the
interrupt bit, it reads the register until the interrupt bit is no longer valid. The interrupt bit is valid as long
as there is a valid bit in FIFO. A cleared interrupt bit is not affected by the FIFO status. When Qsys
finishes reading the register, the access violation service is ready to receive new access violation requests.
If an access violation occurs when FIFO is full, then an overflow bit is set, indicating more than n access
violations have occurred, and some are not logged.
Qsys exits the access violation service after either the interrupt bit is no longer set, or when it determines
that the access violation service has continued for too long.
Send Feedback
QPS5V1
2016.05.03 CSR Read Access Violation Log 10-33
3:1 R0 0 Indicates the PROT of the initiating cycle that causes the
access violation.
0x104 31:0 R0 0 Master ID for the cycle that causes the access violation.
0x108 31:0 R0 0 Read cycle target address for the cycle that causes the
access violation (lower 32-bit).
Send Feedback
QPS5V1
10-34 CSR Write Access Violation Log 2016.05.03
3:1 R0 0 Indicates the PROT of the initiating cycle that causes the
access violation.
0x194 31:0 R0 0 Master ID for the cycle that causes the access violation.
0x198 31:0 R0 0 Write target address for the cycle that causes the access
violation (lower 32-bit).
0x19C 31:0 R0 0 Write target address for the cycle that causes the access
violation (upper 32-bit). Valid only if widest address in
system is larger than 32 bits.
Send Feedback
QPS5V1
2016.05.03 Designating a Default Slave in the System Contents Tab 10-35
0x1A4 31:0 R0 0 Bits [63:32] of the write data for the write cycle that
causes the access violation. Valid only if the data width
is greater than 32 -bits.
0x1A8 31:0 R0 0 Bits [95:64] of the write data for the write cycle that
causes the access violation. Valid only if the data width
is greater than 64 -bits.
0x1AC 31:0 R0 0 The first bits (127:96) of the write data for the write
cycle that causes the access violation. Valid only if the
data width is greater than 64 -bits.
Note: When this register is read, the current write
access violation log is recovered from FIFO.
Tri-State Components
The tri-state interface type allows you to design Qsys subsystems that connect to tri-state devices on your
PCB. You can use tri-state components to implement pin sharing, convert between unidirectional and
bidirectional signals, and create tri-state controllers for devices whose interfaces can be described using
the tri-state signal types.
Send Feedback
QPS5V1
10-36 Tri-State Components 2016.05.03
Figure 10-22: Tri-State Conduit System to Control Off-Chip SRAM and Flash Devices
In this example, there are two generic Tri-State Conduit Controllers. The first is customized to control a
flash memory. The second is customized to control an off-chip SSRAM. The Tri-State Conduit Pin Sharer
multiplexes between these two controllers, and the Tri-State Conduit Bridge converts between an on-chip
encoding of tri-state signals and true bidirectional signals. By default, the Tri-State Conduit Pin Sharer
and Tri-State Conduit Bridge present byte addresses. Typically, each address location contains more than
one byte of data.
Altera FPGA
Generic Tri-state
Controller
Parameterized Cn SSRAM
for 2 MByte
S x32 SSRAM TCM
TCS
M Tri-state
Nios II Tri-state
Conduit TCM TCS Cn
Processor Conduit
Pin
M Bridge
Generic Tri-state TCS Sharer
Controller
Parameterized
for 8 MByte Cn Flash
S x16 Flash TCM
Cn Conduit
Send Feedback
QPS5V1
2016.05.03 Tri-State Components 10-37
The flash device operates on 16-bit words and must ignore the least-significant bit of the Avalon-MM
address, and shows addr[0]as not connected. The SSRAM memory operates on 32-bit words and must
ignore the two, low-order memory bits. Because neither device requires a byte address, addr[0] is not
routed on the PCB.
The flash device responds to address range 0 MBytes to 8 MBytes-1. The SSRAM responds to address
range 8 MBytes to 10 MBytes-1. The PCB schematic for the PCB connects addr [21:0] to addr [18:0] of
the SSRAM device because the SSRAM responds to 32-bit word address. The 8 MByte flash device
accesses 16-bit words; consequently, the schematic does not connect addr[0]. The chipselect signals
select between the two devices.
PCB
8 MByte Flash
8 MByte Flash (16-bit word)
(16-bit word)
PCB_Addr [21:0]
Addr [21:0]
0
Note: If you create a custom tri-state conduit master with word aligned addresses, the Tri-state Conduit
Pin Sharer does not change or align the address signals.
Send Feedback
QPS5V1
10-38 Generic Tri-State Controller 2016.05.03
Related Information
• Avalon Interface Specifications
• Avalon Tri-State Conduit Components User Guide
Send Feedback
QPS5V1
2016.05.03 Tri‑State Conduit Pin Sharer 10-39
The parameter editor includes a Shared Signal Name column. If the widths of shared signals differ, the
signals are aligned on their 0th bit and the higher-order pins are driven to 0 whenever the smaller signal
has control of the bus. Unshared signals always propagate through the pin sharer. The tri-state conduit
pin sharer uses the round-robin arbiter to select between tri-state conduit controllers.
Note: All tri-state conduit components are connected to a pin sharer must be in the same clock domain.
Send Feedback
QPS5V1
10-40 Tri‑State Conduit Bridge 2016.05.03
Related Information
Avalon-ST Round Robin Scheduler on page 10-69
The test pattern generator core accepts commands to generate data via an Avalon-MM command
interface, and drives the generated data to an Avalon-ST data interface. You can parameterize most
aspects of the Avalon-ST data interface, such as the number of error bits and data signal width, thus
allowing you to test components with different interfaces.
control & status
Avalon-MM
Slave Port
Avalon-ST
Source
command data_out
Avalon-MM
TEST PATTERN
Slave Port
GENERATOR
Send Feedback
QPS5V1
2016.05.03 Test Pattern Generator Command Interface 10-41
The data pattern is calculated as: Symbol Value = Symbol Position in Packet XOR Data Error Mask. Data
that is not organized in packets is a single stream with no beginning or end. The test pattern generator has
a throttle register that is set via the Avalon-MM control interface. The test pattern generator uses the
value of the throttle register in conjunction with a pseudo-random number generator to throttle the data
generation rate.
Send Feedback
QPS5V1
10-42 Test Pattern Checker 2016.05.03
The test pattern checker core accepts data via an Avalon-ST interface and verifies it against the same
predetermined pattern that the test pattern generator uses to produce the data. The test pattern checker
core reports any exceptions to the control interface. You can parameterize most aspects of the test pattern
checker's Avalon-ST interface such as the number of error bits and the data signal width. This enables the
ability to test components with different interfaces. The test pattern checker has a throttle register that is
set via the Avalon-MM control interface. The value of the throttle register controls the rate at which data
is accepted.
control & status
Avalon-MM
Slave Port
CHECKER
Sink
The test pattern checker detects exceptions and reports them to the control interface via a 32-element
deep internal FIFO. Possible exceptions are data error, missing start-of-packet (SOP), missing end-of-
packet (EOP), and signaled error.
As each exception occurs, an exception descriptor is pushed into the FIFO. If the same exception occurs
more than once consecutively, only one exception descriptor is pushed into the FIFO. All exceptions are
ignored when the FIFO is full. Exception descriptors are deleted from the FIFO after they are read by the
control and status interface.
Send Feedback
QPS5V1
2016.05.03 Test Pattern Checker Functional Parameter 10-43
Software Programming Model for the Test Pattern Generator and Checker Cores
The HAL system library support, software files, and register maps describe the software programming
model for the test pattern generator and checker cores.
Send Feedback
QPS5V1
10-44 Register Maps for the Test Pattern Generator and Test Pattern Checker... 2016.05.03
Register Maps for the Test Pattern Generator and Test Pattern Checker Cores
Table 10-16: Test Pattern Generator Control and Status Register Map
Shows the offset for the test pattern generator control and status registers. Each register is 32-bits wide.
Offset Register Name
base + 0 status
base + 1 control
base + 2 fill
[0] ENABLE RW Setting this bit to 1 enables the test pattern generator core.
[7:1] Reserved
Send Feedback
QPS5V1
2016.05.03 Test Pattern Generator Command Registers 10-45
[16:8] THROTTLE RW Specifies the throttle value which can be between 0–256,
inclusively. The test pattern generator uses this value in conjunc‐
tion with a pseudo-random number generator to throttle the data
generation rate.
Setting THROTTLE to 0 stops the test pattern generator core. Setting
it to 256 causes the test pattern generator core to run at full
throttle. Values between 0–256 result in a data rate proportional to
the throttle value.
[17] SOFT RESET RW When this bit is set to 1, all internal counters and statistics are
reset. Write 0 to this bit to exit reset.
[31:18] Reserved
[6:1] Reserved
[31:16] Reserved
Shows the offset for the command registers. Each register is 32-bits wide.
Offset Register Name
base + 0 cmd_lo
base + 1 cmd_hi
The cmd_lo is pushed into the FIFO only when the cmd_lo register is addressed.
Send Feedback
QPS5V1
10-46 Test Pattern Checker Control and Status Registers 2016.05.03
[15:0] SIZE RW The segment size in symbols. Except for the last segment in a
packet, the size of all segments must be a multiple of the
configured number of symbols per beat. If this condition is not
met, the test pattern generator core inserts additional symbols to
the segment to ensure the condition is fulfilled.
[29:16] CHANNEL RW The channel to send the segment on. If the channel signal is less
than 14 bits wide, the test pattern generator uses the low order bits
of this register to drive the signal.
[30] SOP RW Set this bit to 1 when sending the first segment in a packet. This
bit is ignored when data packets are not supported.
[31] EOP RW Set this bit to 1 when sending the last segment in a packet. This bit
is ignored when data packets are not supported.
[15:0] SIGNALED RW Specifies the value to drive the error signal. A non-zero value
ERROR creates a signalled error.
[23:16] DATA ERROR RW The output data is XORed with the contents of this register to
create data errors. To stop creating data errors, set this register to
0.
[24] SUPPRESS RW Set this bit to 1 to suppress the assertion of the startofpacket
SOP signal when the first segment in a packet is sent.
[25] SUPRESS RW Set this bit to 1 to suppress the assertion of the endofpacket
EOP signal when the last segment in a packet is sent.
Table 10-23: Test Pattern Checker Control and Status Register Map
Shows the offset for the control and status registers. Each register is 32 bits wide.
Offset Register Name
base + 0 status
base + 1 control
Send Feedback
QPS5V1
2016.05.03 Test Pattern Checker Control and Status Registers 10-47
base + 2
base + 3 Reserved
base + 4
base + 5 exception_descriptor
base + 6 indirect_select
base + 7 indirect_count
[0] ENABLE RW Setting this bit to 1 enables the test pattern checker.
[7:1] Reserved
[16:8] THROTTLE RW Specifies the throttle value which can be between 0–256,
inclusively. Qsys uses this value in conjunction with a pseudo-
random number generator to throttle the data generation rate.
Setting THROTTLE to 0 stops the test pattern generator core. Setting
it to 256 causes the test pattern generator core to run at full
throttle. Values between 0–256 result in a data rate proportional to
the throttle value.
[17] SOFT RESET RW When this bit is set to 1, all internal counters and statistics are
reset. Write 0 to this bit to exit reset.
[31:18] Reserved
Send Feedback
QPS5V1
10-48 Test Pattern Checker Control and Status Registers 2016.05.03
[0] DATA ERROR RO A value of 1 indicates that an error is detected in the incoming
data.
[7:3] Reserved
[23:16] Reserved
[7:0] INDIRECT RW Specifies the channel number that applies to the INDIRECT
CHANNEL PACKET COUNT, INDIRECT SYMBOL COUNT, and INDIRECT ERROR
COUNT registers.
[15:8] Reserved
[31:16] INDIRECT RO The number of data errors that occurred on the channel specified
ERROR by INDIRECT CHANNEL.
[15:0] INDIRECT RO The number of data packets received on the channel specified by
PACKET INDIRECT CHANNEL.
COUNT
Send Feedback
QPS5V1
2016.05.03 Test Pattern Generator API 10-49
data_source_reset()
Table 10-29: data_source_reset()
Thread-safe No
Returns void
Description Resets the test pattern generator core including all internal counters
and FIFOs. The control and status registers are not reset by this
function.
Send Feedback
QPS5V1
10-50 data_source_init() 2016.05.03
data_source_init()
Table 10-30: data_source_init()
Thread-safe No
0—Initialization is unsuccessful.
data_source_get_id()
Table 10-31: data_source_get_id()
Thread-safe Yes
Send Feedback
QPS5V1
2016.05.03 data_source_get_supports_packets() 10-51
data_source_get_supports_packets()
Table 10-32: data_source_get_supports_packets()
Thread-safe Yes
Description Checks if the test pattern generator core supports data packets.
data_source_get_num_channels()
Table 10-33: data_source_get_num_channels()
Description Description
Thread-safe Yes
data_source_get_symbols_per_cycle()
Table 10-34: data_source_get_symbols_per_cycle()
Description Description
Thread-safe Yes
Send Feedback
QPS5V1
10-52 data_source_get_enable() 2016.05.03
Description Description
data_source_get_enable()
Table 10-35: data_source_get_enable()
Thread-safe Yes
data_source_set_enable()
Table 10-36: data_source_set_enable()
Thread-safe No
Returns void
Send Feedback
QPS5V1
2016.05.03 data_source_get_throttle() 10-53
Description Enables or disables the test pattern generator core. When disabled, the
test pattern generator core stops data transmission but continues to
accept commands and stores them in the FIFO
data_source_get_throttle()
Table 10-37: data_source_get_throttle()
Thread-safe Yes
data_source_set_throttle()
Table 10-38: data_source_set_throttle()
Thread-safe No
value—Throttle value.
Returns void
Description Sets the throttle value, which can be between 0–256 inclusively. The
throttle value, when divided by 256 yields the rate at which the test
pattern generator sends data.
Send Feedback
QPS5V1
10-54 data_source_is_busy() 2016.05.03
data_source_is_busy()
Table 10-39: data_source_is_busy()
Thread-safe Yes
Description Checks if the test pattern generator is busy. The test pattern generator
core is busy when it is sending data or has data in the command FIFO
to be sent.
data_source_fill_level()
Table 10-40: data_source_fill_level()
Thread-safe Yes
data_source_send_data()
Table 10-41: data_source_send_data()
Send Feedback
QPS5V1
2016.05.03 Test Pattern Checker API 10-55
Thread-safe No
size—Data size.
Returns Returns 1.
Description Sends a data fragment to the specified channel. If data packets are
supported, applications must ensure consistent usage of SOP and EOP
in each channel. Except for the last segment in a packet, the length of
each segment is a multiple of the data width.
If data packets are not supported, applications must ensure that there
are no SOP and EOP indicators in the data. The length of each segment
in a packet is a multiple of the data width.
Send Feedback
QPS5V1
10-56 data_sink_reset() 2016.05.03
data_sink_reset()
Table 10-42: data_sink_reset()
Thread-safe No
Returns void
Description Resets the test pattern checker core including all internal counters.
data_sink_init()
Table 10-43: data_sink_init()
Thread-safe No
Send Feedback
QPS5V1
2016.05.03 data_sink_get_id() 10-57
0—Initialization is unsuccessful.
Description Performs the following operations to initialize the test pattern checker
core:
• Resets and disables the test pattern checker core.
• Sets the throttle to the maximum value.
data_sink_get_id()
Table 10-44: data_sink_get_id()
Thread-safe Yes
data_sink_get_supports_packets()
Table 10-45: data_sink_get_supports_packets()
Thread-safe Yes
Description Checks if the test pattern checker core supports data packets.
Send Feedback
QPS5V1
10-58 data_sink_get_num_channels() 2016.05.03
data_sink_get_num_channels()
Table 10-46: data_sink_get_num_channels()
Thread-safe Yes
Description Retrieves the number of channels supported by the test pattern checker
core.
data_sink_get_symbols_per_cycle()
Table 10-47: data_sink_get_symbols_per_cycle()
Thread-safe Yes
Description Retrieves the number of symbols received by the test pattern checker
core in each beat.
data_sink_get_enable()
Table 10-48: data_sink_get_enable()
Thread-safe Yes
Send Feedback
QPS5V1
2016.05.03 data_sink_set enable() 10-59
data_sink_set enable()
Table 10-49: data_sink_set enable()
Thread-safe No
Returns void
data_sink_get_throttle()
Table 10-50: data_sink_get_throttle()
Thread-safe Yes
Send Feedback
QPS5V1
10-60 data_sink_set_throttle() 2016.05.03
data_sink_set_throttle()
Table 10-51: data_sink_set_throttle()
Thread-safe No
value—Throttle value.
Returns void
Description Sets the throttle value, which can be between 0–256 inclusively. The
throttle value, when divided by 256 yields the rate at which the test
pattern checker receives data.
data_sink_get_packet_count()
Table 10-52: data_sink_get_packet_count()
Thread-safe No
channel—Channel number.
Send Feedback
QPS5V1
2016.05.03 data_sink_get_error_count() 10-61
data_sink_get_error_count()
Table 10-53: data_sink_get_error_count()
Thread-safe No
channel—Channel number.
data_sink_get_symbol_count()
Table 10-54: data_sink_get_symbol_count()
Thread-safe No
channel—Channel number.
data_sink_get_exception()
Table 10-55: data_sink_get_exception()
Send Feedback
QPS5V1
10-62 data_sink_exception_is_exception() 2016.05.03
Thread-safe Yes
Description Retrieves the first exception descriptor in the exception FIFO and pops
it off the FIFO.
data_sink_exception_is_exception()
Table 10-56: data_sink_exception_is_exception()
Thread-safe Yes
0—No exception.
data_sink_exception_has_data_error()
Table 10-57: data_sink_exception_has_data_error()
Thread-safe Yes
Send Feedback
QPS5V1
2016.05.03 data_sink_exception_has_missing_sop() 10-63
0—No errors.
data_sink_exception_has_missing_sop()
Table 10-58: data_sink_exception_has_missing_sop()
Thread-safe Yes
data_sink_exception_has_missing_eop()
Table 10-59: data_sink_exception_has_missing_eop()
Thread-safe Yes
Send Feedback
QPS5V1
10-64 data_sink_exception_signalled_error() 2016.05.03
data_sink_exception_signalled_error()
Table 10-60: data_sink_exception_signalled_error()
Thread-safe Yes
Description Retrieves the value of the signaled error from the exception.
data_sink_exception_channel()
Table 10-61: data_sink_exception_channel()
Thread-safe Yes
Send Feedback
QPS5V1
2016.05.03 Avalon-ST Splitter Core 10-65
The Avalon-ST Splitter Core allows you to replicate transactions from an Avalon-ST source interface to
multiple Avalon-ST sink interfaces. This core supports from 1 to 16 outputs.
Output 0
Avalon-ST
Source 0
In_Data
Avalon-ST
Sink Avalon-ST
Splitter Core Out_Data
Avalon-ST
Source N
Clock
Output N
The Avalon-ST Splitter core copies input signals from the input interface to the corresponding output
signals of each output interface without altering the size or functionality. This includes all signals except
for the ready signal. The core includes a clock signal to determine the Avalon-ST interface and clock
domain where the core resides. Because the splitter core does nor use the clock signal internally, latency
is not introduced when using this core.
Send Feedback
QPS5V1
10-66 Splitter Core Parameters 2016.05.03
Feature Support
Bits Per Symbol 1–512 8 The number of bits per symbol for the input
and output interfaces. For example, byte-
oriented interfaces have 8-bit symbols.
Channel Width 0-8 1 The width of the channel signal on the data
interfaces. This parameter is disabled when
Use Channel is set to 0.
Send Feedback
QPS5V1
2016.05.03 Avalon-ST Delay Core 10-67
Error Width 0–31 1 The width of the error signal on the output
interfaces. A value of 0 indicates that the
splitter core is not using the error signal.
This parameter is disabled when Use Error
is set to 0.
The Avalon-ST Delay Core provides a solution to delay Avalon-ST transactions by a constant number of
clock cycles. This core supports up to 16 clock cycle delays.
In_Data
Avalon-ST
Avalon-ST
Out_Data
Source
Sink
Avalon-ST
Delay Core
Clock
The Delay core adds a delay between the input and output interfaces. The core accepts transactions
presented on the input interface and reproduces them on the output interface N cycles later without
changing the transaction.
The input interface delays the input signals by a constant N number of clock cycles to the corresponding
output signals of the output interface. The Number Of Delay Clocks parameter defines the constant N,
which must be between 0 and 16. The change of the in_valid signal is reflected on the out_valid signal
exactly N cycles later.
Send Feedback
QPS5V1
10-68 Delay Core Interfaces 2016.05.03
are held at 0 for N clock cycles. The delayed values of the input signals are then reflected at the output
signals after N clock cycles.
Feature Support
Bits Per Symbol 1–512 8 The number of bits per symbol for the input
and output interfaces. For example, byte-
oriented interfaces have 8-bit symbols.
Send Feedback
QPS5V1
2016.05.03 Avalon-ST Round Robin Scheduler 10-69
Channel Width 0-8 1 The width of the channel signal on the data
interfaces. This parameter is disabled when
Use Channel is set to 0.
Error Width 0–31 1 The width of the error signal on the output
interfaces. A value of 0 indicates that the
error signal is not in use. This parameter is
disabled when Use Error is set to 0.
The Avalon-ST Round Robin Scheduler core controls the read operations from a multi-channel Avalon-
ST component that buffers data by channels. It reads the almost-full threshold values from the multiple
channels in the multi-channel component and issues the read request to the Avalon-ST source according
to a round-robin scheduling algorithm.
Request
Avalon-ST Sink
Avalon-ST
Write Master
Avalon-MM
In a multi-channel component, the component can store data either in the sequence that it comes in
(FIFO), or in segments according to the channel. When data is stored in segments according to channels,
a scheduler is needed to schedule the read operations.
Send Feedback
QPS5V1
10-70 Almost-Full Status Interface (Round Robin Scheduler) 2016.05.03
Feature Property
Send Feedback
QPS5V1
2016.05.03 Round Robin Scheduler Parameters 10-71
request_address (log2 Max_ Out The write address that indicates which channel has
Channels–1:0) the request.
almost_full_data (log2 Max_ In A 1-bit signal that is asserted high to indicate that
Channels–1:0) the channel indicated by almost_full_channel is
almost full.
Number of channels 2–32 Specifies the number of channels the Avalon-ST Round
Robin Scheduler supports.
Use almost-full status 0–1 Specifies whether the scheduler uses the almost-full
interface. If not, the core requests data from the next
channel at the next clock cycle.
Send Feedback
QPS5V1
10-72 Avalon Packets to Transactions Converter 2016.05.03
The Avalon Packets to Transactions Converter core receives streaming data from upstream components
and initiates Avalon-MM transactions. The core then returns Avalon-MM transaction responses to the
requesting components.
Avalon-ST
Sink
data_in
Avalon-MM Master
Avalon
Packets to Avalon-MM
Transactions Slave
Converter Component
Avalon-ST
Source
data_out
Note: The SPI Slave to Avalon Master Bridge and JTAG to Avalon Master Bridge are examples of the
Packets to Transactions Converter core. For more information, refer to the Avalon Interface
Specifications.
Related Information
Avalon Interface Specifications
Feature Property
Send Feedback
QPS5V1
2016.05.03 Packets to Transactions Converter Operation 10-73
Feature Property
Packet Supported.
The Avalon-MM master interface supports read and write transactions. The data width is set to 32 bits,
and burst transactions are not supported.
[3:2] Size Transaction size in bytes. For write transactions, the size
indicates the size of the data field. For read transactions,
the size indicates the total number of bytes to read.
0 Transaction code The transaction code with the most significant bit
inversed.
Send Feedback
QPS5V1
10-74 Packets to Transactions Converter Supported Transactions 2016.05.03
Related Information
• Packets to Transactions Converter Interfaces on page 10-72
• Packets to Transactions Converter Interfaces on page 10-72
0x00 Write, non-incrementing address. Writes data to the address until the total number of bytes
written to the same word address equals to the value
specified in the size field.
0x04 Write, incrementing address. Writes transaction data starting at the current address.
0x10 Read, non-incrementing address. Reads 32 bits of data from the address until the total
number of bytes read from the same address equals to the
value specified in the size field.
0x14 Read, incrementing address. Reads the number of bytes specified in the size parameter
starting from the current address.
The Packets to Transactions Converter core can process only a single transaction at a time. The ready
signal on the core's Avalon-ST sink interface is asserted only when the current transaction is completely
processed.
No internal buffer is implemented on the data paths. Data received on the Avalon-ST interface is
forwarded directly to the Avalon-MM interface and vice-versa. Asserting the waitrequest signal on the
Avalon-MM interface backpressures the Avalon-ST sink interface. In the opposite direction, if the
Avalon-ST source interface is backpressured, the read signal on the Avalon-MM interface is not asserted
until the backpressure is alleviated. Backpressuring the Avalon-ST source in the middle of a read could
result in data loss. In this cases, the core returns the data that is successfully received.
A transaction is considered complete when the core receives an EOP. For write transactions, the actual
data size is expected to be the same as the value of the size property. Whether or not both values agree,
the core always uses the end of packet (EOP) to determine the end of data.
Send Feedback
QPS5V1
2016.05.03 Packets to Transactions Converter Malformed Packets 10-75
If the ready signal is not pipelined, the pipeline stage becomes a simple register.
Send Feedback
QPS5V1
10-76 Streaming Channel Multiplexer and Demultiplexer Cores 2016.05.03
If the ready signal is pipelined, the pipeline stage must also include a second "holding" register.
Full?
Register 1
data_in Sink Source data_out
Register 0
Full?
Related Information
Avalon-ST Round Robin Scheduler on page 10-69
Send Feedback
QPS5V1
2016.05.03 Avalon-ST Multiplexer 10-77
Avalon-ST Multiplexer
Figure 10-34: Avalon-ST Multiplexer
The Avalon-ST multiplexer takes data from a variety of input data interfaces, and multiplexes the data
onto a single output interface. The multiplexer includes a round-robin scheduler that selects from the next
input interface that has data. Each input interface has the same width as the output interface, so that the
other input interfaces are backpressured when the multiplexer is carrying data from a different input
interface.
data_in 0
sink
...
...
data_out
src
sink sink
data_in_ n
sink
The multiplexer includes an optional channel signal that enables each input interface to carry channelized
data. The output interface channel width is equal to:
(log2 (n-1)) + 1 + w
where n is the number of input interfaces, and w is the channel width of each input interface. All input
interfaces must have the same channel width. These bits are appended to either the most or least signifi‐
cant bits of the output channel signal.
The scheduler processes one input interface at a time, selecting it for transfer. Once an input interface has
been selected, data from that input interface is sent until one of the following scenarios occurs:
• The specified number of cycles have elapsed.
• The input interface has no more data to send and the valid signal is deasserted on a ready cycle.
• When packets are supported, endofpacket is asserted.
Send Feedback
QPS5V1
10-78 Multiplexer Output Interface 2016.05.03
Multiplexer Parameters
You can configure the following parameters for the multiplexer:
• Number of Input Ports—The number of input interfaces that the multiplexer supports. Valid values
are 2 to 16.
• Scheduling Size (Cycles)—The number of cycles that are sent from a single channel before changing
to the next channel.
• Use Packet Scheduling—When this parameter is turned on, the multiplexer only switches the selected
input interface on packet boundaries. Therefore, packets on the output interface are not interleaved.
• Use high bits to indicate source port—When this parameter is turned on, the multiplexer uses the
high bits of the output channel signal to indicate the origin of the input interface of the data. For
example, if the input interfaces have 4-bit channel signals, and the multiplexer has 4 input interfaces,
the output interface has a 6-bit channel signal. If this parameter is turned on, bits [5:4] of the output
channel signal indicate origin of the input interface of the data, and bits [3:0] are the channel bits that
were presented at the input interface.
Send Feedback
QPS5V1
2016.05.03 Avalon-ST Demultiplexer 10-79
Avalon-ST Demultiplexer
Figure 10-35: Avalon-ST Demultiplexer
That Avalon-ST demultiplexer takes data from a channelized input data interface and provides that data
to multiple output interfaces, where the output interface selected for a particular transfer is specified by
the input channel signal.
data_out 0
src
...
data_in
...
sink
sink sink
data_out _n
src
channel
The data is delivered to the output interfaces in the same order it is received at the input interface,
regardless of the value of channel, packet, frame, or any other signal. Each of the output interfaces has
the same width as the input interface; each output interface is idle when the demultiplexer is driving data
to a different output interface. The demultiplexer uses log2 (num_output_interfaces) bits of the
channel signal to select the output for the data; the remainder of the channel bits are forwarded to the
appropriate output interface unchanged.
Send Feedback
QPS5V1
10-80 Demultiplexer Parameters 2016.05.03
symbol, data, and error widths are the same as the input interface. The width of the channel signal is the
same as the input interface, without the bits that the demultiplexer uses to select the output interface.
Demultiplexer Parameters
You can configure the following parameters for the demultiplexer:
• Number of Output Ports—The number of output interfaces that the multiplexer supports Valid
values are 2 to 16.
• High channel bits select output—When this option is turned on, the demultiplexing function uses the
high bits of the input channel signal, and the low order bits are passed to the output. When this option
is turned off, the demultiplexing function uses the low order bits, and the high order bits are passed to
the output.
Where you place the signals in our design affects the functionality; for example, there is one input
interface and two output interfaces. If the low-order bits of the channel signal select the output interfaces,
the even channels goes to channel 0, and the odd channels goes to channel 1. If the high-order bits of the
channel signal select the output interface, channels 0 to 7 goes to channel 0 and channels 8 to 15 goes to
channel 1.
Figure 10-36: Select Bits for the Demultiplexer
sink
data_ out 0
src channel <3 .. 0 >
data_ in
channel <4 .. 0 > sink sink
data_out_n
src channel <3 .. 0 >
Send Feedback
QPS5V1
2016.05.03 Single-Clock and Dual-Clock FIFO Cores 10-81
csr
Avalon-MM
Slave
Avalon-ST Avalon-ST
Status Status
Source Source
almost_full almost_empty
Send Feedback
QPS5V1
10-82 Interfaces Implemented in FIFO Cores 2016.05.03
Avalon-ST
in_csr out_csr
Dual-Clock
FIFO
Avalon-MM Avalon-MM
Slave Slave
Clock A Clock B
Feature Property
Send Feedback
QPS5V1
2016.05.03 Avalon-MM Control and Status Register Interface 10-83
Feature Property
Error Configurable.
Packet Configurable.
Send Feedback
QPS5V1
10-84 Almost-Full and Almost-Empty Thresholds to Prevent Overflow and... 2016.05.03
the input clock domain represents the amount of space available in the FIFO (available space = FIFO
depth – input fill level).
Bits per symbol 1–32 These parameters determine the width of the FIFO.
FIFO width = Bits per symbol * Symbols per beat, where:
Symbols per beat 1–32
Bits per symbol is the number of bits in a symbol, and
Symbols per beat is the number of symbols transferred in
a beat.
FIFO depth 2n The FIFO depth. An output pipeline stage is added to the
FIFO to increase performance, which increases the FIFO
depth by one. <n> = n=1,2,3,4...
Send Feedback
QPS5V1
2016.05.03 Single-Clock and Dual-Clock FIFO Core Parameters 10-85
Use Store and Forward To turn on Cut-through mode, Use store and forward
must be set to 0. Turning on Use store and forward
prompts the user to turn on Use fill level, and then the
CSR appears.
Use sink fill level — Turn on this parameter to include the Avalon-MM
control and status register interface in the input clock
domain.
Use source fill level — Turn on this parameter to include the Avalon-MM control
and status register interface in the output clock domain.
Write pointer synchronizer 2–8 The length of the write pointer synchronizer chain. Setting
length this parameter to a higher value leads to better metasta‐
bility while increasing the latency of the core.
Read pointer synchronizer 2–8 The length of the read pointer synchronizer chain. Setting
length this parameter to a higher value leads to better metasta‐
bility.
Use Max Channel — Turn on this parameter to specify the maximum channel
number.
Note: For more information on metastability in Altera devices, refer to Understanding Metastability in
FPGAs. For more information on metastability analysis and synchronization register chains, refer
to the Managing Metastability.
Related Information
• Understanding Metastability in FPGAs
• Managing Metastability on page 13-1
Send Feedback
QPS5V1
10-86 Avalon-ST Single-Clock FIFO Registers 2016.05.03
The CSR interface in the Avalon-ST Single Clock FIFO core provides access to registers.
32-Bit Name Access Reset Description
Word
Offset
2 almost_ RW FIFO Set this register to a value that indicates the FIFO buffer is
full_ depth–1 getting full.
threshold
3 almost_ RW 0 Set this register to a value that indicates the FIFO buffer is
empty_ getting empty.
threshold
The in_csr and out_csr interfaces in the Avalon-ST Dual Clock FIFO core reports the FIFO fill level.
32-Bit Word Offset Name Access Reset Value Description
Send Feedback
QPS5V1
2016.05.03 Document Revision History 10-87
Related Information
• Avalon Interface Specifications
• Avalon Memory-Mapped Design Optimizations
The table below indicates edits made to the Qsys System Design Components content since its creation.
Date Version Changes
Send Feedback
QPS5V1
10-88 Document Revision History 2016.05.03
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2016.05.03
Recommended Design Practices
11
QPS5V1 Subscribe Send Feedback
This chapter provides design recommendations for Altera® devices and describes the Quartus Prime
Design Assistant, which helps you check your design for violations of Altera’s design recommendations.
Current FPGA applications have reached the complexity and performance requirements of ASICs. In the
development of complex system designs, good design practices have an enormous impact on the timing
performance, logic utilization, and system reliability of a device. Well-coded designs behave in a predict‐
able and reliable manner even when retargeted to different families or speed grades. Good design practices
also aid in successful design migration between FPGA and ASIC implementations for prototyping and
production.
For optimal performance, reliability, and faster time-to-market when designing with Altera devices, you
should adhere to the following guidelines:
• Understand the impact of synchronous design practices
• Follow recommended design techniques, including hierarchical design partitioning, and timing
closure guidelines
• Take advantage of the architectural features in the targeted device
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V1
11-2 Asynchronous Design Hazards 2016.05.03
inputs of registers change values. This change triggers a period of instability due to propagation delays
through the logic as the signals go through several transitions and finally settle to new values. Changes
that occur on data inputs of registers do not affect the values of their outputs until after the next active
clock edge.
Because the internal circuitry of registers isolates data outputs from inputs, instability in the combina‐
tional logic does not affect the operation of the design as long as you meet the following timing require‐
ments:
• Before an active clock edge, you must ensure that the data input has been stable for at least the setup
time of the register.
• After an active clock edge, you must ensure that the data input remains stable for at least the hold time
of the register.
When you specify all of your clock frequencies and other timing requirements, the Quartus Prime
TimeQuest Timing Analyzer reports actual hardware requirements for the setup times (tSU) and hold
times (tH) for every pin in your design. By meeting these external pin requirements and following
synchronous design techniques, you ensure that you satisfy the setup and hold times for all registers in
your device.
Tip: To meet setup and hold time requirements on all input pins, any inputs to combinational logic
that feed a register should have a synchronous relationship with the clock of the register. If
signals are asynchronous, you can register the signals at the inputs of the device to help prevent a
violation of the required setup and hold times.
When you violate the setup or hold time of a register, you might oscillate the output, or set the
output to an intermediate voltage level between the high and low levels called a metastable state.
In this unstable state, small perturbations such as noise in power rails can cause the register to
assume either the high or low voltage level, resulting in an unpredictable valid state. Various
undesirable effects can occur, including increased propagation delays and incorrect output states.
In some cases, the output can even oscillate between the two valid states for a relatively long
period of time.
Send Feedback
QPS5V1
2016.05.03 HDL Design Guidelines 11-3
combinational logic change, the outputs exhibit several glitches before they settle to their new values.
These glitches can propagate through the combinational logic, leading to incorrect values on the outputs
in asynchronous designs. In a synchronous design, glitches on the data inputs of registers are normal
events that have no negative consequences because the data is not processed until the clock edge.
Logic
Tip: Use recovery and removal analysis to perform timing analysis on asynchronous ports, such as clear
or reset in the Quartus Prime software.
Send Feedback
QPS5V1
11-4 Avoid Unintended Latch Inference 2016.05.03
Combinational loops are inherently high-risk design structures for the following reasons:
• Combinational loop behavior generally depends on relative propagation delays through the logic
involved in the loop. As discussed, propagation delays can change, which means the behavior of
the loop is unpredictable.
• Combinational loops can cause endless computation loops in many design tools. Most tools
break open combinational loops to process the design. The various tools used in the design flow
may open a given loop in a different manner, processing it in a way that is inconsistent with the
original design intent.
Send Feedback
QPS5V1
2016.05.03 Use Synchronous Pulse Generators 11-5
Pulse
T rigger
Using a Register
T rigger Pulse
Clock
A trigger signal feeds both inputs of a 2-input AND gate, but the design adds inverts to create a delay
chain to one of the inputs. The width of the pulse depends on the time differences between path that feeds
the gate directly, and the path that goes through the delay chain. This is the same mechanism responsible
for the generation of glitches in combinational logic following a change of input values. This technique
artificially increases the width of the glitch.
A register’s output drives the same register’s asynchronous reset signal through a delay chain. The register
resets itself asynchronously after a certain delay.
The width of pulses generated in this way are difficult for synthesis and place-and-route to determine, set,
or verify. The actual pulse width can only be determined after placement and routing, when routing and
propagation delays are known. You cannot reliably create a specific pulse width when creating HDL code,
and it cannot be set by EDA tools. The pulse may not be wide enough for the application under all PVT
conditions. Also, the pulse width changes if you change to a different device. Additionally, verification is
difficult because static timing analysis cannot verify the pulse width.
Multivibrators use a glitch generator to create pulses, together with a combinational loop that turns the
circuit into an oscillator. This creates additional problems because of the number of pulses involved.
Additionally, when the structures generate multiple pulses, they also create a new artificial clock in the
design must be analyzed by design tools.
When you must use a pulse generator, use synchronous techniques.
Figure 11-3: Recommended Pulse-Generation Technique
Pulse
T rigger Signal
Clock
The pulse width is always equal to the clock period. This pulse generator is predictable, can be verified
with timing analysis, and is easily moved to other architectures, devices, or speed grades.
Send Feedback
QPS5V1
11-6 Optimizing Clocking Schemes 2016.05.03
Clock
Generation
Logic Internally Generated Clock
Routed on Global Clock Resource
Registering the output of combinational logic ensures that glitches generated by the combinational logic
are blocked at the data input of the register.
Send Feedback
QPS5V1
2016.05.03 Avoid Asyncrhonous Clock Division 11-7
Clock 2
Select Signal
Send Feedback
QPS5V1
11-8 Use Gated Clocks 2016.05.03
Adding multiplexing logic to the clock signal can create the problems addressed in the previous sections,
but requirements for multiplexed clocks vary widely, depending on the application. Clock multiplexing is
acceptable when the clock signal uses global clock routing resources and if the following criteria are met:
• The clock multiplexing logic does not change after initial configuration
• The design uses multiplexing logic to select a clock for testing purposes
• Registers are always reset when the clock switches
• A temporarily incorrect response following clock switching has no negative consequences
If the design switches clocks in real time with no reset signal, and your design cannot tolerate a
temporarily incorrect response, you must use a synchronous design so that there are no timing
violations on the registers, no glitches on clock signals, and no race conditions or other logical
problems. By default, the Quartus Prime software optimizes and analyzes all possible paths through the
multiplexer and between both internal clocks that may come from the multiplexer. This may lead to
more restrictive analysis than required if the multiplexer is always selecting one particular clock. If you
do not require the more complete analysis, you can assign the output of the multiplexer as a base clock
in the Quartus Prime software, so that all register-to-register paths are analyzed using that clock.
Tip: Use dedicated hardware to perform clock multiplexing when it is available, instead of using
multiplexing logic. For example, you can use the clock-switchover feature or clock control block
available in certain Altera devices. These dedicated hardware blocks ensure that you use global
low-skew routing lines and avoid any possible hold time problems on the device due to logic
delay on the clock line.
Note: For device-specific information about clocking structures, refer to the appropriate device data sheet
or handbook on the Literature page of the Altera website.
Clock
You can use gated clocks to reduce power consumption in some device architectures by effectively
shutting down portions of a digital circuit when they are not in use. When a clock is gated, both the clock
network and the registers driven by it stop toggling, thereby eliminating their contributions to power
consumption. However, gated clocks are not part of a synchronous scheme and therefore can significantly
increase the effort required for design implementation and verification. Gated clocks contribute to clock
skew and make device migration difficult. These clocks are also sensitive to glitches, which can cause
design failure.
Use dedicated hardware to perform clock gating rather than an AND or OR gate. For example, you can
use the clock control block in newer Altera devices to shut down an entire clock network. Dedicated
hardware blocks ensure that you use global routing with low skew, and avoid any possible hold time
problems on the device due to logic delay on the clock line.
From a functional point of view, you can shut down a clock domain in a purely synchronous manner
using a synchronous clock enable signal. However, when using a synchronous clock enable scheme, the
Send Feedback
QPS5V1
2016.05.03 Use Synchronous Clock Enables 11-9
clock network continues toggling. This practice does not reduce power consumption as much as gating
the clock at the source does. In most cases, use a synchronous scheme.
Data
Enable
Clock
A register generates the enable signal to ensure that the signal is free of glitches and spikes. The register
that generates the enable signal is triggered on the inactive edge of the clock to be gated. Use the falling
edge when gating a clock that is active on the rising edge. Using this technique, only one input of the gate
that turns the clock on and off changes at a time. This prevents glitches or spikes on the output. Use an
AND gate to gate a clock that is active on the rising edge. For a clock that is active on the falling edge, use
an OR gate to gate the clock and register the enable command with a positive edge-triggered register.
Send Feedback
QPS5V1
11-10 Optimizing Physical Implementation and Timing Closure 2016.05.03
When using this technique, pay close attention to the duty cycle of the clock and the delay through the
logic that generates the enable signal because you must generate the enable command in one-half the
clock cycle. This situation might cause problems if the logic that generates the enable command is particu‐
larly complex, or if the duty cycle of the clock is severely unbalanced. However, careful management of
the duty cycle and logic delay may be an acceptable solution when compared with problems created by
other methods of gating clocks.
Ensure that you apply a clock setting to the gated clock in the TimeQuest analyzer. Apply a clock setting
to the output of the AND gate. Otherwise, the timing analyzer might analyze the circuit using the clock
path through the register as the longest clock path and the path that skips the register as the shortest clock
path, resulting in artificial clock skew.
In certain cases, converting the gated clocks to clock enables may help reduce glitch and clock skew, and
eventually produce a more accurate timing analysis. You can set the Quartus Prime software to automati‐
cally convert gated clocks to clock enables by turning on the Auto Gated Clock Conversion option. The
conversion applies to two types of gated clocking schemes: single-gated clock and cascaded-gated clock.
Send Feedback
QPS5V1
2016.05.03 Optimizing Timing Closure 11-11
When floorplanning a design, consider the balance of different types of device resources, such as memory,
logic, and DSP blocks in the main functional blocks. For example, if a design is memory intensive with a
small amount of logic, it may be difficult to develop an effective floorplan. Logic that interfaces with the
memory would have to spread across the chip to access the memory. In this case, it is important to use
enough register stages in the data and control paths to allow signals to traverse the chip to access the
physically disparate resources needed.
Send Feedback
QPS5V1
11-12 Optimizing Critical Timing Paths 2016.05.03
Send Feedback
QPS5V1
2016.05.03 Validating Against Design Rules 11-13
Design Files
Fitter
Post-Fitting Custom
Netlist Rules (2)
T iming Analysis
Send Feedback
QPS5V1
11-14 Creating Custom Design Rules 2016.05.03
• When you run the Design Assistant after running a full compilation or fitting, the Design Assistant
performs a post-fitting analysis on the design.
• When you run the Design Assistant after performing Analysis and Synthesis, the Design Assistant
performs post-synthesis analysis on the design.
• When you start the Design Assistant after performing Analysis and Elaboration, the Design Assistant
performs a pre-synthesis analysis on the design. You can also perform pre-synthesis analysis with the
Design Assistant using the command-line. You can use the -rtl option with the quartus_drc
executable, as shown in the following example:
quartus_drc <project_name> --rtl=on
If your design violates a design rule, the Design Assistant generates warning messages and information
messages about the violated rule. The Design Assistant displays these messages in the Messages
window, in the Design Assistant Messages report, and in the Design Assistant report files. You can find
the Design Assistant report files called <project_name>.drc.rpt in the <project_name> subdirectory of
the project directory.
Related Information
Design Assistant Rules
Send Feedback
QPS5V1
2016.05.03 Custom Design Rule Examples 11-15
<REPORTING_ROOT>
<MESSAGE NAME="Rule %ARG1%: Found %ARG2% node(s) related to this rule.">
<MESSAGE_ARGUMENT NAME="ARG1" TYPE="ATTRIBUTE" VALUE="ID" />
<MESSAGE_ARGUMENT NAME="ARG2" TYPE="TOTAL_NODE" VALUE="NODE_1" />
</MESSAGE>
</REPORTING_ROOT>
</DA_RULE>
The possible SR latch structures are specified in the rule definition section. Codes defined in the
<AND></AND> block are tied together, meaning that each statement in the block must be true for
the block to be fulfilled (AND gate similarity). In the <OR></OR> block, as long as one statement
in the block is true, the block is fulfilled (OR gate similarity). If no <AND></AND> or <OR></OR>
blocks are specified, the default is <AND></AND>.
The <FORBID></FORBID> section contains the undesirable condition for the design, which in this
case is the SR latch structures. If the condition is fulfilled, the Design Assistant highlights a rule
violation.
<AND>
<NODE_RELATIONSHIP FROM_NAME="NODE_1" FROM_TYPE="NAND" TO_NAME="NODE_2"
TO_TYPE="NAND" />
<NODE_RELATIONSHIP FROM_NAME="NODE_2" FROM_TYPE="NAND" TO_NAME="NODE_1"
TO_TYPE="NAND" />
</AND>
NAND2
NODE_1
NAND2
NODE_2
<AND>
<NODE_RELATIONSHIP FROM_NAME="NODE_1" FROM_TYPE="NOR" TO_NAME="NODE_2"
TO_TYPE="NOR" />
<NODE_RELATIONSHIP FROM_NAME="NODE_2" FROM_TYPE="NOR" TO_NAME="NODE_1"
TO_TYPE="NOR" />
</AND>
Send Feedback
QPS5V1
11-16 Custom Design Rule Examples 2016.05.03
This example shows how to use the CLOCK_RELATIONSHIP attribute to relate nodes to clock
domains. This example checks for correct synchronization in data transfer between asynchronous
clock domains. Synchronization is done with cascaded registers, also called synchronizers, at the
receiving clock domain. The code in This example checks for the synchronizer configuration
based on the following guidelines:
• The cascading registers need to be triggered on the same clock edge
• There is no logic between the register output of the transmitting clock domain and the
cascaded registers in the receiving asynchronous clock domain.
<RULE_DEFINITION>
<DECLARE>
<NODE NAME="NODE_1" TYPE="REG" />
<NODE NAME="NODE_2" TYPE="REG" />
<NODE NAME="NODE_3" TYPE="REG" />
</DECLARE>
<FORBID>
<NODE_RELATIONSHIP FROM_NAME="NODE_1" TO_NAME="NODE_2" TO_PORT="D_PORT"
CLOCK_RELATIONSHIP="ASYN" />
<NODE_RELATIONSHIP FROM_NAME="NODE_2" TO_NAME="NODE_3" TO_PORT="D_PORT"
CLOCK_RELATIONSHIP="!ASYN" />
<OR>
<NODE_RELATIONSHIP FROM_NAME="NODE_1" TO_NAME="NODE_2"
TO_PORT="D_PORT" REQUIRED_THROUGH="YES" THROUGH_TYPE="COMB" CLOCK_RELATION-
SHIP="ASYN" />
<CLOCK_RELATIONSHIP NAME="SEQ_EDGE|ASYN" NODE_LIST="NODE_2, NODE_3" />
</OR>
</FORBID>
</RULE_DEFINITION>
<REPORTING_ROOT>
<MESSAGE NAME="Rule %ARG1%: Found %ARG2% node(s) related to this rule.">
<MESSAGE_ARGUMENT NAME="ARG1" TYPE="ATTRIBUTE" VALUE="ID" />
<MESSAGE_ARGUMENT NAME="ARG2" TYPE="TOTAL_NODE" VALUE="NODE_1" />
<MESSAGE NAME="Source node(s): %ARG3%, Destination node(s): %ARG4%">
<MESSAGE_ARGUMENT NAME="ARG3" TYPE="NODE" VALUE="NODE_1" />
<MESSAGE_ARGUMENT NAME="ARG4" TYPE="NODE" VALUE="NODE_2" />
</MESSAGE>
Send Feedback
QPS5V1
2016.05.03 Custom Design Rule Examples 11-17
</MESSAGE>
</REPORTING_ROOT>
</DA_RULE>
The codes differentiate the clock domains. ASYN means asynchronous, and !ASYN means non-
asynchronous. This notation is useful for describing nodes that are in different clock domains.
The following lines from the example state that NODE_2 and NODE_3 are in the same clock domain,
but NODE_1 is not.
The next line of code states that NODE_2 and NODE_3 have a clock relationship of either sequential
edge or asynchronous.
The <FORBID></FORBID> section contains the undesirable condition for the design, which in this
case is the undesired configuration of the synchronizer. If the condition is fulfilled, the Design
Assistant highlights a rule violation.
The possible SR latch structures are specified in the rule definition section. Codes defined in the
<AND></AND> block are tied together, meaning that each statement in the block must be true for
the block to be fulfilled (AND gate similarity). In the <OR></OR> block, as long as one statement
in the block is true, the block is fulfilled (OR gate similarity). If no <AND></AND> or <OR></OR>
blocks are specified, the default is <AND></AND>.
The <FORBID></FORBID> section contains the undesirable condition for the design, which in this
case is the SR latch structures. If the condition is fulfilled, the Design Assistant highlights a rule
violation.
The following examples show the undesired conditions from with their equivalent block
diagrams:
Send Feedback
QPS5V1
11-18 Use Clock and Register-Control Architectural Features 2016.05.03
D Logic Q
CLOCK_1
CLOCK_2
D Q
CLOCK_1
CLOCK_2
Send Feedback
QPS5V1
2016.05.03 Use Global Reset Resources 11-19
You should limit the number of clocks in your design to the number of dedicated global clock resources
available in your FPGA. Clocks feeding multiple locations that do not use global routing may exhibit clock
skew across the device that could lead to timing problems. In addition, when you use combinational logic
to generate an internal clock, it adds delays on the clock path. In some cases, delay on a clock line can
result in a clock skew greater than the data path length between two registers. If the clock skew is greater
than the data delay, you violate the timing parameters of the register (such as hold time requirements) and
the design does not function correctly.
FPGAs offer a number of low-skew global routing resources to distribute high fan-out signals to help with
the implementation of large designs with many clock domains. Many large FPGA devices provide
dedicated global clock networks, regional clock networks, and dedicated fast regional clock networks.
These clocks are organized into a hierarchical clock structure that allows many clocks in each device
region with low skew and delay. There are typically several dedicated clock pins to drive either global or
regional clock networks, and both PLL outputs and internal clocks can drive various clock networks.
To reduce clock skew in a given clock domain and ensure that hold times are met in that clock domain,
assign each clock signal to one of the global high fan-out, low-skew clock networks in the FPGA device.
The Quartus Prime software automatically uses global routing for high fan-out control signals, PLL
outputs, and signals feeding the global clock pins on the device. You can make explicit Global Signal logic
option settings by turning on the Global Signal option setting. Use this option when it is necessary to
force the software to use the global routing for particular signals.
To take full advantage of these routing resources, the sources of clock signals in a design (input clock pins
or internally-generated clocks) need to drive only the clock input ports of registers. In older Altera device
families, if a clock signal feeds the data ports of a register, the signal may not be able to use dedicated
routing, which can lead to decreased performance and clock skew problems. In general, allowing clock
signals to drive the data ports of registers is not considered synchronous design and can complicate
timing analysis.
Send Feedback
QPS5V1
11-20 Use Synchronous Resets 2016.05.03
AND2
DFF
inst1
6
Dedicated Row LAB Clocks
6
Local Interconnect
Local Interconnect
Local Interconnect
Local Interconnect
Local Interconnect
Local Interconnect
Consider two types of synchronous resets when you examine the timing analysis of synchronous resets—
externally synchronized resets and internally synchronized resets. Externally synchronized resets are
synchronized to the clock domain outside the FPGA, and are not very common. A power-on asynchro‐
nous reset is dual-rank synchronized externally to the system clock and then brought into the FPGA.
Inside the FPGA, gate this reset with the data input to the registers to implement a synchronous reset.
Send Feedback
QPS5V1
2016.05.03 Use Synchronous Resets 11-21
por_n
FPG A
clock
INPU T
AND2
reset_n VCC
INPU T
data_a VCC
OUTPU T
lc 1 out_a
clock INPU T
VCC
AND2
data_b INPU T
VCC
OUTPU T
lc 2 out_b
The following example shows the Verilog equivalent of the schematic. When you use synchronous resets,
the reset signal is not put in the sensitivity list.
The following example shows the necessary modifications that you should make to the internally
synchronized reset.
module sync_reset_ext (
input clock,
input reset_n,
input data_a,
input data_b,
output out_a,
output out_b
);
reg reg1, reg2
assign out_a = reg1;
assign out_b = reg2;
always @ (posedge clock)
begin
if (!reset_n)
begin
reg1 <= 1’b0;
reg2 <= 1’b0;
end
else
begin
reg1 <= data_a;
reg2 <= data_b;
end
end
endmodule // sync_reset_ext
The following example shows the constraints for the externally synchronous reset. Because the
external reset is synchronous, you only need to constrain the reset_n signal as a normal input
signal with set_input_delay constraint for -max and -min.
Send Feedback
QPS5V1
11-22 Use Synchronous Resets 2016.05.03
More often, resets coming into the device are asynchronous, and must be synchronized internally
before being sent to the registers.
Figure 11-17: Internally Synchronized Reset
INPU T
VCC
AND2
INPU T
VCC
OUTPU T
lc 1
INPU T
VCC
AND2
INPU T
VCC
OUTPU T
lc 2
The following example shows the Verilog equivalent of the schematic. Only the clock edge is in
the sensitivity list for a synchronous reset.
module sync_reset (
input clock,
input reset_n,
input data_a,
input data_b,
output out_a,
output out_b
);
reg reg1, reg2
reg reg3, reg4
Send Feedback
QPS5V1
2016.05.03 Use Synchronous Resets 11-23
The SDC constraints are similar to the external synchronous reset, except that the input reset
cannot be constrained because it is asynchronous and should be cut with a set_false_path
statement to avoid these being considered as unconstrained paths.
An issue with synchronous resets is their behavior with respect to short pulses (less than a period)
on the asynchronous input to the synchronizer flipflops. This can be a disadvantage because the
asynchronous reset requires a pulse width of at least one period wide to guarantee that it is
captured by the first flipflop. However, this can also be viewed as an advantage in that this circuit
increases noise immunity. Spurious pulses on the asynchronous input have a lower chance of
being captured by the first flipflop, so the pulses do not trigger a synchronous reset. In some
cases, you might want to increase the noise immunity further and reject any asynchronous input
reset that is less than n periods wide to debounce an asynchronous input reset.
Send Feedback
QPS5V1
11-24 Using Asynchronous Resets 2016.05.03
BNAND2
INPU T
VCC
lc 3
AND2
INPU T
VCC
OUTPU T
lc 1
INPU T
VCC
AND2
INPU T
VCC
OUTPU T
lc 2
1. Junction dots indicate the number of stages. You can have more flip flops to get a wider pulse
that spans more clock cycles.
Many designs have more than one clock signal. In these cases, use a separate reset synchroni‐
zation circuit for each clock domain in the design. When you create synchronizers for PLL
output clocks, these clock domains are not reset until you lock the PLL and the PLL output
clocks are stable. If you use the reset to the PLL, this reset does not have to be synchronous
with the input clock of the PLL. You can use an asynchronous reset for this. Using a reset to
the PLL further delays the assertion of a synchronous reset to the PLL output clock domains
when using internally synchronized resets.
Send Feedback
QPS5V1
2016.05.03 Using Asynchronous Resets 11-25
INPU T
VCC
OUTPU T out_a
INPU T
VCC
INPU T
VCC
The following example shows the equivalent Verilog code. The active edge of the reset is now in the
sensitivity list for the procedural block, which infers a clock enable on the follower registers with the
inverse of the reset signal tied to the clock enable. The follower registers should be in a separate
procedural block as shown using non-blocking assignments.
module async_reset (
input clock,
input reset_n,
input data_a,
output out_a,
);
reg reg1, reg2, reg3;
assign out_a = reg3;
always @ (posedge clock, negedge reset_n)
begin
if (!reset_n)
reg1 <= 1’b0;
else
reg1 <= data_a;
end
always @ (posedge clock)
begin
reg2 <= reg1;
reg3 <= reg2;
end
endmodule // async_reset
You can easily constrain an asynchronous reset. By definition, asynchronous resets have a non-
deterministic relationship to the clock domains of the registers they are resetting. Therefore, static
timing analysis of these resets is not possible and you can use the set_false_path command to
exclude the path from timing analysis. Because the relationship of the reset to the clock at the
register is not known, you cannot run recovery and removal analysis in the TimeQuest analyzer
for this path. Attempting to do so even without the false path statement results in no paths
reported for recovery and removal.
Send Feedback
QPS5V1
11-26 Use Synchronized Asynchronous Reset 2016.05.03
-name {clock} \
-period 10.0 \
-waveform {0.0 5.0}
# Input constraints on data
set_input_delay 7.0 \
-max \
-clock [get_clocks {clock}]\
[get_ports {data_a}]
set_input_delay 1.0 \
-min \
-clock [get_clocks {clock}] \
[get_ports {data_a}]
# Cut the asynchronous reset input
set_false_path \
-from [get_ports {reset_n}] \
-to [all_registers]
The asynchronous reset is susceptible to noise, and a noisy asynchronous reset can cause a
spurious reset. You must ensure that the asynchronous reset is debounced and filtered. You can
easily enter into a reset asynchronously, but releasing a reset asynchronously can lead to potential
problems (also referred to as “reset removal”) with metastability, including the hazards of
unwanted situations with synchronous circuits involving feedback.
Send Feedback
QPS5V1
2016.05.03 Use Synchronized Asynchronous Reset 11-27
VCC
DFF DFF
reg3 reg4
DFF
reset_n INPU T
VCC reg1
DFF
reg2
The following example shows the equivalent Verilog HDL code. Use the active edge of the reset in the
sensitivity list for the blocks.
module sync_async_reset (
input clock,
input reset_n,
input data_a,
input data_b,
output out_a,
output out_b
);
reg reg1, reg2;
reg reg3, reg4;
assign out_a = reg1;
assign out_b = reg2;
assign rst_n = reg4;
always @ (posedge clock, negedge reset_n)
begin
if (!reset_n)
begin
reg3 <= 1’b0;
reg4 <= 1’b0;
end
else
begin
reg3 <= 1’b1;
reg4 <= reg3;
end
end
always @ (posedge clock, negedge rst_n)
begin
if (!rst_n)
Send Feedback
QPS5V1
11-28 Avoid Asynchronous Register Control Signals 2016.05.03
begin
reg1 <= 1’b0;
reg2 <= 1;b0;
end
else
begin
reg1 <= data_a;
reg2 <= data_b;
end
end
endmodule // sync_async_reset
To minimize the metastability effect between the two synchronization registers, and to increase
the MTBF, the registers should be located as close as possible in the device to minimize routing
delay. If possible, locate the registers in the same logic array block (LAB). The input reset signal
(reset_n) must be excluded with a set_false_path command:
set_false_path -from [get_ports {reset_n}] -to [all_registers]
The set_false_path command used with the specified constraint excludes unnecessary input
timing reports that would otherwise result from specifying an input delay on the reset pin.
The instantaneous assertion of synchronized asynchronous resets is susceptible to noise and runt
pulses. If possible, you should debounce the asynchronous reset and filter the reset before it enters
the device. The circuit ensures that the synchronized asynchronous reset is at least one full clock
period in length. To extend this time to n clock periods, you must increase the number of
synchronizer registers to n + 1. You must connect the asynchronous input reset (reset_n) to the
CLRN pin of all the synchronizer registers to maintain the asynchronous assertion of the synchron‐
ized asynchronous reset.
Send Feedback
QPS5V1
2016.05.03 Document Revision History 11-29
memory address in the same clock cycle; for example, you read from the same address to which you write
in the same clock cycle.
You should check how you specify the memory in your HDL code when you use read-during-write
behavior. The HDL code that describes the read returns either the old data stored at the memory location,
or the new data being written to the memory location.
In some cases, when the device architecture cannot implement the memory behavior described in your
HDL code, the memory block is not mapped to the dedicated RAM blocks, or the memory block is
implemented using extra logic in addition to the dedicated RAM block. Implement the read-during-write
behavior using single-port RAM in Arria GX devices and the Cyclone and Stratix series of devices to avoid
this extra logic implementation.
In many synthesis tools, you can specify that the read-during-write behavior is not important to your
design; if, for example, you never read and write from the same address in the same clock cycle. For
Quartus Prime integrated synthesis, add the synthesis attribute ramstyle=”no_rw_check” to allow the
software to choose the read-during-write behavior of a RAM, rather than using the read-during-write
behavior specified in your HDL code. Using this type of attribute prevents the synthesis tool from using
extra logic to implement the memory block and, in some cases, can allow memory inference when it
would otherwise be impossible.
2014.12.15 14.1.0 Updated location of Fitter Settings, Analysis & Synthesis Settings, and Physical
Optimization Settings to Compiler Settings.
June 2014 14.0.0 Removed references to obsolete MegaWizard Plug-In Manager.
November 13.1.0 Removed HardCopy device information.
2013
May 2013 13.0.0 Removed PrimeTime support.
Send Feedback
QPS5V1
11-30 Document Revision History 2016.05.03
July 2010 10.0.0 • Removed duplicated content and added references to Quartus Prime Help for
Design Assistant settings, Design Assistant rules, Enabling and Disabling Design
Assistant Rules, and Viewing Design Assistant reports.
• Removed information from “Combinational Logic Structures” on page 5–4
• Changed heading from “Design Techniques to Save Power” to “Power
Optimization” on page 5–12
• Added new “Metastability” section
• Added new “Incremental Compilation” section
• Added information to “Reset Resources” on page 5–23
• Removed “Referenced Documents” section
May 2008 8.0.0 • Updated Figure 5–9 on page 5–13; added custom rules file to the flow
• Added notes to Figure 5–9 on page 5–13
• Added new section: “Custom Rules Report” on page 5–34
• Added new section: “Custom Rules” on page 5–34
• Added new section: “Targeting Embedded RAM Architectural Features” on
page 5–38
• Minor editorial updates throughout the chapter
• Added hyperlinks to referenced documents throughout the chapter
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2016.05.03
Recommended HDL Coding Styles
12
QPS5V1 Subscribe Send Feedback
This chapter provides Hardware Description Language (HDL) coding style recommendations to ensure
optimal synthesis results when targeting Altera devices.
HDL coding styles can have a significant effect on the quality of results that you achieve for program‐
mable logic designs. Synthesis tools optimize HDL code for both logic utilization and performance;
however, synthesis tools have no information about the purpose or intent of the design. The best
optimizations require your conscious interaction. The Altera website provides design examples for other
types of functions and to target specific applications.
Note: For style recommendations, options, or HDL attributes specific to your synthesis tool (including
Quartus Prime integrated synthesis and other EDA tools), refer to the tool vendor’s documenta‐
tion.
Related Information
• Quartus Prime Integrated Synthesis on page 16-1
• Recommended Design Practices on page 11-1
• Advanced Synthesis Cookbook
• Design Examples
• Reference Designs
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V1
12-2 Instantiating IP Cores in HDL 2016.05.03
Note: You can use any of the standard features of the Quartus Prime Text Editor to modify the HDL
design or save the template as an HDL file to edit in your preferred text editor.
Related Information
About the Quartus Prime Text Editor
Send Feedback
QPS5V1
2016.05.03 Inferring Multipliers and DSP Functions 12-3
would any other module, component, or subdesign. Alternatively, you can use the IP Catalog (Tools > IP
Catalog) and parameter editor GUI to simplify customization of your IP core variation. You can infer or
instantiate IP cores that optimize the following device architecture features:
• Transceivers
• LVDS drivers
• Memory and DSP blocks
• Phase-locked loops (PLLs)
• double-data rate input/output (DDIO) circuitry
For some types of logic functions, such as memories and DSP functions, you can infer device-specific
dedicated architecture blocks instead of instantiating an IP core. Quartus Prime synthesis recognizes
certain HDL code structures and automatically infers the appropriate IP core or map directly to device
atoms.
Related Information
• Inferring Multipliers and DSP Functions on page 12-3
• Inferring Memory Functions from HDL Code on page 12-8
• Altera IP Core Literature
Related Information
DSP Solutions Center
Inferring Multipliers
To infer multiplier functions, synthesis tools detect multiplier logic and implement this in Altera IP cores,
or map the logic directly to device atoms.
For devices with DSP blocks, the software can implement the function in a DSP block instead of logic,
depending on device utilization. The Quartus Prime Fitter can also place input and output registers in
DSP blocks (that is, perform register packing) to improve performance and area utilization.
The Verilog HDL and VHDL code examples show, for unsigned and signed multipliers, that synthesis
tools can infer as an IP core or DSP block atoms. Each example fits into one DSP block element. In
addition, when register packing occurs, no extra logic cells for registers are required.
Note: The signed declaration in Verilog HDL is a feature of the Verilog 2001 Standard.
Send Feedback
QPS5V1
12-4 Inferring Multipliers 2016.05.03
assign out = a * b;
endmodule
Example 12-2: Verilog HDL Signed Multiplier with Input and Output Registers (Pipelining = 2)
Example 12-3: VHDL Unsigned Multiplier with Input and Output Registers (Pipelining = 2)
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.numeric_std.all;
ENTITY unsigned_mult IS
PORT (
a: IN UNSIGNED (7 DOWNTO 0);
b: IN UNSIGNED (7 DOWNTO 0);
clk: IN STD_LOGIC;
aclr: IN STD_LOGIC;
result: OUT UNSIGNED (15 DOWNTO 0)
);
END unsigned_mult;
Send Feedback
QPS5V1
2016.05.03 Inferring Multiply‑Accumulator and Multiply-Adder 12-5
END PROCESS;
END rtl;
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.numeric_std.all;
ENTITY signed_mult IS
PORT (
a: IN SIGNED (7 DOWNTO 0);
b: IN SIGNED (7 DOWNTO 0);
result: OUT SIGNED (15 DOWNTO 0)
);
END signed_mult;
Send Feedback
QPS5V1
12-6 Inferring Multiply‑Accumulator and Multiply-Adder 2016.05.03
Send Feedback
QPS5V1
2016.05.03 Inferring Multiply‑Accumulator and Multiply-Adder 12-7
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.numeric_std.all;
ENTITY sig_altmult_accum IS
PORT (
a: IN SIGNED(7 DOWNTO 0);
b: IN SIGNED (7 DOWNTO 0);
clk: IN STD_LOGIC;
aclr: IN STD_LOGIC;
accum_out: OUT SIGNED (15 DOWNTO 0)
) ;
END sig_altmult_accum;
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.numeric_std.all;
ENTITY unsignedmult_add IS
PORT (
a: IN UNSIGNED (7 DOWNTO 0);
b: IN UNSIGNED (7 DOWNTO 0);
c: IN UNSIGNED (7 DOWNTO 0);
d: IN UNSIGNED (7 DOWNTO 0);
clk: IN STD_LOGIC;
aclr: IN STD_LOGIC;
result: OUT UNSIGNED (15 DOWNTO 0)
);
END unsignedmult_add;
Send Feedback
QPS5V1
12-8 Inferring Memory Functions from HDL Code 2016.05.03
BEGIN
PROCESS (clk, aclr)
BEGIN
IF (aclr = '1') THEN
a_reg <= (OTHERS => '0');
b_reg <= (OTHERS => '0');
c_reg <= (OTHERS => '0');
d_reg <= (OTHERS => '0');
pdt_reg <= (OTHERS => '0');
pdt2_reg <= (OTHERS => '0');
Related Information
• DSP Design Examples
• AN639: Inferring Stratix V DSP Blocks for FIR Filtering
Send Feedback
QPS5V1
2016.05.03 Inferring RAM functions from HDL Code 12-9
Related Information
• Design Examples
• Introduction to Altera IP Cores
Refer to the "Instantiating IP Cores in HDL" section.
Send Feedback
QPS5V1
12-10 Use Synchronous Memory Blocks 2016.05.03
Synthesis tools typically consider all signals and variables that have a multi-dimensional array type and
then create a RAM block, if applicable. This is based on the way the signals or variables are assigned or
referenced in the HDL source description.
Standard synthesis tools recognize single-port and simple dual-port (one read port and one write port)
RAM blocks. Some tools (such as the Quartus Prime software) also recognize true dual-port (two read
ports and two write ports) RAM blocks that map to the memory blocks in certain Altera devices.
Some tools (such as the Quartus Prime software) also infer memory blocks for array variables and signals
that are referenced (read/written) by two indices, to recognize mixed-width and byte-enabled RAMs for
certain coding styles.
Note: If your design contains a RAM block that your synthesis tool does not recognize and infer, the
design might require a large amount of system memory that can potentially cause compilation
problems.
Send Feedback
QPS5V1
2016.05.03 Avoid Unsupported Reset and Control Conditions 12-11
In addition to reset signals, other control logic can prevent memory logic from being inferred as a
memory block. For example, you cannot use a clock enable on the read address registers in some devices
because this affects the output latch of the RAM, and therefore the synthesized result in the device RAM
architecture would not match the HDL description. You can use the address stall feature as a read address
clock enable to avoid this limitation. Check the documentation for your device architecture to ensure that
your code matches the hardware available in the device.
Example 12-9: Verilog RAM with Reset Signal that Clears RAM Contents: Not Supported in
Device Architecture
module clear_ram
(
input clock, reset, we,
input [7:0] data_in,
input [4:0] address,
output reg [7:0] data_out
);
Example 12-10: Verilog RAM with Reset Signal that Affects RAM: Not Supported in Device
Architecture
module bad_reset
(
input clock,
input reset,
input we,
input [7:0] data_in,
input [4:0] address,
output reg [7:0] data_out,
input d,
output reg q
);
Send Feedback
QPS5V1
12-12 Check Read‑During‑Write Behavior 2016.05.03
Related Information
Specifying Initial Memory Contents at Power-Up on page 12-25
When a write operation occurs, this type of HDL implies that the read should immediately reflect the new
data at the address, independent of the read clock. However, that is not the behavior of synchronous
memory blocks. In the device architecture, the new data is not available until the next edge of the read
clock. Therefore, if the synthesis tool mapped the logic directly to a synchronous memory block, the
device functionality and gate-level simulation results would not match the HDL description or functional
simulation results. If the write clock and read clock are the same, the synthesis tool can infer memory
blocks and add extra bypass logic so that the device behavior matches the HDL behavior. If the write and
read clocks are different, the synthesis tool cannot reliably add bypass logic, so the logic is implemented in
regular logic cells instead of dedicated RAM blocks. The examples in the following sections discuss some
of these differences for read-during-write conditions.
In addition, the MLAB feature in certain device logic array blocks (LABs) does not easily support old data
or new data behavior for a read-during-write in the dedicated device architecture. Implementing the extra
logic to support this behavior significantly reduces timing performance through the memory.
Note: For best performance in MLAB memories, your design should not depend on the read data during
a write operation.
In many synthesis tools, you can specify that the read-during-write behavior is not important to your
design; for example, if you never read from the same address to which you write in the same clock cycle.
For Quartus Prime integrated synthesis, add the synthesis attribute ramstyle set to "no_rw_check" to
allow the software to choose the read-during-write behavior of a RAM, rather than use the behavior
Send Feedback
QPS5V1
2016.05.03 Controlling RAM Inference and Implementation 12-13
specified by your HDL code. In some cases, this attribute prevents the synthesis tool from using extra
logic to implement the memory block, or can allow memory inference when it would otherwise be
impossible.
Synchronous RAM blocks require a synchronous read, so Quartus Prime integrated synthesis packs either
data output registers or read address registers into the RAM block. When the read address registers are
packed into the RAM block, the read address signals connected to the RAM block contain the next value
of the read address signals indexing the HDL variable, which impacts which clock cycle the read and the
write occur, and changes the read-during-write conditions. Therefore, bypass logic may still be added to
the design to preserve the read-during-write behavior, even if the "no_rw_check" attribute is set.
Related Information
Quartus Prime Integrated Synthesis on page 16-1
Related Information
Quartus Prime Integrated Synthesis on page 16-1
Send Feedback
QPS5V1
12-14 Single-Clock Synchronous RAM with Old Data Read‑During‑Write Behavior 2016.05.03
write to that RAM location. For best performance in MLAB memories, use the appropriate attribute so
that your design does not depend on the read data during a write operation. The simple dual-port RAM
code samples map directly into Altera synchronous memory.
Single-port versions of memory blocks (that is, using the same read address and write address signals) can
allow better RAM utilization than dual-port memory blocks, depending on the device family.
Example 12-11: Verilog HDL Single-Clock Simple Dual-Port Synchronous RAM with Old Data
Read-During-Write Behavior
module single_clk_ram(
output reg [7:0] q,
input [7:0] d,
input [6:0] write_address, read_address,
input we, clk
);
reg [7:0] mem [127:0];
Example 12-12: VHDL Single-Clock Simple Dual-Port Synchronous RAM with Old Data
Read‑During‑Write Behavior
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY single_clock_ram IS
PORT (
clock: IN STD_LOGIC;
data: IN STD_LOGIC_VECTOR (2 DOWNTO 0);
write_address: IN INTEGER RANGE 0 to 31;
read_address: IN INTEGER RANGE 0 to 31;
we: IN STD_LOGIC;
q: OUT STD_LOGIC_VECTOR (2 DOWNTO 0)
);
END single_clock_ram;
Send Feedback
QPS5V1
2016.05.03 Single-Clock Synchronous RAM with New Data Read-During-Write Behavior 12-15
END PROCESS;
END rtl;
Related Information
• Check Read-During-Write Behavior on page 12-12
• Single-Clock Synchronous RAM with New Data Read-During-Write Behavior on page 12-15
Example 12-13: Verilog HDL Single-Clock Simple Dual-Port Synchronous RAM with New Data
Read-During-Write Behavior
module single_clock_wr_ram(
output reg [7:0] q,
input [7:0] d,
input [6:0] write_address, read_address,
input we, clk
);
reg [7:0] mem [127:0];
It is possible to create a single-clock RAM using an assign statement to read the address of mem to
create the output q. By itself, the code describes new data read-during-write behavior. However, if
the RAM output feeds a register in another hierarchy, a read-during-write results in the old data.
Synthesis tools may not infer a RAM block if the tool cannot determine which behavior is
described, such as when the memory feeds a hard hierarchical partition boundary. Avoid this type
of coding.
Send Feedback
QPS5V1
12-16 Single-Clock Synchronous RAM with New Data Read-During-Write Behavior 2016.05.03
assign q = mem[read_address_reg];
The following example uses a concurrent signal assignment to read from the RAM. By itself, this
example describes new data read-during-write behavior. However, if the RAM output feeds a
register in another hierarchy, a read-during-write results in the old data. Synthesis tools may not
infer a RAM block if the tool cannot determine which behavior is described, such as when the
memory feeds a hard hierarchical partition boundary
Example 12-15: VHDL Single-Clock Simple Dual-Port Synchronous RAM with New Data Read-
During-Write Behavior
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY single_clock_rw_ram IS
PORT (
clock: IN STD_LOGIC;
data: IN STD_LOGIC_VECTOR (2 DOWNTO 0);
write_address: IN INTEGER RANGE 0 to 31;
read_address: IN INTEGER RANGE 0 to 31;
we: IN STD_LOGIC;
q: OUT STD_LOGIC_VECTOR (2 DOWNTO 0)
);
END single_clock_rw_ram;
For Quartus Prime integrated synthesis, if you do not require the read-through-write capability,
add the synthesis attribute ramstyle="no_rw_check" to allow the software to choose the read-
during-write behavior of a RAM, rather than using the behavior specified by your HDL code. This
Send Feedback
QPS5V1
2016.05.03 Simple Dual-Port, Dual-Clock Synchronous RAM 12-17
attribute may prevent generation of extra bypass logic but it is not always possible to eliminate the
requirement for bypass logic.
Related Information
• Check Read-During-Write Behavior on page 12-12
• Check Read-During-Write Behavior on page 12-12
• Single-Clock Synchronous RAM with Old Data Read-During-Write Behavior on page 12-13
module simple_dual_port_ram_dual_clock
#(parameter DATA_WIDTH=8, parameter ADDR_WIDTH=6)
(
input [(DATA_WIDTH-1):0] data,
input [(ADDR_WIDTH-1):0] read_addr, write_addr,
input we, read_clock, write_clock,
output reg [(DATA_WIDTH-1):0] q
);
endmodule
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY dual_clock_ram IS
PORT (
clock1, clock2: IN STD_LOGIC;
data: IN STD_LOGIC_VECTOR (3 DOWNTO 0);
write_address: IN INTEGER RANGE 0 to 31;
Send Feedback
QPS5V1
12-18 True Dual-Port Synchronous RAM 2016.05.03
Related Information
Check Read-During-Write Behavior on page 12-12
Send Feedback
QPS5V1
2016.05.03 True Dual-Port Synchronous RAM 12-19
When a read and write operation occurs on different ports for the same address (also known as mixed
port), the read operation may behave as follows:
• Read new data—Quartus Prime integrated synthesis supports this mode by creating bypass logic
around the synchronous memory block.
• Read old data—Synchronous memory blocks support this behavior.
• Read don’t care—This behavior is supported on different ports in simple dual-port mode by synchro‐
nous memory blocks.
The Verilog HDL single-clock code sample maps directly into Altera synchronous memory. When a read
and write operation occurs on the same port for the same address, the new data being written to the
memory is read. When a read and write operation occurs on different ports for the same address, the old
data in the memory is read. Simultaneous writes to the same location on both ports results in indetermi‐
nate behavior.
A dual-clock version of this design describes the same behavior, but the memory in the target device will
have undefined mixed port read-during-write behavior because it depends on the relationship between
the clocks.
Example 12-18: Verilog HDL True Dual-Port RAM with Single Clock
module true_dual_port_ram_single_clock
(
input [(DATA_WIDTH-1):0] data_a, data_b,
input [(ADDR_WIDTH-1):0] addr_a, addr_b,
input we_a, we_b, clk,
output reg [(DATA_WIDTH-1):0] q_a, q_b
);
parameter DATA_WIDTH = 8;
parameter ADDR_WIDTH = 6;
endmodule
If you use the following Verilog HDL read statements instead of the if-else statements, the HDL
code specifies that the read results in old data when a read operation and write operation occurs
Send Feedback
QPS5V1
12-20 True Dual-Port Synchronous RAM 2016.05.03
at the same time for the same address on the same port or mixed ports. This mode is supported
only in device families that support M144, M9k, and MLAB memory blocks.
-- Port A
process(clk)
begin
if(rising_edge(clk)) then
if(we_a = '1') then
ram(addr_a) := data_a;
end if;
q_a <= ram(addr_a);
end if;
end process;
-- Port B
process(clk)
begin
if(rising_edge(clk)) then
if(we_b = '1') then
ram(addr_b) := data_b;
end if;
q_b <= ram(addr_b);
end if;
end process;
The VHDL single-clock code sample maps directly into Altera synchronous memory. When a
read and write operation occurs on the same port for the same address, the new data being
written to the memory is read. When a read and write operation occurs on different ports for the
same address, the old data in the memory is read. Simultaneous write operations to the same
location on both ports results in indeterminate behavior.
A dual-clock version of this design describes the same behavior, but the memory in the target
device will have undefined mixed port read-during-write behavior because it depends on the
relationship between the clocks.
LIBRARY ieee;
use ieee.std_logic_1164.all;
entity true_dual_port_ram_single_clock is
generic (
DATA_WIDTH : natural := 8;
ADDR_WIDTH : natural := 6
);
port (
clk : in std_logic;
addr_a : in natural range 0 to 2**ADDR_WIDTH - 1;
addr_b : in natural range 0 to 2**ADDR_WIDTH - 1;
data_a : in std_logic_vector((DATA_WIDTH-1) downto 0);
data_b : in std_logic_vector((DATA_WIDTH-1) downto 0);
we_a : in std_logic := '1';
we_b : in std_logic := '1';
q_a : out std_logic_vector((DATA_WIDTH -1) downto 0);
Send Feedback
QPS5V1
2016.05.03 Mixed-Width Dual-Port RAM 12-21
begin
process(clk)
begin
if(rising_edge(clk)) then -- Port A
if(we_a = '1') then
ram(addr_a) <= data_a;
-- Read-during-write on the same port returns NEW data
q_a <= data_a;
else
-- Read-during-write on the mixed port returns OLD
data
q_a <= ram(addr_a);
end if;
end if;
end process;
process(clk)
begin
if(rising_edge(clk)) then -- Port B
if(we_b = '1') then
ram(addr_b) <= data_b;
-- Read-during-write on the same port returns NEW data
q_b <= data_b;
else
-- Read-during-write on the mixed port returns OLD data
q_b <= ram(addr_b);
end if;
end if;
end process;
end rtl;
The port behavior inferred in the Quartus Prime software for the above example is:
PORT_A_READ_DURING_WRITE_MODE = "new_data_no_nbe_read"
PORT_B_READ_DURING_WRITE_MODE = "new_data_no_nbe_read"
MIXED_PORT_FEED_THROUGH_MODE = "old"
Related Information
Check Read-During-Write Behavior on page 12-12
Send Feedback
QPS5V1
12-22 Mixed-Width Dual-Port RAM 2016.05.03
may differ in their support for these memories. This section describes the inference rules for Quartus
Prime integrated synthesis.
The first dimension of the multi-dimensional packed array represents the ratio of the wider port to the
narrower port, and the second dimension represents the narrower port width. The read and write port
widths must specify a read or write ratio supported by the memory blocks in the target device, or the
synthesis tool does not infer a RAM.
Refer to the Quartus Prime templates for parameterized examples that you can use for supported
combinations of read and write widths, and true dual port RAM examples with two read ports and two
write ports for mixed-width writes and reads.
Example 12-21: SystemVerilog Mixed-Width RAM with Read Width Smaller than Write Width
Example 12-22: SystemVerilog Mixed-Width RAM with Read Width Larger than Write Width
Example 12-23: VHDL Mixed-Width RAM with Read Width Smaller than Write Width
library ieee;
use ieee.std_logic_1164.all;
Send Feedback
QPS5V1
2016.05.03 Mixed-Width Dual-Port RAM 12-23
package ram_types is
type word_t is array (0 to 3) of std_logic_vector(7 downto 0);
type ram_t is array (0 to 255) of word_t;
end ram_types;
library ieee;
use ieee.std_logic_1164.all;
library work;
use work.ram_types.all;
entity mixed_width_ram is
port (
we, clk : in std_logic;
waddr : in integer range 0 to 255;
wdata : in word_t;
raddr : in integer range 0 to 1023;
q : out std_logic_vector(7 downto 0));
end mixed_width_ram;
Example 12-24: VHDL Mixed-Width RAM with Read Width Larger than Write Width
library ieee;
use ieee.std_logic_1164.all;
package ram_types is
type word_t is array (0 to 3) of std_logic_vector(7 downto 0);
type ram_t is array (0 to 255) of word_t;
end ram_types;
library ieee;
use ieee.std_logic_1164.all;
library work;
use work.ram_types.all;
entity mixed_width_ram is
port (
we, clk : in std_logic;
waddr : in integer range 0 to 1023;
wdata : in std_logic_vector(7 downto 0);
raddr : in integer range 0 to 255;
q : out word_t);
end mixed_width_ram;
Send Feedback
QPS5V1
12-24 RAM with Byte-Enable Signals 2016.05.03
Example 12-25: SystemVerilog Simple Dual-Port Synchronous RAM with Byte Enable
module byte_enabled_simple_dual_port_ram
(
input we, clk,
input [5:0] waddr, raddr, // address width = 6
input [3:0] be, // 4 bytes per word
input [31:0] wdata, // byte width = 8, 4 bytes per word
output reg [31:0] q // byte width = 8, 4 bytes per word
);
// use a multi-dimensional packed array
//to model individual bytes within the word
logic [3:0][7:0] ram[0:63]; // # words = 1 << address width
always_ff@(posedge clk)
begin
if(we) begin
if(be[0]) ram[waddr][0] <= wdata[7:0];
if(be[1]) ram[waddr][1] <= wdata[15:8];
if(be[2]) ram[waddr][2] <= wdata[23:16];
if(be[3]) ram[waddr][3] <= wdata[31:24];
end
q <= ram[raddr];
end
endmodule
Example 12-26: VHDL Simple Dual-Port Synchronous RAM with Byte Enable
library ieee;
use ieee.std_logic_1164.all;
library work;
entity byte_enabled_simple_dual_port_ram is
Send Feedback
QPS5V1
2016.05.03 Specifying Initial Memory Contents at Power‑Up 12-25
port (
we, clk : in std_logic;
waddr, raddr : in integer range 0 to 63 ; -- address width = 6
be : in std_logic_vector (3 downto 0); -- 4 bytes per word
wdata : in std_logic_vector(31 downto 0); -- byte width = 8
q : out std_logic_vector(31 downto 0) ); -- byte width = 8
end byte_enabled_simple_dual_port_ram;
begin -- Re-organize the read data from the RAM to match the output
unpack: for i in 0 to 3 generate
q(8*(i+1) - 1 downto 8*i) <= q_local(i);
end generate unpack;
process(clk)
begin
if(rising_edge(clk)) then
if(we = '1') then
if(be(0) = '1') then
ram(waddr)(0) <= wdata(7 downto 0);
end if;
if be(1) = '1' then
ram(waddr)(1) <= wdata(15 downto 8);
end if;
if be(2) = '1' then
ram(waddr)(2) <= wdata(23 downto 16);
end if;
if be(3) = '1' then
ram(waddr)(3) <= wdata(31 downto 24);
end if;
end if;
q_local <= ram(raddr);
end if;
end process;
end rtl;
Send Feedback
QPS5V1
12-26 Specifying Initial Memory Contents at Power‑Up 2016.05.03
module ram_with_init(
output reg [7:0] q,
input [7:0] d,
input [4:0] write_address, read_address,
input we, clk
);
reg [7:0] mem [0:31];
integer i;
initial begin
for (i = 0; i < 32; i = i + 1)
mem[i] = i[7:0];
end
Quartus Prime integrated synthesis and other synthesis tools also support the $readmemb and
$readmemh commands so that RAM initialization and ROM initialization work identically in
synthesis and simulation.
Example 12-28: Verilog HDL RAM Initialized with the readmemb Command
In VHDL, you can initialize the contents of an inferred memory by specifying a default value for
the corresponding signal. Quartus Prime integrated synthesis automatically converts the default
value into a .mif file for the inferred RAM.
LIBRARY ieee;
USE ieee.std_logic_1164.all;
use ieee.numeric_std.all;
ENTITY ram_with_init IS
PORT(
clock: IN STD_LOGIC;
data: IN UNSIGNED (7 DOWNTO 0);
write_address: IN integer RANGE 0 to 31;
read_address: IN integer RANGE 0 to 31;
we: IN std_logic;
q: OUT UNSIGNED (7 DOWNTO 0));
END;
Send Feedback
QPS5V1
2016.05.03 Inferring ROM Functions from HDL Code 12-27
Related Information
Quartus Prime Integrated Synthesis on page 16-1
Send Feedback
QPS5V1
12-28 Inferring ROM Functions from HDL Code 2016.05.03
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY sync_rom IS
PORT (
clock: IN STD_LOGIC;
address: IN STD_LOGIC_VECTOR(7 downto 0);
data_out: OUT STD_LOGIC_VECTOR(5 downto 0)
);
END sync_rom;
module dual_port_rom (
input [(addr_width-1):0] addr_a, addr_b,
Send Feedback
QPS5V1
2016.05.03 Inferring ROM Functions from HDL Code 12-29
input clk,
output reg [(data_width-1):0] q_a, q_b
);
parameter data_width = 8;
parameter addr_width = 8;
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity dual_port_rom is
generic (
DATA_WIDTH : natural := 8;
ADDR_WIDTH : natural := 8
);
port (
clk : in std_logic;
addr_a : in natural range 0 to 2**ADDR_WIDTH - 1;
addr_b : in natural range 0 to 2**ADDR_WIDTH - 1;
q_a : out std_logic_vector((DATA_WIDTH -1) downto 0);
q_b : out std_logic_vector((DATA_WIDTH -1) downto 0)
);
end entity;
function init_rom
return memory_t is
variable tmp : memory_t := (others => (others => '0'));
begin
for addr_pos in 0 to 2**ADDR_WIDTH - 1 loop
-- Initialize each address with the address itself
tmp(addr_pos) := std_logic_vector(to_unsigned(addr_pos,
DATA_WIDTH));
end loop;
return tmp;
end init_rom;
Send Feedback
QPS5V1
12-30 Inferring Shift Registers in HDL Code 2016.05.03
if (rising_edge(clk)) then
q_a <= rom(addr_a);
q_b <= rom(addr_b);
end if;
end process;
end rtl;
Related Information
Quartus Prime Integrated Synthesis on page 16-1
Send Feedback
QPS5V1
2016.05.03 Shift Register with Evenly Spaced Taps 12-31
blocks or MLAB memory. If the length of the register is less than 64 bits, the software implements the
shift register in logic.
Example 12-34: Verilog HDL Single-Bit Wide, 64-Bit Long Shift Register
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.all;
ENTITY shift_1x64 IS
PORT (
clk: IN STD_LOGIC;
shift: IN STD_LOGIC;
sr_in: IN STD_LOGIC;
sr_out: OUT STD_LOGIC
);
END shift_1x64;
Send Feedback
QPS5V1
12-32 Shift Register with Evenly Spaced Taps 2016.05.03
The synthesis software implements this function in a single ALTSHIFT_TAPS IP core and maps it to
RAM in supported devices, which is allowed placement in dedicated RAM blocks or MLAB memory.
Example 12-36: Verilog HDL 8-Bit Wide, 64-Bit Long Shift Register with Evenly Spaced Taps
end
assign sr_tap_one = sr[15];
assign sr_tap_two = sr[31];
assign sr_tap_three = sr[47];
assign sr_out = sr[63];
endmodule
Example 12-37: VHDL 8-Bit Wide, 64-Bit Long Shift Register with Evenly Spaced Taps
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.all;
ENTITY shift_8x64_taps IS
PORT (
clk: IN STD_LOGIC;
shift: IN STD_LOGIC;
sr_in: IN STD_LOGIC_VECTOR(7 DOWNTO 0);
sr_tap_one: OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
sr_tap_two : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
sr_tap_three: OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
sr_out: OUT STD_LOGIC_VECTOR(7 DOWNTO 0)
);
END shift_8x64_taps;
Send Feedback
QPS5V1
2016.05.03 Register and Latch Coding Guidelines 12-33
END PROCESS;
sr_tap_one <= sr(15);
sr_tap_two <= sr(31);
sr_tap_three <= sr(47);
sr_out <= sr(63);
END arch;
Send Feedback
QPS5V1
12-34 Specifying a Power-Up Value 2016.05.03
With Quartus Prime integrated synthesis, you can apply the Power-Up Level logic option. You can also
apply the option with an altera_attribute assignment in your source code. Using this option forces
synthesis to perform NOT gate push-back because synthesis tools cannot actually change the power-up
states of core registers.
You can apply the Quartus Prime integrated synthesis Power-Up Level logic option to a specific register
or to a design entity, module, or subdesign. If you do so, every register in that block receives the value.
Registers power up to 0 by default; therefore, you can use this assignment to force all registers to power up
to 1 using NOT gate push-back.
Note: Setting the Power-Up Level to a logic level of high for a large design entity could degrade the
quality of results due to the number of inverters that are required. In some situations, issues are
caused by enable signal inference or secondary control logic inference. It may also be more difficult
to migrate such a design to an ASIC.
Note: You can simulate the power-up behavior in a functional simulation if you use initialization.
Some synthesis tools can also read the default or initial values for registered signals and implement this
behavior in the device. For example, Quartus Prime integrated synthesis converts default values for
registered signals into Power-Up Level settings. When the Quartus Prime software reads the default
values, the synthesized behavior matches the power-up state of the HDL code during a functional
simulation.
There may also be undeclared default power-up conditions based on signal type. If you declare a
VHDL register signal as an integer, Quartus Prime synthesis attempts to use the left end of the
integer range as the power-up value. For the default signed integer type, the default power-up
value is the highest magnitude negative integer (100…001). For an unsigned integer type, the
default power-up value is 0.
Note: If the target device architecture does not support two asynchronous control
signals, such as aclr and aload, you cannot set a different power-up state and
reset state. If the NOT gate push-back algorithm creates logic to set a register to 1,
that register will power-up high. If you set a different power-up condition through
Send Feedback
QPS5V1
2016.05.03 Secondary Register Control Signals Such as Clear and Clock Enable 12-35
Related Information
Quartus Prime Integrated Synthesis on page 16-1
Send Feedback
QPS5V1
12-36 Secondary Register Control Signals Such as Clear and Clock Enable 2016.05.03
The following examples provide Verilog HDL and VHDL code that creates a register with the aclr,
aload, and ena control signals.
Note: The Verilog HDL example does not have adata on the sensitivity list, but the VHDL example does.
This is a limitation of the Verilog HDL language—there is no way to describe an asynchronous
load signal (in which q toggles if adata toggles while aload is high). All synthesis tools should infer
an aload signal from this construct despite this limitation. When they perform such inference, you
may see information or warning messages from the synthesis tool.
Example 12-40: Verilog HDL D-Type Flipflop (Register) with ena, aclr, and aload Control Signals
reg q;
Example 12-41: VHDL D-Type Flipflop (Register) with ena, aclr, and aload Control Signals (part
1)
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY dff_control IS
PORT (
clk: IN STD_LOGIC;
aclr: IN STD_LOGIC;
aload: IN STD_LOGIC;
adata: IN STD_LOGIC;
ena: IN STD_LOGIC;
data: IN STD_LOGIC;
q: OUT STD_LOGIC
);
END dff_control;
Example 12-42: VHDL D-Type Flipflop (Register) with ena, aclr, and aload Control Signals (part
2)
Send Feedback
QPS5V1
2016.05.03 Latches 12-37
q <= '0';
ELSIF (aload = '1') THEN
q <= adata;
ELSE
IF (rising_edge(clk)) THEN
IF (ena ='1') THEN
q <= data;
END IF;
END IF;
END IF;
END PROCESS;
END rtl;
Latches
A latch is a small combinational loop that holds the value of a signal until a new value is assigned.
Latches can be inferred from HDL code when you did not intend to use a latch. If you do intend to infer a
latch, it is important to infer it correctly to guarantee correct device operation.
Note: Altera recommends that you design without the use of latches whenever possible.
Related Information
Recommended Design Practices on page 11-1
Send Feedback
QPS5V1
12-38 Inferring Latches Correctly 2016.05.03
LIBRARY ieee;
USE IEEE.std_logic_1164.all;
ENTITY nolatch IS
PORT (a,b,c: IN STD_LOGIC;
sel: IN STD_LOGIC_VECTOR (4 DOWNTO 0);
oput: OUT STD_LOGIC);
END nolatch;
Related Information
Quartus Prime Integrated Synthesis on page 16-1
Send Feedback
QPS5V1
2016.05.03 Inferring Latches Correctly 12-39
For 4-input LUT-based devices, such as Stratixdevices, the Cyclone series, and MAX II devices, all latches
in the User Specified and Inferred Latches table with a single LUT in the feedback loop are free of timing
hazards when a single input changes. Because of the hardware behavior of the LUT, the output does not
glitch when a single input toggles between two values that are supposed to produce the same output value,
such as a D-type input toggling when the enable input is inactive or a set input toggling when a reset input
with higher priority is active. This hardware behavior of the LUT means that no cover term is required for
a loop around a single LUT. The Quartus Prime software uses a single LUT in the feedback loop whenever
possible. A latch that has data, enable, set, and reset inputs in addition to the output fed back to the input
cannot be implemented in a single 4-input LUT. If the Quartus Prime software cannot implement the
latch with a single-LUT loop because there are too many inputs, the User Specified and Inferred Latches
table indicates that the latch is not free of timing hazards.
For 6-input LUT-based devices, the software can implement all latch inputs with a single adaptive look-up
table (ALUT) in the combinational loop. Therefore, all latches in the User-Specified and Inferred
Latches table are free of timing hazards when a single input changes.
If a latch is listed as a safe latch, other optimizations performed by the Quartus Prime software, such as
physical synthesis netlist optimizations in the Fitter, maintain the hazard-free performance. To ensure
hazard-free behavior, only one control input can change at a time. Changing two inputs simultaneously,
such as deasserting set and reset at the same time, or changing data and enable at the same time, can
produce incorrect behavior in any latch.
Quartus Prime integrated synthesis infers latches from always blocks in Verilog HDL and process
statements in VHDL, but not from continuous assignments in Verilog HDL or concurrent signal
assignments in VHDL. These rules are the same as for register inference. The software infers registers or
flipflops only from always blocks and process statements.
module simple_latch (
input SetTerm,
input ResetTerm,
output reg LatchOut
);
LIBRARY IEEE;
USE IEEE.std_logic_1164.all;
ENTITY simple_latch IS
PORT (
enable, data : IN STD_LOGIC;
q : OUT STD_LOGIC
);
END simple_latch;
Send Feedback
QPS5V1
12-40 General Coding Guidelines 2016.05.03
The following example shows a Verilog HDL continuous assignment that does not infer a latch in
the Quartus Prime software:
The behavior of the assignment is similar to a latch, but it may not function correctly as a latch,
and its timing is not analyzed as a latch. Quartus Prime integrated synthesis also creates safe
latches when possible for instantiations of an Altera latch IP core. You can use an Altera latch IP
core to define a latch with any combination of data, enable, set, and reset inputs. The same
limitations apply for creating safe latches as for inferring latches from HDL code.
Inferring Altera latch IP core in another synthesis tool ensures that the implementation is also
recognized as a latch in the Quartus Prime software. If a third-party synthesis tool implements a
latch using the Altera latch IP core, the Quartus Prime integrated synthesis lists the latch in the
User-Specified and Inferred Latches table in the same way as it lists latches created in HDL
source code. The coding style necessary to produce an Altera latch IP core implementation may
depend on your synthesis tool. Some third-party synthesis tools list the number of Altera latch IP
cores that are inferred.
For LUT-based families, the Fitter uses global routing for control signals, including signals that
Analysis and Synthesis identifies as latch enables. In some cases the global insertion delay may
decrease the timing performance. If necessary, you can turn off the Quartus Prime Global Signal
logic option to manually prevent the use of global signals. Global latch enables are listed in the
Global & Other Fast Signals table in the Compilation Report.
Tri-State Signals
When you target Altera devices, you should use tri-state signals only when they are attached to top-level
bidirectional or output pins.
Send Feedback
QPS5V1
2016.05.03 Clock Multiplexing 12-41
Avoid lower-level bidirectional pins, and avoid using the Z logic value unless it is driving an output or
bidirectional pin. Synthesis tools implement designs with internal tri-state signals correctly in Altera
devices using multiplexer logic, but Altera does not recommend this coding practice.
Note: In hierarchical block-based design flows, a hierarchical boundary cannot contain any bidirectional
ports, unless the lower-level bidirectional port is connected directly through the hierarchy to a top-
level output pin without connecting to any other design logic. If you use boundary tri-states in a
lower-level block, synthesis software must push the tri-states through the hierarchy to the top level
to make use of the tri-state drivers on output pins of Altera devices. Because pushing tri-states
requires optimizing through hierarchies, lower-level tri-states are restricted with block-based
design methodologies.
Clock Multiplexing
Clock multiplexing is sometimes used to operate the same logic function with different clock sources.
This type of logic can introduce glitches that create functional problems, and the delay inherent in the
combinational logic can lead to timing problems. Clock multiplexers trigger warnings from a wide range
of design rule check and timing analysis tools.
Altera recommends using dedicated hardware to perform clock multiplexing when it is available, instead
of using multiplexing logic. For example, you can use the Clock Switchover feature or the Clock Control
Block available in certain Altera devices. These dedicated hardware blocks avoid glitches, ensure that you
use global low-skew routing lines, and avoid any possible hold time problems on the device due to logic
delay on the clock line. Many Altera devices also support dynamic PLL reconfiguration, which is the safest
and most robust method of changing clock rates during device operation.
If you implement a clock multiplexer in logic cells because the design has too many clocks to use the clock
control block, or if dynamic reconfiguration is too complex for your design, it is important to consider
simultaneous toggling inputs and ensure glitch-free transitions.
Figure 12-2: Simple Clock Multiplexer in a 6-Input LUT
clk_select (static)
clk0
clk1
Sys_clk
clk2
clk3
The data sheet for your target device describes how LUT outputs may glitch during a simultaneous toggle
of input signals, independent of the LUT function. Although, in practice, the 4:1 MUX function does not
generate detectable glitches during simultaneous data input toggles, it is possible to construct cell
implementations that do exhibit significant glitches, so this simple clock mux structure is not
recommended. An additional problem with this implementation is that the output behaves erratically
during a change in the clk_select signals. This behavior could create timing violations on all registers
fed by the system clock and result in possible metastability.
Send Feedback
QPS5V1
12-42 Clock Multiplexing 2016.05.03
A more sophisticated clock select structure can eliminate the simultaneous toggle and switching
problems.
Figure 12-3: Glitch-Free Clock Multiplexer Structure
sel0
DQ DQ DQ
clk0 clk_out
DQ DQ DQ
sel1
clk1
You can generalize this structure for any number of clock channels. The design ensures that no clock
activates until all others are inactive for at least a few cycles, and that activation occurs while the clock is
low. The design applies a synthesis_keep directive to the AND gates on the right side, which ensures
there are no simultaneous toggles on the input of the clk_out OR gate.
Note: Switching from clock A to clock B requires that clock A continue to operate for at least a few cycles.
If the old clock stops immediately, the design sticks. The select signals are implemented as a “one-
hot” control in this example, but you can use other encoding if you prefer. The input side logic is
asynchronous and is not critical. This design can tolerate extreme glitching during the switch
process.
parameter num_clocks = 4;
genvar i;
Send Feedback
QPS5V1
2016.05.03 Adder Trees 12-43
initial begin
ena_r0 = 0;
ena_r1 = 0;
ena_r2 = 0;
end
generate
for (i=0; i<num_clocks; i=i+1)
begin : lp0
wire [num_clocks-1:0] tmp_mask;
assign tmp_mask = {num_clocks{1'b1}} ^ (1 << i);
endmodule
Related Information
Altera IP Core Literature
Adder Trees
Structuring adder trees appropriately to match your targeted Altera device architecture can provide
significant improvements in your design's efficiency and performance.
A good example of an application using a large adder tree is a finite impulse response (FIR) correlator.
Using a pipelined binary or ternary adder tree appropriately can greatly improve the quality of your
results.
This section explains why coding recommendations are different for Altera 4-input LUT devices and
6-input LUT devices.
Send Feedback
QPS5V1
12-44 Architectures with 6-Input LUTs in Adaptive Logic Modules 2016.05.03
Adding five numbers in devices that use 4-input lookup tables requires four adders and three levels of
registers for a total of 64 LEs (for 16-bit numbers).
Send Feedback
QPS5V1
2016.05.03 State Machine HDL Guidelines 12-45
An equivalent implementation of this state machine can be achieved by using ‘define instead of
the parameter data type, as follows:
In this case, the state and next_state assignments are assigned a ‘state_x instead of a state_x,
for example:
Note: Although the ‘define construct is supported, Altera strongly recommends the use
of the parameter data type because doing so preserves the state names throughout
synthesis.
Send Feedback
QPS5V1
12-46 Verilog HDL State Machines 2016.05.03
To achieve the best results on average, synthesis tools often use one-hot encoding for FPGA devices and
minimal-bit encoding for CPLD devices, although the choice of implementation can vary for different
state machines and different devices. Refer to your synthesis tool documentation for specific ways to
control the manner in which state machines are encoded.
To ensure proper recognition and inference of state machines and to improve the quality of results, Altera
recommends that you observe the following guidelines, which apply to both Verilog HDL and VHDL:
• Assign default values to outputs derived from the state machine so that synthesis does not generate
unwanted latches.
• Separate the state machine logic from all arithmetic functions and data paths, including assigning
output values.
• If your design contains an operation that is used by more than one state, define the operation outside
the state machine and cause the output logic of the state machine to use this value.
• Use a simple asynchronous or synchronous reset to ensure a defined power-up state. If your state
machine design contains more elaborate reset logic, such as both an asynchronous reset and an
asynchronous load, the Quartus Prime software generates regular logic rather than inferring a state
machine.
If a state machine enters an illegal state due to a problem with the device, the design likely ceases to
function correctly until the next reset of the state machine. Synthesis tools do not provide for this
situation by default. The same issue applies to any other registers if there is some kind of fault in the
system. A default or when others clause does not affect this operation, assuming that your design never
deliberately enters this state. Synthesis tools remove any logic generated by a default state if it is not
reachable by normal state machine operation.
Many synthesis tools (including Quartus Prime integrated synthesis) have an option to implement a safe
state machine. The software inserts extra logic to detect an illegal state and force the state machine’s
transition to the reset state. It is commonly used when the state machine can enter an illegal state. The
most common cause of this situation is a state machine that has control inputs that come from another
clock domain, such as the control logic for a dual-clock FIFO.
This option protects only state machines by forcing them into the reset state. All other registers in the
design are not protected this way. If the design has asynchronous inputs, Altera recommends using a
synchronization register chain instead of relying on the safe state machine option.
Related Information
Quartus Prime Integrated Synthesis on page 16-1
Send Feedback
QPS5V1
2016.05.03 Verilog-2001 State Machine Coding Example 12-47
• If you are using the SystemVerilog standard, use enumerated types to describe state machines.
• Represent the states in a state machine with the parameter data types in Verilog-1995 and
Verilog-2001, and use the parameters to make state assignments. This parameter implementation
makes the state machine easier to read and reduces the risk of errors during coding.
• Altera recommends against the direct use of integer values for state variables, such as next_state
<= 0. However, using an integer does not prevent inference in the Quartus Prime software.
• No state machine is inferred in the Quartus Prime software if the state transition logic uses arithmetic
similar to that in the following example:
case (state)
0: begin
if (ena) next_state <= state + 2;
else next_state <= state + 1;
end
1: begin
...
endcase
case (state)0: beginif (ena) next_state <= state + 2;else next_state <= state + 1;end1: begin...endcase
• No state machine is inferred in the Quartus Prime software if the state variable is an output.
• No state machine is inferred in the Quartus Prime software for signed variables.
Related Information
• Verilog-2001 State Machine Coding Example on page 12-47
• SystemVerilog State Machine Coding Example on page 12-49
Send Feedback
QPS5V1
12-48 Verilog-2001 State Machine Coding Example 2016.05.03
else
state <= next_state;
end
always @ (*)
begin
tmp_out_0 = in_1 + in_2;
tmp_out_1 = in_1 - in_2;
case (state)
state_0: begin
tmp_out_2 = in_1 + 5'b00001;
next_state = state_1;
end
state_1: begin
if (in_1 < in_2) begin
next_state = state_2;
tmp_out_2 = tmp_out_0;
end
else begin
next_state = state_3;
tmp_out_2 = tmp_out_1;
end
end
state_2: begin
tmp_out_2 = tmp_out_0 - 5'b00001;
next_state = state_3;
end
state_3: begin
tmp_out_2 = tmp_out_1 + 5'b00001;
next_state = state_0;
end
state_4:begin
tmp_out_2 = in_2 + 5'b00001;
next_state = state_0;
end
default:begin
tmp_out_2 = 5'b00000;
next_state = state_0;
end
endcase
end
assign out = tmp_out_2;
endmodule
An equivalent implementation of this state machine can be achieved by using ‘define instead of
the parameter data type, as follows:
In this case, the state and next_state assignments are assigned a ‘state_x instead of a state_x,
for example:
Note: Although the ‘define construct is supported, Altera strongly recommends the use
of the parameter data type because doing so preserves the state names throughout
synthesis.
Send Feedback
QPS5V1
2016.05.03 SystemVerilog State Machine Coding Example 12-49
module enum_fsm (input clk, reset, input int data[3:0], output int o);
always_comb begin
case(state)
S0: o = data[3];
S1: o = data[2];
S2: o = data[1];
S3: o = data[0];
endcase
end
Send Feedback
QPS5V1
12-50 VHDL State Machine Coding Example 2016.05.03
The sum of in1 and in2 is an output of the state machine in state_1 and state_2. The difference (in1 -
in2) is also used in state_1 and state_2. The temporary variables tmp_out_0 and tmp_out_1 store the
sum and the difference of in1 and in2. Using these temporary variables in the various states of the state
machine ensures proper resource sharing between the mutually exclusive states.
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.numeric_std.all;
ENTITY vhdl_fsm IS
PORT(
clk: IN STD_LOGIC;
reset: IN STD_LOGIC;
in1: IN UNSIGNED(4 downto 0);
in2: IN UNSIGNED(4 downto 0);
out_1: OUT UNSIGNED(4 downto 0)
);
END vhdl_fsm;
ARCHITECTURE rtl OF vhdl_fsm IS
TYPE Tstate IS (state_0, state_1, state_2, state_3, state_4);
SIGNAL state: Tstate;
SIGNAL next_state: Tstate;
BEGIN
PROCESS(clk, reset)
BEGIN
IF reset = '1' THEN
state <=state_0;
ELSIF rising_edge(clk) THEN
state <= next_state;
END IF;
END PROCESS;
PROCESS (state, in1, in2)
VARIABLE tmp_out_0: UNSIGNED (4 downto 0);
VARIABLE tmp_out_1: UNSIGNED (4 downto 0);
BEGIN
tmp_out_0 := in1 + in2;
tmp_out_1 := in1 - in2;
CASE state IS
WHEN state_0 =>
out_1 <= in1;
next_state <= state_1;
WHEN state_1 =>
IF (in1 < in2) then
next_state <= state_2;
out_1 <= tmp_out_0;
ELSE
next_state <= state_3;
out_1 <= tmp_out_1;
END IF;
WHEN state_2 =>
IF (in1 < "0100") then
out_1 <= tmp_out_0;
ELSE
out_1 <= tmp_out_1;
END IF;
next_state <= state_3;
WHEN state_3 =>
out_1 <= "11111";
next_state <= state_4;
WHEN state_4 =>
out_1 <= in2;
next_state <= state_0;
WHEN OTHERS =>
Send Feedback
QPS5V1
2016.05.03 Multiplexer HDL Guidelines 12-51
Multiplexer Types
This section addresses how multiplexers are created from various types of HDL code. CASE statements, IF
statements, and state machines are all common sources of multiplexer logic in designs.
These HDL structures create different types of multiplexers, including binary multiplexers, selector
multiplexers, and priority multiplexers. Understanding how multiplexers are created from HDL code, and
how they might be implemented during synthesis, is the first step toward optimizing multiplexer
structures for best results.
Binary Multiplexers
Binary multiplexers select inputs based on binary-encoded selection bits.
Stratix series devices starting with the Stratix II device family feature 6-input look up tables (LUTs) which
are perfectly suited for 4:1 multiplexer building blocks (4 data and 2 select inputs). The extended input
mode facilitates implementing 8:1 blocks, and the fractured mode handles residual 2:1 multiplexer pairs.
For device families using 4-input LUTs, such as the Cyclone series and Stratix devices, the 4:1 binary
multiplexer is efficiently implemented by using two 4-input LUTs. Larger binary multiplexers are
decomposed by the synthesis tool into 4:1 multiplexer blocks, possibly with a residual 2:1 multiplexer at
the head.
Send Feedback
QPS5V1
12-52 Selector Multiplexers 2016.05.03
case (sel)
2'b00: z = a;
2'b01: z = b;
2'b10: z = c;
2'b11: z = d;
endcase
Selector Multiplexers
Selector multiplexers have a separate select line for each data input.
The select lines for the multiplexer are one-hot encoded. Selector multiplexers are commonly built as a
tree of AND and OR gates. An N-input selector multiplexer of this structure is slightly less efficient in
implementation than a binary multiplexer. However, in many cases the select signal is the output of a
decoder, in which case Quartus Prime Synthesis will try to combine the selector and decoder into a binary
multiplexer.
case (sel)
4'b0001: z = a;
4'b0010: z = b;
4'b0100: z = c;
4'b1000: z = d;
default: z = 1'bx;
endcase
Priority Multiplexers
In priority multiplexers, the select logic implies a priority. The options to select the correct item must be
checked in a specific order based on signal priority.
These structures commonly are created from IF, ELSE, WHEN, SELECT, and ?: statements in VHDL or
Verilog HDL.
The multiplexers form a chain, evaluating each condition or select bit sequentially.
Send Feedback
QPS5V1
2016.05.03 Implicit Defaults in If Statements 12-53
a b c d
sel[1:0]
“01xx” “10xx”
“00xx” “11xx”
sel[3:2]
Binary MUX
Depending on the number of multiplexers in the chain, the timing delay through this chain can
become large, especially for device families with 4-input LUTs.
To improve the timing delay through the multiplexer, avoid priority multiplexers if priority is not
required. If the order of the choices is not important to the design, use a CASE statement to
implement a binary or selector multiplexer instead of a priority multiplexer. If delay through the
structure is important in a multiplexed design requiring priority, consider recoding the design to
reduce the number of logic levels to minimize delay, especially along your critical paths.
Send Feedback
QPS5V1
12-54 Cyclic Redundancy Check Functions 2016.05.03
To obtain best results, explicitly define invalid CASE selections with a separate default or OTHERS
statement instead of combining the invalid cases with one of the defined cases.
If the value in the invalid cases is not important, specify those cases explicitly by assigning the X
(don’t care) logic value instead of choosing another value. This assignment allows your synthesis tool to
perform the best area optimizations.
Send Feedback
QPS5V1
2016.05.03 Take Advantage of Latency if Available 12-55
If you are having problems with the quality of results and you see that two CRC functions are sharing
logic, ensure that the blocks are synthesized independently using one of the following methods:
• Define each CRC block as a separate design partition in an incremental compilation design flow.
• Synthesize each CRC block as a separate project in your third-party synthesis tool and then write a
separate Verilog Quartus Mapping (.vqm) or EDIF netlist file for each.
Send Feedback
QPS5V1
12-56 Counter HDL Guidelines 2016.05.03
If you are using Quartus Prime integrated synthesis, you can guide the synthesis by using specific coding
styles. To select a carry chain implementation explicitly, rephrase your comparison in terms of addition.
As a simple example, the following coding style allows the synthesis tool to select the implementation,
which is most likely using general logic cells in modern device families:
In the following coding style, the synthesis tool uses a carry chain (except for a few cases, such as when the
chain is very short or the signals a and b minimize to the same signal):
This second coding style uses the top bit of the tmp signal, which is 1 in twos complement logic if a is less
than b, because the subtraction a – b results in a negative number.
If you have any information about the range of the input, you have “don’t care” values that you can use to
optimize the design. Because this information is not available to the synthesis tool, you can often reduce
the device area required to implement the comparator with specific hand implementation of the logic.
You can also check whether a bus value is within a constant range with a small amount of logic area by
using the following logic structure . This type of logic occurs frequently in address decoders.
Figure 12-5: Example Logic Structure for Using Comparators to Check a Bus Value Range
Address[ ]
Send Feedback
QPS5V1
2016.05.03 Designing with Low-Level Primitives 12-57
The following coding style requires only one adder along with some other logic:
In this case, the coding style better matches the device hardware because there is only one carry chain
adder, and the –1 constant logic is implemented in the LUT in front of the adder without adding extra
area utilization.
2016.05.03 16.0.0 • Updated example code templates with latest coding styles.
2015.05.04 15.0.0 Added information and reference about ramstyle attribute for sift register
inference.
Send Feedback
QPS5V1
12-58 Document Revision History 2016.05.03
2014.12.15 14.1.0 Updated location of Fitter Settings, Analysis & Synthesis Settings, and
Physical Optimization Settings to Compiler Settings.
Send Feedback
QPS5V1
2016.05.03 Document Revision History 12-59
May 2008 8.0.0 Updates for the Quartus Prime software version 8.0 release, including:
• Added information to “RAM
• Functions—Inferring ALTSYNCRAM and ALTDPRAM Megafunctions
from HDL Code” on page 6–13
• Added information to “Avoid Unsupported Reset and Control
Conditions” on page 6–14
• Added information to “Check Read-During-Write Behavior” on page 6–
16
• Added two new examples to “ROM Functions—Inferring
ALTSYNCRAM and LPM_ROM Megafunctions from HDL Code” on
page 6–28: Example 6–24 and Example 6–25
• Added new section: “Clock Multiplexing” on page 6–46
• Added hyperlinks to references within the chapter
• Minor editorial updates
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
Managing Metastability with the Quartus
Prime Software 13
QPS5V1 Subscribe Send Feedback
You can use the Quartus Prime software to analyze the average mean time between failures (MTBF) due
to metastability caused by synchronization of asynchronous signals, and optimize the design to improve
the metastability MTBF.
All registers in digital devices, such as FPGAs, have defined signal-timing requirements that allow each
register to correctly capture data at its input ports and produce an output signal. To ensure reliable
operation, the input to a register must be stable for a minimum amount of time before the clock edge
(register setup time or tSU) and a minimum amount of time after the clock edge (register hold time or tH).
The register output is available after a specified clock-to-output delay (tCO).
If the data violates the setup or hold time requirements, the output of the register might go into a
metastable state. In a metastable state, the voltage at the register output hovers at a value between the high
and low states, which means the output transition to a defined high or low state is delayed beyond the
specified tCO. Different destination registers might capture different values for the metastable signal,
which can cause the system to fail.
In synchronous systems, the input signals must always meet the register timing requirements, so that
metastability does not occur. Metastability problems commonly occur when a signal is transferred
between circuitry in unrelated or asynchronous clock domains, because the signal can arrive at any time
relative to the destination clock.
The MTBF due to metastability is an estimate of the average time between instances when metastability
could cause a design failure. A high MTBF (such as hundreds or thousands of years between metastability
failures) indicates a more robust design. You should determine an acceptable target MTBF in the context
of your entire system and taking in account that MTBF calculations are statistical estimates.
The metastability MTBF for a specific signal transfer, or all the transfers in a design, can be calculated
using information about the design and the device characteristics. Improving the metastability MTBF for
your design reduces the chance that signal transfers could cause metastability problems in your device.
The Quartus Prime software provides analysis, optimization, and reporting features to help manage
metastability in Altera designs. These metastability features are supported only for designs constrained
with the Quartus Prime Timing Analyzer. Both typical and worst-case MBTF values are generated for
select device families.
Related Information
• Understanding Metastability in FPGAs
For more information about metastability due to signal synchronization, its effects in FPGAs, and how
MTBF is calculated
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V1
13-2 Metastability Analysis in the Quartus Prime Software 2015.11.02
• Reliability Report
For information about Altera device reliability
Related Information
• Metastability and MTBF Reporting on page 13-4
• MTBF Optimization on page 13-7
Synchronization Chain
Clock 1 Clock 2
Send Feedback
QPS5V1
2015.11.02 Identifying Synchronizers for Metastability Analysis 13-3
The path between synchronization registers can contain combinational logic as long as all registers of the
synchronization register chain are in the same clock domain. The figure shows an example of a synchroni‐
zation register chain that includes logic between the registers.
Figure 13-2: Sample Synchronization Register Chain Containing Logic
Synchronization Chain
Data D Q D Q D Q Output
Registers
Clock 2
The timing slack available in the register-to-register paths of the synchronizer allows a metastable signal
to settle, and is referred to as the available settling time. The available settling time in the MTBF calcula‐
tion for a synchronizer is the sum of the output timing slacks for each register in the chain. Adding
available settling time with additional synchronization registers improves the metastability MTBF.
Related Information
How Timing Constraints Affect Synchronizer Identification and Metastability Analysis on page 13-
3
Related Information
Identifying Synchronizers for Metastability
For more information about how to enable metastability MTBF analysis and optimization in the Quartus
Prime software, and more detailed descriptions of the synchronizer identification settings
Send Feedback
QPS5V1
13-4 Metastability and MTBF Reporting 2015.11.02
signal. Therefore, you must ensure that your design is correctly constrained with the real application
frequency requirements to get an accurate MTBF report.
In addition, the Auto and Forced If Asynchronous synchronizer identification options use timing
constraints to automatically detect the synchronizer chains in the design. These options check for signal
transfers between circuitry in unrelated or asynchronous clock domains, so clock domains must be related
correctly with timing constraints.
The timing analyzer views input ports as asynchronous signals unless they are associated correctly with a
clock domain. If an input port fans out to registers that are not acting as synchronization registers, apply a
set_input_delay constraint to the input port; otherwise, the input register might be reported as a
synchronization register. Constraining a synchronous input port with a set_max_delay constraint for a
setup (tSU) requirement does not prevent synchronizer identification because the constraint does not
associate the input port with a clock domain.
Instead, use the following command to specify an input setup requirement associated with a clock:
set_input_delay -max -clock <clock name> <latch – launch – tsu requirement> <input port name>
Registers that are at the end of false paths are also considered synchronization registers because false paths
are not timing-analyzed. Because there are no timing requirements for these paths, the signal may change
at any point, which may violate the tSU and tH of the register. Therefore, these registers are identified as
synchronization registers. If these registers are not used for synchronization, you can turn off synchron‐
izer identification and analysis. To do so, set Synchronizer Identification to Off for the first synchroniza‐
tion register in these register chains.
Related Information
• Metastability Reports on page 13-4
• MTBF Optimization on page 13-7
• Synchronizer Data Toggle Rate in MTBF Calculation on page 13-6
• Understanding Metastability in FPGAs
For more information about how metastability MTBF is calculated
Metastability Reports
Metastability reports provide summaries of the metastability analysis results. In addition to the MTBF
Summary and Synchronizer Summary reports, the Timing Analyzer tool reports additional statistics in a
report for each synchronizer chain.
Note: If the design uses only the Auto Synchronizer Identification setting, the reports list likely
synchronizers but do not report MTBF. To obtain an MTBF for each register chain, force identifi‐
cation of synchronization registers.
Send Feedback
QPS5V1
2015.11.02 MTBF Summary Report 13-5
Note: If the synchronizer chain does not meet its timing requirements, the reports list identified
synchronizers but do not report MTBF. To obtain MTBF calculations, ensure that the design is
properly constrained and that the synchronizer meets its timing requirements.
Related Information
• Identifying Synchronizers for Metastability Analysis on page 13-3
• How Timing Constraints Affect Synchronizer Identification and Metastability Analysis on page
13-3
Related Information
Timing Analyzer page
Synchronizer Chains
The MTBF Summary report also lists the Number of Synchronizer Chains Found and the length of the
Shortest Synchronizer Chain, which can help you identify whether the report is based on accurate
information.
If the number of synchronizer chains found is different from what you expect, or if the length of the
shortest synchronizer chain is less than you expect, you might have to add or change Synchronizer
Identification settings for the design. The report also provides the Worst Case Available Settling Time,
defined as the available settling time for the synchronizer with the worst MTBF.
You can use the reported Fraction of Chains for which MTBFs Could Not be Calculated to determine
whether a high proportion of chains are missing in the metastability analysis. A fraction of 1, for example,
means that MTBF could not be calculated for any chains in the design. MTBF is not calculated if you have
not identified the chain with the appropriate Synchronizer identification option, or if paths are not
timing-analyzed and therefore have no valid slack for metastability analysis. You might have to correct
your timing constraints to enable complete analysis of the applicable register chains.
Send Feedback
QPS5V1
13-6 Increasing Available Settling Time 2015.11.02
Related Information
Synchronizer Chain Statistics Report in the Timing Analyzer on page 13-6
Related Information
Synchronizer Data Toggle Rate in MTBF Calculation on page 13-6
Send Feedback
QPS5V1
2015.11.02 MTBF Optimization 13-7
can set the Synchronizer Toggle Rate to 0 for the synchronization chain so the MTBF is not reported. To
apply the assignment with Tcl, use the following command:
In addtion to Synchronizer Toggle Rate, there are two other assignments associated with toggle rates,
which are not used for metastability MTBF calculations. The I/O Maximum Toggle Rate is only used for
pins, and specifies the worst-case toggle rates used for signal integrity purposes. The Power Toggle Rate
assignment is used to specify the expected time-averaged toggle rate, and is used by the PowerPlay Power
Analyzer to estimate time-averaged power consumption.
MTBF Optimization
In addition to reporting synchronization register chains and MTBF values found in the design, the
Quartus Prime software can also protect these registers from optimizations that might negatively impact
MTBF and can optimize the register placement and routing if the MTBF is too low.
Synchronization register chains must first be explicitly identified as synchronizers. Altera recommends
that you set Synchronizer Identification to Forced If Asynchronous for all registers that are part of a
synchronizer chain.
Optimization algorithms, such as register duplication and logic retiming in physical synthesis, are not
performed on identified synchronization registers. The Fitter protects the number of synchronization
registers specified by the Synchronizer Register Chain Length option.
In addition, the Fitter optimizes identified synchronizers for improved MTBF by placing and routing the
registers to increase their output setup slack values. Adding slack in the synchronizer chain increases the
available settling time for a potentially metastable signal, which improves the chance that the signal
resolves to a known value, and exponentially increases the design MTBF. The Fitter optimizes the number
of synchronization registers specified by the Synchronizer Register Chain Length option.
Metastability optimization is on by default. To view or change the Optimize Design for Metastability
option, click Assignments > Settings > Compiler Settings > Advanced Settings (Fitter). To turn the
optimization on or off with Tcl, use the following command:
Related Information
Identifying Synchronizers for Metastability Analysis on page 13-3
Send Feedback
QPS5V1
13-8 Reducing Metastability Effects 2015.11.02
The default setting for the Synchronization Register Chain Length option is 2. The first register of a
synchronization chain is always protected from operations that might reduce MTBF, but you should set
the protection length to protect more of the synchronizer chain. Altera recommends that you set this
option to the maximum length of synchronization chains you have in your design so that all synchroniza‐
tion registers are preserved and optimized for MTBF.
Click Assignments > Settings > Compiler Settings > Advanced Settings (Synthesis) to change the global
Synchronization Register Chain Length option.
You can also set the Synchronization Register Chain Length on a node or an entity in the Assignment
Editor. You can set this value on the first register in a synchronization chain to specify how many registers
to protect and optimize in this chain. This individual setting is useful if you want to protect and optimize
extra registers that you have created in a specific synchronization chain that has low MTBF, or optimize
less registers for MTBF in a specific chain where the maximum frequency or timing performance is not
being met. To make the global setting with Tcl, use the following command:
To apply the assignment to a design instance or the first register in a specific chain with Tcl, use the
following command:
Related Information
Metastability Reports on page 13-4
Send Feedback
QPS5V1
2015.11.02 Force the Identification of Synchronization Registers 13-9
You should use set_input_delay constraints in place of set_max_delay constraints to associate each
input port with a clock domain to help eliminate false positives during synchronization register identifica‐
tion.
Related Information
How Timing Constraints Affect Synchronizer Identification and Metastability Analysis on page 13-3
Related Information
Identifying Synchronizers for Metastability Analysis on page 13-3
Related Information
Synchronizer Data Toggle Rate in MTBF Calculation on page 13-6
Related Information
MTBF Optimization on page 13-7
Related Information
Synchronization Register Chain Length on page 13-7
Send Feedback
QPS5V1
13-10 Set Fitter Effort to Standard Fit instead of Auto Fit 2015.11.02
Scripting Support
You can run procedures and make settings described in this chapter in a Tcl script. You can also run some
procedures at a command prompt. For detailed information about scripting command options, refer to
the Quartus Prime Command-Line and Tcl API Help browser.
To run the Help browser, type the following command at the command prompt:
quartus_sh --qhelp r
Related Information
• Tcl Scripting
For more information about Tcl scripting
• Quartus Prime Settings File Reference Manual
For more information about settings and constraints in the Quartus Prime software
Send Feedback
QPS5V1
2015.11.02 Identifying Synchronizers for Metastability Analysis 13-11
• Command-Line Scripting
For more information about command-line scripting
• About Quartus Prime Scripting
For more information about command-line scripting
To apply the Synchronizer Identification assignment to a specific register or instance, use the following
command:
Related Information
Synchronizer Data Toggle Rate in MTBF Calculation on page 13-6
Option Description
-append If output is sent to a file, this option appends the result
to that file. Otherwise, the file is overwritten.
-file <name> Sends the results to an ASCII or HTML file. The
extension specified in the file name determines the file
type — either *.txt or *.html.
-panel_name Sends the results to the panel and specifies the name
<name> of the new panel.
-stdout Indicates the report be sent to the standard output, via
messages. This option is required only if you have
selected another output format, such as a file, and
would also like to receive messages.
Send Feedback
QPS5V1
13-12 MTBF Optimization 2015.11.02
Related Information
Metastability Reports on page 13-4
MTBF Optimization
To ensure that metastability optimization described on page MTBF Optimization is turned on (or to turn
it off), use the following command:
Related Information
MTBF Optimization on page 13-7
To apply the assignment to a design instance or the first register in a specific chain, use the following
command:
Related Information
Synchronization Register Chain Length on page 13-7
Managing Metastability
Altera’s Quartus Prime software provides industry-leading analysis and optimization features to help you
manage metastability in your FPGA designs. Set up your Quartus Prime project with the appropriate
constraints and settings to enable the software to analyze, report, and optimize the design MTBF. Take
advantage of these features in the Quartus Prime software to make your design more robust with respect
to metastability.
2014.12.15 14.1.0 Updated location of Fitter Settings, Analysis & Synthesis Settings, and
Physical Optimization Settings to Compiler Settings.
June 2014 14.0.0 Updated formatting.
Send Feedback
QPS5V1
2015.11.02 Document Revision History 13-13
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
Best Practices for Incremental Compilation
Partitions and Floorplan Assignments 14
QPS5V1 Subscribe Send Feedback
Related Information
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design documentation on
page 3-1
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V1
14-2 Recommendations for the Netlist Type 2015.11.02
When you make changes to your design, the Quartus Prime software recompiles only the designated
partitions and merges the new compilation results with existing netlists for other partitions, according to
the degree of results preservation you set with the netlist for each design partition.
In some cases, Altera recommends that you create a design floorplan with placement assignments to
constrain parts of the design to specific regions of the device.
You must use the partial reconfiguration (PR) feature in conjunction with incremental compilation for
Stratix V device families. Partial reconfiguration allows you to reconfigure a portion of the FPGA
®
Related Information
• Introduction to Design Floorplans on page 14-35
• Design Planning for Partial Reconfiguration documentation on page 4-1
The Partial Reconfiguration (PR) feature in the Quartus Prime software allows you to reconfigure a
portion of the FPGA dynamically, while the remainder of the device continues to operate.
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 Design Flows Using Incremental Compilation 14-3
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-4 Project Management in Team-Based Design Flows 2015.11.02
Using Scripts
The project lead also has the option to generate design partition scripts to manage resource and timing
budgets in the top-level design when partitions are developed outside the top-level project framework.
Scripts make it easier for designers of independent Quartus Prime projects to follow instructions from the
project lead. The Quartus Prime design partition scripts feature creates Tcl scripts or .tcl files and
makefiles that an independent designer can run to set up an independent Quartus Prime project.
Using Constraints
If designers create Quartus Prime assignments or timing constraints for their partitions, they must ensure
that the constraints are integrated into the top-level design. If partition designers use the same top-level
project framework (and design hierarchy), the constraints or Synopsys Design Constraints File (.sdc) can
be easily copied or included in the top-level design. If partition designers use a separate Quartus Prime
project with a different design hierarchy, they must ensure that constraints are applied to the appropriate
level of hierarchy in the top-level design, and design the .sdc for easy delivery to the project lead.
Related Information
• Including SDC Constraints from Lower-Level Partitions for
Third-Party IP Delivery on page 14-31
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 Why Plan Partitions and Floorplan Assignments? 14-5
• Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design documentation
on page 3-1
Information about the different types of incremental design flows and example applications, as well as
documented restrictions and limitations
Related Information
Introduction to Design Floorplans on page 14-35
Hierarchy A Hierarchy B
Compile
Cannot obtain results of an
without
individual hierarchy for
partition
Hierarchy A incremental compilation
boundaries
Hierarchy B
Hierarchy A Hierarchy B
Hierarchies remain independent
during logic optimizations
Compile (with limited cross-boundary optimizations)
with
partition Possible to incrementally
boundaries recompile each hierarchy
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-6 Merging Partitions 2015.11.02
Merging Partitions
You can use the Merge command in the Design Partitions window to combine hierarchical partitions into
a single partition, as long as they share the same immediate parent partition. Merging partitions allows
additional optimizations for partition I/O ports that connect between or feed more than one of the
merged hierarchical design blocks.
When partitions are placed together, the Fitter can perform placement optimizations on the design as a
whole to optimize the placement of cross-boundary paths. However, the Fitter can never perform logic
optimizations such as physical synthesis across the partition boundary. If partitions are fit separately in
different projects, or if some partitions use previous post-fitting results, the Fitter does not place and route
the entire cross-boundary path at the same time and cannot fully optimize placement across the partition
boundaries. Good design partitions can be placed independently because cross-partition paths are not the
critical timing paths in the design.
Resource Utilization
There are possible timing performance utilization effects due to partitioning and creating a floorplan. Not
all designs encounter these issues, but you should consider these effects if a flat version of your design is
very close to meeting its timing requirements, or is close to using all the device resources, before adding
partition or floorplan assignments:
• Partitions can increase resource utilization due to cross-boundary optimization limitations if the
design does not follow partitioning guidelines. Floorplan assignments can also increase resource
utilization because regions can lead to unused logic. If your device is full with the flat version of your
design, you can focus on creating partitions and floorplan assignments for timing-critical or
often-changing blocks to benefit most from incremental compilation.
• Partitions and floorplan assignments might increase routing utilization compared to a flat design. If
long compilation times are due to routing congestion, you might not be able to use the incremental
flow to reduce compilation time. Review the Fitter messages to check how much time is spent during
routing optimizations to determine the percentage of routing utilization. When routing is difficult, you
can use incremental compilation to lock the routing for routing-critical blocks only (with other
partitions empty), and then compile the rest of the design after the critical blocks meets their require‐
ments.
• Partitions can reduce timing performance in some cases because of the optimization and resource
effects described above, causing longer logic delays. Floorplan assignments restrict logic placement,
which can make it more difficult for the Fitter to meet timing requirements. Use the guidelines in this
manual to reduce any effect on your design performance.
Related Information
• Design Partition Guidelines on page 14-9
• Checking Floorplan Quality on page 14-43
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 Guidelines for Incremental Compilation 14-7
software recompiles your partition from source automatically. Cross-boundary optimizations include the
following: propagate constants, propagate inversions on partition inputs, merge inputs fed by a common
source, merge electrically equivalent bidirectional pins, absorb internal paths, and remove logic connected
to dangling outputs.
Cross-boundary optimizations are implemented top-down from the parent partition into the child
partition, but not vice-versa. The cross-boundary optimization feature cannot be used with partitions with
multiple personas (partial reconfiguration partitions).
Although more partitions allow for a greater reduction in compilation time, consider limiting the number
of partitions to prevent degradation in the quality of results. Creating good design partitions and good
floorplan location assignments helps to improve the design resource utilization and timing performance
results for cross-partition paths.
Related Information
Design Partition Properties Dialog Box online help
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-8 Using Partitions with Third-Party Synthesis Tools 2015.11.02
Related Information
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design documentation on
page 3-1
Related Information
Analyzing and Optimizing the Design Floorplan with the Chip Planner documentation
Information about clock domains and their affect on partition design
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 Design Partition Guidelines 14-9
specifications changing for part of the design? If so, define changing logic in its own partition so that you
can recompile only the changing part while the rest of the design remains unchanged.
As a general rule, create partitions to isolate logic that will change from logic that will not change.
Partitioning a design in this way maximizes the preservation of unchanged logic and minimizes compila‐
tion time.
Partition A Partition B
D Q D Q D Q D Q
Cross-boundary partition
routing delay is not the
critical timing path
If a design cannot include both input and output registers for each partition due to latency or resource
utilization concerns, choose to register one end of each connection. If you register every partition output,
for example, the combinational logic that occurs in each cross-partition path is included in one partition
so that it can be optimized together.
It is a good synchronous design practice to include registers for every output of a design block. Registered
outputs ensure that the input timing performance for each design block is controlled exclusively within
the destination logic block.
Related Information
• Partition Statistics Report on page 14-30
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-10 Minimize Cross-Partition-Boundary I/O 2015.11.02
A B A B
Another way to minimize connections between partitions is to avoid using combinational ”glue logic”
between partitions. You can often move the logic to the partition at one end of the connection to keep
more logic paths within one partition. For example, the bottom diagram includes a new level of hierarchy
C defined as a partition instead of block B. Clearly, there are fewer I/O connections between partitions A
and C than between partitions A and B.
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 Examine the Need for Logic Optimization Across Partitions 14-11
Related Information
• Partition Statistics Report on page 14-30
• Incremental Compilation Advisor on page 14-27
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-12 Example—Fitter Merging 2015.11.02
and B, as shown in the left diagram of the figure. To maintain correct incremental functionality, these two
inverters cannot be removed from the design during optimization because they occur in different design
partitions. The Quartus Prime software cannot use information about other partitions when it compiles
each partition, because each partition is allowed to change independently from the other.
On the right side of the figure, partitions A and B are merged to group the logic in blocks A and B into
one partition. If the two blocks A and B are not under the same immediate parent partition, you can
create a wrapper file to define a new level of hierarchy that contains both blocks, and set this new
hierarchy block as the partition. With the logic contained in one partition, the software can optimize the
logic and remove the two inverters (shown in gray), which reduces the delay for that logic path. Removing
two inverters is not a significant reduction in resource utilization because inversion logic is readily
available in Altera device architecture. However, this example is a simple demonstration of the types of
logic optimization that are prevented by partition boundaries.
Figure 14-5: Keeping Logic in the Same Partition for Optimization
Merged Parition
A B A B
Example—Fitter Merging
In a flat design, the Fitter can also merge logical instantiations into the same physical device resource.
With incremental compilation, logic defined in different partitions cannot be merged to use the same
physical device resource.
For example, the Fitter can merge two single-port RAMs from a design into one dedicated RAM block in
the device. If the two RAMs are defined in different partitions, the Fitter cannot merge them into one
dedicated device RAM block.
This limitation is a only a concern if merging is required to fit the design in the target device. Therefore,
you are more likely to encounter this issue during troubleshooting rather than during planning, if your
design uses more logic than is available in the device.
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 Keep Constants in the Same Partition as Logic 14-13
VCC VCC
Merged Partition
GND GND
A A B
B
Connections to constants in another partition: Constants in merged partition are used to optimize:
Poor design partition assignment Better design partition assignment
Related Information
• Partition Statistics Report on page 14-30
• Incremental Compilation Advisor on page 14-27
Avoid Signals That Drive Multiple Partition I/O or Connect I/O Together
Do not use the same signal to drive multiple ports of a single partition or directly connect two ports of a
partition. If the same signal drives multiple ports of a partition, or if two ports of a partition are directly
connected, those ports are logically equivalent. However, the software has limited information about
connections made in another partition (including the top-level partition), the compilation cannot take
advantage of the equivalence. This restriction usually produces sub-optimal results.
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-14 Example—Single Signal Driving More Than One Port 2015.11.02
If your design has these types of connections, redefine the partition boundaries to remove the affected
ports. If one signal from a higher-level partition feeds two input ports of the same partition, feed the one
signal into the partition, and then make the two connections within the partition. If an output port drives
an input port of the same partition, the connection can be made internally without going through any I/O
ports. If an input port drives an output port directly, the connection can likely be implemented without
the ports in the lower-level partition by connecting the signals in a higher-level partition.
Top Top
rd_clk
Dual- Single-
rd_clk
Clock wr_clk clock Clock wr_clk clock
RAM RAM
A B A
Related Information
Incremental Compilation Advisor on page 14-27
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 Example—Clock Signal Inversion 14-15
Top Top
A A
B Clock B
Clock
Inverter acts as clock gating (adding skew): Clock inverted inside destination LABs,
Poor design partition assignment only one global routing signal:
Better design partition assignment
Notice that this diagram also shows another example of a single pin feeding two ports of a partition
boundary. In the left diagram, partition B does not have the information that the clock and inverted clock
come from the same source. In the right diagram, partition B has more information to help optimize the
design because the clock is connected as one port of the partition.
Connect I/O Pin Directly to I/O Register for Packing Across Partition Boundaries
The Quartus Prime software allows cross-partition register packing of I/O registers in certain cases where
your input and output pins are defined in the top-level hierarchy (and the top-level partition), but the
corresponding I/O registers are defined in other partitions.
Input pin cross-partition register packing requires the following specific circumstances:
• The input pin feeds exactly one register.
• The path between the input pin and register includes only input ports of partitions that have one fan-
out each.
Output pin cross-partition register packing requires the following specific circumstances:
• The register feeds exactly one output pin.
• The output pin is fed by only one signal.
• The path between the register and output pin includes only output ports of partitions that have one
fan-out each.
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-16 Example 1—Output Register in Partition Feeding Multiple Output Pins 2015.11.02
The following examples of I/O register packing illustrate this point using Block Design File (.bdf)
schematics to describe the design logic.
If the top-level design instantiates the subdesign with a single fan-out directly feeding an output pin, and
designates the subdesign as a separate design partition, the Quartus Prime software can perform cross-
partition register packing because the single partition port feeds the output pin directly.
In this example, the top-level design instantiates the subdesign as an output register with more than one
fan-out signal.
Figure 14-10: Top-Level Design Instantiating the Subdesign with Two Output Pins
In this case, the Quartus Prime software does not perform output register packing. If there is a Fast
Output Register assignment on pin out, the software issues a warning that the Fitter cannot pack the
node to an I/O pin because the node and the I/O cell are connected across a design partition boundary.
This type of cross-partition register packing is not allowed because it requires modification to the
interface of the subdesign partition. To perform incremental compilation, the Quartus Prime software
must preserve the interface of design partitions.
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 Example 2—Input Register in Partition Fed by an Inverted Input Pin or... 14-17
To allow the Quartus Prime software to pack the register in the subdesign with the output pin out in the
figure, restructure your HDL code so that output registers directly connect to output pins by making one
of the following changes:
• Place the register in the same partition as the output pin. The simplest method is to move the register
from the subdesign partition into the partition containing the output pin. Doing so guarantees that the
Fitter can optimize the two nodes without violating partition boundaries.
• Duplicate the register in your subdesign HDL so that each register feeds only one pin, and then
connect the extra output pin to the new port in the top-level design. Doing so converts the cross-
partition register packing into the simplest case where each register has a single fan-out.
Figure 14-11: Modified Subdesign with Two Output Registers and Two Output Ports
Figure 14-12: Modified Top-Level Design Connecting Two Output Ports to Output Pins
Example 2—Input Register in Partition Fed by an Inverted Input Pin or Output Register in Partition
Feeding an Inverted Output Pin
In this example, a subdesign designated as a separate partition contains a register. The top-level design in
the figure instantiates the subdesign as an input register with the input pin inverted. The top-level design
instantiates the subdesign as an output register with the signal inverted before feeding an output pin.
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-18 Do Not Use Internal Tri-States 2015.11.02
Figure 14-13: Top-Level Design Instantiating Subdesign as an Input Register with an Inverted Input Pin
Figure 14-14: Top-Level Design Instantiating the Subdesign as an Output Register Feeding an Inverted
Output Pin
In these cases, the Quartus Prime software does not perform register packing. If there is a Fast Input
Register assignment on pin in, as shown in the top figure, or a Fast Output Register assignment on pin
out, as shown in the bottom figure, the Quartus Prime software issues a warning that the Fitter cannot
pack the node to an I/O pin because the node and I/O cell are connected across a design partition
boundary.
This type of register packing is not allowed because it requires moving logic across a design partition
boundary to place into a single I/O device atom. To perform register packing, either the register must be
moved out of the subdesign partition, or the inverter must be moved into the subdesign partition to be
implemented in the register.
To allow the Quartus Prime software to pack the single register in the subdesign with the input pin in, as
shown in top figure or the output pin out, as shown in the bottom figure, restructure your HDL code to
place the register in the same partition as the inverter by making one of the following changes:
• Move the register from the subdesign partition into the top-level partition containing the pin. Doing
so ensures that the Fitter can optimize the I/O register and inverter without violating partition
boundaries.
• Move the inverter from the top-level block into the subdesign, and then connect the subdesign directly
to a pin in the top-level design. Doing so allows the Fitter to optimize the inverter into the register
implementation, so that the register is directly connected to a pin, which enables register packing.
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 Do Not Use Internal Tri-States 14-19
the Quartus Prime software cannot convert the logic to combinational gates because the partition could
be connected to a top-level device I/O through another partition.
The figures below show a design with partitions that are not supported for incremental compilation due
to the internal tri-state output logic on the partition boundaries. Instead of using internal tri-state logic
for partition outputs, implement the correct logic to select between the two signals. Doing so is good
practice even when there are no partitions, because such logic explicitly defines the behavior for the
internal signals instead of relying on the Quartus Prime software to convert the tri-state signals into logic.
Figure 14-15: Unsupported Internal Tri-State Signals
Top
Figure 14-16: Merged Partition Allows Synthesis to Convert Internal Tri-State Logic to Combinational
Logic
Top
Merged Partition
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-20 Include All Tri-State and Enable Logic in the Same Partition 2015.11.02
Do not use tri-state signals or bidirectional ports on hierarchical partition boundaries, unless the port is
connected directly to a top-level I/O pin on the device. If you must use internal tri-state logic, ensure that
all the control and destination logic is contained in the same partition, in which case the Quartus Prime
software can convert the internal tri-state signals into combinational logic as in a flat design. In this
example, you can also merge all three partitions into one partition, as shown in the bottom figure, to allow
the Quartus Prime software to treat the logic as internal tri-state and perform the same type of optimiza‐
tion as a flat design. If possible, you should avoid using internal
tri-state logic in any Altera FPGA design to ensure that you get the desired implementation when the
design is compiled for the target device architecture.
Merged Partition
A A
Top Top
B B
B
Multiple tri-states on partition boundaries: Tri-state output logic within merged partition:
Illegal design partitions Better design partition
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 Summary of Guidelines Related to Logic Optimization Across Partitions 14-21
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-22 Design Partition Guidelines for Third-Party IP Delivery 2015.11.02
and-conquer approach for the reset structure. By implementing a cascaded reset structure, the reset paths
for each partition are independent. This structure reduces the effect of inter-partition dependency because
the inter-partition reset signals can now be treated as false paths for timing analysis. In some cases, the
reset signal of the partition can be placed on local lines to reduce the delay added by routing to a global
routing line. In other cases, the signal can be routed on a regional or quadrant clock signal.
The figure shows a cascaded reset structure.
Figure 14-18: Cascaded Reset Structure
A CLRN CLRN
VCC
D Q D Q
VCC
CLRN CLRN D Q D Q
B_Reset
Reset
B CLRN CLRN
This circuit design can help you achieve timing closure and partition independence for your global reset
signal. Evaluate the circuit and consider how it works for your design.
Related Information
Recommended Design Practices documentation on page 11-1
Information and design recommendations for reset structures
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 Allocate Logic Resources 14-23
common project is not possible, especially when the project lead plans to integrate the IP's post-fitting
results, it is important that the project lead and IP designer clearly communicate their requirements.
Related Information
Project Management in Team-Based Design Flows on page 14-4
Related Information
• Introduction to Design Floorplans on page 14-35
• Quartus Prime Integrated Synthesis documentation on page 16-1
Information about resource balancing DSP and RAM blocks when using Quartus Prime synthesis
• Timing Closure and Optimization documentation
Tips about resource balancing and reducing resource utilization
• More Analysis Synthesis Settings Dialog Box online help
Information about how to set global logic options for partitions
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-24 Allocate Global Routing Signals and Clock Networks if Required 2015.11.02
If the exported IP core is small, you can reduce the potential for problems by using constraints to promote
clock and high fan-out signals to regional routing signals that cover only part of the device, instead of
global routing signals. In this case, the Quartus Prime software is likely to find a routing solution in the
top-level design because there are many regional routing signals available on most Altera devices, and
designs do not typically overuse regional resources.
To ensure that an IP block can utilize a regional clock signal, view the resource coverage of regional clocks
in the Chip Planner, and then align LogicLock regions that constrain partition placement with available
global clock routing resources. For example, if the LogicLock region for a particular partition is limited to
one device quadrant, that partition’s clock can use a regional clock routing type that covers only one
device quadrant. When all partition logic is available, the project lead can compile the entire design at the
top level with floorplan assignments to allow the use of regional clocks that span only a part of the device.
If global resources are heavily used in the overall design, or the IP designer requires global clocks for their
partition, you can set up constraints to avoid signal overuse at the top-level by assigning the appropriate
type of global signals or setting a maximum number of clock signals for the partition.
You can use the Global Signal assignment to force or prevent the use of a global routing line, making the
assignment to a clock source node or signal. You can also assign certain types of global clock resources in
some device families, such as regional clocks. For example, if you have an IP core, such as a memory
interface that specifies the use of a dual regional clock, you can constrain the IP to part of the device
covered by a regional clock and change the Global Signal assignment to use a regional clock. This type of
assignment can reduce clocking congestion and conflicts.
Alternatively, partition designers can specify the number of clocks allowed in the project using the
maximum clocks allowed options in the Advanced Settings (Fitter) dialog box. Specify Maximum
number of clocks of any type allowed, or use the Maximum number of global clocks allowed,
Maximum number of regional clocks allowed, and Maximum number of periphery clocks allowed
options to restrict the number of clock resources of a particular type in your design.
If you require more control when planning a design with integrated partitions, you can assign a specific
signal to use a particular clock network in newer device families by assigning the clock control block
instance called CLKCTRL. You can make a point-to-point assignment from a clock source node to a
destination node, or a single-point assignment to a clock source node with the Global Clock CLKCTRL
Location logic option. Set the assignment value to the name of the clock control block: CLKCTRL_G<global
network number> for a global routing network, or CLKCTRL_R<regional network number> for a dedicated
regional routing network in the device.
If you want to disable the automatic global promotion performed in the Fitter to prevent other signals
from being placed on global (or regional) routing networks, turn off the Auto Global Clock and Auto
Global Register Control Signals options in the Advanced Settings (Fitter) dialog box.
If you are using design partition scripts for independent partitions, the Quartus Prime software can
automatically write the commands to pass global constraints and turn off automatic options.
Alternatively, to avoid problems when integrating partitions into the top-level design, you can direct the
Fitter to discard the placement and routing of the partition netlist by using the post-synthesis netlist,
which forces the Fitter to reassign all the global signals for the partition when compiling the top-level
design.
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 Assign Virtual Pins 14-25
Related Information
• Advanced Settings (Fitter) Dialog Box online help
Information about how to disable automatic global promotion
• Analyzing and Optimizing the Design Floorplan with the Chip Planner documentation
Information about how clock networks affect partition design
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-26 Recreate PLLs for Lower-Level Partitions if Required 2015.11.02
Connecting the clock signal directly avoids any timing analysis difficulties with gated clocks. Clock gating
is never recommended for FPGA designs because of potential glitches and clock skew. Clock gating can be
especially problematic with exported partitions because the partitions have no information about gating
that takes place at the top-level design or in another partition. If a gated clock is required in a partition,
perform the gating within that partition.
Direct connections to input clock pins also allows design partition scripts to send constraints from the
top-level device pin to lower-level partitions.
Related Information
Invert Clocks in Destination Partitions on page 14-14
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 Checking Partition Quality 14-27
Related Information
• Incremental Compilation Advisor on page 14-27
• Incremental Compilation Advisor Command online help
• Example of Using the Incremental Compilation Advisor to Identify Non-Global Ports That Are
Not Registered online help
For more information about the Incremental Compilation Advisor
• Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design documentation
on page 3-1
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-28 Design Partition Planner 2015.11.02
You can switch between connectivity display mode and hierarchical display mode, to examine the view-
only hierarchy display. You can also remove the connection lines between partitions and I/O banks by
turning off Display connections to I/O banks, or use the settings on the Connection Counting tab in the
Bundle Configuration dialog box to adjust how the connections are counted in the bundles.
To optimize design performance, confine failing paths within individual design partitions so that there are
no failing paths passing between partitions. In the top-level entity, child entities that contain failing paths
are marked by a small red dot in the upper right corner of the entity box.
To view the critical timing paths from a timing analyzer report, first perform a timing analysis on your
design, and then in the Design Partition Planner, click Show Timing Data on the View menu.
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 Viewing Design Partition Planner and Floorplan Side-by-Side 14-29
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-30 Partition Statistics Report 2015.11.02
Related Information
Partition Merge Reports online help
Related Information
Quartus Prime TimeQuest Timing Analyzer documentation
Information about the TimeQuest report_timing command and reports
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 Including SDC Constraints from Lower-Level Partitions for 14-31
Third-Party...
To run a full compilation, use the Start Compilation command.
2. Record the quality of results from the Compilation report (timing slack or fMAX, area and any other
relevant results).
3. Create design partitions following the guidelines described in this manual.
4. Recompile the design.
5. Record the quality of results from the Compilation report. If the quality of results is significantly worse
than those obtained in the previous compilation, repeat step 3 through step 5 to change your partition
assignments and use a different partitioning scheme.
6. Even if the quality of results is acceptable, you can repeat step 3 through step 5 by further dividing a
large partition into several smaller partitions, which can improve compilation time in subsequent
incremental compilations. You can repeat these steps until you achieve a good trade-off point (that is,
all critical paths are localized within partitions, the quality of results is not negatively affected, and the
size of each partition is reasonable).
You can also remove or disable partition assignments defined in the top-level design at any time during
the design flow to compile the design as one flat compilation and get all possible design optimizations to
assess the results. To disable the partitions without deleting the assignments, use the Ignore partition
assignments during compilation option on the Incremental Compilation page of the Settings dialog
box in the Quartus Prime software. This option disables all design partition assignments in your project
and runs a full compilation, ignoring all partition boundaries and netlists. This option can be useful if you
are using partitions to reduce compilation time as you develop various parts of the design, but can run a
long compilation near the end of the design cycle to ensure the design meets its timing requirements.
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-32 Creating an .sdc File with Project-Wide Constraints 2015.11.02
In this top-level design, there is a single clock setting called clk associated with the FPGA input called
top_level_clk. The top-level .sdc contains the following constraint for the clock:
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 Example Step 1—Project Lead Produces .sdc with Project-Wide Constraints... 14-33
Additionally, the .sdc with project-wide constraints should contain all project-wide timing exception
assignments, such as the following:
• Multicycle assignments, set_multicycle_path
• False path assignments, set_false_path
• Maximum delay assignments, set_max_delay
• Minimum delay assignments, set_min_delay
The project-wide .sdc can also contain any set_input_delay or set_output_delay constraints that are
used for ports in separate Quartus Prime projects, because these represent delays external to a given
partition. If the partition designer wants to set these constraints within the separate Quartus Prime
projects, the team must ensure that the I/O port names are identical in all projects so that the assignments
can be integrated successfully without changes.
Similarly, a constraint on a path that crosses a partition boundary should be in the project-wide .sdc,
because it is not completely localized in a separate Quartus Prime project.
Example Step 1—Project Lead Produces .sdc with Project-Wide Constraints for Lower-Level
Partitions
The device input top_level_clk in Figure 14-22 drives the input_clk port of module_A. To make sure
the clock constraint is passed correctly to the partition, the project lead creates an .sdc with project-wide
constraints for module_A that contains the following command:
The designer of module_A includes this .sdc as part of the separate Quartus Prime project.
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-34 Example Step 2—Partition Designer Creates .sdc with Partition-Specific... 2015.11.02
ensure that final timing sign-off is accurate. Use the following guidelines in the partition-specific .sdc to
simplify these export and integration steps:
• Create a hierarchy variable for the partition (such as module_A_hierarchy) and set it to an empty
string because the partition is the top-level instance in the separate Quartus Prime project. The project
lead modifies this variable for the top-level hierarchy, reducing the effort of translating constraints on
lower-level design hierarchies into constraints that apply in the top-level hierarchy. Use the following
Tcl command first to check if the variable is already defined in the project, so that the top-level design
does not use this empty hierarchy path: if {![info exists module_A_hierarchy]}.
• Use the hierarchy variable in the partition-specific .sdc as a prefix for assignments in the project. For
example, instead of naming a particular instance of a register reg:inst, use $
{module_A_hierarchy}reg:inst. Also, use the hierarchy variable as a prefix to any wildcard
characters (such as ” * ”).
• Pay attention to the location of the assignments to I/O ports of the partition. In most cases, these
assignments should be specified in the .sdc with project-wide constraints, because the partition
interface depends on the top-level design. If you want to set I/O constraints within the partition, the
team must ensure that the I/O port names are identical in all projects so that the assignments can be
integrated successfully without changes.
• Use caution with the derive_clocks and derive_pll_clocks commands. In most cases, the .sdc with
project-wide constraints should call these commands. Because these commands impact the entire
design, integrating them unexpectedly into the top-level design might cause problems.
If the design team follows these recommendations, the project lead should be able to include the .sdc with
the partition-specific constraints provided by the partition designer directly in the top-level design.
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 Example Step 3—Project Lead Performs Final Timing Analysis and Sign-off 14-35
Example Step 3—Project Lead Performs Final Timing Analysis and Sign-off
With these commands, the top-level .sdc file looks like the following example:
When the project lead performs top-level timing analysis, the false path assignment from the lower-level
module_A project expands to the following:
Adding the hierarchy path as a prefix to the SDC command makes the constraint legal in the top-level
design, and ensures that the wildcard does not affect any nodes outside the partition that it was intended
to target.
Related Information
Analyzing and Optimizing the Design Floorplan with the Chip Planner documentation
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-36 Why Create a Floorplan? 2015.11.02
preserve the placement results; it simply reuses the results stored in the database netlist from a previous
compilation.
P2 P3 P2
P1 P1
P3
P1 P4 Change in P3 P1 P4
P2 P2
P1 P3 P1
No floorplan assignments: Device has 4 partitions Device after removing changed partition P3:
and the logic is placed throughout New P3 must be placed in empty areas
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 When to Create a Floorplan 14-37
The Fitter has a more difficult task because of more difficult physical constraints, and as a result, compila‐
tion time often increases. The Fitter might not be able to find any legal placement for the logic in partition
P3, even if it could in the initial compilation. Additionally, if the Fitter can find a legal placement, the
quality of results often decreases in these cases, sometimes dramatically, because the new partition is now
scattered throughout the device.
The figure below shows the initial placement of a four-partition design with floorplan location
assignments. Each partition is assigned to a LogicLock region. The second part of the figure shows the
device after partition P3 is removed. This placement presents a much more reasonable task to the Fitter
and yields better results.
Figure 14-24: Representation of Device Floorplan with Location Assignments
P2 P3 P2
Change in P3
P1 P4 P1 P4
With floorplan location assignments: Device has Device after removing changed partition P3:
4 partitions placed in 4 LogicLock regions Much easier to place new P3 partition in empty area
Altera recommends that you create a LogicLock floorplan assignment for timing-critical blocks with little
timing margin that will be recompiled as you make changes to the design.
Early Floorplan
An early floorplan is created before the design stage. You can plan an early floorplan at the top level of a
design to allocate each partition a portion of the device resources. Doing so allows the designer for each
block to create the logic for their design partition without conflicting with other logic. Each partition can
be optimized in a separate Quartus Prime project if required, and the design can still be easily integrated
in the top-level design. Even within one Quartus Prime project, each partition can be locked down with a
post-fit netlist, and you can be sure there is space in the device floorplan for other partitions.
When you have compiled your complete design, or after you have integrated the first versions of
partitions developed in separate Quartus Prime projects, you can use the design information and Quartus
Prime features to tune and improve the floorplan .
Late Floorplan
A late floorplan is created or modified after the design is created, when the code is close to complete and
the design structure is likely to remain stable. Creating a late floorplan is typically necessary only if you are
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-38 Design Floorplan Placement Guidelines 2015.11.02
starting to use incremental compilation late in the design flow, or need to reserve space for a logic block
that becomes timing-critical but still has HDL changes to be integrated. When the design is complete, you
can take advantage of the Quartus Prime analysis features to check the floorplan quality. To adjust the
floorplan, you can perform iterative compilations as required and assess the results of different
assignments.
Note: It may not be possible to create a good-quality late floorplan if you do not create partitions in the
early stages of the design.
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 How to Size and Place Regions 14-39
The Quartus Prime software is flexible and allows exceptions to this rule. For example, you can place
more than one partition in the same LogicLock region if the partitions are tightly connected, but you do
not want to merge the partitions into one larger partition. For best results, ensure that you recompile all
partitions in the LogicLock region every time the logic in one partition changes. Additionally, if a
partition contains multiple lower-level entities, you can place those entities in different areas of the device
with multiple LogicLock regions, even if they are defined in the same partition.
You can use the Reserved LogicLock option to ensure that you avoid conflicts with other logic that is not
locked into a LogicLock region. This option prevents other logic from being placed in the region, and is
useful if you have empty partitions at any point during your design flow, so that you can reserve space in
the floorplan. Do not make reserved regions too large to prevent unused area because no other logic can
be placed in a region with the Reserved LogicLock option.
Related Information
LogicLock Region Properties Dialog Box online help
Related Information
Checking Partition Quality on page 14-27
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-40 I/O Connections 2015.11.02
early floorplan, when the design has not yet been created, you can use the guidelines in this section to set
the size and origin, even though there is no initial Fitter placement.
The easiest way to move and resize regions is to drag the region location and borders in the Chip Planner.
Make sure that you select the User-Defined region in the floorplan (as opposed to the Fitter-Placed
region from the last compilation) so that you can change the region.
Generally, you can keep the Fitter-determined relative placement of the regions, but make adjustments if
required to meet timing performance. Performing a full compilation ensures that the Fitter can optimize
for a full placement and routing.
If two LogicLock regions have several connections between them, ensure they are placed near each other
to improve timing performance. By placing connected regions near each other, the Fitter has more
opportunity to optimize inter-region paths when both partitions are recompiled. Reducing the criticality
of inter-region paths also allows the Fitter more flexibility when placing other logic in each region.
If resource utilization is low in the overall device, enlarge the regions. Doing so usually improves the final
results because it gives the Fitter more freedom to place additional or modified logic added to the
partition during subsequent incremental compilations. It also allows room for optimizations such as
pipelining and logic duplication.
Try to have each region evenly full, with the same ”fullness” that the complete design would have without
LogicLock regions; Altera recommends approximately 75% full.
Allow more area for regions that are densely populated, because overly congested regions can lead to poor
results. Allow more empty space for timing-critical partitions to improve results. However, do not make
regions too large for their logic. Regions that are too large can result in wasted resources and also lead to
suboptimal results.
Ideally, almost the entire device should be covered by LogicLock regions if all partitions are assigned to
regions.
Regions should not overlap in the device floorplan. If two partitions are allocated on an overlapping
portion of the chip, each may independently claim common resources in this region. This leads to
resource conflicts when integrating results into a top-level design. In a single project, overlapping regions
give more difficult constraints to the Fitter and can lead to reduced quality of results.
You can create hierarchical LogicLock regions to ensure that the logic in a child partition is physically
placed inside the LogicLock region for its parent partition. This can be useful when the parent partition
does not contain registers at the boundary with the lower-level child partition and has a lot of signal
connectivity. To create a hierarchical relationship between regions in the LogicLock Regions window,
drag and drop the child region to the parent region.
I/O Connections
Consider I/O timing when placing regions. Using I/O registers can minimize I/O timing problems, and
using boundary registers on partitions can minimize problems connecting regions or partitions. However,
I/O timing might still be a concern. It is most important for flows where each partition is compiled
independently, because the Fitter can optimize the placement for paths between partitions if the partitions
are compiled at the same time.
Place regions close to the appropriate I/O, if necessary. For example, DDR memory interfaces have very
strict placement rules to meet timing requirements. Incorporate any specific placement requirements into
your floorplan as required. You should create LogicLock regions for internal logic only, and provide pin
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 LogicLock Resource Exclusions 14-41
location assignments for external device I/O pins (instead of including the I/O cells in a LogicLock region
to control placement).
Exclude DSP
blocks from
LogicLock region
M512 RAM
M512 RAM
M4K RAM
M4K RAM
MRAM
MRAM
DSP
DSP
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-42 Creating Floorplan Location Assignments With Tcl Commands—Excluding or... 2015.11.02
or entity) in the Members box, and then click Edit. In the Edit Node dialog box, to set up a resource
exception, click the Edit button next to the Excluded element types box, and then turn on the design
element types to be excluded from the region. You can choose to exclude combinational logic or registers
from logic cells, or any of the sizes of TriMatrix memory blocks, or DSP blocks.
If the excluded logic is in its own lower-level design entity (even if it is within the same design partition),
you can assign the entity to a separate LogicLock region to constrain its placement in the device.
You can also use this feature with the LogicLock Reserved property to reserve specific resources for logic
that will be added to the design.
• <LogicLock region name>—The name of the LogicLock region to which the code block is assigned.
• <block>—A code block in a Quartus Prime project hierarchy, which can also be a design partition.
• <keyword>—The list of exceptions made during assignment. For example, if DSP was in the keyword
list, the named block of code would be assigned to the LogicLock region, except for any DSP block
within the code block. You can include the following exceptions in the set_logiclock_contents
command:
Keyword variables:
• REGISTER—Any registers in the logic cells.
• COMBINATIONAL—Any combinational elements in the logic cells.
• SMALL_MEM—Small TriMatrix memory blocks (M512 or MLAB).
• MEDIUMEM_MEM—Medium TriMatrix memory blocks (M4K or M9K).
• LARGE_MEM—Large TriMatrix memory blocks (M-RAM or M144K).
• DSP—Any DSP blocks.
• VIRTUAL_PIN—Any virtual pins.
Note: Resource filtering uses the optional Tcl argument -exclude_resources in the
set_logiclock_contents function. If left unspecified, no resource filter is created. In the .qsf,
resource filtering uses an extra LogicLock membership assignment called
LL_MEMBER_RESOURCE_EXCLUDE. For example, the following line in the .qsf is used to specify a
resource filter for the alu:alu_unit entity assigned to the ALU region.
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 Checking Floorplan Quality 14-43
to control which logic can be placed inside these child regions. Setting the Reserved option for the region
prevents the Fitter from placing nodes that are not assigned to the region inside the boundary of the
region.
Related Information
Creating and Manipulating LogicLock Regions online help
Related Information
LogicLock Region Properties Dialog Box online help
Locate the Quartus Prime TimeQuest Timing Analyzer Path in the Chip Planner
In the TimeQuest analyzer user interface, you can locate a specific path in the Chip Planner to view its
placement and perform a report timing operation (for example, report timing for all paths with less than 0
ns slack).
Related Information
Locate Dialog Box online help
Information about how to locate paths between the TimeQuest analyzer and the Chip Planner
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-44 Routing Utilization 2015.11.02
Related Information
Inter-region Bundles Dialog Box online help
Information about how to display bundles of connections between LogicLock regions
Routing Utilization
The Chip Planner includes a feature to display a color map of routing congestion. This display helps
identify areas of the chip that are too tightly packed.
In the Chip Planner, red LAB blocks indicate higher routing congestion. You can position the mouse
pointer over a LAB to display a tooltip that reports the logic and routing utilization information.
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 Create a Floorplan Assignment for One Design Block with Difficult Timing 14-45
To create a floorplan for major design blocks, follow this general methodology:
1. In the Design Partitions window, ensure that all partitions have their netlist type set to Source File or
Post-Synthesis. If the netlist type is set to Post-Fit, floorplan location assignments are not used when
recompiling the design.
2. Create a LogicLock region for each partition (including the top-level entity, which is set as a partition
by default).
3. Run a full compilation of your design to view the initial Fitter-chosen placement of the LogicLock
regions as a guideline.
4. In the Chip Planner, view the placement results of each partition and LogicLock region on the device.
5. If required, modify the size and location of the LogicLock regions in the Chip Planner. For example,
enlarge the regions to fill up the device and allow for future logic changes.You can also, if needed,
create a new LogicLock region by drawing a box around an area on the floorplan.
6. Run the Compiler with the Start Compilation command to determine the timing performance of your
design with the modified or new LogicLock regions.
7. Repeat steps 5 and 6 until you are satisfied with the quality of results for your design floorplan. Once
you are satisfied with your results, run a full compilation of your design.
Create a Floorplan Assignment for One Design Block with Difficult Timing
Use this flow when you have one timing-critical design block that requires more optimization than the
rest of your design. You can take advantage of incremental compilation to reduce your compilation time
without creating a full design floorplan.
In this scenario, you do not want to create floorplan assignments for the entire design. Instead, you can
create a region to constrain the location of your critical design block, and allow the rest of the logic to be
placed anywhere on the device. To create a region for critical design block, follow these steps:
1. Divide up your design into partitions. Ensure that you isolate the timing-critical logic in a separate
partition.
2. Define a LogicLock region for the timing-critical partition. Ensure that you capture the correct amount
of device resources in the region. Turn on the Reserved property to prevent any other logic from being
placed in the region.
• If the design block is not complete, reserve space in the design floorplan based on your knowledge
of the design specifications, connectivity between design blocks, and estimates of the size of the
partition based on any initial implementation numbers.
• If the critical design block has initial source code ready, compile the design to place the LogicLock
region. Save the Fitter-determined size and origin, and then enlarge the region to provide more
flexibility and allow for future design changes.
As the rest of the design is completed, and the device fills up, the timing-critical region reserves an area
of the floorplan. When you make changes to the design block, the logic will be re-placed in the same
part of the device, which helps ensure good quality of results.
Related Information
Design Partition Guidelines on page 14-9
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-46 Create a Floorplan as the Project Lead in a Team-Based Flow 2015.11.02
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
QPS5V1
2015.11.02 Document Revision History 14-47
July 2010 10.0.0 • Removed the explanation of the “bottom-up design flow” where
designers work completely independently, and replaced with Altera’s
recommendations for team-based environments where partitions are
developed in the same top-level project framework, plus an explana‐
tion of the bottom-up process for including independent partitions
from third-party IP designers.
• Expanded the Merge command explanation to explain how it now
accommodates cross-partition boundary optimizations.
• Restructured Altera recommendations for when to use a floorplan.
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Altera Corporation
Send Feedback
QPS5V1
14-48 Document Revision History 2015.11.02
March 2009 9.0.0 • Added I/O register packing examples from Incremental Compilation
for Hierarchical and Team-Based Designs chapter
• Moved "Incremental Compilation Advisor" section
• Added "Viewing Design Partition Planner and Floorplan Side-by-
Side" section
• Updated Figure 15-22
• Chapter 8 was previously Chapter 7 in software release 8.1.
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Altera Corporation Best Practices for Incremental Compilation Partitions and Floorplan Assignments
Send Feedback
2016.05.24
Mitigating Single Event Upset
15
QPS5V1 Subscribe Send Feedback
Single event upsets (SEUs) are rare, unintended changes in the state of an FPGA's internal memory
elements caused by cosmic radiation effects. The change in state is a soft error and the FPGA incurs no
permanent damage. Because of the unintended memory state, the FPGA may operate erroneously until
background scrubbing fixes the upset. The Quartus Prime software offers several features to detect and
correct the effects of SEU, or soft errors, as well as to characterize the effects of SEU on your designs.
Additionally, some Altera FPGAs contain dedicated circuitry to help detect and correct errors.
Figure 15-1: Tools, IP, and Circuitry for Detecting and Correcting SEU
Altera FPGA
Hierarchy Tagging Altera Advanced SEU EMR Unloader
(Design Partitions) Detection IP Core IP Core
Error Detection
Fault Injection Sensitivity Map Altera Fault CRC (CRAM)
Debugger Header File (.smh) Injection IP Core
The Projected SEU FIT by Component Usage Simulate SEU in your design using Use hard or soft ECC circuitry
report provides the projected design-specific the Fault injection Debugger and to correct errors in the FPGA’s
SEU FIT for your chosen device. Altera Fault Injection IP core. embedded memory.
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V1
15-2 Understanding Failure Rates 2016.05.24
Altera FPGAs have memory in user logic (block memory and registers) and in Configuration Random
Access Memory (CRAM). The Quartus Prime Programmer loads the CRAM with a .sof file. Then, the
CRAM configures all FPGA logic and routing. If an SEU strikes a CRAM bit, the effect can be harmless if
the device does not use the CRAM bit. However, the affect can be severe if the SEU affects critical logic or
internal signal routing (such as a lookup table bit).
Often, a design does not require SEU mitigation because of the low chance of occurrence. However, for
highly complex systems, such as systems with multiple high-density components, the error rate may be a
significant system design factor. If your system includes multiple FPGAs and requires very high reliability
and availability, you should consider the implications of soft errors. Use the techniques in this chapter to
detect and recover from these types of errors.
Related Information
• Introduction to Single Event Upsets
• Understanding Single Event Functional Interrupts in FPGA Designs White Paper
Related Information
• Poisson Distribution
• Exponential Distribution
• www.seutest.com
• JEDEC Standard 89A
• Understanding the SEU FIT Reports on page 15-10
Send Feedback
QPS5V1
2016.05.24 Mitigating SEU Effects in Embedded User RAM 15-3
Related Information
• ECC in Stratix V Memory Blocks
• Stratix IV Embedded Memory Blocks
• ECC in Arria V Memory Blocks
• Embedded Memory (RAM: 1-PORT, RAM:2-PORT, ROM: 1-PORT, and ROM: 2-PORT) User
Guide
Memory Storage
Data Output Word
Data
Error Detection
Words
and Correction
ECC ECC
ECC
Encode Values
Send Feedback
QPS5V1
15-4 Mitigating SEU Effects in Configuration RAM 2016.05.24
Related Information
ALTECC (Error Correction Code: Encoder/Decoder)
CRAM
Frame
32-Bit
CRC
CRC Error
Detection/Correction
Engine
CRC_ERROR
Related Information
Single Event Upsets
Send Feedback
QPS5V1
2016.05.24 Internal Scrubbing 15-5
2. To enable the CRC_ERROR pin as an open-drain output, turn on Enable open drain on CRC_ERROR
pin.
3. To guarantee the availability of a clock, the EDCRC function operates on an independent clock
generated internally on the FPGA itself. To enable EDCRC operation on a divided version of the clock
select a value from Divide error check frequency by.
Internal Scrubbing
Arria 10, select Cyclone V (including SoC devices), and Stratix V FPGAs support automatic CRAM error
correction without reloading the original CRAM contents from an external copy of the original .sof.
The EDCRC calculates and stores redundancy fields of the FPGA's configuration bits. Therefore, the
FPGA can correct errors automatically. This automatic correction is known as internal scrubbing. To
enable internal scrubbing, click Assignments > Device > Device and Pin Options > Error Detection
CRC and turn on the Enable internal scrubbing option.
If the FPGA finds a CRC error in a CRAM frame, the FPGA reconstructs the frame from the error
correcting code calculated for that frame. Then the FPGA writes the corrected frame into the CRAM.
Note: If you enable internal scrubbing, you must still plan a recovery sequence. Although scrubbing can
restore the CRAM array to intended configuration, latency occurs between the soft error detection
and correction. Because of the large number of configuration bits the FPGA must scan, this latency
can be up to 100 milliseconds for large devices. Therefore, the FPGA may operate with errors
during that period.
Related Information
Error Detection CRC Page
Send Feedback
QPS5V1
15-6 Planning for SEU Recovery 2016.05.24
because SEUs corrupted the FPGA configuration during operation. Errors due to faulty operation can
propagate elsewhere within the FPGA or to the system outside the FPGA. When recovering from SEU,
the system should reset the FPGA to a known state. During your design process, determine the possible
SEU outcomes and design a recovery response.
Send Feedback
QPS5V1
2016.05.24 Designating the Sensitivity of Your Design Hierarchy 15-7
Normal
Operation
CRAM CRC no
Error?
yes
Notify
System
Look Up Sensitivity
of CRAM Bit
no
Critical Bit?
yes
Take Corrective
Action
The ratio of SEU strikes versus functional interrupts is the Single Event Functional Interrupt (SEFI) ratio.
Minimizing this ratio improves SEU mitigation.
Related Information
• AN 737: SEU Detection and Recovery in Arria 10 Devices
• Understanding Single Event Functional Interrupts in FPGA Designs
Send Feedback
QPS5V1
15-8 Hierarchy Tagging 2016.05.24
To generate an .smh, click Assignments > Device > Device and Pin Options and turn on the Generate
SEU sensitivity map file (.smh) option.
Note: You must have a licensed version of Quartus Prime software to generate .smh files.
Add an instance of the Altera Advanced SEU Detection IP core to your design to access the .smh.
• During system operation, the Altera Advanced SEU Detection IP core reads the FPGA's error message
register (EMR) to determine the location of the error.
• The IP core finds the upset location in the .smh.
• The IP core returns whether or not the bit is critical for the design.
The Altera Advanced SEU Detection IP Core User Guide provides instructions for incorporating the IP
core into your design, and describes how to access the .smh.
Related Information
Altera Advanced SEU Detection IP Core User Guide
Hierarchy Tagging
The Quartus Prime hierarchy tagging feature enables customized soft error classification by indicating
design logic susceptible to soft errors. Hierarchy tagging improves design-effective FIT rate by tagging
only the critical logic for device operation. You also define the system recovery procedure based on
knowledge of logic impaired by SEU. This technique reduces downtime for the FPGA and the system in
which the FPGA resides. The Arria 10, Cyclone V, and Stratix V device families support hierarchy
tagging.
The .smh contains a mask for design sensitive bits in a compressed format. The Quartus Prime software
generates the sensitivity mask for the entire design. Hierarchy tagging provides the following benefits:
• Increases system stability by avoiding disruptive recovery procedures for inconsequential errors.
• Allows diverse corrective action for different design logic.
Send Feedback
QPS5V1
2016.05.24 Altera Advanced SEU Detection IP Core 15-9
Related Information
Altera Advanced SEU Detection IP Core User Guide
Related Information
Altera Advanced SEU Detection IP Core User Guide
Send Feedback
QPS5V1
15-10 External Sensitivity Processor 2016.05.24
Related Information
Altera Advanced SEU Detection IP Core User Guide
Note: You can compute scaled values using the JESD published equations for altitude, latitude, and
longitude. Websites, such as www.seutest.com, can make this computation for you.
• Alpha Flux is the default for standard Altera packages; you cannot override the default.
Note: When you change the relative Neutron Flux Multiplier, the Quartus Prime software only scales
the neutron component of FIT. Alpha flux is not affected by location.
Send Feedback
QPS5V1
2016.05.24 Understanding the Quartus Prime SEU FIT Reports 15-11
The Projected SEU FIT by Component Usage report shows the different components (or cell types) that
comprise the total FIT rate, and SEU FIT calculation results.
Note: Arria 10, Arria V, Arria V SoC, Cyclone V, Cyclone V SoC, and Stratix V FPGAs support the
Projected SEU FIT by Component Usage report.
Related Information
• Altera Reliability Report
• www.seutest.com
Send Feedback
QPS5V1
15-12 Component FIT Rates 2016.05.24
Raw FIT
Raw FIT is the FIT rate of the FPGA if the design uses every component. The device Reliability Report
and the Quartus Prime Projected SEU FIT by Component Usage report both provide raw FIT data.
• The Reliability Report, available on the Altera web site, provides reliability data and testing procedures
for Altera devices. The raw FIT data is not design specific.
• The Quartus Prime Projected SEU FIT by Component Usage report shows the raw FIT in the Raw
column. The Quartus Prime software computes the FIT for each component using (component Mb ×
intrinsic FIT/Mb × Neutron Flux Multiplier) for the device family and process node. (For flipflops,
“Mb” represents a million flipflops.)
For example, a CRAM FIT rate of 5,414 is the number of Mb of CRAM in a Stratix V GX A4 chip
multiplied by the CRAM FIT/Mb. To give the worst-case raw FIT, the report assumes the maximum
amount of CRAM that implements MLABs in the device. Thus, the CRAM raw FIT is the sum of CRAM
and MLAB entries, which, in this example, is 5,414 + 2,767= 8,181. For M20K blocks, the raw FIT assumes
that the design completely uses all 20 Kb of all M20K blocks.
Note: The Quartus Prime software counts device bits for target devices using different parameter
information than the Reliability Report. Therefore, expect a ±5% variation in the Projected SEU
FIT by Component Usage report Raw column compared to the Reliabilty Report data.
Related Information
Altera Reliability Report
Utilized FIT
The Utilized column shows the FIT for the bits that the design actually uses. For example, if the design
does not use a LUT or routing multiplexer, the Utilized column does not include those bits. Altera FPGAs
can tolerate SEU events in unused resources; these events do not affect the FPGA. Therefore, you can
safely ignore these bits for resiliency statistics.
The Utilized column discounts unused memory bits. For example, a 16 × 16 memory implemented in an
M20K block uses only 256 bits of the total possible 20 Kb.
Send Feedback
QPS5V1
2016.05.24 Mitigated FIT 15-13
design uses. Therefore, it is not an accurate indicator of FIT. For example, a design implementing one 4-
LUT in a 6-LUT ALM shows only 16 out of 64 used CRAM bits in the Projected SEU FIT by Component
report. In constrast, the .smh counts the full ALM. In this example, the .smh reports 60% of the LUTs and
multiplexer blocks as used. The FIT report, which is much more detailed, correctly reports that the design
uses only 30% of the FPGA’s bits.
Small Designs
Raw FIT is always correct. In contrast, the utilized FIT only becomes accurate for designs that reasonably
fill up the chosen device. FPGAs contain overhead, such as the configuration state machine, the clock
network control logic, and the I/O calibration block. These infrastructure blocks contain flipflops,
memories, and sometimes I/O configuration blocks. The Projected SEU FIT by Component report
includes the constant overhead for GPIO and HSSI calibration circuitry for first I/O block or transceiver
the design uses. Because of this overhead, the FIT of a 1-transceiver design is much higher than 1/10 the
FIT of a 10-transceiver design. On the other hand, a trivial design such as “a single AND gate plus
flipflop” could easily use so few bits that its CRAM FIT rate is 0.01, which the report rounds to zero.
Related Information
• Altera Advanced SEU Detection IP Core User Guide
• Designating the Sensitivity of your Design Hierarchy on page 15-7
Mitigated FIT
You can lower FIT by reducing the observed FIT rate, such as by enabling ECC. You can also use the
optional M20K ECC to mitigate FIT, as well as the (not optional) hard processor ECC and other hard IP
such as memory controllers, PCIe, and I/O calibration blocks.
The Projected SEU FIT by Component Usage report's w/ECC column represents the FPGA's lowest
guaranteed, provable FIT rate that the Quartus Prime software can calculate. ECC does not affect CRAM
and flipflop rates; therefore, the data in the w/ECC column for these components is the same as the in
Utilized column.
The ECC code strength varies with the device family. In Arria 10 devices, the M20K block can correct up
to two errors, and the FIT rate beyond two (not corrected) is small enough to be negligible in the total.
Note: In Cyclone V devices, the M10K block does not have ECC, therefore, the w/ECC column does not
apply.
Send Feedback
QPS5V1
15-14 Architectural Vulnerability Factor 2016.05.24
An MLAB is simply a LAB configured with writable CRAM. However, when the Quartus Prime software
configures the RAM as write enabled (MLAB), the MLAB has a slightly different FIT/Mb. The Projected
SEU FIT by Component Usage report displays a FIT rate in the MLAB row when the design uses MLABs,
otherwise the report accounts for the block's FIT in the CRAM row. During compilation, if the Quartus
Prime software changes a LAB to an MLAB, the FIT accounting moves from the LAB row to the MLAB
row.
The w/ECC column does not account for other forms of FIT protection in the design, such as designer-
inserted parity, soft ECC blocks, bounds checking, system monitors, triple-module redundancy, or the
impact of higher-level protocols on general fault tolerance. Additionally, it does not account for single
event effects that occur in the logic but the design never reads or notices. For example, if you implement a
non-ECC FIFO function 512 bits deep and an SEU event occurs outside of the front and back pointers,
the application does not observe the SEU event. However, the report accounts for the full 512 bit deep
memory and includes it in the w/ECC FIT rate. Designers often combine these factors into general
deflation factors (called architectural vulnerability factors or AVF) based on knowledge of their design.
Designers use AVF factors as low (aggressive) as 5% and as high (conservative) as 50% based on
experience, fault-injection or neutron beam testing, or high-level system monitors.
Related Information
Understanding Single Event Functional Interrupts in FPGA Designs White Paper
Triple-Module Redundancy
Use Triple-Module Redundancy (TMR) if your system cannot suffer downtime due to SEU. TMR is an
established SEU mitigation technique for improving hardware fault tolerance. A TMR design has three
identical instances of hardware with voting hardware at the output. If an SEU affects one of the hardware
instances, the voting logic notes the majority output. This operation masks malfunctioning hardware.
Send Feedback
QPS5V1
2016.05.24 Evaluating Your System's Response to Functional Upsets 15-15
With TMR, your design does not suffer downtime in the case of a single SEU; if the system detects a faulty
module, the system can scrub the error by reprogramming the module. The error detection and
correction time is many orders of magnitude less than the MTBF of SEU events. Therefore, the system can
repair a soft interrupt before another SEU affects another instance in the TMR application.
The disadvantage of TMR is its hardware resource cost: it requires three times as much hardware in
addition to voting logic. You can minimize this hardware cost by implementing TMR for only the most
critical parts of your design.
There are several automated ways to generate TMR designs by automatically replicating designated
functions and synthesizing the required voting logic. Synopsys offers automated TMR synthesis.
Related Information
Debugging Single Event Upsets Using the Fault Injection Debugger
Send Feedback
QPS5V1
15-16 Document Revision History 2016.05.24
Send Feedback
2016.05.03
Quartus Prime Integrated Synthesis
16
QPS5V1 Subscribe Send Feedback
As programmable logic designs become more complex and require increased performance, advanced
synthesis becomes an important part of a design flow. The Altera Quartus II software includes advanced
® ®
Integrated Synthesis that fully supports VHDL, Verilog HDL, and Altera-specific design entry languages,
and provides options to control the synthesis process. With this synthesis support, the Quartus Prime
software provides a complete, easy-to-use solution.
Related Information
• Recommended HDL Coding Styles on page 12-1
For examples of Verilog HDL and VHDL code synthesized for specific logic functions
• Designing With Low-Level Primitives User Guide
For more information about coding with primitives that describe specific low-level functions in Altera
devices
Design Flow
The Quartus Prime Analysis & Synthesis stage of the compilation flow runs Integrated Synthesis, which
fully supports Verilog HDL, VHDL, and Altera-specific languages, and major features of the SystemVer‐
ilog language.
In the synthesis stage of the compilation flow, the Quartus Prime software performs logic synthesis to
optimize design logic and performs technology mapping to implement the design logic in device
resources such as logic elements (LEs) or adaptive logic modules (ALMs), and other dedicated logic
blocks. The synthesis stage generates a single project database that integrates all your design files in a
project (including any netlists from third-party synthesis tools).
You can use Analysis & Synthesis to perform the following compilation processes:
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V1
16-2 Design Flow 2016.05.03
Related Information
• Language Support on page 16-4
• Start Hierarchy Elaboration Command Processing Menu
For more information about the Hierarchy Elaboration flow
Send Feedback
QPS5V1
2016.05.03 Quartus Prime Integrated Synthesis Design and Compilation Flow 16-3
Altera
Quartus Prime Hardware Altera
Exported Description schematic
Partition File Language Block Design
System Verilog (.qxp) Verilog HDL VHDL (AHDL) File (.bdf)
Functional/RTL
Simulation
Constraints Gate-Level
& Settings Analysis & Synthesis Functional
Simulation
Post Synthesis
Internal Simulation File
Synthesis (.vho/.vo)
Netlist
Configure/Program Device
The Quartus Prime Integrated Synthesis design and compilation flow consists of the following steps:
1. Create a project in the Quartus Prime software and specify the general project information, including
the top-level design entity name.
2. Create design files in the Quartus Prime software or with a text editor.
3. On the Project menu, click Add/Remove Files in Project and add all design files to your Quartus
Prime project using the Files page of the Settings dialog box.
4. Specify Compiler settings that control the compilation and optimization of your design during
synthesis and fitting.
5. Add timing constraints to specify the timing requirements.
6. Compile your design. To synthesize your design, on the Processing menu, point to Start, and then
click Start Analysis & Synthesis. To run a complete compilation flow including placement, routing,
creation of a programming file, and timing analysis, click Start Compilation on the Processing menu.
7. After obtaining synthesis and placement and routing results that meet your requirements, program or
configure your Altera device.
Integrated Synthesis generates netlists that enable you to perform functional simulation or gate-level
timing simulation, timing analysis, and formal verification.
Send Feedback
QPS5V1
16-4 Language Support 2016.05.03
Related Information
• Quartus Prime Synthesis Options on page 16-20
For more information about synthesis settings
• Incremental Compilation on page 16-18
For more information about partitioning your design to reduce compilation time
• Quartus Prime Exported Partition File as Source on page 16-20
For more information about using .qxp as a design source file
• Introduction to the Quartus Prime Software
For an overall summary of features in the Quartus Prime software
• Managing Files in a Project
For more information about Quartus Prime projects
• About Compilation Flows
For more information about Quartus Prime the compilation flow
Language Support
Quartus Prime Integrated Synthesis supports HDL. You can specify the Verilog HDL or VHDL language
version in your design.
To ensure that the Quartus Prime software reads all associated project files, add each file to your Quartus
Prime project by clicking Add/Remove Files in Project on the Project menu. You can add design files to
your project. You can mix all supported languages and netlists generated by third-party synthesis tools in
a single Quartus Prime project.
Related Information
• Design Libraries on page 16-11
Describes how to compile and reference design units in custom libraries
• Using Parameters/Generics on page 16-14
Describes how to use parameters or generics and pass them between languages
• Insert Template Dialog Box
For more information about using the available templates in the Quartus Prime Text Editor for various
Verilog and VHDL features
Send Feedback
QPS5V1
2016.05.03 Verilog HDL Configuration 16-5
The Quartus Prime software support for Verilog HDL is case sensitive in accordance with the Verilog
HDL standard. The Quartus Prime software supports the compiler directive `define, in accordance with
the Verilog HDL standard.
The Quartus Prime software supports the include compiler directive to include files with absolute paths
(with either “/” or “\” as the separator), or relative paths. When searching for a relative path, the Quartus
Prime software initially searches relative to the project directory. If the Quartus Prime software cannot
find the file, the software then searches relative to all user libraries and then relative to the directory
location of the current file. Spectra-Q synthesis searches for all modules or entities earlier in the synthesis
process than other Quartus software tools, which may result in more early syntax errors for undefined
entities.
Related Information
Configuration Syntax on page 16-5
Configuration Syntax
config config_identifier;
design [library_identifier.]cell_identifier;
config_rule_statement;
endconfig
Send Feedback
QPS5V1
16-6 Hierarchical Design Configurations 2016.05.03
instance Specifies a specific instance. The specified instance clause depends on the use of the
following keywords:
• liblist—specifies the logical libraries to search to resolve the instance.
• use—specifies that the instance is an instance of the specified cell in the specified
logical library.
The following are examples of instance clauses:
instance top.dev1 liblist lib1 lib2;
This instance clause specifies to resolve instance top.dev1 with the cells
assigned to logical libraries lib1 and lib2;
instance top.dev1.gm1 use lib2.gizmult;
This instance clause specifies that top.dev1.gm1 is an instance of the cell named
gizmult in logical library lib2.
cell A cell clause is similar to an instance clause, except that the cell clause specifies
all instances of a cell definition instead of specifying a particular instance. What it
specifies depends on the use of the liblist or use keywords:
• liblist—specifies the logical libraries to search to resolve all instances of the cell.
• use—the specified cell’s definition is in the specified library.
Send Feedback
QPS5V1
2016.05.03 Suffix :config 16-7
For example, suppose a sub-hierarchy of a design is an eight-bit adder, and the RTL Verilog code
describes the adder in a logical library named rtllib. The gate-level code describes the adder in a logical
library named gatelib.
If you want to use the gate-level code for the 0 (zero) bit of the adder and the RTL level code for the other
seven bits, the configuration might appear as shown in the following example:
config cfg1;
design aLib.eight_adder;
default liblist rtllib;
instance adder.fulladd0 liblist gatelib;
endconfig
If you are instantiating this eight-bit adder eight times to create a 64-bit adder, use configuration cfg1 for
the first instance of the eight-bit adder, but not in any other instance. A configuration that would perform
this function is shown in the following example:
config cfg2;
design bLib.64_adder;
default liblist bLib;
instance top.64add0 use work.cfg1:config;
endconfig
Note: The name of the unbound module may be different than the name of the cell that is bounded to the
instance.
Suffix :config
To distinguish between a module by the same name, use the optional extension :config to refer to
configuration names. For example, you can always refer to a cfg2 configuration as cfg2:config (even if
the cfg2 module does not exist).
SystemVerilog Support
The Quartus Prime software supports the SystemVerilog constructs.
Note: Designs written to support the Verilog-2001 standard might not compile with the SystemVerilog
setting because the SystemVerilog standard has several new reserved keywords.
Related Information
• Quartus Prime Support for SystemVerilog
For more information about the supported SystemVerilog constructs
• Quartus Prime Support for Verilog 2001
For more information about the supported Verilog-2001 features
Send Feedback
QPS5V1
16-8 Verilog HDL Macros 2016.05.03
Synthesis of initial constructs enables the power-up state of the synthesized design to match the power-up
state of the original HDL code in simulation.
Note: Initial blocks do not infer power-up conditions in some third-party EDA synthesis tools. If you
convert between synthesis tools, you must set your power-up conditions correctly.
Quartus Prime synthesis supports the $readmemb and $readmemh system tasks to initialize memories.
This example shows an initial construct that initializes an inferred RAM with $readmemb.
Example 16-1: Verilog HDL Code: Initializing RAM with the readmemb Command
When creating a text file to use for memory initialization, specify the address using the format
@<location> on a new line, and then specify the memory word such as 110101 or abcde on the
next line.
The following example shows a portion of a Memory Initialization File (.mif) for the RAM.
Example 16-2: Text File Format: Initializing RAM with the readmemb Command
@0
00000000
@1
00000001
@2
00000010
…
@e
00001110
@f
00001111
Related Information
• Translate Off and On / Synthesis Off and On on page 16-57
• Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design on page 3-1
Send Feedback
QPS5V1
2016.05.03 Setting a Verilog HDL Macro Default Value in the Quartus Prime Software 16-9
Setting a Verilog HDL Macro Default Value in the Quartus Prime Software
To specify a macro in the Quartus Prime software, follow these steps:
1. Click Assignments > Settings > Compiler Settings > Verilog HDL Input
2. Under Verilog HDL macro, type the macro name in the Name box and the value in the Setting box.
3. Click Add.
To specify multiple macros, you can repeat the option more than once.
VHDL-2008 Support
The Quartus Prime software contains support for VHDL 2008 with constructs defined in the IEEE
Standard 1076-2008 version of the IEEE Standard VHDL Language Reference Manual.
Related Information
Quartus Prime Support for VHDL 2008
For more information about the Quartus Prime software support for VHDL-2008
Send Feedback
QPS5V1
16-10 VHDL wait Constructs 2016.05.03
standard (included in every project by default) and textio. For compatibility with older designs, the
Quartus Prime software also supports the following vendor-specific packages and libraries:
• Synopsys packages such as std_logic_arith and std_logic_unsigned in the IEEE library
• Mentor Graphics packages such as std_logic_arith in the ARITHMETIC library
®
• Altera primitive packages altera_primitives_components (for primitives such as GLOBAL and DFFE)
and maxplus2 in the ALTERA library
• Altera IP core packages altera_mf_components in the ALTERA_MF library (for Altera-specific IP
cores including LCELL), and lpm_components in the LPM library for library of parameterized
modules (LPM) functions.
Note: Altera recommends that you import component declarations for Altera primitives such as GLOBAL
and DFFE from the altera_primitives_components package and not the altera_mf_components
package.
AHDL Support
The Quartus Prime Compiler’s Analysis & Synthesis module fully supports the Altera Hardware Descrip‐
tion Language (AHDL).
AHDL designs use Text Design Files (.tdf). You can import AHDL Include Files (.inc) into a .tdf with an
AHDL include statement. Altera provides .inc files for all IP cores shipped with the Quartus Prime
software.
Note: The AHDL language does not support the synthesis directives or attributes.
Related Information
About AHDL
For more information about AHDL
Send Feedback
QPS5V1
2016.05.03 State Machine Editor 16-11
Design Libraries
By default, the Quartus Prime software compiles all design files into one or more libraries.
If you do not specify a design library, if a file refers to a library that does not exist, or if the referenced
library does not contain a referenced design unit, the Quartus Prime software searches the work library.
This behavior allows the Quartus Prime software to compile most designs with minimal setup, but you
have the option of creating separate custom design libraries.
To compile your design files into specific libraries (for example, when you have two or more functionally
different design entities that share the same name), you can specify a destination library for each design
file in various ways, as described in the following:
• When compiling a design instance, the Quartus Prime software initially searches for the entity in the
library associated with the instance (which is the work library if you do not specify any library).
• If the Quartus Prime software could not locate the entity definition, the software searches for a unique
entity definition in all design libraries.
• If the Quartus Prime software finds more than one entity with the same name, the software generates
an error. If your design uses multiple entities with the same name, you must compile the entities into
separate libraries.
In VHDL, you can associate an instance with an entity in several ways, as described in Mapping a VHDL
Instance to an Entity in a Specific Library.
In Verilog HDL, BDF schematic entry, AHDL, VQM, and EDIF netlists, you can use different libraries for
each of the entities that have the same name, and compile the instantiation into the same library as the
appropriate entity.
Related Information
Mapping a VHDL Instance to an Entity in a Specific Library on page 16-12
Specifying a Destination Library Name in the Quartus Prime Settings File or with Tcl
You can specify the library name with the -library option to the <language type>_FILE assignment in
the Quartus Prime Settings File (.qsf) or with Tcl commands.
Send Feedback
QPS5V1
16-12 Specifying a Destination Library Name in a VHDL File 2016.05.03
For example, the following assignments specify that the Quartus Prime software analyzes the my_file.vhd
and stores its contents (design units) in the VHDL library my_lib, and then analyzes the Verilog HDL file
my_header_file.h and stores its contents in a library called another_lib.
Related Information
Scripting Support on page 16-74
For more information about Tcl scripting
You can use the library synthesis directive to specify a library name in your VHDL source file.
This directive takes the name of the destination library as a single string argument. Specify the
library directive in a VHDL comment before the context clause for a primary design unit (that
is, a package declaration, an entity declaration, or a configuration), with one of the supported
keywords for synthesis directives, that is, altera, synthesis, pragma, synopsys, or exemplar.
The library directive overrides the default library destination work, the library setting specified
for the current file in the Settings dialog box, any existing .qsf setting, any setting made through
the Tcl interface, or any prior library directive in the current file. The directive remains effective
until the end of the file or the next library synthesis directive.
The following example uses the library synthesis directive to create a library called my_lib
containing the my_entity design unit:
Note: You can specify a single destination library for all your design units in a given
source file by specifying the library name in the Settings dialog box, editing
the .qsf, or using the Tcl interface. To organize your design units in a single file
into different libraries rather than just a single library, you can use the library
directive to change the destination VHDL library in a source file.
The Quartus Prime software generates an error if you use the library directive in a design unit.
Related Information
Synthesis Directives on page 16-23
For more information about specifying synthesis directives
Send Feedback
QPS5V1
2016.05.03 Component Instantiation—Explicit Binding Instantiation 16-13
The following shows the direct entity instantiation method for VHDL:
entity entity1 is
port(...);
end entity entity1;
architecture arch of entity1 is
begin
inst: entity lib1.foo
port map(...);
end architecture arch;
entity entity1 is
port(...);
end entity entity1;
package components is
component entity1 is
port map (...);
end component entity1;
end package components;
entity top_entity is
port(...);
end entity top_entity;
use lib1.components.all;
architecture arch of top_entity is
-- Explicitly bind instance I1 to entity1 from lib1
for I1: entity1 use entity lib1.entity1
port map(...);
end for;
begin
I1: entity1 port map(...);
end architecture arch;
If you do not provide an explicit binding indication, the Quartus Prime software binds a
component instance to the nearest visible entity with the same name. If no such entity is visible in
the current scope, the Quartus Prime software binds the instance to the entity in the library in
which you declare the component. For example, if you declare the component in a package in the
MY_LIB library, an instance of the component binds to the entity in the MY_LIB library.
The code examples in the following examples show this instantiation method:
Example 16-3: VHDL Code: Default Binding to the Entity in the Same Library as the Component
Declaration
-- library “mylib”
architecture rtl of top
...
begin
-- This instance will be bound to entity “foo” in library “mylib”
inst: foo
Send Feedback
QPS5V1
16-14 Using Parameters/Generics 2016.05.03
port map(...);
end architecture rtl;
Example 16-4: VHDL Code: Default Binding to the Directly Visible Entity
Using Parameters/Generics
The Quartus Prime software supports parameters (known as generics in VHDL) and you can pass these
parameters between design languages.
Click Assignments > Settings > Compiler Settings > Default Parameters to enter default parameter
values for your design. In AHDL, the Quartus Prime software inherits parameters, so any default
parameters apply to all AHDL instances in your design. You can also specify parameters for instantiated
modules in a .bdf. To specify parameters in a .bdf instance, double-click the parameter value box for the
instance symbol, or right-click the symbol and click Properties, and then click the Parameters tab.
You can specify parameters for instantiated modules in your design source files with the provided syntax
for your chosen language. Some designs instantiate entities in a different language; for example, they
might instantiate a VHDL entity from a Verilog HDL design file. You can pass parameters or generics
between VHDL, Verilog HDL, AHDL, and BDF schematic entry, and from EDIF or VQM to any of these
languages. You do not require an additional procedure to pass parameters from one language to another.
However, sometimes you must specify the type of parameter you are passing. In those cases, you must
follow certain guidelines to ensure that the Quartus Prime software correctly interprets the parameter
value.
Related Information
• Setting Default Parameter Values and BDF Instance Parameter Values on page 16-14
For more information about the GUI-based entry methods, the interpretation of parameter values, and
format recommendations
• Passing Parameters Between Two Design Languages on page 16-16
For more information about parameter type rules
Send Feedback
QPS5V1
2016.05.03 Setting Default Parameter Values and BDF Instance Parameter Values 16-15
interpret the value, so that the Quartus Prime software interprets a value of 123 as a string if the VHDL
parameter is of a type string. In addition, you can set the parameter value in a format that is legal in the
language of the instantiated entity. For example, to pass an unsized bit literal value from .bdf to Verilog
HDL, you can use '1 as the parameter value, and to pass a 4-bit binary vector from .bdf to Verilog HDL,
you can use 4'b1111 as the parameter value.
In a few cases, the Quartus Prime software cannot infer the correct type of parameter value. To avoid
ambiguity, specify the parameter value in a type-encoded format in which the first or first and second
characters of the parameter indicate the type of the parameter, and the rest of the string indicates the
value in a quoted sub-string. For example, to pass a binary string 1001 from .bdf to Verilog HDL, you
cannot use the value 1001, because the Quartus Prime software interprets it as a decimal value. You also
cannot use the string "1001" because the Quartus Prime software interprets it as an ASCII string. You
must use the type-encoded string B"1001" for the Quartus Prime software to correctly interpret the
parameter value.
This table lists valid parameter strings and how the Quartus Prime software interprets the parameter
strings. Use the type-encoded format only when necessary to resolve ambiguity.
You can select the parameter type for global parameters or global constants with the pull-down list in the
Parameter tab of the Symbol Properties dialog box. If you do not specify the parameter type, the Quartus
Prime software interprets the parameter value and defines the parameter type. You must specify
parameter type with the pull-down list to avoid ambiguity.
Send Feedback
QPS5V1
16-16 Passing Parameters Between Two Design Languages 2016.05.03
Note: If you open a .bdf in the Quartus Prime software, the software automatically updates the parameter
types of old symbol blocks by interpreting the parameter value based on the language-independent
format. If the Quartus Prime software does not recognize the parameter value type, the software
sets the parameter type as untyped.
The Quartus Prime software supports the following parameter types:
• Unsigned Integer
• Signed Integer
• Unsigned Binary
• Signed Binary
• Octal
• Hexadecimal
• Float
• Enum
• String
• Boolean
• Char
• Untyped/Auto
Send Feedback
QPS5V1
2016.05.03 Passing Parameters Between Two Design Languages 16-17
This table shows a VHDL subdesign that you instantiate in a top-level Verilog HDL design in Table 16-5.
HDL Code
VHDL
type fruit is (apple, orange, grape);
entity vhdl_sub is
generic (
name : string := "default",
width : integer := 8,
number_string : string := "123",
f : fruit := apple,
binary_vector : std_logic_vector(3 downto 0) := "0101",
signed_vector : signed (3 downto 0) := "1111");
Table 16-5: Verilog HDL Top-Level Design Instantiating and Passing Parameters to VHDL Entity
This table shows a Verilog HDL Top-Level Design Instantiating and Passing Parameters to VHDL Entity from
Table 16-4.
HDL Code
Verilog HDL
vhdl_sub inst (...);
defparam inst.name = "lower";
defparam inst.width = 3;
defparam inst.num_string = "321";
defparam inst.f = "grape"; // Must exactly match enum value
defparam inst.binary_vector = 4'b1010;
defparam inst.signed_vector = 4'sb1010;
This table shows a Verilog HDL subdesign that you instantiate in a top-level VHDL design in Table 16-7.
HDL Code
Verilog HDL
module veri_sub (...)
parameter name = "default";
parameter width = 8;
parameter number_string = "123";
parameter binary_vector = 4'b0101;
parameter signed_vector = 4'sb1111;
Send Feedback
QPS5V1
16-18 Incremental Compilation 2016.05.03
Table 16-7: VHDL Top-Level Design Instantiating and Passing Parameters to the Verilog HDL Module
This table shows a VHDL Top-Level Design Instantiating and Passing Parameters to the Verilog HDL Module
from Table 16-6.
HDL Code
VHDL
inst:veri_sub
generic map (
name => "lower",
width => 3,
number_string => "321"
binary_vector = "1010"
signed_vector = "1010")
To use an HDL subdesign such as the one shown in Table 16-6 in a top-level .bdf design, you must
generate a symbol for the HDL file, as shown in Figure 16-2. Open the HDL file in the Quartus Prime
software, and then, on the File menu, point to Create/Update, and then click Create Symbol Files for
Current File.
To specify parameters on a .bdf instance, double-click the parameter value box for the instance symbol, or
right-click the symbol and click Properties, and then click the Parameters tab. Right-click the symbol and
click Update Design File from Selected Block to pass the updated parameter to the HDL file.
Figure 16-2: BDF Top-Level Design Instantiating and Passing Parameters to the Verilog HDL Module
This figure shows BDF Top-Level Design Instantiating and Passing Parameters to the Verilog HDL
Module from Table 16-6
Incremental Compilation
Incremental compilation manages a design hierarchy for incremental design by allowing you to divide
your design into multiple partitions. Incremental compilation ensures that the Quartus Prime software
resynthesizes only the updated partitions of your design during compilation, to reduce the compilation
time and the runtime memory usage. The feature maintains node names during synthesis for all registered
and combinational nodes in unchanged partitions. You can perform incremental synthesis by setting the
netlist type for all design partitions to Post-Synthesis.
You can also preserve the placement and routing information for unchanged partitions. This feature
allows you to preserve performance of unchanged blocks in your design and reduces the time required for
placement and routing, which significantly reduces your design compilation time.
Send Feedback
QPS5V1
2016.05.03 Partitions for Preserving Hierarchical Boundaries 16-19
Related Information
• About Incremental Compilation
For more information about incremental compilation
• Best Practices for Incremental Compilation Partitions and Floorplan Assignments
For more information about incremental compilation best practices and floorplan assignments
• Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design on page 3-1
For more information about incremental compilation for hierarchical and team-based design
Parallel Synthesis
The Parallel Synthesis logic option reduces compilation time for synthesis. The option enables the
Quartus Prime software to use multiple processors to synthesize multiple partitions in parallel.
This option is available when you perform the following tasks:
• Specify the maximum number of processors allowed under Parallel Compilation options in the
Compilation Process Settings page of the Settings dialog box.
• Enable the incremental compilation feature.
• Use two or more partitions in your design.
• Turn on the Parallel Synthesis option.
By default, the Quartus Prime software enables the Parallel Synthesis option. To disable parallel
synthesis, click Assignments > Settings > Compiler Settings > Advanced Settings (Synthesis) > Parallel
Synthesis.
You can also set the Parallel Synthesis option with the following Tcl command:
If you use the command line, you can differentiate among the interleaved messages by turning on the
Show partition that generated the message option in the Messages page. This option shows the partition
ID in parenthesis for each message.
You can view all the interleaved messages from different partitions in the Messages window. The
Partition column in the Messages window displays the partition ID of the partition referred to in the
message. After compilation, you can sort the messages by partition.
Send Feedback
QPS5V1
16-20 Quartus Prime Exported Partition File as Source 2016.05.03
Related Information
About the Messages Window
For more information about displaying the Partition column
Related Information
• Quartus Prime Exported Partition File .qxp
For more information about .qxp
• Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design on page 3-1
For more information about exporting design partitions and using .qxp files
Related Information
Setting Synthesis Options on page 16-20
Describes the Compiler Settings page of the Settings dialog box, in which you can set the most common
global settings and options, and defines the following types of synthesis options: Quartus Prime logic
options, synthesis attributes, and synthesis directives.
Send Feedback
QPS5V1
2016.05.03 Quartus Prime Logic Options 16-21
Synthesis Attributes
The Quartus Prime software supports synthesis attributes for Verilog HDL and VHDL, also commonly
called pragmas. These attributes are not standard Verilog HDL or VHDL commands. Synthesis tools use
attributes to control the synthesis process. The Quartus Prime software applies the attributes in the HDL
source code, and attributes always apply to a specific design element. Some synthesis attributes are also
available as Quartus Prime logic options via the Quartus Prime software or scripting. Each attribute
description indicates a corresponding setting or a logic option that you can set in the Quartus Prime
software. You can specify only some attributes with HDL synthesis attributes.
Attributes specified in your HDL code are not visible in the Assignment Editor or in the .qsf. Assignments
or settings made with the Quartus Prime software, the .qsf, or the Tcl interface take precedence over
assignments or settings made with synthesis attributes in your HDL code. The Quartus Prime software
generates warning messages if the software finds invalid attributes, but does not generate an error or stop
the compilation. This behavior is necessary because attributes are specific to various design tools, and
attributes not recognized in the Quartus Prime software might be for a different EDA tool. The Quartus
Prime software lists the attributes specified in your HDL code in the Source assignments table of the
Analysis & Synthesis report.
The Verilog-2001, SystemVerilog, and VHDL language definitions provide specific syntax for specifying
attributes, but in Verilog-1995, you must embed attribute assignments in comments. You can enter
attributes in your code using the syntax in Specifying Synthesis Attributes in Verilog-1995 on page 1-
22 through Synthesis Attributes in VHDL on page 1-23, in which <attribute>, <attribute type>,
<value>, <object>, and <object type> are variables, and the entry in brackets is optional. These examples
demonstrate each syntax form.
Note: Verilog HDL is case sensitive; therefore, synthesis attributes in Verilog HDL files are also case
sensitive.
In addition to the synthesis keyword shown above, the Quartus Prime software supports the pragma,
synopsys, and exemplar keywords for compatibility with other synthesis tools. The software also
supports the altera keyword, which allows you to add synthesis attributes that the Quartus Prime
Integrated Synthesis feature recognizes and not by other tools that recognize the same synthesis attribute.
Note: Because formal verification tools do not recognize the exemplar, pragma, and altera keywords,
avoid using these attribute keywords when using formal verification.
Related Information
• Maximum Fan-Out on page 16-41
For more information about maximum fan-out attribute
• Preserve Registers on page 16-36
For more information about preserve attribute
Send Feedback
QPS5V1
16-22 Synthesis Attributes in Verilog-1995 2016.05.03
For example, to set the maxfan attribute to 16 and set the preserve attribute on a register called my_reg,
use the following syntax:
Related Information
• Maximum Fan-Out on page 16-41
For more information about maximum fan-out attribute
• Preserve Registers on page 16-36
For more information about preserve attribute
(* <attribute> [ = <value> ] *)
Send Feedback
QPS5V1
2016.05.03 Synthesis Attributes in VHDL 16-23
For example, to set the maxfan attribute to 16 and set the preserve attribute on a register called my_reg,
use the following syntax:
Related Information
• Maximum Fan-Out on page 16-41
For more information about maximum fan-out attribute
• Preserve Registers on page 16-36
For more information about preserve attribute
altera_syn_attributes
The Quartus Prime software defines and applies each attribute separately to a given node. For VHDL
designs, the software declares all supported synthesis attributes in the altera_syn_attributes package
in the Altera library. You can call this library from your VHDL code to declare the synthesis attributes:
LIBRARY altera;
USE altera.altera_syn_attributes.all;
Synthesis Directives
The Quartus Prime software supports synthesis directives, also commonly called compiler directives or
pragmas. You can include synthesis directives in Verilog HDL or VHDL code as comments. These
directives are not standard Verilog HDL or VHDL commands. Synthesis tools use directives to control
the synthesis process. Directives do not apply to a specific design node, but change the behavior of the
synthesis tool from the point in which they occur in the HDL source code. Other tools, such as simulators,
ignore these directives and treat them as comments.
Send Feedback
QPS5V1
16-24 Optimization Technique 2016.05.03
You can enter synthesis directives in your code using the syntax in the following table, in which <directive> and
<value> are variables, and the entry in brackets are optional. For synthesis directives, no equal sign before the
value is necessary; this is different than the Verilog syntax for synthesis attributes. The examples demonstrate each
syntax form.
Language Syntax Example
Verilog
// synthesis <directive> [ <value> ]
HDL(10) or
/* synthesis <directive> [ <value> ] */
VHDL
-- synthesis <directive> [ <value> ]
VHDL-2008
/* synthesis <directive> [<value>] */
In addition to the synthesis keyword shown above, the software supports the pragma, synopsys, and
exemplar keywords in Verilog HDL and VHDL for compatibility with other synthesis tools. The Quartus
Prime software also supports the keyword altera, which allows you to add synthesis directives that only
Quartus Prime Integrated Synthesis feature recognizes, and not by other tools that recognize the same
synthesis directives.
Note: Because formal verification tools ignore the exemplar, pragma, and altera keywords, Altera
recommends that you avoid using these directive keywords when you use formal verification to
prevent mismatches with the Quartus Prime results.
Optimization Technique
The Optimization Technique logic option specifies the goal for logic optimization during compilation;
that is, whether to attempt to achieve maximum speed performance or minimum area usage, or a balance
between the two.
Related Information
Optimization Technique logic option
For more information about the Optimization Technique logic option
(10)
Verilog HDL is case sensitive; therefore, all synthesis directives are also case sensitive.
Send Feedback
QPS5V1
2016.05.03 Auto Gated Clock Conversion 16-25
The gated clock conversion occurs when all these conditions are met:
• Only one base clock drives a gated-clock
• For one set of gating input values, the value output of the gated clock remains constant and does not
change as the base clock changes
• For one value of the base clock, changes in the gating inputs do not change the value output for the
gated clock
The option supports combinational gates in clock gating network.
Figure 16-3: Example Gated Clock Conversion
ena ena
ena1
clk
clk
ena ena
Note: This option does not support registers in RAM, DSP blocks, or I/O related WYSIWYG primitives.
Because the gated-clock conversion cannot trace the base clock from the gated clock, the gated
clock conversion does not support multiple design partitions from incremental compilation in
which the gated clock and base clock are not in the same hierarchical partition. A gated clock tree,
instead of every gated clock, is the basis of each conversion. Therefore, if you cannot convert a
gated clock from a root gated clock of a multiple cascaded gated clock, the conversion of the entire
gated clock tree fails.
The Info tab in the Messages window lists all the converted gated clocks. You can view a list of converted
and nonconverted gated clocks from the Compilation Report under the Optimization Results of the
Analysis & Synthesis Report. The Gated Clock Conversion Details table lists the reasons for
nonconverted gated clocks.
Related Information
Auto Gated Clock Conversion logic option
For more information about Auto Gated Clock Conversion logic option and a list of supported devices
Send Feedback
QPS5V1
16-26 Timing-Driven Synthesis 2016.05.03
Timing-Driven Synthesis
Timing-driven synthesis accounts for any .sdc timing constraints in optimizing the circuit during
synthesis. Timing analysis runs first to obtain timing information about the netlist. Synthesis then focuses
on performance for timing-critical design elements, while optimizing non-timing-critical portions for
area. Synthesis preserves .sdc constraints and does not perform timing optimizations that conflict
with .sdc timing constraints. Duplicate registers must have compatible timing constraints.
The increased performance affects the amount of area used, specifically adaptive look-up tables (ALUTs)
and registers in your design. Depending on how much of your design is timing critical, overall area can
increase or decrease when you turn on the Timing-Driven Synthesis option. Runtime and peak memory
use increases slightly if you turn on the Timing-Driven Synthesis option.
The Timing-Driven Synthesis logic option impacts the Optimization Technique option:
• Optimization Technique Speed—optimizes timing-critical portions of your design for performance at
the cost of increasing area (logic and register utilization)
• Optimization Technique Balanced—also optimizes the timing-critical portions of your design for
performance, but the option allows only limited area increase
• Optimization Technique Area—optimizes your design only for area
Timing-Driven Synthesis prevents registers with incompatible timing constraints from merging for any
Optimization Technique setting. If your design contains multiple partitions, you can select Timing-
Driven Synthesis unique options for each partition. If you use a .qxp as a source file, or if your design
uses partitions developed in separate Quartus Prime projects, the software cannot properly compute
timing of paths that cross the partition boundaries.
Even with the Optimization Technique option set to Speed, the Timing-Driven Synthesis option still
considers the resource usage in your design when increasing area to improve timing. For example, the
Timing-Driven Synthesis option checks if a device has enough registers before deciding to implement the
shift registers in logic cells instead of RAM for better timing performance.
To turn on or turn off the Timing-Driven Synthesis option, follow these steps:
1. Click Assignments > Settings > Compiler Settings > Advanced Settings (Synthesis).
2. Turn on or turn off Timing-Driven Synthesis.
Note: Select a specific device for timing-driven synthesis to have the most accurate timing information.
When you select auto device, timing-driven synthesis uses the smallest device for the selected
family to obtain timing information.
Send Feedback
QPS5V1
2016.05.03 PowerPlay Power Optimization 16-27
Related Information
• PowerPlay Power Optimization logic option
For more information about the available settings for the PowerPlay power optimization logic option
and a list of supported devices
• Power Optimization
For more information about optimizing your design for power utilization
• PowerPlay Power Analysis
For information about analyzing your power results
Related Information
• Creating LogicLock Regions on page 16-27
For more information about preventing a no-fit error during the fitting process
• Using Assignments to Limit the Number of RAM and DSP Blocks on page 16-28
For more information about preventing a no-fit error during the fitting process
Send Feedback
QPS5V1
16-28 Using Assignments to Limit the Number of RAM and DSP Blocks 2016.05.03
region, resource balancing takes into account that all the DSP and RAM blocks in that partition need to fit
in this LogicLock region. Resource balancing then balances the DSP and RAM blocks accordingly.
Because floorplan-aware balancing step considers only one partition at a time, it does not know that
nodes from another partition may be using the same resources. When using this feature, Altera
recommends that you do not manually assign nodes from different partitions to the same LogicLock
region.
If you do not want the software to consider the LogicLock floorplan constraints when performing DSP
and RAM balancing, you can turn off the floorplan-aware synthesis feature. Click Assignments >
Settings > Compiler Settings > Advanced Settings (Synthesis) to disable Use LogicLock Constraints
During Resource Balancing option.
Related Information
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design on page 3-1
For more information about using LogicLock regions to create a floorplan for incremental compilation
Send Feedback
QPS5V1
2016.05.03 Restructure Multiplexers 16-29
Restructure Multiplexers
The Restructure Multiplexers logic option restructures multiplexers to create more efficient use of area,
allowing you to implement multiplexers with a reduced number of LEs or ALMs.
When multiplexers from one part of your design feed multiplexers in another part of your design, trees of
multiplexers form. Multiplexers may arise in different parts of your design through Verilog HDL or
VHDL constructs such as the “if,” “case,” or “?:” statements. Multiplexer buses occur most often as a
result of multiplexing together arrays in Verilog HDL, or STD_LOGIC_VECTOR signals in VHDL. The
Restructure Multiplexers logic option identifies buses of multiplexer trees that have a similar structure.
This logic option optimizes the structure of each multiplexer bus for the target device to reduce the overall
amount of logic in your design.
Results of the multiplexer optimizations are design dependent, but area reductions as high as 20% are
possible. The option can negatively affect your design’s fMAX.
Related Information
• Recommended HDL Coding Styles on page 12-1
For more information about optimizing for multiplexers
• Analysis Synthesis Optimization Results Reports
For more information about the Multiplexer Restructuring Statistics report table for each bus of
multiplexers
• Restructure Multiplexers logic option
For more information about the Restructure Multiplexers logic option, including the settings and a list
of supported device families
Synthesis Effort
The Synthesis Effort logic option specifies the overall synthesis effort level in the Quartus Prime software.
Related Information
Synthesis Effort logic option
For more information about Synthesis Effort logic option, including a list of supported device families
Send Feedback
QPS5V1
16-30 State Machine Processing 2016.05.03
The State Machine Processing logic option specifies the processing style to synthesize a state
machine.
The default state machine encoding, Auto, uses one-hot encoding for FPGA devices and
minimal-bits encoding for CPLDs. These settings achieve the best results on average, but another
encoding style might be more appropriate for your design, so this option allows you to control the
state machine encoding.
For one-hot encoding, the Quartus Prime software does not guarantee that each state has one bit
set to one and all other bits set to zero. Quartus Prime Integrated Synthesis creates one-hot
register encoding with standard one-hot encoding and then inverts the first bit. This results in an
initial state with all zero values, and the remaining states have two 1 values. Quartus Prime
Integrated Synthesis encodes the initial state with all zeros for the state machine power-up
because all device registers power up to a low value. This encoding has the same properties as true
one-hot encoding: the software recognizes each state by the value of one bit. For example, in a
one-hot-encoded state machine with five states, including an initial or reset state, the software
uses the following register encoding:
State 0 0 0 0 0 0
State 1 0 0 0 1 1
State 2 0 0 1 0 1
State 3 0 1 0 0 1
State 4 1 0 0 0 1
If you set the State Machine Processing logic option to User-Encoded in a Verilog HDL design,
the software starts with the original design values for the state constants. For example, a Verilog
HDL design can contain the following declaration:
If the software infers the states S0, S1,... the software uses the encoding 4'b1010,
4'b0101,... . If necessary, the software inverts bits in a user-encoded state machine to ensure
that all bits of the reset state of the state machine are zero.
Note: You can view the state machine encoding from the Compilation Report under the
State Machines of the Analysis & Synthesis Report. The State Machine Viewer
displays only a graphical representation of the state machines as interpreted from
your design.
To assign your own state encoding with the User-Encoded setting of the State Machine
Processing option in a VHDL design, you must apply specific binary encoding to the elements of
an enumerated type because enumeration literals have no numeric values in VHDL. Use the
syn_encoding synthesis attribute to apply your encoding values.
Related Information
• Manually Specifying State Assignments Using the syn_encoding Attribute on page 16-31
• Recommended HDL Coding Styles on page 12-1
For guidelines on how to correctly infer and encode your state machine
Send Feedback
QPS5V1
2016.05.03 Manually Specifying State Assignments Using the syn_encoding Attribute 16-31
The syn_encoding attribute must follow the enumeration type definition, but precede its use.
Related Information
State Machine Processing on page 16-30
Send Feedback
QPS5V1
16-32 Manually Specifying Enumerated Types Using the enum_encoding Attribute 2016.05.03
By default, the Quartus Prime software one-hot encodes all enumerated types you defined. With
the enum_encoding attribute, you can specify the logic encoding for an enumerated type and
override the default one-hot encoding to improve the logic efficiency.
Note: If an enumerated type represents the states of a state machine, using the
enum_encoding attribute to specify a manual state encoding prevents the Compiler
from recognizing state machines based on the enumerated type. Instead, the
Compiler processes these state machines as regular logic with the encoding
specified by the attribute, and the Report window for your project does not list
these states machines as state machines. If you want to control the encoding for a
recognized state machine, use the State Machine Processing logic option and the
syn_encoding synthesis attribute.
To use the enum_encoding attribute in a VHDL design file, associate the attribute with the
enumeration type whose encoding you want to control. The enum_encoding attribute must follow
the enumeration type definition, but precede its use. In addition, the attribute value should be a
string literal that specifies either an arbitrary user encoding or an encoding style of "default",
"sequential", "gray", "johnson", or "one-hot".
An arbitrary user encoding consists of a space-delimited list of encodings. The list must contain
as many encodings as the number of enumeration literals in your enumeration type. In addition,
the encodings should have the same length, and each encoding must consist solely of values from
the std_ulogic type declared by the std_logic_1164 package in the IEEE library.
In this example, the enum_encoding attribute specifies an arbitrary user encoding for the
enumeration type fruit.
Example 16-5: Specifying an Arbitrary User Encoding for Enumerated Type
apple = "11"
orange = "01"
pear = "10"
mango = "00"
Altera recommends that you specify an encoding style, rather than a manual user encoding,
especially when the enumeration type has a large number of enumeration literals. The Quartus
Prime software can implement Enumeration Types with the different encoding styles, as shown in
this table.
Send Feedback
QPS5V1
2016.05.03 Safe State Machine 16-33
"sequentia Use a binary encoding in which the first enumeration literal in the enumeration
l" type has encoding 0 and the second 1.
"gray" Use an encoding in which the encodings for adjacent enumeration literals differ by
exactly one bit. An N-bit gray code can represent 2N values.
"johnson" Use an encoding similar to a gray code. An N-bit Johnson code can represent at
most 2N states, but requires less logic than a gray encoding.
"one-hot" The default encoding style requiring N bits, in which N is the number of enumera‐
tion literals in the enumeration type.
In Example 16-5, the enum_encoding attribute manually specified a gray encoding for the
enumeration type fruit. You can also concisely write this example by specifying the "gray"
encoding style instead of a manual encoding, as shown in the following example:
Example 16-7: Specifying the “gray” Encoding Style or Enumeration Type
Send Feedback
QPS5V1
16-34 Power-Up Level 2016.05.03
recovery logic added by Quartus Prime Integrated Synthesis forces its transition from an illegal state to
the reset state.
You can set the Safe State Machine logic option globally, or on individual state machines. To set this logic
option, click Assignments > Settings > Compiler Settings > Advanced Settings (Synthesis).
Table 16-11: Setting the syn_encoding safe attribute on a State Machine in HDL
HDL Code
Verilog HDL
reg [2:0] my_fsm /* synthesis syn_encoding = "safe" */
;
VHDL
ATTRIBUTE syn_encoding OF my_fsm : TYPE IS "safe";
If you specify an encoding style, separate the encoding style value in the quotation marks with the safe
value with a comma, as follows: "safe, one-hot" or "safe, gray".
Safe state machine implementation can result in a noticeable area increase for your design. Therefore,
Altera recommends that you set this option only on the critical state machines in your design in which the
safe mode is necessary, such as a state machine that uses inputs from asynchronous clock domains. You
may not need to use this option if you correctly synchronize inputs coming from other clock domains.
Note: If you create the safe state machine assignment on an instance that the software fails to recognize
as a state machine, or an entity that contains a state machine, the software takes no action. You
must restructure the code, so that the software recognizes and infers the instance as a state
machine.
Related Information
• Manually Specifying State Assignments Using the syn_encoding Attribute on page 16-31
• Safe State Machine logic option
For more information about the Safe State Machine logic option
• Recommended HDL Coding Styles on page 12-1
For guidelines to ensure that the software correctly infers your state machine
Power-Up Level
This logic option causes a register (flipflop) to power up with the specified logic level, either high (1) or
low (0). The registers in the core hardware power up to 0 in all Altera devices. For the register to power up
with a logic level high, the Compiler performs an optimization referred to as NOT-gate push back on the
register. NOT-gate push back adds an inverter to the input and the output of the register, so that the reset
and power-up conditions appear to be high and the device operates as expected. The register itself still
powers up to 0, but the register output inverts so the signal arriving at all destinations is 1.
The Power-Up Level option supports wildcard characters, and you can apply this option to any register,
registered logic cell WYSIWYG primitive, or to a design entity containing registers, if you want to set the
power level for all registers in your design entity. If you assign this option to a registered logic cell
WYSIWYG primitive, such as an atom primitive from a third-party synthesis tool, you must turn on the
Send Feedback
QPS5V1
2016.05.03 Inferred Power-Up Levels 16-35
Perform WYSIWYG Primitive Resynthesis logic option for the option to take effect. You can also apply
the option to a pin with the logic configurations described in the following list:
• If you turn on this option for an input pin, the option transfers to the register that the pin drives, if all
these conditions are present:
• No logic, other than inversion, between the pin and the register.
• The input pin drives the data input of the register.
• The input pin does not fan-out to any other logic.
• If you turn on this option for an output or bidirectional pin, the option transfers to the register that
feeds the pin, if all these conditions are present:
• No logic, other than inversion, between the register and the pin.
• The register does not fan out to any other logic.
Related Information
Power-Up Level logic option
For more information about the Power-Up Level logic option, including information on the supported
device families
Quartus Prime Integrated Synthesis reads default values for registered signals defined in Verilog
HDL and VHDL code, and converts the default values into Power-Up Level settings. The
software also synthesizes variables with assigned values in Verilog HDL initial blocks into power-
up conditions. Synthesis of these default and initial constructs allows synthesized behavior of your
design to match, as closely as possible, the power-up state of the HDL code during a functional
simulation.
The following register declarations all set a power-up level of VCC or a logic value “1”, as shown in
this example:
reg q;
initial begin q = 1'b1; end // power-up to VCC
Related Information
Recommended HDL Coding Styles on page 12-1
For more information about NOT-gate push back, the power-up states for Altera devices, and how set and
reset control signals affect the power-up level
Send Feedback
QPS5V1
16-36 Remove Duplicate Registers 2016.05.03
connect its output to VCC. If you turn this option off or if you set a Power-Up Level assignment of Low
for this register, the register transitions from GND to VCC when your design starts up on the first clock
signal. Thus, the register is at VCC and you cannot remove the register. Similarly, if the register has a clear
signal, the Compiler cannot remove the register because after asserting the clear signal, the register
transitions again to GND and back to VCC.
If the Compiler performs a Power-Up Don’t Care optimization that allows it to remove a register, it
issues a message to indicate that it is doing so.
This project-wide option does not apply to registers that have the Power-Up Level logic option set to
either High or Low.
Related Information
Power-Up Don’t Care logic option
For more information about Power-Up Don’t Care logic option and a list of supported devices
Related Information
Remove Duplicate Registers logic option
For more information about Remove Duplicate Registers logic option and the supported devices
Preserve Registers
This attribute and logic option directs the Compiler not to minimize or remove a specified register during
synthesis optimizations or register netlist optimizations. Optimizations can eliminate redundant registers
and registers with constant drivers; this option prevents the software from reducing a register to a
constant or merging with a duplicate register. This option can preserve a register so you can observe the
register during simulation or with the SignalTap II Logic Analyzer. Additionally, this option can
®
preserve registers if you create a preliminary version of your design in which you have not specified the
secondary signals. You can also use the attribute to preserve a duplicate of an I/O register so that you can
place one copy of the I/O register in an I/O cell and the second in the core.
Note: This option cannot preserve registers that have no fan-out.
The Preserve Registers logic option prevents the software from inferring a register as a state machine.
You can set the Preserve Registers logic option in the Quartus Prime software, or you can set the
preserve attribute in your HDL code. In these examples, the Quartus Prime software preserves the
my_reg register.
HDL Code(11)
Verilog HDL
reg my_reg /* synthesis syn_preserve = 1 */;
(11)
The = 1 after the preserve are optional, because the assignment uses a default value of 1 when you specify
the assignment.
Send Feedback
QPS5V1
2016.05.03 Disable Register Merging/Don’t Merge Register 16-37
HDL Code(11)
Verilog-2001
(* syn_preserve = 1 *) reg my_reg;
In addition to preserve, the Quartus Prime software supports the syn_preserve attribute name for compatibility
with other synthesis tools.
HDL Code
VHDL
signal my_reg : stdlogic;
attribute preserve : boolean;
attribute preserve of my_reg : signal is true;
Related Information
• Preserve Registers logic option
For more information about the Preserve Registers logic option and the supported devices
• Noprune Synthesis Attribute/Preserve Fan-out Free Register Node on page 16-38
For more information about preventing the removal of registers with no fan-out
HDL Code
Verilog HD
reg my_reg /* synthesis dont_merge */;
(11)
The = 1 after the preserve are optional, because the assignment uses a default value of 1 when you specify
the assignment.
Send Feedback
QPS5V1
16-38 Noprune Synthesis Attribute/Preserve Fan-out Free Register Node 2016.05.03
Related Information
Disable Register Merging logic option
For more information about the Disable Register Merging logic option and the supported devices
HDL Code
Verilog HD
reg my_reg /* synthesis syn_noprune */;
Verilog-2001 and
(* noprune *) reg my_reg;
SystemVerilog
VHDL
signal my_reg : stdlogic;
attribute noprune: boolean;
attribute noprune of my_reg : signal is true;
Related Information
Preserve Fan-out Free Register logic option
For more information about Preserve Fan-out Free Register Node logic option and a list of supported
devices
Send Feedback
QPS5V1
2016.05.03 Keep Combinational Node/Implement as Output of Logic Cell 16-39
name of the wire or node. You can use this directive to make combinational nodes visible to the
SignalTap II Logic Analyzer.
Note: The option cannot keep nodes that have no fan-out. You cannot maintain node names for wires
with tri-state drivers, or if the signal feeds a top-level pin of the same name (the software changes
the node name to a name such as <net name>~buf0).
You can use the Ignore LCELL Buffers logic option to direct Analysis & Synthesis to ignore logic cell
buffers that the Implement as Output of Logic Cell logic option or the LCELL primitive created. If you
apply this logic option to an entity, it affects all lower-level entities in the hierarchy path.
Note: To avoid unintended design optimizations, ensure that any entity instantiated with Altera or third-
party IP that relies on logic cell buffers for correct behavior does not inherit the Ignore LCELL
Buffers logic option. For example, if an IP core uses logic cell buffers to manage high fan-out
signals and inherits the Ignore LCELL Buffers logic option, the target device may no longer
function properly.
You can turn off the Ignore LCELL Buffers logic option for a specific entity to override any assignments
inherited from higher-level entities in the hierarchy path if logic cell buffers created by the Implement as
Output of Logic Cell logic option or the LCELL primitive are required for correct behavior.
You can set the Implement as Output of Logic Cell logic option in the Quartus Prime software, or you
can set the keep attribute in your HDL code, as shown in these tables. In these tables, the Compiler
maintains the node name my_wire.
HDL Code
Verilog HD
wire my_wire /* synthesis keep = 1 */;
Verilog-2001
(* keep = 1 *) wire my_wire;
In addition to keep, the Quartus Prime software supports the syn_keep attribute name for compatibility with
other synthesis tools.
HDL Code
VHDL
signal my_wire: bit;
attribute syn_keep: boolean;
attribute syn_keep of my_wire: signal is true;
Related Information
Implement as Output of Logic Cell logic option
For more information about the Implement as Output of Logic Cell logic option and the supported
devices
Send Feedback
QPS5V1
16-40 Disabling Synthesis Netlist Optimizations with dont_retime Attribute 2016.05.03
HDL Code
Verilog HDL
reg my_reg /* synthesis dont_retime */;
VHD
signal my_reg : std_logic;
attribute dont_retime : boolean;
attribute dont_retime of my_reg :
signal is true;
Note: For compatibility with third-party synthesis tools, Quartus Prime Integrated Synthesis also
supports the attribute syn_allow_retiming. To disable retiming, set syn_allow_retiming to 0
(Verilog HDL) or false (VHDL). This attribute does not have any effect when you set the attribute
to 1 or true.
HDL Code
Verilog HD
reg my_reg /* synthesis dont_replicate */;
Send Feedback
QPS5V1
2016.05.03 Maximum Fan-Out 16-41
HDL Code
Verilog-2001 and
(* dont_replicate *) reg my_reg;
SystemVerilog
VHDL
signal my_reg : std_logic;
attribute dont_replicate : boolean;
attribute dont_replicate of my_reg : signal is true;
Note: For compatibility with third-party synthesis tools, Quartus Prime Integrated Synthesis also
supports the attribute syn_replicate. To disable replication, set syn_replicate to 0 (Verilog
HDL) or false (VHDL). This attribute does not have any effect when you set the attribute to 1 or
true.
Maximum Fan-Out
This Maximum Fan-Out attribute and logic option direct the Compiler to control the number of destina‐
tions that a node feeds. The Compiler duplicates a node and splits its fan-out until the individual fan-out
of each copy falls below the maximum fan-out restriction. You can apply this option to a register or a
logic cell buffer, or to a design entity that contains these elements. You can use this option to reduce the
load of critical signals, which can improve performance. You can use the option to instruct the Compiler
to duplicate a register that feeds nodes in different locations on the target device. Duplicating the register
can enable the Fitter to place these new registers closer to their destination logic to minimize routing
delay.
To turn off the option for a given node if you set the option at a higher level of the design hierarchy, in the
Netlist Optimizations logic option, select Never Allow. If not disabled by the Netlist Optimizations
option, the Compiler acknowledges the maximum fan-out constraint as long as the following conditions
are met:
• The node is not part of a cascade, carry, or register cascade chain.
• The node does not feed itself.
• The node feeds other logic cells, DSP blocks, RAM blocks, and pins through data, address, clock
enable, and other ports, but not through any asynchronous control ports (such as asynchronous clear).
The Compiler does not create duplicate nodes in these cases, because there is no clear way to duplicate the
node, or to avoid the small differences in timing which could produce functional differences in the
implementation (in the third condition above in which asynchronous control signals are involved). If you
cannot apply the constraint because you do not meet one of these conditions, the Compiler issues a
message to indicate that the Compiler ignores the maximum fan-out assignment. To instruct the
Compiler not to check node destinations for possible problems such as the third condition, you can set
the Netlist Optimizations logic option to Always Allow for a given node.
Note: If you have enabled any of the Quartus Prime netlist optimizations that affect registers, add the
preserve attribute to any registers to which you have set a maxfan attribute. The preserve
attribute ensures that the netlist optimization algorithms, such as register retiming, do not affect
the registers.
You can set the Maximum Fan-Out logic option in the Quartus Prime software. This option supports
wildcard characters. You can also set the maxfan attribute in your HDL code, as shown in these examples.
In these examples, the Compiler duplicates the clk_gen register, so its fan-out is not greater than 50.
Send Feedback
QPS5V1
16-42 Controlling Clock Enable Signals with Auto Clock Enable Replacement and... 2016.05.03
HDL Code
Verilog HDL
reg clk_gen /* synthesis syn_maxfan = 50 */;
Verilog-2001
(* maxfan = 50 *) reg clk_gen;
The Quartus Prime software supports the syn_maxfan attribute for compatibility with other synthesis tools.
HDL Code
VHDL
signal clk_gen : stdlogic;
attribute maxfan : signal ;
attribute maxfan of clk_gen : signal is 50;
Related Information
• Netlist Optimizations and Physical Synthesis
For details about netlist optimizations
• Maximum Fan-Out logic option
For more information about the Maximum Fan-Out logic option and the supported devices
Controlling Clock Enable Signals with Auto Clock Enable Replacement and
direct_enable
The Auto Clock Enable Replacement logic option allows the software to find logic that feeds a register
and move the logic to the register’s clock enable input port. To solve fitting or performance issues with
designs that have many clock enables, you can turn off this option for individual registers or design
entities. Turning the option off prevents the software from using the register’s clock enable port. The
software implements the clock enable functionality using multiplexers in logic cells.
If the software does not move the specific logic to a clock enable input with the Auto Clock Enable
Replacement logic option, you can instruct the software to use a direct clock enable signal. The attribute
ensures that the signal drives the clock enable port, and the software does not optimize or combine the
signal with other logic.
These tables show how to set this attribute to ensure that the attribute preserves the signal and uses the
signal as a clock enable.
HDL Code
Verilog HDL
wire my_enable /* synthesis direct_enable = 1 */ ;
Send Feedback
QPS5V1
2016.05.03 Inferring Multiplier, DSP, and Memory Functions from HDL Code 16-43
HDL Code
VHDL
attribute direct_enable: boolean;
attribute direct_enable of my_enable: signal is true;
The Quartus Prime software supports the syn_direct_enable attribute name for compatibility with other
synthesis tools.
HDL Code
Verilog-2001 and
(* syn_direct_enable *) wire my_enable;
SystemVerilog
Related Information
Auto Clock Enable Replacement logic option
For more information about the Auto Clock Enable Replacement logic option and the supported devices
Related Information
Recommended HDL Coding Styles on page 12-1
For details about coding style recommendations when targeting IP cores in Altera devices
Related Information
Auto DSP Block Replacement logic option
For more information about the Auto DSP Block Replacement logic option and the supported devices
Send Feedback
QPS5V1
16-44 Shift Registers 2016.05.03
Shift Registers
Use the Auto Shift Register Replacement logic option to control shift register inference. This option has
three settings: Off, Auto and Always. Auto is the default setting in which Quartus Prime Integrated
Synthesis decides which shift registers to replace or leave in registers. Placing shift registers in memory
saves logic area, but can have a negative effect on fmax. Quartus Prime Integrated Synthesis uses the
optimization technique setting, logic and RAM utilization of your design, and timing information from
Timing-Driven Synthesis to determine which shift registers are located in memory and which are located
in registers. To disable inference, click Assignments > Settings > Compiler Settings > Advanced
Settings (Synthesis). You can also disable the option for a specific block with the Assignment Editor.
Even if you set the logic option to On or Auto, the software might not infer small shift registers because
small shift registers do not benefit from implementation in dedicated memory. However, you can use the
Allow Any Shift Register Size for Recognition logic option to instruct synthesis to infer a shift register
even when its size is too small.
You can use the Allow Shift Register Merging across Hierarchies option to prevent the Compiler from
merging shift registers in different hierarchies into one larger shift register. The option has three settings:
On, Off, and Auto. The Auto setting is the default setting, and the Compiler decides whether or not to
merge shift registers across hierarchies. When you turn on this option, the Compiler allows all shift
registers to merge across hierarchies, and when you turn off this option, the Compiler does not allow any
shift registers to merge across hierarchies. You can set this option globally or on entities or individual
nodes.
Note: The registers that the software maps to the RAM-based Shift Register IP core and places in RAM
are not available in the Simulator because their node names do not exist after synthesis.
The Compiler turns off the Auto Shift Register Replacement logic option when you select a formal
verification tool on the EDA Tool Settings page. If you do not select a formal verification tool, the
Compiler issues a warning and the compilation report lists shift registers that the logic option might infer.
To enable an IP core for the shift register in the formal verification flow, you can either instantiate a shift
register explicitly with the IP catalog or make the shift register into a black box in a separate entity or
module.
Related Information
• Auto Shift Register Replacement logic option
For more information about the Auto Shift Register Replacement logic option and the supported
devices
• RAM-Based Shift Register (ALTSHIFT_TAPS) User Guide
For more information about the RAM-based Shift Register IP core
Send Feedback
QPS5V1
2016.05.03 Resource Aware RAM, ROM, and Shift-Register Inference 16-45
The software might not infer very small RAM or ROM blocks because you can implement very small
memory blocks with the registers in the logic. However, you can use the Allow Any RAM Size for
Recognition and Allow Any ROM Size for Recognition logic options to instruct synthesis to infer a
memory block even when its size is too small.
Note: The software turns off the Auto ROM Replacement logic option when you select a formal verifica‐
tion tool in the EDA Tool Settings page. If you do not select a formal verification tool, the software
issues a warning and a report panel provides a list of ROMs that the logic option might infer. To
enable an IP core for the shift register in the formal verification flow, you can either instantiate a
ROM explicitly using the IP Catalog or create a black box for the ROM in a separate entity or in a
separate module.
Although formal verification tools do not support inferred RAM blocks, due to the importance of
inferring RAM in many designs, the software turns on the Auto RAM Replacement logic option when
you select a formal verification tool in the EDA Tool Settings page. The software automatically performs
black box instance for any module or entity that contains an inferred RAM block. The software issues a
warning and lists the black box created in the compilation report. This black box allows formal verifica‐
tion tools to proceed; however, the formal verification tool cannot verify the entire module or entire entity
that contains the RAM. Altera recommends that you explicitly instantiate RAM blocks in separate
modules or in separate entities so that the formal verification tool can verify as much logic as possible.
Related Information
• Shift Registers on page 16-44
• Auto RAM Replacement logic option
For more information about the Auto RAM Replacement logic option and its supported devices
• Auto ROM Replacement logic option
For more information about the Auto ROM Replacement logic option and its supported devices
Send Feedback
QPS5V1
16-46 Auto RAM to Logic Cell Conversion 2016.05.03
Related Information
Auto RAM to Logic Cell Conversion logic option
For more information about the Auto RAM to Logic Cell Conversion logic options and the supported
devices
Send Feedback
QPS5V1
2016.05.03 RAM Style and ROM Style—for Inferred Memory 16-47
These tables specify that you must implement all memory in the module or the my_memory_blocks entity
with a specific type of block.
HDL Code
Verilog-1995
module my_memory_blocks (...) /* synthesis romstyle = "M4K" */
;
HDL Code
Verilog-2001 and
(* ramstyle = "M512" *) module my_memory_blocks (...);
SystemVerilog
HDL Code
VHDL
architecture rtl of my_ my_memory_blocks is
attribute romstyle : string;
attribute romstyle of rtl : architecture is "M-RAM";
begin
These tables specify that you must implement the inferred my_ram or my_rom memory with regular logic
instead of a TriMatrix memory block.
HDL Code
Verilog-1995
reg [0:7] my_ram[0:63] /* synthesis syn_ramstyle = "logic" */
;
HDL Code
Verilog-2001 and
(* romstyle = "logic" *) reg [0:7] my_rom[0:63];
SystemVerilog
Send Feedback
QPS5V1
16-48 RAM Style Attribute—For Shift Registers Inference 2016.05.03
HDL Code
VHDL
type memory_t is array (0 to 63) of std_logic_vector (0 to 7)
;
signal my_ram : memory_t;
attribute ramstyle : string;
attribute ramstyle of my_ram : signal is "logic";
You can control the depth of an inferred memory block and optimize its usage with the max_depth
attribute. You can also optimize the usage of the memory block with this attribute.
These tables specify the depth of the inferred memory mem using the max_depth synthesis attribute.
HDL Code
Verilog-1995
reg [7:0] mem [127:0] /* synthesis max_depth = 2048 */
HDL Code
Verilog-2001 and
(* max_depth = 2048*) reg [7:0] mem [127:0];
SystemVerilog
HDL Code
VHDL
type ram_block is array (0 to 31) of std_logic_vector (2
downto 0);
signal mem : ram_block;
attribute max_depth : natural;
attribute max_depth OF mem : signal is 2048;
The syntax for setting these attributes in HDL is the same as the syntax for other synthesis attributes, as
shown in Synthesis Attributes on page 16-21.
Related Information
Synthesis Attributes on page 16-21
Send Feedback
QPS5V1
2016.05.03 Disabling Add Pass-Through Logic to Inferred RAMs no_rw_check Attribute 16-49
Table 16-33: Setting the RAM Style Attribute for Shift Registers
HDL Code
Verilog
(* ramstyle = "mlab" *)reg [N-1:0] sr;
VHDL
attribute ramstyle : string;attribute ramstyle of sr : signal is
"M20K";
Related Information
Inferring Shift Registers in HDL Code on page 12-30
Send Feedback
QPS5V1
16-50 Disabling Add Pass-Through Logic to Inferred RAMs no_rw_check Attribute 2016.05.03
HDL Code
Verilog HDL
module ram_infer (q, wa, ra, d, we, clk);
output [7:0] q;
input [7:0] d;
input [6:0] wa;
input [6:0] ra;
input we, clk;
reg [6:0] read_add;
(* ramstyle = "no_rw_check" *) reg [7:0] mem [127:0];
always @ (posedge clk) begin
if (we)
mem[wa] <= d;
read_add <= ra;
end
assign q = mem[read_add];
endmodule
VHDL
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY ram IS
PORT (
clock: IN STD_LOGIC;
data: IN STD_LOGIC_VECTOR (2 DOWNTO 0);
write_address: IN INTEGER RANGE 0 to 31;
read_address: IN INTEGER RANGE 0 to 31;
we: IN STD_LOGIC;
q: OUT STD_LOGIC_VECTOR (2 DOWNTO 0) );
END ram;
ARCHITECTURE rtl OF ram IS
TYPE MEM IS ARRAY(0 TO 31) OF STD_LOGIC_VECTOR(2 DOWNTO 0);
SIGNAL ram_block: MEM;
ATTRIBUTE ramstyle : string;
ATTRIBUTE ramstyle of ram_block : signal is "no_rw_check";
SIGNAL read_address_reg: INTEGER RANGE 0 to 31;
BEGIN
PROCESS (clock)
BEGIN
IF (clock'event AND clock = '1') THEN
IF (we = '1') THEN
ram_block(write_address) <= data;
END IF;
read_address_reg <= read_address;
END IF;
END PROCESS;
q <= ram_block(read_address_reg);
END rtl;
You can use a ramstyle attribute with the MLAB value, so that the Quartus Prime software can infer a
small RAM block and place it in an MLAB.
Note: You can use this attribute in cases in which some asynchronous RAM blocks might be coded with
read-during-write behavior that does not match the Stratix IV and Stratix V architectures. Thus,
the device behavior would not exactly match the behavior that the code describes. If the difference
in behavior is acceptable in your design, use the ramstyle attribute with the no_rw_check value to
specify that the software should not check the read-during-write behavior when inferring the
RAM. When you set this attribute, Quartus Prime Integrated Synthesis allows the behavior of the
output to differ when the asynchronous read occurs on an address that had a write on the most
Send Feedback
QPS5V1
2016.05.03 Disabling Add Pass-Through Logic to Inferred RAMs no_rw_check Attribute 16-51
recent clock edge. That is, the functional HDL simulation results do not match the hardware
behavior if you write to an address that is being read. To include these attributes, set the value of
the ramstyle attribute to MLAB, no_rw_check.
These examples show the method of setting two values to the ramstyle attribute with a small asynchro‐
nous RAM block, with the ramstyle synthesis attribute set, so that the software can implement the
memory in the MLAB memory block and so that the read-during-write behavior is not important.
Without the attribute, this design requires 512 registers and 240 ALUTs. With the attribute, the design
requires eight memory ALUTs and only 15 registers.
HDL Code
Verilog HDL
module async_ram (
input [5:0] addr,
input [7:0] data_in,
input clk,
input write,
output [7:0] data_out );
(* ramstyle = "MLAB, no_rw_check" *) reg [7:0] mem[0:63];
assign data_out = mem[addr];
always @ (posedge clk)
begin
if (write)
mem[addr] = data_in;
end
endmodule
VHDL
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY ram IS
PORT (
clock: IN STD_LOGIC;
data: IN STD_LOGIC_VECTOR (2 DOWNTO 0);
write_address: IN INTEGER RANGE 0 to 31;
read_address: IN INTEGER RANGE 0 to 31;
we: IN STD_LOGIC;
q: OUT STD_LOGIC_VECTOR (2 DOWNTO 0));
END ram;
ARCHITECTURE rtl OF ram IS
TYPE MEM IS ARRAY(0 TO 31) OF STD_LOGIC_VECTOR(2 DOWNTO 0);
SIGNAL ram_block: MEM;
ATTRIBUTE ramstyle : string;
ATTRIBUTE ramstyle of ram_block : signal is "MLAB , no_rw_
check";
SIGNAL read_address_reg: INTEGER RANGE 0 to 31;
BEGIN
PROCESS (clock)
BEGIN
IF (clock'event AND clock = '1') THEN
IF (we = '1') THEN
ram_block(write_address) <= data;
END IF;
read_address_reg <= read_address;
END IF;
END PROCESS;
q <= ram_block(read_address_reg);
END rtl;
Send Feedback
QPS5V1
16-52 RAM Initialization File—for Inferred Memory 2016.05.03
Related Information
• Recommended HDL Coding Styles on page 12-1
For more information about recommended styles for inferring RAM and some of the issues involved
with different read-during-write conditions
• Add Pass-Through Logic to Inferred RAMs logic option
For more information about the Add Pass-Through Logic to Inferred RAMs logic option and the
supported devices
HDL Code
Verilog-1995
reg [7:0] mem[0:255] /* synthesis ram_init_file
= " my_init_file.mif" */;
Verilog-2001
(* ram_init_file = "my_init_file.mif" *) reg [7:0] mem[0:255];
VHDL(12)
type mem_t is array(0 to 255) of unsigned(7 downto 0);
signal ram : mem_t;
attribute ram_init_file : string;
attribute ram_init_file of ram :
signal is "my_init_file.mif";
Related Information
Recommended HDL Coding Styles on page 12-1
For more information about Inferring ROM Functions from HDL Code
(12)
You can also initialize the contents of an inferred memory by specifying a default value for the
corresponding signal. In Verilog HDL, you can use an initial block to specify the memory contents. Quartus
Prime Integrated Synthesis automatically converts the default value into a .mif for the inferred RAM.
Send Feedback
QPS5V1
2016.05.03 Multiplier Style—for Inferred Multipliers 16-53
Note: Specifying a multstyle of "dsp" does not guarantee that the Quartus Prime software can
implement a multiplication in dedicated DSP hardware. The final implementation depends on
several conditions, including the availability of dedicated hardware in the target device, the size of
the operands, and whether or not one or both operands are constant.
In addition to multstyle, the Quartus Prime software supports the syn_multstyle attribute name for
compatibility with other synthesis tools.
When applied to a Verilog HDL module declaration, the attribute specifies the default implementation
style for all instances of the * operator in the module. For example, in the following code examples, the
multstyle attribute directs the Quartus Prime software to implement all multiplications inside module
my_module in the dedicated multiplication hardware.
HDL Code
Verilog-1995
module my_module (...) /* synthesis multstyle = "dsp" */;
Verilog-2001
(* multstyle = "dsp" *) module my_module(...);
When applied to a Verilog HDL variable declaration, the attribute specifies the implementation style for a
multiplication operator, which has a result directly assigned to the variable. The attribute overrides the
multstyle attribute with the enclosing module, if present.
In these examples, the multstyle attribute applied to variable result directs the Quartus Prime software
to implement a * b in logic rather than the dedicated hardware.
HDL Code
Verilog-2001
wire [8:0] a, b;
(* multstyle = "logic" *) wire [17:0] result;
assign result = a * b; //Multiplication must be
//directly assigned to result
Verilog-1995
wire [8:0] a, b;
wire [17:0] result /* synthesis multstyle = "logic" */;
assign result = a * b; //Multiplication must be
When applied directly to a binary expression that contains the * operator, the attribute specifies the
implementation style for that specific operator alone and overrides any multstyle attribute with the
target variable or enclosing module.
In this example, the multstyle attribute indicates that you must implement a * b in the dedicated
hardware.
Send Feedback
QPS5V1
16-54 Full Case Attribute 2016.05.03
HDL Code
Verilog-2001
wire [8:0] a, b;
wire [17:0] result;
assign result = a * (* multstyle = "dsp" *) b;
Note: You cannot use Verilog-1995 attribute syntax to apply the multstyle attribute to a binary
expression.
When applied to a VHDL entity or architecture, the attribute specifies the default implementation style
for all instances of the * operator in the entity or architecture.
In this example, the multstyle attribute directs the Quartus Prime software to use dedicated hardware, if
possible, for all multiplications inside architecture rtl of entity my_entity.
HDL Code
VHDL
architecture rtl of my_entity is
attribute multstyle : string;
attribute multstyle of rtl : architecture is "dsp";
begin
When applied to a VHDL signal or variable, the attribute specifies the implementation style for all
instances of the * operator, which has a result directly assigned to the signal or variable. The attribute
overrides the multstyle attribute with the enclosing entity or architecture, if present.
In this example, the multstyle attribute associated with signal result directs the Quartus Prime software
to implement a * b in logic rather than the dedicated hardware.
HDL Code
VHDL
signal a, b : unsigned(8 downto 0);
signal result : unsigned(17 downto 0);
Send Feedback
QPS5V1
2016.05.03 Parallel Case 16-55
Note: Latches have limited support in formal verification tools. Do not infer latches unintentionally, for
example, through an incomplete case statement when using formal verification.
Formal verification tools support the full_case synthesis attribute (with limited support for attribute
syntax, as described in Synthesis Attributes on page 16-21).
Using the full_case attribute might cause a simulation mismatch between the Verilog HDL functional
and the post-Quartus Prime simulation because unknown case statement cases can still function as latches
during functional simulation. For example, a simulation mismatch can occur with the code in Table
16-42 when sel is 2'b11 because a functional HDL simulation output behaves as a latch and the Quartus
Prime simulation output behaves as a don’t care value.
Note: Altera recommends making the case statement “full” in your regular HDL code, instead of using
the full_case attribute.
The case statement in this example is not full because you do not specify some sel binary values. Because you use
the full_case attribute, synthesis treats the output as “don’t care” when the sel input is 2'b11.
HDL Code
Verilog HDL
module full_case (a, sel, y);
input [3:0] a;
input [1:0] sel;
output y;
reg y;
always @ (a or sel)
case (sel) // synthesis full_case
2'b00: y=a[0];
2'b01: y=a[1];
2'b10: y=a[2];
endcase
endmodule
Verilog-2001 syntax also accepts the statements in Table 16-43 in the case header instead of the
comment form as shown in Table 16-42.
HDL Syntax
Verilog-2001
(* full_case *) case (sel)
Related Information
• Synthesis Attributes on page 16-21
• Recommended Design Practices on page 11-1
For more information about avoiding latch inference problems
Parallel Case
The parallel_case attribute indicates that you must consider a Verilog HDL case statement as parallel;
that is, you can match only one case item at a time. Case items in Verilog HDL case statements might
Send Feedback
QPS5V1
16-56 Parallel Case 2016.05.03
overlap. To resolve multiple matching case items, the Verilog HDL language defines a priority among case
items in which the case statement always executes the first case item that matches the case expression
value. By default, the Quartus Prime software implements the extra logic necessary to satisfy this priority
relationship.
Attaching a parallel_case attribute to a case statement header allows the Quartus Prime software to
consider its case items as inherently parallel; that is, at most one case item matches the case expression
value. Parallel case items simplify the generated logic.
In VHDL, the individual choices in a case statement might not overlap, so they are always parallel and this
attribute does not apply.
Altera recommends that you use this attribute only when the case statement is truly parallel. If you use
the attribute in any other situation, the generated logic does not match the functional simulation behavior
of the Verilog HDL.
Note: Altera recommends that you avoid using the parallel_case attribute, because you may mismatch
the Verilog HDL functional and the post-Quartus Prime simulation.
If you specify SystemVerilog-2005 as the supported Verilog HDL version for your design, you can use the
SystemVerilog keyword unique to achieve the same result as the parallel_case directive without
causing simulation mismatches.
This example shows a casez statement with overlapping case items. In functional HDL simulation, the
software prioritizes the three case items by the bits in sel. For example, sel[2] takes priority over
sel[1], which takes priority over sel[0]. However, the synthesized design can simulate differently
because the parallel_case attribute eliminates this priority. If more than one bit of sel is high, more
than one output (a, b, or c) is high as well, a situation that cannot occur in functional HDL simulation.
HDL Code
Verilog HDL
module parallel_case (sel, a, b, c);
input [2:0] sel;
output a, b, c;
reg a, b, c;
always @ (sel)
begin
{a, b, c} = 3'b0;
casez (sel) // synthesis parallel_case
3'b1??: a = 1'b1;
3'b?1?: b = 1'b1;
3'b??1: c = 1'b1;
endcase
end
endmodule
Send Feedback
QPS5V1
2016.05.03 Translate Off and On / Synthesis Off and On 16-57
Verilog-2001 syntax also accepts the statements as shown in the following table in the case (or casez) header
instead of the comment form, as shown in Table 16-44.
HDL Syntax
Verilog-2001
(* parallel_case *) casez (sel)
You can use these directives to indicate a portion of code for simulation only. The synthesis tool reads
synthesis-specific directives and processes them during synthesis; however, third-party simulation tools
read the directives as comments and ignore them.
These examples show these directives.
HDL Code
Verilog HDL
// synthesis translate_off
parameter tpd = 2; // Delay for simulation
#tpd;
// synthesis translate_on
VHDL
-- synthesis translate_off
use std.textio.all;
-- synthesis translate_on
VHDL 2008
/* synthesis translate_off */
use std.textio.all;
/* synthesis translate_on */
If you want to ignore only a portion of code in Quartus Prime Integrated Synthesis, you can use the
Altera-specific attribute keyword altera. For example, use the // altera translate_off
and // altera translate_on directives to direct Quartus Prime Integrated Synthesis to ignore a portion
of code that you intend only for other synthesis tools.
Send Feedback
QPS5V1
16-58 Read Comments as HDL 2016.05.03
the Ignore translate_off and synthesis_off Directives logic option, click Assignments > Settings >
Compiler Settings > Advanced Settings (Synthesis).
Related Information
Ignore translate_off and synthesis_off Directives logic option
For more information about the Ignore translate_off and synthesis_off Directives logic option and the
supported devices
HDL Code
Verilog HDL
// synthesis read_comments_as_HDL on
// my_rom lpm_rom (.address (address),
// .data (data));
// synthesis read_comments_as_HDL off
VHDL
-- synthesis read_comments_as_HDL on
-- my_rom : entity lpm_rom
-- port map (
-- address => address,
-- data => data, );
-- synthesis read_comments_as_HDL off
VHDL 2008
/* synthesis read_comments_as_HDL on */
/* my_rom : entity lpm_rom
port map (
address => address,
data => data, ); */
synthesis read_comments_as_HDL off */
Send Feedback
QPS5V1
2016.05.03 Use I/O Flipflops 16-59
HDL Code
Verilog HDL
module top_level(clk, a, b, o);
input clk;
input [1:0] a, b /* synthesis useioff = 1 */;
output [2:0] o /* synthesis useioff = 1 */;
reg [1:0] a_reg, b_reg;
reg [2:0] o_reg;
always @ (posedge clk)
begin
a_reg <= a;
b_reg <= b;
o_reg <= a_reg + b_reg;
end
assign o = o_reg;
endmodule
Table 16-49 and Table 16-50 show that the Verilog-2001 syntax also accepts the type of statements
instead of the comment form in Table 16-48.
HDL Code
Verilog-2001
(* useioff = 1 *) input [1:0] a, b;
(* useioff = 1 *) output [2:0] o;
Send Feedback
QPS5V1
16-60 Specifying Pin Locations with chip_pin 2016.05.03
HDL Code
VHDL
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity useioff_example is
port (
clk : in std_logic;
a, b : in unsigned(1 downto 0);
o : out unsigned(1 downto 0));
attribute useioff : boolean;
attribute useioff of a : signal is true;
attribute useioff of b : signal is true;
attribute useioff of o : signal is true;
end useioff_example;
architecture rtl of useioff_example is
signal o_reg, a_reg, b_reg : unsigned(1 downto 0);
begin
process(clk)
begin
if (clk = '1' AND clk'event) then
a_reg <= a;
b_reg <= b;
o_reg <= a_reg + b_reg;
end if;
end process;
o <= o_reg;
end rtl;
These examples in this table show different ways of assigning my_pin1 to Pin C1 and my_pin2 to Pin 4 on a
different target device.
HDL Code
Verilog-1995
input my_pin1 /* synthesis chip_pin = "C1" */;
input my_pin2 /* synthesis altera_chip_pin_lc = "@4" */;
Verilog-2001
(* chip_pin = "C1" *) input my_pin1;
(* altera_chip_pin_lc = "@4" *) input my_pin2;
Send Feedback
QPS5V1
2016.05.03 Specifying Pin Locations with chip_pin 16-61
HDL Code
VHDL
entity my_entity is
port(my_pin1: in std_logic; my_pin2: in std_logic;…);
end my_entity;
attribute chip_pin : string;
attribute altera_chip_pin_lc : string;
attribute chip_pin of my_pin1 : signal is "C1";
attribute altera_chip_pin_lc of my_pin2 : signal is "@4";
For bus I/O ports, the value of the chip pin attribute is a comma-delimited list of pin assignments. The
order in which you declare the range of the port determines the mapping of assignments to individual bits
in the port. To leave a bit unassigned, leave its corresponding pin assignment blank.
The example in this table assigns my_pin[2] to Pin_4, my_pin[1] to Pin_5, and my_pin[0] to Pin_6.
HDL Code
Verilog-1995
input [2:0] my_pin /* synthesis chip_pin = "4, 5, 6" */;
The example in this table reverses the order of the signals in the bus, assigning my_pin[0] to Pin_4 and
my_pin[2] to Pin_6 but leaves my_pin[1] unassigned.
HDL Code
Verilog-1995
input [0:2] my_pin /* synthesis chip_pin = "4, ,6" */;
The example in this table assigns my_pin[2] to Pin 4 and my_pin[0] to Pin 6, but leaves my_pin[1] unassigned.
HDL Code
VHDL
entity my_entity is
port(my_pin: in std_logic_vector(2 downto 0);…);
end my_entity;
attribute chip_pin of my_pin: signal is "4, , 6";
Table 16-55: VHDL and Verilog-2001 Examples: Assigning Pin Location and I/O Standard
HDL Code
VHDL
attribute altera_chip_pin_lc: string;
attribute altera_attribute: string;
attribute altera_chip_pin_lc of clk: signal is "B13";
attribute altera_attribute of clk:signal is "-name IO_STANDARD ""3.3-
V LVCMOS""";
Send Feedback
QPS5V1
16-62 Using altera_attribute to Set Quartus Prime Logic Options 2016.05.03
HDL Code
Verilog-2001
(* altera_attribute = "-name IO_STANDARD \"3.3-V LVCMOS\"" *)(* chip_
pin = "L5" *)input clk;
(* altera_attribute = "-name IO_STANDARD LVDS" *)(* chip_pin = "L4"
*)input sel;
output [3:0] data_o, input [3:0] data_i);
If the Quartus Prime option or assignment includes a target, source, and section tag, you must use the
syntax in this example for each .qsf variable assignment:
This example shows the syntax for the full attribute value, including the optional target, source, and
section tags for two different .qsf assignments:
If the assigned value of a variable is a string of text, you must use escaped quotes around the value in Verilog HDL
or double-quotes in VHDL:
HDL Code
Assigned Value of a Variable in Verilog HDL
"VARIABLE_NAME \"STRING_VALUE\""
(With Nonexistent Variable and Value Terms)
Assigned Value of a Variable in VHDL (With
"VARIABLE_NAME ""STRING_VALUE"""
Nonexistent Variable and Value Terms)
To find the .qsf variable name or value corresponding to a specific Quartus Prime option or assignment,
you can set the option setting or assignment in the Quartus Prime software, and then make the changes in
the .qsf.
Send Feedback
QPS5V1
2016.05.03 Using altera_attribute to Set Quartus Prime Logic Options 16-63
Verilog-2001
(* altera_attribute = "-name POWER_UP_LEVEL HIGH" *) reg my_reg;
VHDL
signal my_reg : std_logic;
attribute altera_attribute : string;
attribute altera_attribute of my_reg: signal is "-name POWER_UP_
LEVEL HIGH";
Note: For inferred instances, you cannot apply the attribute to the instance directly. Therefore, you must
apply the attribute to one of the output nets of the instance. The Quartus Prime software automati‐
cally moves the attribute to the inferred instance.
HDL Code
Verilog-1995
module my_entity(…) /* synthesis altera_attribute = "-name AUTO_
SHIFT_REGISTER_RECOGNITION OFF" */;
Verilog-2001
(* altera_attribute = "-name AUTO_SHIFT_REGISTER_RECOGNITION OFF"
*) module my_entity(…) ;
VHDL
entity my_entity is
-- Declare generics and ports
end my_entity;
architecture rtl of my_entity is
attribute altera_attribute : string;
-- Attribute set on architecture, not entity
attribute altera_attribute of rtl: architecture is "-name AUTO_
SHIFT_REGISTER_RECOGNITION OFF";
begin
-- The architecture body
end rtl;
Send Feedback
QPS5V1
16-64 Analyzing Synthesis Results 2016.05.03
HDL Code
Verilog-1995
reg reg2;
reg reg1 /* synthesis altera_attribute = "-name CUT ON -to reg2"
*/;
Verilog-2001 and
SystemVerilog reg reg2;
(* altera_attribute = "-name CUT ON -to reg2" *) reg reg1;
VHDL
signal reg1, reg2 : std_logic;
attribute altera_attribute: string;
attribute altera_attribute of reg1 : signal is "-name CUT ON -to
reg2";
You can specify either the -to option or the -from option in a single altera_attribute; Integrated
Synthesis automatically sets the remaining option to the target of the altera_attribute. You can also
specify wildcards for either option. For example, if you specify “*” for the -to option instead of reg2 in
these examples, the Quartus Prime software cuts all timing paths from reg1 to every other register in this
design entity.
You can use the altera_attribute only for entity-level settings, and the assignments (including
wildcards) apply only to the current entity.
Related Information
• Synthesis Attributes on page 16-21
• Quartus Prime Settings File Manual
Lists all variable names
Send Feedback
QPS5V1
2016.05.03 Project Navigator 16-65
Analysis & Synthesis includes various report sections, including a list of the source files read for the
project, the resource utilization by entity after synthesis, and information about state machines, latches,
optimization results, and parameter settings.
Related Information
Analysis Synthesis Summary Reports
For more information about each report section
Project Navigator
The Hierarchy tab of the Project Navigator provides a view of the project hierarchy and a summary of
resource and device information about the current project. After Analysis & Synthesis, before the Fitter
begins, the Project Navigator provides a summary of utilization based on synthesis data, before Fitter
optimizations have occurred.
If an entity in the Hierarchy tab contains parameter settings, a tooltip displays the settings when you hold
the pointer over the entity.
Related Information
Upgrade IP Components dialog box
For more information about the Upgrade IP Components dialog box
Related Information
• About the Messages Window
For more information about the Messages window and message suppression
Send Feedback
QPS5V1
16-66 VHDL and Verilog HDL Messages 2016.05.03
//dup.v
module dup(input i, input j, output reg o);
always @ (i or i)
o = i & j;
endmodule
When processing the HDL code, the Quartus Prime software generates the following warning message.
Warning: (10276) Verilog HDL sensitivity list warning at dup.v(2): sensitivity list
contains multiple entries for "i".
In Verilog HDL, variable names are case sensitive, so the variables my_reg and MY_REG below are two
different variables. However, declaring variables that have names in different cases is confusing, especially
if you use VHDL, in which variables are not case sensitive.
// namecase.v
module namecase (input i, output o);
reg my_reg;
reg MY_REG;
assign o = i;
endmodule
When processing the HDL code, the Quartus Prime software generates the following informational
message:
Info: (10281) Verilog HDL information at namecase.v(3): variable name "MY_REG" and
variable name "my_reg" should not differ only in case.
Send Feedback
QPS5V1
2016.05.03 Setting the HDL Message Level 16-67
In addition, the Quartus Prime software generates additional HDL info messages to inform you that this
small design does not use neither my_reg nor MY_REG:
The Quartus Prime software allows you to control how many HDL messages you can view during the
Analysis & Elaboration of your design files. You can set the HDL Message Level to enable or disable
groups of HDL messages, or you can enable or disable specific messages.
Related Information
Synthesis Directives on page 16-23
For more information about synthesis directives and their syntax
You must address all issues reported at the Level1 setting. The default HDL message level is Level2.
To set the HDL Message Level in the Quartus Prime software, follow these steps:
1. Click Assignments > Settings > Compiler Settings > Advanced Settings (Synthesis)
2. Set the necessary message level from the pull-down menu in the HDL Message Level list, and then
click OK.
You can override this default setting in a source file with the message_level synthesis directive,
which takes the values level1, level2, and level3, as shown in the following table.
Send Feedback
QPS5V1
16-68 Enabling or Disabling Specific HDL Messages by Module/Entity 2016.05.03
HDL Code
Verilog HDL
// altera message_level level1
or
/* altera message_level level3 */
VHDL
-- altera message_level level2
A message_level synthesis directive remains effective until the end of a file or until the next
message_level directive. In VHDL, you can use the message_level synthesis directive to set the
HDL Message Level for entities and architectures, but not for other design units. An HDL Message
Level for an entity applies to its architectures, unless overridden by another message_level directive.
In Verilog HDL, you can use the message_level directive to set the HDL Message Level for a module.
HDL Code
Verilog HDL
// altera message_off 10000
or
/* altera message_off 10000 */
VHDL
-- altera message_off 10000
Send Feedback
QPS5V1
2016.05.03 Node-Naming Conventions in Quartus Prime Integrated Synthesis 16-69
For example, if entity A contains a register (DFF atom) called my_dff, its full hierarchy name would be
A:my_A_inst|my_dff.
To instruct the Compiler to generate node names that do not contain entity names, on the Compilation
Process Settings page of the Settings dialog box, click More Settings, and then turn off Display entity
name for node name.
With this option turned off, the node names use the convention in shown in this example:
Table 16-63: HDL Example of a Register that Creates my_dff_out DFF Primitive
Send Feedback
QPS5V1
16-70 Register Changes During Synthesis 2016.05.03
AHDL designs explicitly declare DFF registers rather than infer, so the software uses the user-declared
name for the register.
For schematic designs using a .bdf, your design names all elements when you instantiate the elements in
your design, so the software uses the name you defined for the register or DFF.
In the special case that a wire or signal (such as my_dff_out in the preceding examples) is also an output
pin of your top-level design, the Quartus Prime software cannot use that name for the register (for
example, cannot use my_dff_out) because the software requires that all logic and I/O cells have unique
names. Here, Quartus Prime Integrated Synthesis appends ~reg0 to the register name.
For example, the Verilog HDL code example in this table generates a register called q~reg0.
HDL Code
Verilog HDL
module my_dff (input clk, input d, output q);
always @ (posedge clk)
q <= d;
endmodule
This situation occurs only for registers driving top-level pins. If a register drives a port of a lower level of
the hierarchy, the software removes the port during hierarchy flattening and the register retains its
original name, in this case, q.
Send Feedback
QPS5V1
2016.05.03 Synthesis and Fitting Optimizations 16-71
Related Information
• Netlist Optimizations and Physical Synthesis
For more information about the type of optimizations performed by synthesis netlist optimizations
• Preserving Register Names on page 16-72
For more information about preserving certain nodes throughout compilation
State Machines
If your HDL code infers a state machine, the software maps the registers that represent the states into a
new set of registers that implement the state machine. Most commonly, the software converts the state
machine into a one-hot form in which one register represents each state. In this case, for Verilog HDL or
VHDL designs, the registers take the name of the state register and the states.
For example, consider a Verilog HDL state machine in which the states are parameter state0 = 1,
state1 = 2, state2 = 3, and in which the software declares the state machine register as reg [1:0]
Send Feedback
QPS5V1
16-72 Inferred Adder-Subtractors, Shift Registers, Memory, and DSP Functions 2016.05.03
my_fsm. In this example, the three one-hot state registers are my_fsm.state0, my_fsm.state1, and
my_fsm.state2.
An AHDL design explicitly specifies state machines with a state machine name. Your design names state
machine registers with synthesized names based on the state machine name, but not the state names. For
example, if a my_fsm state machine has four state bits, The software might synthesize these state bits with
names such as my_fsm~12, my_fsm~13, my_fsm~14, and my_fsm~15.
Related Information
Recommended HDL Coding Styles on page 12-1
For information about inferring IP cores
Related Information
Recommended HDL Coding Styles on page 12-1
For information about packing registers into RAM and DSP IP cores
Related Information
• Preserve Registers on page 16-36
Use the preserve attribute to instruct the Compiler not to minimize or remove a specified register
during synthesis optimizations or register netlist optimizations
• Noprune Synthesis Attribute/Preserve Fan-out Free Register Node on page 16-38
Use the noprune attribute to preserve a fan-out-free register through the entire compilation flow
• Disable Register Merging/Don’t Merge Register on page 16-37
Use the synthesis attribute syn_dont_merge to ensure that the Compiler does not merge registers with
other registers
Send Feedback
QPS5V1
2016.05.03 Preserving Combinational Logic Names 16-73
For example, consider the Verilog HDL code in this example. Quartus Prime Integrated Synthesis uses the
names c, d, e, and f for the generated combinational logic cells.
wire c;
reg d, e, f;
assign c = a | b;
always @ (a or b)
d = a & b;
always @ (a or b) begin : my_label
e = a ^ b;
end
always @ (a or b)
f = ~(a | b);
For schematic designs using a .bdf, your design names all elements when you instantiate the elements in
your design and the software uses the name you defined when possible.
If logic cells are packed with registers in device architectures such as the Stratix and Cyclone device
families, those names might not appear in the netlist after fitting. In other devices, such as newer families
in the Stratix and Cyclone series device families, the register and combinational nodes are kept separate
throughout the compilation, so these names are more often maintained through fitting.
When logic optimizations occur during synthesis, it is not always possible to retain the initial names as
described. Sometimes, synthesized names are used, which are the wire names with a tilde (~) and a
number appended. For example, if a complex expression is assigned to wire w and that expression
generates several logic cells, those cells can have names such as w, w~1, and w~2. Sometimes the original
wire name w is removed, and an arbitrary name such as rtl~123 is created. Quartus Prime Integrated
Synthesis attempts to retain user names whenever possible. Any node name ending with ~<number> is a
name created during synthesis, which can change if the design is changed and re-synthesized. Knowing
these naming conventions helps you understand your post-synthesis results, helping you to debug your
design or create assignments.
During synthesis, the software maintains combinational clock logic by not changing nodes that might be
clocks. The software also maintains or protects multiplexers in clock trees, so that the TimeQuest analyzer
has information about which paths are unate, to allow complete and correct analysis of combinational
clocks. Multiplexers often occur in clock trees when the software selects between different clocks. To help
with the analysis of clock trees, the software ensures that each multiplexer encountered in a clock tree is
broken into 2:1 multiplexers, and each of those 2:1 multiplexers is mapped into one lookup table
(independent of the device family). This optimization might result in a slight increase in area, and for
some designs a decrease in timing performance. To disable the option, click Assignments > Settings >
Compiler Settings > Advanced Settings (Synthesis) > Clock MUX Protection.
Related Information
Clock MUX Protection logic option
For more information about Clock MUX Protection logic option and a list of supported devices
Send Feedback
QPS5V1
16-74 Scripting Support 2016.05.03
For any internal node in your design clock network, use keep to protect the name so that you can apply
correct clock settings. Also, set the attribute for combinational logic involved in cut and -through
assignments.
Note: Setting the keep attribute for combinational logic can increase the area utilization and increase the
delay of the final mapped logic because the attribute requires the insertion of extra combinational
logic. Use the attribute only when necessary.
Related Information
Keep Combinational Node/Implement as Output of Logic Cell on page 16-38
Scripting Support
You can run procedures and make settings in a Tcl script. You can also run some procedures at a
command prompt. For detailed information about scripting command options, refer to the Quartus
Prime Command-Line and Tcl API Help browser.
To run the Help browser, type the command at the command prompt shown in this example:
quartus_sh --qhelp
You can specify many of the options either on an instance, at the global level, or both.
To make a global assignment, use the Tcl command shown in this example:
To make an instance assignment, use the Tcl command shown in this example:
To set the Synthesis Effort option at the command line, use the --effort option with the quartus_map
executable shown in this example:
Related Information
• Tcl Scripting
For more information about Tcl scripting
• Quartus Prime Settings File Manual
For more information about all settings and constraints in the Quartus Prime software
• Command-Line Scripting
For more information about command-line scripting
• API Functions for Tcl
For more information about Tcl scripting
• Synthesis Effort on page 16-29
Send Feedback
QPS5V1
2016.05.03 Adding an HDL File to a Project and Setting the HDL Version 16-75
Note: You can use any file extension for design files, as long as you specify the correct language when
adding the design file. For example, you can use .h for Verilog HDL header files.
To specify the Verilog HDL or VHDL version, use the option shown in this example, at the end of the
VERILOG_FILE or VHDL_FILE command:
For example, to add a Verilog HDL file called my_file.v written in Verilog-1995, use the command shown
in this example:
In this example, the syn_encoding attribute associates a binary encoding with the states in the
enumerated type count_state. In this example, the states are encoded with the following values: zero =
"11", one = "01", two = "10", three = "00".
You can also use the syn_encoding attribute in Verilog HDL to direct the synthesis tool to use the
encoding from your HDL code, instead of using the State Machine Processing option.
The syn_encoding value "user" instructs the Quartus Prime software to encode each state with
its corresponding value from the Verilog HDL source code. By changing the values of your state
constants, you can change the encoding of your state machine.
In Example 16-8, the states are encoded as follows:
init = "00"
last = "11"
Send Feedback
QPS5V1
16-76 Assigning a Pin 2016.05.03
next = "01"
later = "10"
Example 16-8: Verilog-2001 and SystemVerilog Code: Specifying User-Encoded States with the
syn_encoding Attribute
Without the syn_encoding attribute, the Quartus Prime software encodes the state machine
based on the current value of the State Machine Processing logic option.
If you also specify a safe state machine (as described in Safe State Machine on page 16-33),
separate the encoding style value in the quotation marks from the safe value with a comma, as
follows: “safe, one-hot” or “safe, gray”.
Related Information
• Safe State Machine on page 16-33
• Manually Specifying State Assignments Using the syn_encoding Attribute on page 16-31
Assigning a Pin
To assign a signal to a pin or device location, use the Tcl command shown in this example:
Valid locations are pin location names. Some device families also support edge and I/O bank locations.
Edge locations are EDGE_BOTTOM, EDGE_LEFT, EDGE_TOP, and EDGE_RIGHT. I/O bank locations include
IOBANK_1 to IOBANK_n, where n is the number of I/O banks in a device.
The <file name> variable is the name used for internally generated netlist files during incremental
compilation. If you create the partition in the Quartus Prime software, netlist files are named automati‐
cally by the Quartus Prime software based on the instance name. If you use Tcl to create your partitions,
you must assign a custom file name that is unique across all partitions. For the top-level partition, the
specified file name is ignored, and you can use any dummy value. To ensure the names are safe and
Send Feedback
QPS5V1
2016.05.03 Quartus Prime Synthesis Options 16-77
platform independent, file names should be unique, regardless of case. For example, if a partition uses the
file name my_file, no other partition can use the file name MY_FILE. To make file naming simple, Altera
recommends that you base each file name on the corresponding instance name for the partition.
The <destination> is the short hierarchy path of the entity. A short hierarchy path is the full hierarchy
path without the top-level name, for example: "ram:ram_unit|altsyncram:altsyncram_component"
(with quotation marks). For the top-level partition, you can use the pipe (|) symbol to represent the top-
level entity.
The <partition name> is the partition name you designate, which should be unique and less than 1024
characters long. The name may only consist of alphanumeric characters, as well as pipe ( | ), colon ( : ),
and underscore ( _ ) characters. Altera recommends enclosing the name in double quotation marks (" ").
Related Information
Node-Naming Conventions in Quartus Prime Integrated Synthesis on page 16-69
For more information about hierarchical naming conventions
Send Feedback
QPS5V1
16-78 Document Revision History 2016.05.03
Send Feedback
QPS5V1
2016.05.03 Document Revision History 16-79
Send Feedback
QPS5V1
16-80 Document Revision History 2016.05.03
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2016.05.03
Optimizing the Design Netlist
17
QPS5V1 Subscribe Send Feedback
This chapter describes how you can use the Quartus Prime Netlist Viewers to analyze and debug your
designs.
As FPGA designs grow in size and complexity, the ability to analyze, debug, optimize, and constrain your
design is critical. With today’s advanced designs, several design engineers are involved in coding and
synthesizing different design blocks, making it difficult to analyze and debug the design. The Quartus
Prime RTL Viewer, State Machine Viewer, and Technology Map Viewer provide powerful ways to view
your initial and fully mapped synthesis results during the debugging, optimization, and constraint entry
processes.
Related Information
• When to Use the Netlist Viewers: Analyzing Design Problems on page 17-1
• Introduction to the User Interface on page 17-5
• Quartus Prime Design Flow with the Netlist Viewers on page 17-2
• State Machine Viewer Overview on page 17-4
• RTL Viewer Overview on page 17-3
• Technology Map Viewer Overview on page 17-5
• Filtering in the Schematic View on page 17-16
• Cross-Probing to a Source Design File and Other Quartus Prime Windows on page 17-23
• Cross-Probing to the Netlist Viewers from Other Quartus Prime Windows on page 17-24
• Viewing a Timing Path on page 17-25
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V1
17-2 Quartus Prime Design Flow with the Netlist Viewers 2016.05.03
transitions and transition equations with the State Machine Viewer. Viewing your design helps you find
and analyze the source of design problems. If your design looks correct in the RTL Viewer, you know to
focus your analysis on later stages of the design process and investigate potential timing violations or
issues in the verification flow itself.
You can use the Technology Map Viewer to look at the results at the end of Analysis and Synthesis. If you
have compiled your design through the Fitter stage, you can view your post-mapping netlist in the
Technology Map Viewer (Post-Mapping) and your post-fitting netlist in the Technology Map Viewer. If
you perform only Analysis and Synthesis, both the Netlist Viewers display the same post-mapping netlist.
In addition, you can use the RTL Viewer or Technology Map Viewer to locate the source of a particular
signal, which can help you debug your design. Use the navigation techniques described in this chapter to
search easily through your design. You can trace back from a point of interest to find the source of the
signal and ensure the connections are as expected.
The Technology Map Viewer can help you locate post-synthesis nodes in your netlist and make
assignments when optimizing your design. This functionality is useful when making a multicycle clock
timing assignment between two registers in your design. Start at an I/O port and trace forward or
backward through the design and through levels of hierarchy to find nodes of interest, or locate a specific
register by visually inspecting the schematic.
Throughout your FPGA design, debug, and optimization stages, you can use all of the netlist viewers in
many ways to increase your productivity while analyzing a design.
Related Information
• Quartus Prime Design Flow with the Netlist Viewers on page 17-2
• State Machine Viewer Overview on page 17-4
• RTL Viewer Overview on page 17-3
• Technology Map Viewer Overview on page 17-5
Send Feedback
QPS5V1
2016.05.03 RTL Viewer Overview 17-3
Figure 17-1: Quartus Prime Design Flow Including the RTL Viewer and Technology Map Viewer
This figure shows how Netlist Viewers fit into the basic Quartus Prime design flow.
Synthesis
Technology Map Viewer and Technology Map Viewer Preprocessor
(Logic Synthesis and
Technology Map Viewer (Post-Mapping) (Once per Synthesis)
Technology Mapping)
Before the Netlist Viewer can run the preprocessor stage, you must compile your design:
• To open the RTL Viewer or State Machine Viewer, first perform Analysis and Elaboration.
• To open the Technology Map Viewer (Post-Fitting) or the Technology Map Viewer (Post-Mapping),
first perform Analysis and Synthesis.
The Netlist Viewers display the results of the last successful compilation.
• Therefore, if you make a design change that causes an error during Analysis and Elaboration, you
cannot view the netlist for the new design files, but you can still see the results from the last success‐
fully compiled version of the design files.
• If you receive an error during compilation and you have not yet successfully run the appropriate
compilation stage for your project, the Netlist Viewer cannot be displayed; in this case, the Quartus
Prime software issues an error message when you try to open the Netlist Viewer.
Note: If the Netlist Viewer is open when you start a new compilation, the Netlist Viewer closes automati‐
cally. You must open the Netlist Viewer again to view the new design netlist after compilation
completes successfully.
Send Feedback
QPS5V1
17-4 State Machine Viewer Overview 2016.05.03
You can view results after Analysis and Elaboration when your design uses any supported Quartus Prime
design entry method, including Verilog HDL Design Files (.v), SystemVerilog Design Files (. sv), VHDL
Design Files (. vhd), AHDL Text Design Files ( .tdf), or schematic Block Design Files (.bdf). You can also
view the hierarchy of atom primitives (such as device logic cells and I/O ports) when your design uses a
synthesis tool to generate a Verilog Quartus Mapping File (.vqm) or Electronic Design Interchange
Format (.edf) file.
The RTL Viewer displays a schematic view of the design netlist after Analysis and Elaboration or netlist
extraction is performed by the Quartus Prime software, but before technology mapping and any synthesis
or fitter optimizations. This view a preliminary pre-optimization design structure and closely represents
your original source design.
• If you synthesized your design with the Quartus Prime integrated synthesis, this view shows how the
Quartus Prime software interpreted your design files.
• If you use a third-party synthesis tool, this view shows the netlist written by your synthesis tool.
While displaying your design, the RTL Viewer optimizes the netlist to maximize readability:
• Removes logic with no fan-out (unconnected output) or fan-in (unconnected inputs) from the display.
• Hides default connections such as VCC and GND.
• Groups pins, nets, wires, module ports, and certain logic into buses where appropriate.
• Groups constant bus connections are grouped.
• Displays values in hexadecimal format.
• Converts NOT gates into bubble inversion symbols in the schematic.
• Merges chains of equivalent combinational gatesinto a single gate; for example, a 2-input AND gate
feeding a 2-input AND gate is converted to a single 3-input AND gate.
• State machine logic is converted into a state diagram, state transition table, and state encoding table,
which are displayed in the State Machine Viewer.
To run the RTL Viewer for a Quartus Prime project, first analyze the design to generate an RTL netlist. To
analyze the design and generate an RTL netlist, from the Processing menu, click Start > Start Analysis &
Elaboration. You can also perform a full compilation on any process that includes the initial Analysis and
Elaboration stage of the Quartus Prime compilation flow.
To open the RTL Viewer, from the Tools menu clickNetlist Viewers > RTL Viewer.
Related Information
Introduction to the User Interface on page 17-5
Send Feedback
QPS5V1
2016.05.03 Technology Map Viewer Overview 17-5
Related Information
State Machine Viewer on page 17-21
You can view your Quartus Prime technology-mapped results after synthesis, fitting, or timing analysis.
To run the Technology Map Viewer for a Quartus Prime project, on the Processing menu, point to Start
and click Start Analysis & Synthesis to synthesize and map the design to the target technology. At this
stage, the Technology Map Viewer shows the same post-mapping netlist as the Technology Map Viewer
(Post-Mapping). You can also perform a full compilation, or any process that includes the synthesis stage
in the compilation flow.
If you have completed the Fitter stage, the Technology Map Viewer shows the changes made to your
netlist by the Fitter, such as physical synthesis optimizations, while the Technology Map Viewer
(Post-Mapping) shows the post-mapping netlist. If you have completed the Timing Analysis stage, you
can locate timing paths from the Timing Analyzer report in the Technology Map Viewer.
To open the Technology Map Viewer, on the Tools menu, point to Netlist Viewers and click Technology
Map Viewer (Post-Fitting) or Technology Map Viewer (Post Mapping).
Related Information
• View Contents of Nodes in the Schematic View on page 17-17
• Viewing a Timing Path on page 17-25
• Introduction to the User Interface on page 17-5
Send Feedback
QPS5V1
17-6 Introduction to the User Interface 2016.05.03
The RTL Viewer and Technology Map Viewer each consist of these main parts:
• The Netlist Navigator pane—displays a representation of the project hierarchy.
• The Find pane—allows you to find and locate specific design elements in the schematic view.
• The Properties pane displays the properties of the selected block when you select Properties from the
shortcut menu.
• The schematic view—displays a graphical representation of the internal structure of your design.
Figure 17-2: RTL Viewer
Netlist Viewers also contain a toolbar that provides tools to use in the schematic view.
• Use the Back and Forward buttons to switch between schematic views. You can go forward only if you
have not made any changes to the view since going back. These commands do not undo an action,
such as selecting a node. The Netlist Viewer caches up to ten actions including filtering, hierarchy
navigation, netlist navigation, and zoom actions.
• The Refresh button to restore the schematic view and optimizes the layout. Refresh does not reload
the database if you change your design and recompile.
• Click the Find button opens and closes the Find pane.
• Click the Selection Tool and Zoom Tool buttons to toggle between the selection mode and zoom
mode.
Send Feedback
QPS5V1
2016.05.03 Introduction to the User Interface 17-7
• Click the Fit in Page button resets the schematic view to encompass the entire design.
• Use the Hand Tool to change the focus of the veiwer without changing the perspective.
• Click the Area Selection Tool to drag a selection box around ports, pins, and nodes in an area.
• Click the Netlist Navigator button to open or close the Netlist Navigator pane.
• Click the Color Settings button to open the Colors pane where you can customize the Netlist Viewer
color scheme.
• Click the Display Settings button to open the Display pane where you can specify the following
settings:
• Show full name or Show only <n> characters. You can specify this separately for Node name, Port
name, Pin name, or Bus name.
• Turn Show timing info on or off.
• Turn Show node type on or off.
• Turn Show constant value on or off.
• Turn Show flat nets on or off.
Figure 17-3: Display Settings
Send Feedback
QPS5V1
17-8 Netlist Navigator Pane 2016.05.03
• The Bird's Eye View button opens the Bird's Eye View window which displays a miniature version of
your design and allows you to navigate within the design and adjust the magnification in the schematic
view quickly.
• The Show/Hide Instance Pins button can toggle the display of instance pins not displayed by
functions such as cross-probing between a Netlist Viewer and TimeQuest. You can also use it to hide
unconnected instance pins when filtering a node results in large numbers of unconnected or unused
pins. Instance pins are hidden by default.
• The Show Netlist on One Page button displays the netlist on a single page if the Netlist Veiwer has
split the design across several pages. This can make netlist tracing easier.
You can have only one RTL Viewer, one Technology Map Viewer (Post-Fitting), one Technology Map
Viewer (Post-Mapping), and one State Machine Viewer window open at the same time, although each
window can show multiple pages, each with multiple tabs. For example, you cannot have two RTL Viewer
windows open at the same time.
Related Information
• RTL Viewer Overview on page 17-3
• Technology Map Viewer Overview on page 17-5
• Netlist Navigator Pane on page 17-8
• Netlist Viewers Find Pane on page 17-11
• Properties Pane on page 17-9
Elements Description
Instances Modules or instances in the design that can be expanded to lower hierarchy
levels.
State Machines State machine instances in the design that can be viewed in the State Machine
Viewer.
Send Feedback
QPS5V1
2016.05.03 Properties Pane 17-9
Elements Description
Primitives Low-level nodes that cannot be expanded to any lower hierarchy level. These
primitives include:
• Registers and gates that you can view in the RTL Viewer when using Quartus
Prime integrated synthesis
• Logic cell atoms in the Technology Map Viewer or in the RTL Viewer when
using a VQM or EDIF from third-party synthesis software
In the Technology Map Viewer, you can view the internal implementation of
certain atom primitives, but you cannot traverse into a lower-level of hierarchy.
Properties Pane
You can view the properties of an instance or primitive using the Properties pane.
Send Feedback
QPS5V1
17-10 Properties Pane 2016.05.03
The Properties pane contains tabs with the following information about the selected node:
• The Fan-in tab displays the Input port and Fan-in Node.
• The Fan-out tab displays the Output port and Fan-out Node.
• The Parameters tab displays the Parameter Name and Values of an instance.
• The Ports tab displays the Port Name and Constant value (for example, VCC or GND). The possible
value of a port are listed below.
Value Description
VCC The port is not connected and has VCC value (tied to VCC)
GND The port is not connected and has GND value (tied to GND)
-- The port is connected and has value (other than VCC or GND)
Send Feedback
QPS5V1
2016.05.03 Netlist Viewers Find Pane 17-11
Value Description
If the selected node is an atom primitive, the Properties pane displays a schematic of the internal logic.
Schematic View
The schematic view is shown on the right side of the RTL Viewer and Technology Map Viewer. The
schematic view contains a schematic representing the design logic in the netlist. This view is the main
screen for viewing your gate-level netlist in the RTL Viewer and your technology-mapped netlist in the
Technology Map Viewer.
The RTL Viewer and Technology Map Viewer attempt to display schematic in a single page view by
default. If the schematic crosses over to several pages, you can highlight a net and use connectors to trace
the signal in a single page.
Send Feedback
QPS5V1
17-12 Schematic Symbols 2016.05.03
Schematic Symbols
The symbols for nodes in the schematic represent elements of your design netlist. These elements include
input and output ports, registers, logic gates, Altera primitives, high-level operators, and hierarchical
instances.
Note: The logic gates and operator primitives appear only in the RTL Viewer. Logic in the Technology
Map Viewer is represented by atom primitives, such as registers and LCELLs.
[1,3]
OR, AND, XOR Gates An OR, AND, or XOR gate primitive (the number
of ports can vary). A small circle (bubble symbol)
always1 always0 C on an input or output port indicates the port is
inverted.
Send Feedback
QPS5V1
2016.05.03 Schematic Symbols 17-13
Symbol Description
Other Primitive Any primitive that does not fall into the previous
categories. Primitives are low-level nodes that
CPU_D[10] cannot be expanded to any lower hierarchy. The
PADIN PADIO symbol displays the port names, the primitive or
operator type, and its name.
PADOUT
BIDIR
Send Feedback
QPS5V1
17-14 Schematic Symbols 2016.05.03
Symbol Description
Send Feedback
QPS5V1
2016.05.03 Schematic Symbols 17-15
Symbol Description
Equal3 Equals
A[1:0]
OUT
B[1:0]
Mux5 A multiplexer:
SEL[2:0]
OUT
DATA[7:0] OUT = DATA [SEL]
Selector1 A selector:
SEL[2:0]
OUT A multiplexer with one-hot select input and more
DATA[2:0]
than two input signals
for x = 0 to x = 2(n+1) - 1
Related Information
• Partition the Schematic into Pages on page 17-21
• Follow Nets Across Schematic Pages on page 17-21
• State Machine Viewer on page 17-21
Send Feedback
QPS5V1
17-16 Select Items in the Schematic View 2016.05.03
Send Feedback
QPS5V1
2016.05.03 View Contents of Nodes in the Schematic View 17-17
• Between Selected Nodes—Displays nodes and connections in the path between the selected nodes .
• Bus Index—Displays the sources or destinations for one or more indices of an output or input bus
port .
• Filtering Options—Displays the Filtering Options dialog box:
• Stop filtering at register—Turning this option on directs the Netlist Viewer to filter out to the
nearest register boundary.
• Filter across hierarchies—Turning this option on directs the Netlist Viewer to filter across
hierarchies.
• Maximum number of hierarchy levels—Sets the maximium number of hierarchy levels displayed
in the schematic view.
To filter your netlist, select a hierarchy box, node, port, net, or state node, right-click in the window, point
to Filter and click the appropriate filter command. The Netlist Viewer generates a new page showing the
netlist that remains after filtering.
When filtering in a state diagram in the State Machine Viewer, sources and destinations refer to the
previous and next transition states or paths between transition states in the state diagram. The transition
table and encoding table also reflect the filtering.
Note: In the schematic view, the internal details in an atom instance cannot be selected as individual
nodes. Any mouse action on any of the internal details is treated as a mouse action on the atom
instance.
Send Feedback
QPS5V1
17-18 View Contents of Nodes in the Schematic View 2016.05.03
Send Feedback
QPS5V1
2016.05.03 Moving Nodes in the Schematic View 17-19
You can double-click on objects in the Connectivity Details window to navigate to them quickly. If the
plus symbol appears, you can further unwrap objects in the view. This can be very useful when tracing a
signal in a complex netlist.
Right-click and click on Refresh to restore the schematic view to its default arrangement.
Send Feedback
QPS5V1
17-20 View LUT Representations in the Technology Map Viewer 2016.05.03
Zoom Controls
Use the Zoom Tool in the toolbar, or mouse gestures, to control the magnification of your schematic on
the View menu.
By default, the Netlist Viewer displays most pages sized to fit in the window. If the schematic page is very
large, the schematic is displayed at the minimum zoom level, and the view is centered on the first node.
Click Zoom In to view the image at a larger size, and click Zoom Out to view the image (when the entire
image is not displayed) at a smaller size. The Zoom command allows you to specify a magnification
percentage (100% is considered the normal size for the schematic symbols).
You can use the Zoom Tool on the Netlist Viewer toolbar to control magnification in the schematic view.
When you select the Zoom Tool in the toolbar, clicking in the schematic zooms in and centers the view on
the location you clicked. Right-click in the schematic to zoom out and center the view on the location you
clicked. When you select the Zoom Tool, you can also zoom into a certain portion of the schematic by
selecting a rectangular box area with your mouse cursor. The schematic is enlarged to show the selected
area.
Within the schematic view, you can also use the following mouse gestures to zoom in on a specific section:
• zoom in—Dragging a box around an area starting in the upper-left and dragging to the lower right
zooms in on that area.
• zoom -0.5—Dragging a line from lower-left to upper-right zooms out 0.5 levels of magnification.
• zoom 0.5—Dragging a line from lower-right to upper-left zooms in 0.5 levels of magnification.
• zoom fit—Dragging a line from upper-right to lower-left fits the schematic view in the page.
Related Information
Filtering in the Schematic View on page 17-16
Send Feedback
QPS5V1
2016.05.03 Partition the Schematic into Pages 17-21
Send Feedback
QPS5V1
17-22 State Diagram View 2016.05.03
State Machine
Viewer Toolbar
Send Feedback
QPS5V1
2016.05.03 State Transition Table 17-23
To view state encoding information in the State Machine Viewer, you must synthesize your design with
the Start Analysis & Synthesis command. If you have only elaborated your design with the Start
Analysis & Elaboration command, the encoding information is not displayed.
Send Feedback
QPS5V1
17-24 Cross-Probing to the Netlist Viewers from Other Quartus Prime Windows 2016.05.03
You can select one or more hierarchy boxes, nodes, state nodes, or state transition arcs that interest you in
the Netlist Viewer and locate the corresponding items in another applicable Quartus Prime software
window. You can then view and make changes or assignments in the appropriate editor or floorplan.
To locate an item from the Netlist Viewer in another window, right-click the items of interest in the
schematic or state diagram, point to Locate, and click the appropriate command. The following
commands are available:
• Locate in Assignment Editor
• Locate in Pin Planner
• Locate in Chip Planner
• Locate in Resource Property Editor
• Locate in Technology Map Viewer
• Locate in RTL Viewer
• Locate in Design File
The options available for locating an item depend on the type of node and whether it exists after
placement and routing. If a command is enabled in the menu, it is available for the selected node. You can
use the Locate in Assignment Editor command for all nodes, but assignments might be ignored during
placement and routing if they are applied to nodes that do not exist after synthesis.
The Netlist Viewer automatically opens another window for the appropriate editor or floorplan and
highlights the selected node or net in the newly opened window. You can switch back to the Netlist
Viewer by selecting it in the Window menu or by closing, minimizing, or moving the new window.
Send Feedback
QPS5V1
2016.05.03 Viewing a Timing Path 17-25
Note: The first time the window opens after a compilation, the preprocessor stage runs before the Netlist
Viewer opens.
The Netlist Viewer shows the selected nodes and, if applicable, the connections between the nodes. The
display is similar to what you see if you right-click the object, then click Filter > Selected Nodes using
Filter across hierarchy. If the nodes cannot be found in the Netlist Viewer, a message box displays the
message: Can’t find requested location.
Send Feedback
QPS5V1
17-26 Document Revision History 2016.05.03
2015.11.02 15.1.0 Added information for the following new features and feature
updatess:
• Nets visible across hierarchies
• Connection Details
• Display Settings
• Hand Tool
• Area Selection Tool
• New default behavior for Show/Hide Instance Pins (default
is now off)
2014.06.30 14.0.0 Added Show Netlist on One Page and show/Hide Instance Pins
commands.
November 2012 12.1.0 Added sections to support Global Net Routing feature.
Send Feedback
QPS5V1
2016.05.03 Document Revision History 17-27
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2016.05.03
Synopsys Synplify Support
18
QPS5V1 Subscribe Send Feedback
The content in this manual applies to the Synplify, Synplify Pro, and Synplify Premier software unless
otherwise specified. This manual assumes that you have set up, licensed, and are familiar with the Synplify
software.
This manual includes the following information:
• General design flow with the Synplify and Quartus Prime software
• Exporting designs and constraints to the Quartus Prime software using NativeLink integration
• Synplify software optimization strategies, including timing-driven compilation settings, optimization
options, and Altera-specific attributes
• Guidelines for Altera IP cores and library of parameterized module (LPM) functions, instantiating
them with the IP Catalog, and tips for inferring them from hardware description language (HDL) code
• Incremental compilation and block-based design, including the MultiPoint flow in the Synplify Pro
and Synplify Premier software
Related Information
• Synplify Synthesis Techniques with the Quartus Prime Software online training
• Synplify Pro Tips and Tricks online training
Design Flow
The following steps describe a basic Quartus Prime software design flow using the Synplify software:
1. Create Verilog HDL or VHDL design files.
2. Set up a project in the Synplify software and add the HDL design files for synthesis.
3. Select a target device and add timing constraints and compiler directives in the Synplify software to
help optimize the design during synthesis.
4. Synthesize the project in the Synplify software.
5. Create a Quartus Prime project and import the following files generated by the Synplify software into
the Quartus Prime software. Use the following files for placement and routing, and for performance
evaluation:
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V1
18-2 Design Flow 2016.05.03
Technology- Forward-Annotated
Specific Netlist Project Constraints
(.vqm/edf) (.tcl/.acf)
Synopsys Constraints Gate-Level
format (.scf) File Functional
Simulation
Post-Synthesis
Constraints & Settings Quartus Prime Software Simulation Files
(.vho/.vo)
Gate-Level Timing
Simulation
Timing & Area
No Post-Place-and-Route
Requirements
Simulation File
Satisfied?
(.vho/.vo)
Yes
Configuation/Programming
Files (.sof/.pof)
Program/Configure Device
Related Information
• Running the Quartus Prime Software from within the Synplify Software on page 18-4
• Synplify Software Generated Files on page 18-5
• Design Constraints Support on page 18-6
Send Feedback
QPS5V1
2016.05.03 Hardware Description Language Support 18-3
Related Information
Guidelines for Altera IP Cores and Architecture-Specific Features on page 18-15
Related Information
Synopsys Website
Tool Setup
Example 18-1: Specifying Quartus Prime Software Version at the Command Line
Send Feedback
QPS5V1
18-4 Running the Quartus Prime Software from within the Synplify Software 2016.05.03
After a design is synthesized in the Synplify software, a .vqm netlist file, an .scf file for TimeQuest Timing
Analyzer timing constraints, and .tcl files are used to import the design into the Quartus Prime software
for place-and-route. You can run the Quartus Prime software from within the Synplify software or as a
stand-alone application. After you import the design into the Quartus Prime software, you can specify
different options to further optimize the design.
Note: When you are using NativeLink integration, the path to your project must not contain empty
spaces. The Synplify software uses Tcl scripts to communicate with the Quartus Prime software,
and the Tcl language does not accept arguments with empty spaces in the path.
Use NativeLink integration to integrate the Synplify software and Quartus Prime software with a single
GUI for both synthesis and place and-route operations. NativeLink integration allows you to run the
Quartus Prime software from within the Synplify software GUI, or to run the Synplify software from
within the Quartus Prime software GUI.
Running the Quartus Prime Software from within the Synplify Software
To run the Quartus Prime software from within the Synplify software, you must set the
QUARTUS_ROOTDIR environment variable to the Quartus Prime software installation directory located
in <Quartus Prime system directory>\altera\ <version number>\quartus. You must set this environment
variable to use the Synplify and Quartus Prime software together. Synplify also uses this variable to open
the Quartus Prime software in the background and obtain detailed information about the Altera IP cores
used in the design.
For the Windows operating system, do the following:
1. Point to Start, and click Control Panel.
2. Click System >Advanced system settings >Environment Variables.
3. Create a QUARTUS_ROOTDIR system variable.
For the Linux operating system, do the following:
• Create an environment variable QUARTUS_ROOTDIR that points to the <home directory>/altera
<version number> location.
You can create new place and route implementations with the New P&R button in the Synplify software
GUI. Under each implementation, the Synplify Pro software creates a place-and-route implementation
called pr_<number> Altera Place and Route. To run the Quartus Prime software in command-line mode
after each synthesis run, use the text box to turn on the place-and-route implementation. The results of
the place-and-route are written to a log file in the pr_ <number> directory under the current implementa‐
tion directory.
You can also use the commands in the Quartus Prime menu to run the Quartus Prime software at any
time following a successful completion of synthesis. In the Synplify software, on the Options menu, click
Quartus Prime and then choose one of the following commands:
• Launch Quartus —Opens the Quartus Prime software GUI and creates a Quartus Prime project with
the synthesized output file, forward-annotated timing constraints, and pin assignments. Use this
command to configure options for the project and to execute any Quartus Prime commands.
• Run Background Compile—Runs the Quartus Prime software in command-line mode with the
project settings from the synthesis run. The results of the place-and-route are written to a log file.
The <project_name>_cons.tcl file is used to set up the Quartus Prime project and directs the
<project_name>.tcl file to pass constraints from the Synplify software to the Quartus Prime software. By
Send Feedback
QPS5V1
2016.05.03 Using the Quartus Prime Software to Run the Synplify Software 18-5
default, the <project_name>.tcl file contains device, timing, and location assignments. The
<project_name>.tcl file contains the command to use the Synplify-generated .scf constraints file with the
TimeQuest Timing Analyzer.
Related Information
Design Flow on page 18-1
Related Information
About Using the Synplify Software with the Quartus Prime Software Online Help
.scf(13) Synopsys Constraint Format file containing timing constraints for the
TimeQuest Timing Analyzer.
(13)
If your design uses the Classic Timing Analyzer for timing analysis in the Quartus Prime software versions
10.0 and earlier, the Synplify software generates timing constraints in the Tcl Constraints File (.tcl). If you
are using the Quartus Prime software versions 10.1 and later, you must use the TimeQuest Timing Analyzer
for timing analysis.
Send Feedback
QPS5V1
18-6 Design Constraints Support 2016.05.03
.srs Technology-independent RTL netlist file that can be read only by the Synplify
software.
.acf Assignment and Configurations file for backward compatibility with the MAX
+PLUS II software. For devices supported by the MAX+PLUS II software, the
MAX+PLUS II assignments are imported from the MAX+PLUS II .acf file.
Related Information
Design Flow on page 18-1
Related Information
• Design Flow on page 18-1
• Synplify Optimization Strategies on page 18-8
• Netlist Optimizations and Physical Synthesis Documentation
(14)
This report file includes performance estimates that are often based on pre-place-and-route information.
Use the fMAX reported by the Quartus Prime software after place-and-route—it is the only reliable source of
timing information. This report file includes post-synthesis device resource utilization statistics that might
inaccurately predict resource usage after place-and-route. The Synplify software does not account for black
box functions nor for logic usage reduction achieved through register packing performed by the Quartus
Prime software. Register packing combines a single register and look-up table (LUT) into a single logic cell,
reducing logic cell utilization below the Synplify software estimate. Use the device utilization reported by the
Quartus Prime software after place-and-route.
Send Feedback
QPS5V1
2016.05.03 Running the Quartus Prime Software Manually With the Synplify‑Generated... 18-7
Running the Quartus Prime Software Manually With the Synplify‑Generated Tcl
Script
You can run the Quartus Prime software with a Synplify-generated Tcl script.
To run the Tcl script to set up your project assignments, perform the following steps:
1. Ensure the .vqm, .scf, and .tcl files are located in the same directory.
2. In the Quartus Prime software, on the View menu, point to Utility Windows and click Tcl Console.
The Quartus Prime Tcl Console opens.
3. At the Tcl Console command prompt, type the following:
source <path>/<project name>_cons.tcl
All Synplify constraints described above are mapped to SDC commands for the TimeQuest Timing
Analyzer.
For syntax and arguments for these commands, refer to the applicable topic in this manual or refer to
Synplify Help. For a list of corresponding commands in the Quartus Prime software, refer to the Quartus
Prime Help.
Related Information
• Timing-Driven Synthesis Settings on page 18-9
• Quartus Prime TimeQuest Timing Analyzer Documentation
Send Feedback
QPS5V1
18-8 Input and Output Delay 2016.05.03
Multicycle Path
Specify a multicycle path constraint in the Synplify software with the define_multicycle_path
command. This command is passed to the Quartus Prime software with the set_multicycle_path
command.
False Path
Specify a false path constraint in the Synplify software with the define_false_path command. This
command is passed to the Quartus Prime software with the set_false_path command.
Related Information
• Design Constraints Support on page 18-6
• Recommended Design Practices Documentation on page 11-1
• Timing Closure and Optimization Documentation
Send Feedback
QPS5V1
2016.05.03 Using Implementations in Synplify Pro or Premier 18-9
Synplify Premier software forward-annotates the design netlist to the Quartus Prime software to perform
the final placement and routing. In the default flow, the Synplify Premier software also forward-annotates
placement information for the critical path(s) in the design, which can improve the compilation time in
the Quartus Prime software.
The physical location annotation file is called <design name>_plc.tcl. If you open the Quartus Prime
software from the Synplify Premier software user interface, the Quartus Prime software automatically uses
this file for the placement information.
The Physical Analyst allows you to examine the placed netlist from the Synplify Premier software, which
is similar to the HDL Analyst for a logical netlist. You can use this display to analyze and diagnose
potential problems.
Related Information
• Passing TimeQuest SDC Timing Constraints to the Quartus Prime Software on page 18-7
• Exporting Designs to the Quartus Prime Software Using NativeLink Integration on page 18-3
Clock Frequencies
For single-clock designs, you can specify a global frequency when using the push-button flow. While this
flow is simple and provides good results, it often does not meet the performance requirements for more
advanced designs. You can use timing constraints, compiler directives, and other attributes to help
optimize the performance of a design. You can enter these attributes and directives directly in the HDL
code. Alternatively, you can enter attributes (not directives) into an .sdc file with the SCOPE window in
the Synplify software.
Send Feedback
QPS5V1
18-10 Multiple Clock Domains 2016.05.03
Use the SCOPE window to set global frequency requirements for the entire design and individual clock
settings. Use the Clocks tab in the SCOPE window to specify frequency (or period), rise times, fall times,
duty cycle, and other settings. Assigning individual clock settings, rather than over-constraining the global
frequency, helps the Quartus Prime software and the Synplify software achieve the fastest clock frequency
for the overall design. The define_clock attribute assigns clock constraints.
When the syn_forward_io_constraints attribute is set to 1, the Synplify software passes the external
input and output delays to the Quartus Prime software using NativeLink integration. The Quartus Prime
software then uses the external delays to calculate the maximum system frequency.
Multicycle Paths
A multicycle path is a path that requires more than one clock cycle to propagate. Specify any multicycle
paths in the design in the Multi-Cycle Paths tab of the SCOPE window, or with the
define_multicycle_path attribute. You should specify which paths are multicycle to prevent the
Quartus Prime and the Synplify compilers from working excessively on a non-critical path. Not specifying
these paths can also result in an inaccurate critical path reported during timing analysis.
False Paths
False paths are paths that should be ignored during timing analysis, or should be assigned low (or no)
priority during optimization. Some examples of false paths include slow asynchronous resets, and test
logic that has been added to the design. Set these paths in the False Paths tab of the SCOPE window, or
use the define_false_path attribute.
FSM Compiler
If the FSM Compiler is turned on, the compiler automatically detects state machines in a design, which
are then extracted and optimized. The FSM Compiler analyzes state machines and implements sequential,
gray, or one-hot encoding, based on the number of states. The compiler also performs unused-state
Send Feedback
QPS5V1
2016.05.03 FSM Explorer in Synplify Pro and Premier 18-11
Value Description
Sequential Generates state machines with the fewest possible flipflops. Sequential, also called
binary, state machines are useful for area-critical designs when timing is not the
primary concern.
Gray Generates state machines where only one flipflop changes during each transition.
Gray-encoded state machines tend to be glitches.
One-hot Generates state machines containing one flipflop for each state. One-hot state
machines typically provide the best performance and shortest clock-to-output delays.
However, one-hot implementations are usually larger than sequential implementa‐
tions.
Safe Generates extra control logic to force the state machine to the reset state if an invalid
state is reached. You can use the safe value in conjunction with any of the other three
values, which results in the state machine being implemented with the requested
encoding scheme and the generation of the reset logic.
By default, the state machine logic is optimized for speed and area, which may be potentially
undesirable for critical systems. The safe value generates extra control logic to force the state
machine to the reset state if an invalid state is reached.
Send Feedback
QPS5V1
18-12 Optimization Attributes and Options 2016.05.03
Maximum Fan-Out
When your design has critical path nets with high fan-out, use the syn_maxfan attribute to control the
fan-out of the net. Setting this attribute for a specific net results in the replication of the driver of the net
to reduce overall fan-out. The syn_maxfan attribute takes an integer value and applies it to inputs or
registers. The syn_maxfan attribute cannot be used to duplicate control signals. The minimum allowed
value of the attribute is 4. Using this attribute might result in increased logic resource utilization, thus
straining routing resources, which can lead to long compilation times and difficult fitting.
If you must duplicate an output register or an output enable register, you can create a register for each
output pin by using the syn_useioff attribute.
Preserving Nets
During synthesis, the compiler maintains ports, registers, and instantiated components. However, some
nets cannot be maintained to create an optimized circuit. Applying the syn_keep directive overrides the
optimization of the compiler and preserves the net during synthesis. The syn_keep directive is a Boolean
data type value and can be applied to wires (Verilog HDL) and signals (VHDL). Setting the value to true
preserves the net through synthesis.
Register Packing
Altera devices allow register packing into I/O cells. Altera recommends allowing the Quartus Prime
software to make the I/O register assignments. However, you can control register packing with the
syn_useioff attribute. The syn_useioff attribute is a Boolean data type value that can be applied to
ports or entire modules. Setting the value to 1 instructs the compiler to pack the register into an I/O cell.
Setting the value to 0 prevents register packing in both the Synplify and Quartus Prime software.
Resource Sharing
The Synplify software uses resource sharing techniques during synthesis, by default, to reduce area.
Turning off the Resource Sharing option on the Options tab of the Implementation Options dialog box
improves performance results for some designs. You can also turn off the option for a specific module
with the syn_sharing attribute. If you turn off this option, be sure to check the results to verify
improvement in timing performance. If there is no improvement, turn on Resource Sharing.
Preserving Hierarchy
The Synplify software performs cross-boundary optimization by default, which causes the design to
flatten to allow optimization. You can use the syn_hier attribute to override the default compiler settings.
The syn_hier attribute applies a string value to modules, architectures, or both. Setting the value to hard
maintains the boundaries of a module, architecture, or both, but allows constant propagation. Setting the
value to locked prevents all cross-boundary optimizations. Use the locked setting with the partition
setting to create separate design blocks and multiple output netlists.
Send Feedback
QPS5V1
2016.05.03 Register Input and Output Delays 18-13
By default, the Synplify software generates a hierarchical .vqm file. To flatten the file, set the
syn_netlist_hierarchy attribute to 0.
syn_direct_enable
This attribute controls the assignment of a clock-enable net to the dedicated enable pin of a register. With
this attribute, you can direct the Synplify mapper to use a particular net as the only clock enable when the
design has multiple clock enable candidates.
To use this attribute as a compiler directive to infer registers with clock enables, enter the
syn_direct_enable directive in your source code, instead of the SCOPE spreadsheet.
The syn_direct_enable data type is Boolean. A value of 1 or true enables net assignment to the clock-
enable pin. The following is the syntax for Verilog HDL:
object /* synthesis syn_direct_enable = 1 */ ;
I/O Standard
For certain Altera devices, specify the I/O standard type for an I/O pad in the design with the I/O
Standard panel in the Synplify SCOPE window.
Send Feedback
QPS5V1
18-14 Altera-Specific Attributes 2016.05.03
The Synplify SDC syntax for the define_io_standard constraint, in which the delay_type must be
either input_delay or output_delay.
For details about supported I/O standards, refer to the Synopsys FPGA Synthesis Reference
Manual.
Altera-Specific Attributes
You can use the altera_chip_pin_lc, altera_io_powerup, and altera_io_opendrain attributes with
specific Altera device features, which are forward-annotated to the Quartus Prime project, and are used
during place-and-route.
altera_chip_pin_lc
Use the altera_chip_pin_lc attribute to make pin assignments. This attribute applies a string value to
inputs and outputs. Use the attribute only on the ports of the top-level entity in the design. Do not use this
attribute to assign pin locations from entities at lower levels of the design hierarchy.
Note: The altera_chip_pin_lc attribute is not supported for any MAX series device.
In the SCOPE window, set the value of the altera_chip_pin_lc attribute to a pin number or a list of pin
numbers.
You can use VHDL code for making location assignments for supported Altera devices. Pin location
assignments for these devices are written to the output .tcl file.
Note: The data_out signal is a 4-bit signal; data_out[3] is assigned to pin 14 and data_out[0] is
assigned to pin 15.
altera_io_powerup
Use the altera_io_powerup attribute to define the power-up value of an I/O register that has no set or
reset. This attribute applies a string value (high|low) to ports with I/O registers. By default, the power-up
value of the I/O register is set to low.
altera_io_opendrain
Use the altera_io_opendrain attribute to specify open-drain mode I/O ports. This attribute applies a
boolean data type value to outputs or bidirectional ports for devices that support open-drain mode.
Send Feedback
QPS5V1
2016.05.03 Guidelines for Altera IP Cores and Architecture-Specific Features 18-15
Related Information
• Hardware Description Language Support on page 18-3
• Recommended HDL Coding Styles Documentation on page 12-1
• About the IP Catalog Online Help
Related Information
• Specifying the Quartus Prime Software Version on page 18-3
• Using the Quartus Prime Software to Run the Synplify Software on page 18-5
Send Feedback
QPS5V1
18-16 Instantiating Altera IP Cores with IP Catalog Generated Verilog HDL... 2016.05.03
Related Information
• Including Files for Quartus Prime Placement and Routing Only on page 18-19
• Synplify Synthesis Techniques with the Quartus Prime Software online training
Includes more information about design flows using clear box model and grey box model.
• Generating a Netlist for 3rd Party Synthesis Tools online help
Send Feedback
QPS5V1
2016.05.03 Instantiating Black Box IP Cores with Generated Verilog HDL Files 18-17
Example 18-6: Sample Top-Level Verilog HDL Code with Black Box Instantiation of IP
Send Feedback
QPS5V1
18-18 Other Synplify Software Attributes for Creating Black Boxes 2016.05.03
The example shows a top-level file that instantiates my_vhdlIP.vhd, which is a simplified customized
variation generated by the IP Catalog.
Example 18-7: Sample Top-Level VHDL Code with Black Box Instantiation of IP
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY top IS
PORT (
clk: IN STD_LOGIC ;
count: OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
);
END top;
module ram32x4(z,d,addr,we,clk);
/* synthesis syn_black_box syn_tcol="clk->z[3:0]=4.0"
syn_tpd1="addr[3:0]->[3:0]=8.0"
syn_tsu1="addr[3:0]->clk=2.0"
syn_tsu2="we->clk=3.0" */
output [3:0]z;
input[3:0]d;
input[3:0]addr;
input we
input clk
endmodule
The following additional attributes are supported by the Synplify software to communicate details
about the characteristics of the black box module within the HDL code:
• syn_resources—Specifies the resources used in a particular black box.
• black_box_pad_pin—Prevents mapping to I/O cells.
• black_box_tri_pin—Indicates a tri-stated signal.
Send Feedback
QPS5V1
2016.05.03 Including Files for Quartus Prime Placement and Routing Only 18-19
For more information about applying these attributes, refer to the Synopsys FPGA Synthesis
Reference Manual.
Related Information
Recommended HDL Coding Styles Documentation on page 12-1
Inferring Multipliers
The figure shows the HDL Analyst view of an unsigned 8 × 8 multiplier with two pipeline stages after
synthesis in the Synplify software. This multiplier is converted into an ALTMULT_ADD or
ALTMULT_ACCUM IP core. For devices with DSP blocks, the software might implement the function in
a DSP block instead of regular logic, depending on device utilization. For some devices, the software maps
directly to DSP block device primitives instead of instantiating an IP core in the .vqm file.
Send Feedback
QPS5V1
18-20 Resource Balancing 2016.05.03
Figure 18-2: HDL Analyst View of LPM_MULT IP Core (Unsigned 8x8 Multiplier with Pipeline=2)
Resource Balancing
While mapping multipliers to DSP blocks, the Synplify software performs resource balancing for
optimum performance.
Altera devices have a fixed number of DSP blocks, which includes a fixed number of embedded
multipliers. If the design uses more multipliers than are available, the Synplify software automatically
maps the extra multipliers to logic elements (LEs), or adaptive logic modules (ALMs).
If a design uses more multipliers than are available in the DSP blocks, the Synplify software maps the
multipliers in the critical paths to DSP blocks. Next, any wide multipliers, which might or might not be in
the critical paths, are mapped to DSP blocks. Smaller multipliers and multipliers that are not in the critical
paths might then be implemented in the logic (LEs or ALMs). This ensures that the design fits successfully
in the device.
Send Feedback
QPS5V1
2016.05.03 Signal Level Attribute 18-21
Example 18-10: Signal Attributes for Controlling DSP Block Inference in Verilog HDL Code
module mult(a,b,c,r,en);
input [7:0] a,b;
output [15:0] r;
input [15:0] c;
input en;
wire [15:0] temp /* synthesis syn_multstyle="logic" */;
Example 18-11: Signal Attributes for Controlling DSP Block Inference in VHDL Code
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
begin
temp <= a * b;
r <= temp when en='1' else c;
end beh;
Send Feedback
QPS5V1
18-22 Inferring RAM 2016.05.03
Inferring RAM
When a RAM block is inferred from an HDL design, the Synplify software uses an Altera IP core to target
the device memory architecture. For some devices, the Synplify software maps directly to memory block
device primitives instead of instantiating an IP core in the .vqm file.
Follow these guidelines for the Synplify software to successfully infer RAM in a design:
• The address line must be at least two bits wide.
• Resets on the memory are not supported. Refer to the device family documentation for information
about whether read and write ports must be synchronous.
• Some Verilog HDL statements with blocking assignments might not be mapped to RAM blocks, so
avoid blocking statements when modeling RAMs in Verilog HDL.
For some device families, the syn_ramstyle attribute specifies the implementation to use for an inferred
RAM. You can apply the syn_ramstyle attribute globally to a module or a RAM instance, to specify
registers or block_ram values. To turn off RAM inference, set the attribute value to registers.
When inferring RAM for some Altera device families, the Synplify software generates additional bypass
logic. This logic is generated to resolve a half-cycle read/write behavior difference between the RTL and
post-synthesis simulations. The RTL simulation shows the memory being updated on the positive edge of
the clock; the post-synthesis simulation shows the memory being updated on the negative edge of the
clock. To eliminate bypass logic, the output of the RAM must be registered. By adding this register, the
output of the RAM is seen after a full clock cycle, by which time the update has occurred, thus eliminating
the need for bypass logic.
For devices with TriMatrix memory blocks, disable the creation of glue logic by setting the syn_ramstyle
value to no_rw_check. Set syn_ramstyle to no_rw_check to disable the creation of glue logic in dual-port
mode.
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_signed.all;
ENTITY dualport_ram IS
PORT ( data_out: OUT STD_LOGIC_VECTOR (7 DOWNTO 0);
data_in: IN STD_LOGIC_VECTOR (7 DOWNTO 0)
wr_addr, rd_addr: IN STD_LOGIC_VECTOR (6 DOWNTO 0);
we: IN STD_LOGIC);
clk: IN STD_LOGIC);
END dualport_ram;
BEGIN
data_out <= mem (CONV_INTEGER(rd_addr));
PROCESS (clk, we, data_in) BEGIN
IF (clk='1' AND clk'EVENT) THEN
IF (we='1') THEN
mem(CONV_INTEGER(wr_addr)) <= data_in;
END IF;
END IF;
Send Feedback
QPS5V1
2016.05.03 RAM Initialization 18-23
END PROCESS;
END ram_infer;
Example 18-13: VHDL Code for Inferred Dual-Port RAM Preventing Bypass Logic
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_signed.all;
ENTITY dualport_ram IS
PORT ( data_out: OUT STD_LOGIC_VECTOR (7 DOWNTO 0);
data_in : IN STD_LOGIC_VECTOR (7 DOWNTO 0);
wr_addr, rd_addr : IN STD_LOGIC_VECTOR (6 DOWNTO 0);
we : IN STD_LOGIC;
clk : IN STD_LOGIC);
END dualport_ram;
BEGIN
tmp_out <= mem (CONV_INTEGER (rd_addr));
PROCESS (clk, we, data_in) BEGIN
IF (clk='1' AND clk'EVENT) THEN
IF (we='1') THEN
mem(CONV_INTEGER(wr_addr)) <= data_in;
END IF;
data_out <= tmp_out; --registers output preventing
-- bypass logic generation
END IF;
END PROCESS;
END ram_infer;
RAM Initialization
Use the Verilog HDL $readmemb or $readmemh system tasks in your HDL code to initialize RAM
memories. The Synplify compiler forward-annotates the initialization values in the .srs (technology-
independent RTL netlist) file and the mapper generates the corresponding hexadecimal memory
initialization (.hex) file. One .hex file is created for each of the altsyncram IP cores that are inferred in
the design. The .hex file is associated with the altsyncram instance in the .vqm file using the init_file
attribute.
The examples show how RAM can be initialized through HDL code, and how the corresponding .hex file
is generated using Verilog HDL.
Example 18-14: Using $readmemb System Task to Initialize an Inferred RAM in Verilog HDL
Code
initial
begin
$readmemb("mem.ini", mem);
end
always @(posedge clk)
begin
raddr_reg <= raddr;
if(we)
Send Feedback
QPS5V1
18-24 Inferring ROM 2016.05.03
Inferring ROM
When a ROM block is inferred from an HDL design, the Synplify software uses an Altera IP core to target
the device memory architecture. For some devices, the Synplify software maps directly to memory block
device atoms instead of instantiating an IP core in the .vqm file.
Follow these guidelines for the Synplify software to successfully infer ROM in a design:
• The address line must be at least two bits wide.
• The ROM must be at least half full.
• A CASE or IF statement must make 16 or more assignments using constant values of the same width.
Send Feedback
QPS5V1
2016.05.03 Design Flow for Incremental Compilation 18-25
is compiled, reducing synthesis run time and preserving the results for the unchanged blocks. You can
change and resynthesize one section of a design without affecting other sections.
You can also partition your design and create different netlist files manually with the Synplify software by
creating a separate project for the logic in each partition of the design. Creating different netlist files for
each partition of the design also means that each partition can be independent of the others.
Hierarchical design methodologies can improve the efficiency of your design process, providing better
design reuse opportunities and fewer integration problems when working in a team environment. When
you use these incremental synthesis methodologies, you can take advantage of incremental compilation in
the Quartus Prime software. You can perform placement and routing on only the changed partitions of
the design, which reduces place-and-route time and preserves your fitting results.
Related Information
Power-Up Level on page 16-34
Send Feedback
QPS5V1
18-26 Using MultiPoint Synthesis with Incremental Compilation 2016.05.03
Altera recommends that you register all inputs and outputs of each partition. This makes logic synchro‐
nous, and avoids any delay penalty on signals that cross partition boundaries.
If you use boundary tri-states in a lower-level block, the Synplify software pushes, or bubbles, the tri-states
through the hierarchy to the top-level to use the tri-state drivers on output pins of Altera devices. Because
bubbling tri-states requires optimizing through hierarchies, lower-level tri-states are not supported with a
block-based compilation methodology. Use tri-state drivers only at the external output pins of the device
and in the top-level block in the hierarchy.
You can generate multiple .vqm netlist files with the MultiPoint synthesis flow in the Synplify Pro and
Premier software, or by manually creating separate Synplify projects and creating a black box for each
block that you want to designate as a separate design partition.
In the MultiPoint synthesis flow in the Synplify Pro and Premier software, you create multiple .vqm
netlist files from one easy-to-manage, top-level synthesis project. By using the manual black box method,
you have multiple synthesis projects, which might be required for certain team-based or bottom-up
designs where a single top-level project is not desired.
After you have created multiple .vqm files using one of these two methods, you must create the
appropriate Quartus Prime projects to place-and-route the design.
Related Information
Best Practices for Incremental Compilation Partitions and Floorplan Assignments on page 14-1
Send Feedback
QPS5V1
2016.05.03 Defining Compile Points With .tcl or .sdc Files 18-27
Partition Top
B C
D E F
Partition B Partition F
In this case, modules A, B, and F are Compile Points. The top-level Compile Point consists of the top-level
block in the design (that is, block A in this example), including the logic that is not defined under another
Compile Point. In this example, the design for top-level Compile Point A also includes the logic in one of
its subblocks, C. Because block F is defined as its own Compile Point, it is not treated as part of the
top-level Compile Point A. Another separate Compile Point B contains the logic in blocks B, D, and E.
One netlist is created for the top-level module A and submodule C, another netlist is created for B and its
submodules D and E, while a third netlist is created for F.
Apply Compile Points to the module, or to the architecture in the Synplify Pro SCOPE spreadsheet, or to
the .sdc file. You cannot set a Compile Point in the Verilog HDL or VHDL source code. You can set the
constraints manually using Tcl, by editing the .sdc file, or you can use the GUI.
<objname> represents any module in the design. The Compile Point type {locked, partition}
indicates that the Compile Point represents a partition for the Quartus Prime incremental
compilation flow.
Each Compile Point has a set of constraint files that begin with the define_current_design
command to set up the SCOPE environment, as follows:
define_current_design {<my_module>}
Send Feedback
QPS5V1
18-28 Creating a Quartus Prime Project for Compile Points and Multiple .vqm... 2016.05.03
You can apply the syn_allowed_resources attribute to any Compile Point view to restrict the number of
resources for a particular module.
When using Compile Points with incremental compilation, be aware of the following restrictions:
• To use Compile Points effectively, you must provide timing constraints (timing budgeting) for each
Compile Point; the more accurate the constraints, the better your results are. Constraints are not
automatically budgeted, so manual time budgeting is essential. Altera recommends that you register all
inputs and outputs of each partition. This avoids any logic delay penalty on signals that cross-partition
boundaries.
• When using the Synplify attribute syn_useioff to pack registers in the I/O Elements (IOEs) of Altera
devices, these registers must be in the top-level module. Otherwise, you must direct the Quartus Prime
software to perform I/O register packing instead of the syn_useioff attribute. You can use the Fast
Input Register or Fast Output Register options, or set I/O timing constraints and turn on Optimize
I/O cell register placement for timing on the Advanced Settings (Fitter) dialog box in the Quartus
Prime software.
• There is no incremental synthesis support for top-level logic; any logic in the top-level is resynthesized
during every compilation in the Synplify software.
For more information about using Compile Points and setting Synplify attributes and constraints for both
top-level and lower-level Compile Points, refer to the Synopsys FPGA Synthesis User Guide and the
Synopsys FPGA Synthesis Reference Manual.
Creating a Quartus Prime Project for Compile Points and Multiple .vqm Files
During compilation, the Synplify Pro and Premier software creates a <top-level project>.tcl file that
provides the Quartus Prime software with the appropriate constraints and design partition assignments,
creating a partition for each .vqm file along with the information to set up a Quartus Prime project.
Depending on your design methodology, you can create one Quartus Prime project for all netlists or a
separate Quartus Prime project for each netlist. In the standard incremental compilation design flow, you
create design partition assignments and optional LogicLock floorplan location assignments for each
™
partition in the design within a single Quartus Prime project. This methodology allows for the best quality
of results and performance preservation during incremental changes to your design.
You might require a bottom-up design flow if each partition must be optimized separately, such as for
third-party IP delivery. If you use this flow, Altera recommends you create a design floorplan to avoid
placement conflicts between each partition. To follow this design flow in the Quartus Prime software,
create separate Quartus Prime projects, export each design partition and incorporate them into a top-level
design using the incremental compilation features to maintain placement results.
Related Information
Running the Quartus Prime Software Manually With the Synplify-Generated Tcl Script on page 18-7
Creating a Single Quartus Prime Project for a Standard Incremental Compilation Flow
Use the <top-level project>.tcl file that contains the Synplify assignments for all partitions within the
project. This method allows you to import all the partitions into one Quartus Prime project and optimize
all modules within the project at once, while taking advantage of the performance preservation and
compilation-time reduction that incremental compilation offers.
Send Feedback
QPS5V1
2016.05.03 Creating Multiple Quartus Prime Projects for a Bottom-Up Incremental... 18-29
Figure 18-4: Design Flow Using Multiple .vqm Files with One Quartus Prime Project
a.vqm
b.vqm f.vqm
Creating Multiple Quartus Prime Projects for a Bottom-Up Incremental Compilation Flow
Use the <lower-level compile point>.tcl files that contain the Synplify assignments for each Compile Point.
Generate multiple Quartus Prime projects, one for each partition and netlist in the design. The designers
in the project can optimize their own partitions separately within the Quartus Prime software and export
the results for their own partitions. You can export the optimized subdesigns and then import them into
one top-level Quartus Prime project using incremental compilation to complete the design.
Figure 18-5: Design Flow Using Multiple .vqm Files with Multiple Quartus Prime Projects
a.vqm
Use the top-level Tcl file a.tcl to Import
Synplify Pro Assignments
Creating Multiple .vqm Files for a Incremental Compilation Flow With Separate
Synplify Projects
You can manually generate multiple .vqm files for a incremental compilation flow with black boxes and
separate Synplify projects for each design partition. This manual flow is supported by versions of the
Synplify software without the MultiPoint Synthesis feature.
Send Feedback
QPS5V1
18-30 Manually Creating Multiple .vqm Files With Black Boxes 2016.05.03
Partition Top
B C
D E F
Partition B Partition F
The partition top contains the top-level block in the design (block A) and the logic that is not defined as
part of another partition. In this example, the partition for top-level block A also includes the logic in one
of its sub-blocks, block C. Because block F is contained in its own partition, it is not treated as part of the
top-level partition A. Another separate partition, partition B, contains the logic in blocks B, D, and E. In a
team-based design, engineers can work independently on the logic in different partitions. One netlist is
created for the top-level module A and its submodule C, another netlist is created for module B and its
submodules D and E, while a third netlist is created for module F.
Example 18-17: Verilog HDL Black Box for Top-Level File A.v
Send Feedback
QPS5V1
2016.05.03 Creating Black Boxes in VHDL 18-31
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY synplify;
USE synplify.attributes.all;
ENTITY A IS
PORT (data_in : IN INTEGER RANGE 0 TO 15;
clk, e, ld : IN STD_LOGIC;
data_out : OUT INTEGER RANGE 0 TO 15 );
END A;
ARCHITECTURE a_arch OF A IS
COMPONENT B PORT(
data_in : IN INTEGER RANGE 0 TO 15;
clk, ld : IN STD_LOGIC;
d_out : OUT INTEGER RANGE 0 TO 15);
END COMPONENT;
COMPONENT F PORT(
d : IN INTEGER RANGE 0 TO 15;
clk, e: IN STD_LOGIC;
q : OUT INTEGER RANGE 0 TO 15);
Send Feedback
QPS5V1
18-32 Creating a Quartus Prime Project for Multiple .vqm Files 2016.05.03
END COMPONENT;
BEGIN
U1 : B
PORT MAP (
data_in => data_in,
clk => clk,
ld => ld,
d_out => cnt_out );
U2 : F
PORT MAP (
d => cnt_out,
clk => clk,
e => e,
q => data_out );
END a_arch;
After you complete the steps above, you have a netlist for each partition of the design. These files
are ready for use with the incremental compilation flow in the Quartus Prime software.
Related Information
Running the Quartus Prime Software Manually With the Synplify-Generated Tcl Script on page 18-7
Creating a Single Quartus Prime Project for a Standard Incremental Compilation Flow
Use the <top-level project>.tcl file that contains the Synplify assignments for the top-level design. This
method allows you to import all of the partitions into one Quartus Prime project and optimize all
modules within the project at once, taking advantage of the performance preservation and compilation
time reduction offered by incremental compilation.
Send Feedback
QPS5V1
2016.05.03 Creating Multiple Quartus Prime Projects for a Bottom-Up Incremental... 18-33
All of the constraints from the top-level project are passed to the Quartus Prime software in the top-
level .tcl file, but constraints made in the lower-level projects within the Synplify software are not
forward-annotated. Enter these constraints manually in your Quartus Prime project.
Figure 18-7: Design Flow Using Multiple .vqm Files with One Quartus Prime Project
a.vqm
b.vqm f.vqm
Creating Multiple Quartus Prime Projects for a Bottom-Up Incremental Compilation Flow
Use the .tcl file that is created for each .vqm file by the Synplify software for each Synplify project. This
method generates multiple Quartus Prime projects, one for each block in the design. The designers in the
project can optimize their own blocks separately within the Quartus Prime software and export the
placement of their own blocks.
Designers should create a LogicLock region to create a design floorplan for each block to avoid conflicts
between partitions. The top-level designer then imports all the blocks and assignments into the top-level
project. This method allows each block in the design to be optimized separately and then imported into
one top-level project.
Figure 18-8: Design Flow Using Multiple Synplify Projects and Multiple Quartus Prime Projects
a.vqm
Use the top-level
Tcl file a.tcl to Import
Synplify Assignments
b.vqm f.vqm
Use the lower-level Use the lower-level
Tcl file b.tcl to Import Tcl file f.tcl to Import
Synplify Assignments Synplify Assignments
Send Feedback
QPS5V1
18-34 Performing Incremental Compilation in the Quartus Prime Software 2016.05.03
Related Information
• Power-Up Level on page 16-34
• Using the Quartus Prime Software to Run the Synplify Software on page 18-5
Send Feedback
QPS5V1
2016.05.03 Document Revision History 18-35
Send Feedback
QPS5V1
18-36 Document Revision History 2016.05.03
Send Feedback
QPS5V1
2016.05.03 Document Revision History 18-37
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
Mentor Graphics Precision Synthesis Support
19
QPS5V1 Subscribe Send Feedback
Plus Synthesis software in the Quartus Prime software, as well as key design flows, methodologies and
techniques for improving your results for Altera devices. This manual assumes that you have set up,
®
licensed, and installed the Precision Synthesis software and the Quartus Prime software.
Note: You must set up, license, and install the Precision RTL Plus Synthesis software if you want to use
the incremental synthesis feature for incremental compilation and block-based design.
To obtain and license the Precision Synthesis software, refer to the Mentor Graphics website. To install
and run the Precision Synthesis software and to set up your work environment, refer to the Precision
Synthesis Installation Guide in the Precision Manuals Bookcase. To access the Manuals Bookcase in the
Precision Synthesis software, click Help and select Open Manuals Bookcase.
Related Information
Mentor Graphics website
Design Flow
The following steps describe a basic Quartus Prime design flow using the Precision Synthesis software:
1. Create Verilog HDL or VHDL design files.
2. Create a project in the Precision Synthesis software that contains the HDL files for your design, select
your target device, and set global constraints.
3. Compile the project in the Precision Synthesis software.
4. Add specific timing constraints, optimization attributes, and compiler directives to optimize the design
during synthesis. With the design analysis and cross-probing capabilities of the Precision Synthesis
software, you can identify and improve circuit area and performance issues using prelayout timing
estimates.
Note: For best results, Mentor Graphics recommends specifying constraints that are as close as
possible to actual operating requirements. Properly setting clock and I/O constraints, assigning
clock domains, and indicating false and multicycle paths guide the synthesis algorithms more
accurately toward a suitable solution in the shortest synthesis time.
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V1
19-2 Design Flow 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Timing Optimization 19-3
Figure 19-1: Design Flow Using the Precision Synthesis Software and Quartus Prime Software
Design Specifications
Constraints and
Precision Synthesis
Settings
Gate-Level Timing
Si m ulation
Yes
Configuration/Programming Files
(.sof /.pof )
Program/Configure Device
Related Information
• Running the Quartus Prime Software from within the Precision Synthesis Software on page 19-9
• Using the Quartus Prime Software to Run the Precision Synthesis Software on page 19-10
Timing Optimization
If your area or timing requirements are not met, you can change the constraints and resynthesize the
design in the Precision Synthesis software, or you can change the constraints to optimize the design
during place-and-route in the Quartus Prime software. Repeat the process until the area and timing
requirements are met.
Send Feedback
QPS5V1
19-4 Altera Device Family Support 2015.11.02
You can use other options and techniques in the Quartus Prime software to meet area and timing require‐
ments. For example, the WYSIWYG Primitive Resynthesis option can perform optimizations on your
EDIF netlist in the Quartus Prime software.
While simulation and analysis can be performed at various points in the design process, final timing
analysis should be performed after placement and routing is complete.
Related Information
• Netlist Optimizations and Physical Synthesis documentation
• Timing Closure and Optimization documentation
(15)
The timing report file includes performance estimates that are based on pre-place-and-route information.
Use the fMAX reported by the Quartus Prime software after place-and-route for accurate post-place-and-
route timing information. The area report file includes post-synthesis device resource utilization statistics
that can differ from the resource usage after place-and-route due to black boxes or further optimizations
performed during placement and routing. Use the device utilization reported by the Quartus Prime software
after place-and-route for final resource utilization results.
(16)
The Precision Synthesis software-generated VQM file is supported by the Quartus Prime software version
10.1 and later.
Send Feedback
QPS5V1
2015.11.02 Creating and Compiling a Project in the Precision Synthesis Software 19-5
.tcl Forward-annotated Tcl assignments and constraints file. The <project name>.tcl
file is generated for all devices. The .tcl file acts as the Quartus Prime Project
Configuration file and is used to make basic project and placement assignments,
and to create and compile a Quartus Prime project.
.acf Assignment and Configurations file for backward compatibility with the MAX
+PLUS II software. For devices supported by the MAX+PLUS II software, the
MAX+PLUS II assignments are imported from the MAX+PLUS II .acf file.
.sdc Quartus Prime timing constraints file in Synopsys Design Constraints format.
This file is generated automatically if the device uses the TimeQuest Timing
Analyzer by default in the Quartus Prime software, and has the naming
convention <project name>_pnr_constraints .sdc.
Related Information
• Exporting Designs to the Quartus Prime Software Using NativeLink Integration on page 19-9
• Synthesizing the Design and Evaluating the Results on page 19-8
Send Feedback
QPS5V1
19-6 Setting Timing Constraints 2015.11.02
You can also enter constraints at the command line. After adding constraints at the command line, update
the .sdc file with the update constraint file command. You can add constraints that change
infrequently directly to the HDL source files with HDL attributes or pragmas.
Note: The Precision .sdc file contains all the constraints for the Precision Synthesis project. For the
Quartus Prime software, placement constraints are written in a .tcl file and timing constraints for
the TimeQuest Timing Analyzer are written in the Quartus Prime .sdc file.
For details about the syntax of Synopsys Design Constraint commands, refer to the Precision RTL
Synthesis User’s Manual and the Precision Synthesis Reference Manual. For more details and examples of
attributes, refer to the Attributes chapter in the Precision Synthesis Reference Manual.
Send Feedback
QPS5V1
2015.11.02 Assigning I/O Registers 19-7
Pin set_attribute -name PIN_NUMBER -value "<pin number>" -port <port name>
number
I/O set_attribute -name IOSTANDARD -value "<I/O Standard>" -port <port name>
standard
Drive set_attribute -name DRIVE -value "<drive strength in mA>" -port <port name>
strength
Slew rate set_attribute -name SLEW -value "TRUE | FALSE" -port <port name>
You also can use synthesis attributes or pragmas in your HDL code to make these assignments.
You can use the same syntax to assign the I/O standard using the IOSTANDARD attribute, drive
strength using the attribute DRIVE, and slew rate using the SLEW attribute.
For more details about attributes and how to set these attributes in your HDL code, refer to the
Precision Synthesis Reference Manual.
Send Feedback
QPS5V1
19-8 Preventing the Precision Synthesis Software from Adding I/O Pads 2015.11.02
want the software to add I/O pads to all I/O pins in the design. The Quartus Prime software can compile a
design without I/O pads; however, including I/O pads provides the Precision Synthesis software with
more information about the top-level pins in the design.
Preventing the Precision Synthesis Software from Adding an I/O Pad on an Individual Pin
To prevent I/O pad insertion on an individual pin when you are using a black box, such as DDR or a
phase-locked loop (PLL), at the external ports of the design, perform the following steps:
1. Compile your design.
2. Use the Precision Synthesis GUI to select the individual pin and turn off I/O pad insertion.
Note: You also can make this assignment by attaching the nopad attribute to the port in the HDL source
code.
After synthesis is complete, you can evaluate the results for area and timing. The Precision RTL Synthesis
User’s Manual describes different results that can be evaluated in the software.
There are several schematic viewers available in the Precision Synthesis software: RTL schematic,
Technology-mapped schematic, and Critical Path schematic. These analysis tools allow you to quickly and
easily isolate the source of timing or area issues, and to make additional constraint or code changes to
optimize the design.
Send Feedback
QPS5V1
2015.11.02 Obtaining Accurate Logic Utilization and Timing Analysis Reports 19-9
Running the Quartus Prime Software from within the Precision Synthesis Software
The Precision Synthesis software also has a built-in place-and-route environment that allows you to run
the Quartus Prime Fitter and view the results in the Precision Synthesis GUI. This feature is useful when
performing an initial compilation of your design to view post-place-and-route timing and device
utilization results. Not all the advanced Quartus Prime options that control the compilation process are
available when you use this feature.
Two primary Precision Synthesis software commands control the place-and-route process. Use the
setup_place_and_route command to set the place-and-route options. Start the process with the
place_and_route command.
Precision Synthesis software uses individual Quartus Prime executables, such as analysis and synthesis,
Fitter, and the TimeQuest Timing Analyzer for improved runtime and memory utilization during place
and route. This flow is referred to as the Quartus Prime Modular flow option in the Precision Synthesis
software. By default, the Precision Synthesis software generates a Quartus Prime Project Configuration
Send Feedback
QPS5V1
19-10 Running the Quartus Prime Software Manually Using the Precision... 2015.11.02
File (.tcl file) for current device families. Timing constraints that you set during synthesis are exported to
the Quartus Prime place-and-route constraints file <project name>_pnr_constraints.sdc.
After you compile the design in the Quartus Prime software from within the Precision Synthesis software,
you can invoke the Quartus Prime GUI manually and then open the project using the generated Quartus
Prime project file. You can view reports, run analysis tools, specify options, and run the various
processing flows available in the Quartus Prime software.
For more information about running the Quartus Prime software from within the Precision Synthesis
software, refer to the Altera Quartus Prime Integration chapter in the Precision Synthesis Reference
Manual.
4. On the File menu, click Open Project. Browse to the project name and click Open.
5. Compile the project in the Quartus Prime software.
Using the Quartus Prime Software to Run the Precision Synthesis Software
With NativeLink integration, you can set up the Quartus Prime software to run the Precision Synthesis
software. This feature allows you to use the Precision Synthesis software to synthesize a design as part of a
standard compilation. When you use this feature, the Precision Synthesis software does not use any
timing constraints or assignments that you have set in the Quartus Prime software.
Related Information
• Exporting Designs to the Quartus Prime Software Using NativeLink Integration on page 19-9
• Using the NativeLink Feature with Other EDA Tools online help
Send Feedback
QPS5V1
2015.11.02 create_clock 19-11
• set_min_delay
• set_false_path
• set_multicycle_path
create_clock
You can specify a clock in the Precision Synthesis software.
The period is specified in units of nanoseconds (ns). If no clock domain is specified, the clock
belongs to a default clock domain main. All clocks in the same clock domain are treated as
synchronous (related) clocks. If no <clock_name> is provided, the default name
virtual_default is used. The <edge_list> sets the rise and fall edges of the clock signal over an
entire clock period. The first value in the list is a rising transition, typically the first rising
transition after time zero. The waveform can contain any even number of alternating edges, and
the edges listed should alternate between rising and falling. The position of any edge can be equal
to or greater than zero but must be equal to or less than the clock period.
If -waveform <edge_list> is not specified and -period <period in ns> is specified, the
default waveform has a rising edge of 0.0 and a falling edge of <period_value>/2.
The Precision Synthesis software maps the clock constraint to the TimeQuest create_clock
setting in the Quartus Prime software.
The Quartus Prime software supports only clock waveforms with two edges in a clock cycle. If the
Precision Synthesis software finds a multi-edge clock, it issues an error message when you
synthesize your design in the Precision Synthesis software.
set_input_delay
This port-specific input delay constraint is specified in the Precision Synthesis software.
This constraint is mapped to the set_input_delay setting in the Quartus Prime software.
When the reference clock <clock_name> is not specified, all clocks are assumed to be the
reference clocks for this assignment. The input pin name for the assignment can be an input pin
name of a time group. The software can use the clock_fall option to specify delay relative to the
falling edge of the clock.
Note: Although the Precision Synthesis software allows you to set input delays on pins
inside the design, these constraints are not sent to the Quartus Prime software, and
a message is displayed.
Send Feedback
QPS5V1
19-12 set_output_delay 2015.11.02
set_output_delay
This port-specific output delay constraint is specified in the Precision Synthesis software.
This constraint is mapped to the set_output_delay setting in the Quartus Prime software.
When the reference clock <clock_name> is not specified, all clocks are assumed to be the
reference clocks for this assignment. The output pin name for the assignment can be an output
pin name of a time group.
Note: Although the Precision Synthesis software allows you to set output delays on pins
inside the design, these constraints are not sent to the Quartus Prime software.
The set_max_delay and set_min_delay commands specify that the maximum and minimum
respectively, required delay for any start point in <from_node_list> to any endpoint in
<to_node_list> must be less than or greater than <delay_value>. Typically, you use these
commands to override the default setup constraint for any path with a specific maximum or
minimum time value for the path.
The node lists can contain a collection of clocks, registers, ports, pins, or cells. The -from and -to
parameters specify the source (start point) and the destination (endpoint) of the timing path,
respectively. The source list (<from_node_list>) cannot include output ports, and the destination
list (<to_node_list>) cannot include input ports. If you include more than one node on a list, you
must enclose the nodes in quotes or in braces ({ }).
If you specify a clock in the source list, you must specify a clock in the destination list. Applying
set_max_delay or set_min_delay setting between clocks applies the exception from all registers
or ports driven by the source clock to all registers or ports driven by the destination clock.
Applying exceptions between clocks is more efficient than applying them for specific node-to-
node, or node-to-clock paths. If you want to specify pin names in the list, the source must be a
clock pin and the destination must be any non-clock input pin to a register. Assignments from
clock pins, or to and from cells, apply to all registers in the cell or for those driven by the clock
pin.
Send Feedback
QPS5V1
2015.11.02 set_false_path 19-13
set_false_path
The false path constraint is specified in the Precision Synthesis software.
The node lists can be a list of clocks, ports, instances, and pins. Multiple elements in the list can be
represented using wildcards such as * and ?.
In a place-and-route Tcl constraints file, this false path setting in the Precision Synthesis software
is mapped to a set_false_path setting. The Quartus Prime software supports setup, hold, rise,
or fall options for this assignment.
The node lists for this assignment represents top-level ports and/or nets connected to instances
(end points of timing assignments).
Any false path setting in the Precision Synthesis software can be mapped to a setting in the
Quartus Prime software with a through path specification.
set_multicycle_path
The multicycle path constraint is specified in the Precision Synthesis software.
The node list can contain clocks, ports, instances, and pins. Multiple elements in the list can be
represented using wildcards such as * and ?. Paths without multicycle path definitions are
identical to paths with multipliers of 1. To add one additional cycle to the datapath, use a
multiplier value of 2. The option start indicates that source clock cycles should be considered for
the multiplier. The option end indicates that destination clock cycles should be considered for the
multiplier. The default is to reference the end clock.
In the place-and-route Tcl constraints file, the multicycle path setting in the Precision Synthesis
software is mapped to a set_multicycle_path setting. The Quartus Prime software supports the
rise or fall options on this assignment.
The node lists represent top-level ports and/or nets connected to instances (end points of timing
assignments). The node lists can contain wildcards (such as *); the Quartus Prime software
automatically expands all wildcards.
Any multicycle path setting in Precision Synthesis software can be mapped to a setting in the
Quartus Prime software with a -through specification.
Send Feedback
QPS5V1
19-14 Guidelines for Altera IP Cores and Architecture-Specific Features 2015.11.02
Related Information
• Inferring Altera IP Cores from HDL Code on page 19-16
• Recommended HDL Coding Styles documentation on page 12-1
• Introduction to Altera IP Cores documentation
Send Feedback
QPS5V1
2015.11.02 Instantiating Intellectual Property With the IP Catalog and Parameter... 19-15
Example 19-10: Top-Level Verilog HDL Code with Black Box Instantiation of IP
// Module declaration
// The following attribute is added to create a
// black box for this module.
module my_verilogIP (clock, q) /* synthesis syn_black_box */;
input clock;
Send Feedback
QPS5V1
19-16 Instantiating Black Box IP Functions With Generated VHDL Files 2015.11.02
output[7:0] q;
endmodule
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY top IS
PORT (
clk: IN STD_LOGIC ;
count: OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
);
END top;
Related Information
Recommended HDL Coding Styles documentation on page 12-1
Send Feedback
QPS5V1
2015.11.02 Multipliers 19-17
Multipliers
The Precision Synthesis software detects multipliers in HDL code and maps them directly to device atoms
to implement the multiplier in the appropriate type of logic. The Precision Synthesis software also allows
you to control the device resources that are used to implement individual multipliers.
Table 19-3: Options for dedicated_mult Parameter to Control Multiplier Implementation in Precision
Synthesis
Value Description
ON Use only DSP blocks to implement multipliers, regardless of the size of the multiplier.
OFF Use only logic (LUTs) to implement multipliers, regardless of the size of the multiplier.
AUTO Use logic (LUTs) or DSP blocks to implement multipliers, depending on the size of the
multipliers.
The dedicated_mult attribute can be applied to signals and wires; it does not work when applied
to a register. This attribute can be applied only to simple multiplier code, such as a = b * c.
Some signals for which the dedicated_mult attribute is set can be removed during synthesis by
the Precision Synthesis software for design optimization. In such cases, if you want to force the
Send Feedback
QPS5V1
19-18 Multiplier-Accumulators and Multiplier-Adders 2015.11.02
implementation, you should preserve the signal by setting the preserve_signal attribute to
TRUE.
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_arith.ALL;
USE ieee.std_logic_unsigned.ALL;
ENTITY unsigned_mult IS
PORT(
a: IN std_logic_vector (7 DOWNTO 0);
b: IN std_logic_vector (7 DOWNTO 0);
result: OUT std_logic_vector (15 DOWNTO 0));
ATTRIBUTE dedicated_mult: STRING;
END unsigned_mult;
Send Feedback
QPS5V1
2015.11.02 Controlling DSP Block Inference 19-19
The Precision Synthesis software detects multiply-accumulators or multiply-adders in HDL code and
infers an ALTMULT_ACCUM or ALTMULT_ADD IP cores so that the logic can be placed in DSP
blocks, or the software maps these functions directly to device atoms to implement the multiplier in the
appropriate type of logic.
Note: The Precision Synthesis software supports inference for these functions only if the target device
family has dedicated DSP blocks.
For more information about DSP blocks in Altera devices, refer to the appropriate Altera device family
handbook and device-specific documentation. For details about which functions a given DSP block can
implement, refer to the DSP Solutions Center on the Altera website.
For more information about inferring multiply-accumulator and multiply-adder IP cores in HDL code,
refer to the Altera Recommended HDL Coding Styles and the Mentor GraphicsPrecision Synthesis Style
Guide.
Related Information
• Altera DSP Solutions website
• Recommended HDL Coding Styles documentation on page 12-1
Value Description
TRUE The ALTMULT_ADD or ALTMULT_ACCUM IP core is inferred.
FALSE The ALTMULT_ADD or ALTMULT_ACCUM IP core is not inferred.
To control inference, use the extract_mac attribute with the appropriate value from the examples below
in your HDL code.
Send Feedback
QPS5V1
19-20 Controlling DSP Block Inference 2015.11.02
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
USE ieee.std_logic_signed.all;
ENTITY signedmult_add IS
PORT(
a, b, c, d: IN STD_LOGIC_VECTOR (7 DOWNTO 0);
result: OUT STD_LOGIC_VECTOR (15 DOWNTO 0));
ATTRIBUTE preserve_signal: BOOLEANS;
ATTRIBUTE dedicated_mult: STRING;
ATTRIBUTE extract_mac: BOOLEAN;
ATTRIBUTE extract_mac OF signedmult_add: ENTITY IS FALSE;
END signedmult_add;
ARCHITECTURE rtl OF signedmult_add IS
SIGNAL a_int, b_int, c_int, d_int : signed (7 DOWNTO 0);
SIGNAL pdt_int, pdt2_int : signed (15 DOWNTO 0);
SIGNAL result_int: signed (15 DOWNTO 0);
ATTRIBUTE preserve_signal OF pdt_int: SIGNAL IS TRUE;
ATTRIBUTE dedicated_mult OF pdt_int: SIGNAL IS "OFF";
ATTRIBUTE preserve_signal OF pdt2_int: SIGNAL IS TRUE;
ATTRIBUTE dedicated_mult OF pdt2_int: SIGNAL IS "OFF";
Send Feedback
QPS5V1
2015.11.02 RAM and ROM 19-21
BEGIN
a_int <= signed (a);
b_int <= signed (b);
c_int <= signed (c);
d_int <= signed (d);
pdt_int <= a_int * b_int;
pdt2_int <= c_int * d_int;
result_int <= pdt_int + pdt2_int;
result <= STD_LOGIC_VECTOR(result_int);
END rtl;
Related Information
Recommended HDL Coding Styles documentation on page 12-1
Send Feedback
QPS5V1
19-22 Creating Partitions with the incr_partition Attribute 2015.11.02
others in an incremental compilation flow. Only the portions of a design that have been updated must be
recompiled during design iterations. You can make changes and resynthesize one partition in a design to
create a new netlist without affecting the synthesis results or fitting of other partitions.
The following steps show a general flow for partition-based incremental synthesis with Quartus Prime
incremental compilation:
1. Create Verilog HDL or VHDL design files.
2. Determine which hierarchical blocks you want to treat as separate partitions in your design, and
designate the partitions with the incr_partition attribute.
3. Create a project in the Precision RTL Plus Synthesis software and add the HDL design files to the
project.
4. Enable incremental synthesis in the Precision RTL Plus Synthesis software using one of these methods:
• Use the Precision RTL Plus Synthesis GUI to turn on Enable Incremental Synthesis.
• Run the following command in the Transcript Window:
setup_design -enable_incr_synth
5. Run the basic Precision Synthesis flow of compilation, synthesis, and place-and-route on your design.
In subsequent runs, the Precision RTL Plus Synthesis software processes only the parts of the design
that have changed, resulting in a shorter iteration than the initial run. The performance of the
unchanged partitions is preserved.
The Precision RTL Plus Synthesis software sets the netlist types of the unchanged partitions to Post Fit
and the changed partitions to Post Synthesis. You can change the netlist type during timing closure in
the Quartus Prime software to obtain the best QoR.
6. Import the EDIF or VQM netlist for each partition and the top-level .tcl file into the Quartus Prime
software, and set up the Quartus Prime project to use incremental compilation.
7. Compile your Quartus Prime project.
8. If you want, you can change the Quartus Prime incremental compilation netlist type for a partition
with the Design Partitions Window. You can change the Netlist Type to one of the following options:
• To preserve the previous post-fit placement results, change the Netlist Type of the partition to
Post-Fit.
• To preserve the previous routing results, set the Fitter Preservation Level of the partition to
Placement and Routing.
module my_block(
input clk;
output reg [31:0] data_out) /* synthesis incr_partition */ ;
Instance partition:
Send Feedback
QPS5V1
2015.11.02 Creating Multiple Mapped Netlist Files With Separate Precision Projects... 19-23
entity my_block is
port(
clk : in std_logic;
data_out : out std_logic_vector(31 downto 0)
);
attribute incr_partition : boolean;
attribute incr_partition of my_block : entity is true;
end entity my_block;
Instance partition:
component my_block is
port(
clk : in std_logic;
data_out : out std_logic_vector(31 downto 0)
);
end component;
my_block_inst my_block
port map(clk, data_out);
Send Feedback
QPS5V1
19-24 Creating Black Boxes in Verilog HDL 2015.11.02
treated as part of the top-level partition A. Another separate partition, B, contains the logic in blocks B, D,
and E. In a team-based design, different engineers may work on the logic in different partitions. One
netlist is created for the top-level module A and its submodule C, another netlist is created for module B
and its submodules D and E, while a third netlist is created for module F.
Figure 19-2: Partitions in a Hierarchical Design
Partition Top
B C
D E F
Partition B Partition F
To create multiple EDIF netlist files for this design, follow these steps:
1. Generate a netlist file for module B. Use B.v/.vhd, D.v/.vhd, and E.v/.vhd as the source files.
2. Generate a netlist file for module F. Use F.v/.vhd as the source file.
3. Generate a top-level netlist file for module A. Use A.v/.vhd and C.v/.vhd as the source files. Ensure
that you create black boxes for modules B and F, which were optimized separately in the previous
steps.
The goal is to individually synthesize and generate a netlist file for each lower-level module and then
instantiate these modules as black boxes in the top-level file. You can then synthesize the top-level file to
generate the netlist file for the top-level design. Finally, both the lower-level and top-level netlist files are
provided to your Quartus Prime project.
Note: When you make design or synthesis optimization changes to part of your design, resynthesize only
the changed partition to generate the new netlist file. Do not resynthesize the implementations or
projects for the unchanged partitions.
Example 19-24: Verilog HDL Black Box for Top-Level File A.v
Send Feedback
QPS5V1
2015.11.02 Creating Black Boxes in VHDL 19-25
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY A IS
PORT ( data_in : IN INTEGER RANGE 0 TO 15;
clk, e, ld : IN STD_LOGIC;
data_out : OUT INTEGER RANGE 0 TO 15);
END A;
ARCHITECTURE a_arch OF A IS
COMPONENT B PORT(
data_in : IN INTEGER RANGE 0 TO 15;
clk, ld : IN STD_LOGIC;
d_out : OUT INTEGER RANGE 0 TO 15);
END COMPONENT;
COMPONENT F PORT(
d : IN INTEGER RANGE 0 TO 15;
clk, e: IN STD_LOGIC;
q : OUT INTEGER RANGE 0 TO 15);
END COMPONENT;
-- Other component declarations in A.vhd go here
signal cnt_out : INTEGER RANGE 0 TO 15;
BEGIN
U1 : B
PORT MAP (
data_in => data_in,
clk => clk,
ld => ld,
d_out => cnt_out);
U2 : F
PORT MAP (
d => cnt_out,
clk => clk,
e => e,
Send Feedback
QPS5V1
19-26 Creating Quartus Prime Projects for Multiple Netlist Files 2015.11.02
q => data_out);
-- Any other code in A.vhd goes here
END a_arch;
After you complete the steps outlined above, you have different netlist files for each partition of
the design. These files are ready for use with incremental compilation in the Quartus Prime
software.
Related Information
Running the Quartus Prime Software Manually Using the Precision Synthesis-Generated Tcl Script
on page 19-10
Creating a Single Quartus Prime Project for a Standard Incremental Compilation Flow
Use the <top-level project>.tcl file generated for the top-level partition to create your Quartus Prime
project and import all the netlists into this one Quartus Prime project for an incremental compilation
flow. You can optimize all partitions within the single Quartus Prime project and take advantage of the
performance preservation and compilation time reduction that incremental compilation provides.
All the constraints from the top-level implementation are passed to the Quartus Prime software in the
top-level .tcl file, but any constraints made only in the lower-level implementations within the Precision
Synthesis software are not forward-annotated. Enter these constraints manually in your Quartus Prime
project.
Send Feedback
QPS5V1
2015.11.02 Hierarchy and Design Considerations 19-27
Related Information
Best Practices for Incremental Compilation Partitions and Floorplan Assignments on page 14-1
Send Feedback
QPS5V1
19-28 Document Revision History 2015.11.02
Send Feedback
QPS5V1
2015.11.02 Document Revision History 19-29
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
Quartus Prime Standard Edition Handbook Volume 2: Design
Implementation and Optimization
Constraints, sometimes known as assignments or logic options, control the way the Quartus® Prime
software implements a design for an FPGA. Constraints are also central in the way that the TimeQuest
Timing Analyzer and the PowerPlay Power Analyzer inform synthesis, placement, and routing.
There are several types of constraints:
• Global design constraints and software settings, such as device family selection, package type, and pin
count.
• Entity-level constraints, such as logic options and placement assignments.
• Instance-level constraints.
• Pin assignments and I/O constraints.
User-created constraints are contained in one of two files: the Quartus Prime Settings File (.qsf) or, in
the case of timing constraints, the Synopsys Design Constraints file (.sdc). Constraints and
assignments made with the Device dialog box, Settings dialog box, Assignment Editor, Chip Planner,
and Pin Planner are contained in the Quartus Prime Settings File. The .qsf file contains project-wide
and instance-level assignments for the current revision of the project in Tcl syntax. You can create
separate revisions of your project with different settings, and there is a separate .qsf file for each
revision.
The TimeQuest Timing Analyzer uses industry-standard Synopsys Design Constraints, also using Tcl
syntax, that are contained in Synopsys Design Constraints (.sdc) files. The TimeQuest Timing
Analyzer GUI is a tool for making timing constraints and viewing the results of subsequent analysis.
There are several ways to constrain a design, each potentially more appropriate than the others,
depending on your tool chain and design flow. You can constrain designs for compilation and analysis
in the Quartus Prime software using the GUI, as well as using Tcl syntax and scripting. By combining
the Tcl syntax of the .qsf files and the .sdc files with procedural Tcl, you can automate iteration over
several different settings, changing constraints and recompiling.
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V2
1-2 Global Constraints 2015.11.02
The Assignment Editor and Pin Planner make constraint types and values available based on global
design characteristics such as the targeted device. These tools help you verify that your constraints are
valid before compilation by allowing you to pick only from valid values for each constraint.
The TimeQuest Timing Analyzer GUI allows you to make timing constraints in SDC format and view the
effects of those constraints on the timing in your design. Before running the TimeQuest timing analyzer,
you must specify initial timing constraints that describe the clock characteristics, timing exceptions, and
external signal arrival and required times. The Quartus Prime Fitter optimizes the placement of logic in
the device to meet your specified constraints.
Global Constraints
Global constraints affect the entire Quartus Prime project and all of the applicable logic in the design.
Many of these constraints are simply project settings, such as the targeted device selected for the design.
Synthesis optimizations and global timing and power analysis settings can also be applied with globally.
Global constraints are often made when running the New Project Wizard, or in the Device dialog box or
the Settings dialog box, early project development.
Send Feedback
QPS5V2
2015.11.02 Node, Entity, and Instance-Level Constraints 1-3
When you create or update a constraint in the GUI, the Quartus Prime software displays the equivalent
Tcl command in the System tab of the Messages window. You can use the displayed messages as
references when making assignments using Tcl commands.
Related Information
Managing Quartus Prime Projects
For more information about how the Quartus Prime software uses Quartus Prime Settings Files
Send Feedback
QPS5V2
1-4 SDC and the TimeQuest Timing Analyzer 2015.11.02
You can select a cell in the Assignment Editor spreadsheet and locate the corresponding item in another
applicable Quartus Prime software window, such as the Chip Planner. To locate an item from the
Assignment Editor in another window, right-click the item of interest in the spreadsheet, point to Locate,
and click the appropriate command.
You can also locate nodes in the Assignment Editor and other constraint tools from other windows within
the Quartus Prime software. First, select the node or nodes in the appropriate window. For example, select
an entity in the Entity list in the Hierarchy tab in the Project Navigator, or select nodes in the Chip
Planner. Next, right-click the selected object, point to Locate, and click Locate in Assignment Editor.
The Assignment Editor opens, or it is brought to the foreground if it is already open.
Send Feedback
QPS5V2
2015.11.02 Quartus Prime Settings Files and Tcl 1-5
The example shows the way that the set_global_assignment Quartus Prime Tcl command makes all
global constraints and software settings, with set_location_assignment constraining each I/O node in
the design to a physical pin on the device.
However, after you initially create the Quartus Prime Settings File for your design, you can export the
contents to a procedural, executable Tcl (.tcl) file. You can then use that generated script to restore certain
settings after experimenting with other constraints. You can also use the generated Tcl script to archive
your assignments instead of archiving the Quartus Prime Settings file itself.
To export your constraints as an executable Tcl script, on the Project menu, click Generate Tcl File for
Project.
Send Feedback
QPS5V2
1-6 Quartus Prime Settings Files and Tcl 2015.11.02
Send Feedback
QPS5V2
2015.11.02 Timing Analysis with Synopsys Design Constraints and Tcl 1-7
After setting initial values for variables to control constraint creation and whether or not the project needs
to be closed at the end of the script, the generated script checks to see if a project is open. If a project is
open but it is not the correct project, in this case, chiptrip, the script prints Project chiptrip is not
open to the console and does nothing else.
If no project is open, the script determines if chiptrip exists in the current directory. If the project exists,
the script opens the project. If the project does not exist, the script creates a new project and opens the
project.
The script then creates the constraints. After creating the constraints, the script writes the constraints to
the Quartus Prime Settings File and then closes the project.
# ------------------------------------------
set_time_unit ns
set_decimal_places 3
# ------------------------------------------
#
create_clock -period 10.0 -waveform { 0 5.0 } clk2 -name clk2
create_clock -period 4.0 -waveform { 0 2.0 } clk1 -name clk1
# clk1 -> dir* : INPUT_MAX_DELAY = 1 ns
set_input_delay -max 1ns -clock clk1 [get_ports dir*]
# clk2 -> time* : OUTPUT_MAX_DELAY = -2 ns
set_output_delay -max -2ns -clock clk2 [get_ports time*]
Similar to the constraints in the Quartus Prime Settings File, you can make the SDC constraints part of an
executable timing analysis script.
project_open chiptrip
create_timing_netlist
#
# Create Constraints
#
create_clock -period 10.0 -waveform { 0 5.0 } clk2 -name clk2
create_clock -period 4.0 -waveform { 0 2.0 } clk1 -name clk1
# clk1 -> dir* : INPUT_MAX_DELAY = 1 ns
set_input_delay -max 1ns -clock clk1 [get_ports dir*]
# clk2 -> time* : OUTPUT_MAX_DELAY = -2 ns
set_output_delay -max -2ns -clock clk2 [get_ports time*]
#
# Perform timing analysis for several different sets of operating conditions
#
foreach_in_collection oc [get_available_operating_conditions] {
set_operating_conditions $oc
update_timing_netlist
report_timing -setup -npaths 1
report_timing -hold -npaths 1
report_timing -recovery -npaths 1
report_timing -removal -npaths 1
report_min_pulse_width -nworst 1
}
delete_timing_netlist
project_close
The script opens the project, creates a timing netlist, then constrains the two clocks in the design and
applies input and output delay constraints. The clock settings and delay constraints are identical to those
Send Feedback
QPS5V2
1-8 A Fully Iterative Scripted Flow 2015.11.02
in the .sdc file shown in the first example. The next section of the script updates the timing netlist for the
constraints and performs multi-corner timing analysis on the design.
Related Information
• API Functions for Tcl
• About Quartus Prime Tcl Scripting
Send Feedback
QPS5V2
2015.11.02 Document Revision History 1-9
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
Managing Device I/O Pins
2
QPS5V2 Subscribe Send Feedback
This document describes efficient planning and assignment of the I/O pins in your target device. You
should consider I/O standards, pin placement rules, and your PCB characteristics early in the design
phase.
Figure 2-1: Pin Planner GUI
Task and
Report
Windows
Device
Package
View
All Pins
List
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V2
2-2 I/O Planning Overview 2015.11.02
View tailored pin planning advice Tools > Advisors > Pin Advisor
Validate pin assignments against design rules Processing > Start I/O Assignment Analysis
For more information about special pin assignment features for the Arria 10 SoC devices, refer to
Instantiating the HPS Component in the Arria 10 Hard Processor System Technical Reference Manual.
Related Information
Instantiating the HPS Component
Send Feedback
QPS5V2
2015.11.02 Integrating PCB Design Tools 2-3
a. Click Import IP Core to import any defined IP core, and then assign signals to the interface IP
nodes.
b. Click Set Up Top-Level File and assign user nodes to device pins. User nodes become virtual pins
in the top-level file and are not assigned to device pins.
c. Click Generate Top-Level File. Use this file to validate I/O assignments.
4. Assign I/O properties to match your device and PCB characteristics, including assigning logic, I/O
standards, output loading, slew rate, and current strength.
5. Click Run I/O Assignment Analysis in the Tasks pane to validate assignments and generate a
synthesized design netlist. Correct any problems reported.
6. Click Processing > Start Compilation. During compilation, the Quartus Prime software runs I/O
assignment analysis.
Define and validate I/O assignments in the Pin Planner, Mentor Graphics® I/O DesignerCadence
and then export the assignments to the PCB tool for Allegro
validation
Define I/O assignments in your PCB tool, and then import Mentor Graphics® I/O DesignerCadence
the assignments into the Pin Planner for validation Allegro
Send Feedback
QPS5V2
2-4 Integrating PCB Design Tools 2015.11.02
No Validate?
Yes
For more information about incorporating PCB design tools, refer to the Cadence PCB Design Tools
Support and Mentor Graphics PCB Design Tools Support chapters in volume 2 of the Quartus Prime
Handbook.
Related Information
Mentor Graphics PCB Design Tools Support on page 7-1
Send Feedback
QPS5V2
2015.11.02 Altera Device Terms 2-5
Send Feedback
QPS5V2
2-6 Assigning to Exclusive Pin Groups 2015.11.02
Note: You can increase the accuracy of I/O assignment analysis by reserving specific device pins to
accommodate undefined but expected I/O.
To assign I/O pins in the Pin Planner, follow these steps:
1. Open a Quartus Prime project, and then click Assignments > Pin Planner.
2. (Optional) To validate I/O pin assignments in real time, click Processing > Enable Live I/O Check.
3. Click Processing > Start Analysis & Elaboration to elaborate the design and display All Pins in the
device view.
4. To locate or highlight pins for assignment, click Pin Finder or a pin type under Highlight Pins in the
Tasks pane.
5. (Optional) To define a custom group of nodes for assignment, select one or more nodes in the Groups
or All Pins list, and then click Create Group.
6. Enter assignments of logic, I/O standards, interface IP, and properties for device I/O pins in the All
Pins spreadsheet, or by drag and drop into the package view.
7. To assign properties to differential pin pairs, click Show Differential Pin Pair Connections. A red
connection line appears between positive (p) and negative (n) differential pins.
8. (Optional) To create board trace model assignments, right-click an output or bidirectional pin, and
then click Board Trace Model. For differential I/O standards, the board trace model uses a differential
pin pair with two symmetrical board trace models. Specify board trace parameters on the positive end
of the differential pin pair. The assignment applies to the corresponding value on the negative end of
the differential pin pair.
9. To run a full I/O assignment analysis, click Run I/O Assignment Analysis. The Fitter reports analysis
results. Only reserved pins are analyzed prior to design synthesis.
Send Feedback
QPS5V2
2015.11.02 Assigning Differential Pins 2-7
Note: If you have a single-ended clock that feeds a PLL, assign the pin only to the positive clock pin of a
differential pair in the target device. Single-ended pins that feed a PLL and are assigned to the
negative clock pin device cause the design to not fit.
Figure 2-3: Creating a Differential Pin Pair in the Pin Planner
If your design contains a large bus that exceeds the pins available in a particular I/O bank, you can use
edge location assignments to place the bus. Edge location assignments improve the circuit board routing
ability of large buses, because they are close together near an edge. The following shows Altera device
package edges.
Figure 2-4: Die View and Package View of the Four Edges on an Altera Device
Send Feedback
QPS5V2
2-8 Overriding I/O Placement Rules on Differential Pins 2015.11.02
quartus_sh -t <my_tcl_script>.tcl
Related Information
Tcl Scripting on page 5-1
Send Feedback
QPS5V2
2015.11.02 Using Synthesis Attributes 2-9
VHDL Example
entity my_entity is
port(
my_pin1: in std_logic
);
end my_entity;
Use the altera_attribute synthesis attribute to create other pin-related assignments in your
HDL code. The altera_attribute attribute is understood only by Quartus Prime integrated
synthesis and supports all types of instance assignments. The following examples use the
altera_attribute attribute to embed Fast Input Register logic option assignments and I/O
standard assignments in both a Verilog HDL and a VHDL design file.
entity my_entity is
port(
my_pin1: in std_logic
);
end my_entity;
Send Feedback
QPS5V2
2-10 Using Low-Level I/O Primitives 2015.11.02
Related Information
Designing with Low Level Primitives User Guide
Scenario • From your PCB design tool or • From Quartus Prime project for
spreadsheet into Pin Planner during optimization in a PCB design tool
early pin planning or after optimiza‐ • From Quartus Prime project for
tion in PCB tool spreadsheet analysis or use in scripting
• From another Quartus Prime project assignments
with common constraints • From Quartus Prime project for import
into another Quartus Prime project
with similar constraints
File formats .qsf, .esf, .acf, .csv, .txt, .sdc .pin, .fx, .csv, .tcl, .qsf
Send Feedback
QPS5V2
2015.11.02 Importing and Exporting for PCB Tools 2-11
Pin Name/Usage The name of the design pin, or whether the pin is GND or VCC pin
I/O Standard The name of the I/O standard to which the pin is configured
User Assignment Y or N indicating if the location assignment for the design pin was
user assigned (Y) or assigned by the Fitter (N)
Related Information
• Pin-Out Files for Altera Devices
• Mentor Graphics PCB Tools Support on page 7-1
Send Feedback
QPS5V2
2-12 Migrating Assignments to Another Target Device 2015.11.02
Figure 2-5: Device Migration Compatibility (AC24 does not exist in migration device)
The migration result for the pin function of highlighted PIN_AC23 is not an NC but a voltage reference
VREFB1N2 even though the pin is an NC in the migration device. VREF standards have a higher priority
than an NC, thus the migration result display the voltage reference. Even if you do not use that pin for a
port connection in your design, you must use the VREF standard for I/O standards that require it on the
actual board for the migration device.
If one of the migration devices has pins intended for connection to VCC or GND and these same pins are
I/O pins on a different device in the migration path, the Quartus Prime software ensures these pins are
not used for I/O. Ensure that these pins are connected to the correct PCB plane.
When migrating between two devices in the same package, pins that are not connected to the smaller die
may be intended to connect to VCC or GND on the larger die. To facilitate migration, you can connect
these pins to VCC or GND in your original design because the pins are not physically connected to the
smaller die.
Related Information
AN90: SameFrame PinOut Design for FineLine BGA Packages
Send Feedback
QPS5V2
2015.11.02 Validating Pin Assignments 2-13
Live I/O Verifies preliminary, basic I/O legality as you Processing > Enable Live I/O Check
Check enter assignments
I/O Verifies I/O assignment legality of synthesized Processing > Start I/O Assignment
Assignment design against full set of I/O rules for the target Analysis
Analysis device
Advanced I/ Fully validates I/O assignments against all I/O Processing > Start Compilation
O Timing and timing checks during compilation
I/O bank capacity Checks the number of pins assigned to an I/O bank No
against the number of pins allowed in the I/O bank.
I/O bank VCCIO voltage compati‐ Checks that no more than one VCCIO is required for No
bility the pins assigned to the I/O bank.
I/O bank VREF voltage compati‐ Checks that no more than one VREF is required for No
bility the pins assigned to the I/O bank.
I/O standard and location Checks whether the pin location supports the assigned No
conflicts I/O standard.
I/O standard and signal direction Checks whether the pin location supports the assigned No
conflicts I/O standard and direction. For example, certain I/O
standards on a particular pin location can only
support output pins.
Send Feedback
QPS5V2
2-14 I/O Assignment Validation Rules 2015.11.02
Differential I/O standards cannot Checks that open drain is turned off for all pins with a No
have open drain turned on differential I/O standard.
I/O standard and drive strength Checks whether the drive strength assignments are No
conflicts within the specifications of the I/O standard.
Drive strength and location Checks whether the pin location supports the assigned No
conflicts drive strength.
BUSHOLD and location conflicts Checks whether the pin location supports BUSHOLD. No
For example, dedicated clock pins do not support
BUSHOLD.
WEAK_PULLUP and location Checks whether the pin location supports WEAK_ No
conflicts PULLUP (for example, dedicated clock pins do not
support WEAK_PULLUP).
PCI_IO clamp diode, location, and Checks whether the pin location along with the I/O No
I/O standard conflicts standard assigned supports PCI_IO clamp diode.
SERDES and I/O pin location Checks that all pins connected to a SERDES in your Yes
compatibility check design are assigned to dedicated SERDES pin
locations.
PLL and I/O pin location compati‐ Checks whether pins connected to a PLL are assigned Yes
bility check to the dedicated PLL pin locations.
I/O bank can not have single- Checks that no single-ended I/O pin exists in the same No
ended I/O when DPA exists I/O bank as a DPA.
A PLL I/O bank does not support Checks that there are no single-ended I/O pins present No
both a single-ended I/O and a in the PLL I/O Bank when a differential signal exists.
differential signal simultaneously
Single-ended output is required to Checks whether single-ended output pins are a certain No
be a certain distance away from a distance away from a differential I/O pin.
differential I/O pin
Send Feedback
QPS5V2
2015.11.02 Checking I/O Pin Assignments In Real-Time 2-15
Single-ended output has to be a Checks whether single-ended output pins are a certain No
certain distance away from a distance away from a VREF pad.
VREF pad
Single-ended input is required to Checks whether single-ended input pins are a certain No
be a certain distance away from a distance away from a differential I/O pin.
differential I/O pin
Too many outputs or bidirectional Checks that there are no more than a certain number No
pins in a VREFGROUP when a of outputs or bidirectional pins in a VREFGROUP
VREF is used when a VREF is used.
Send Feedback
QPS5V2
2-16 Running Early I/O Assignment Analysis (without Design Files) 2015.11.02
Run I/O assignment analysis during early pin planning to validate initial reserved pin assignments before
compilation. Once you define design files, run I/O assignment analysis to perform more thorough legality
checks with respect to the synthesized netlist. Run I/O assignment analysis whenever you modify I/O
assignments.
The Fitter assigns pins to accommodate your constraints. For example, if you assign an edge location to a
group of LVDS pins, the Fitter assigns pin locations for each LVDS pin in the specified edge location and
then performs legality checks. To display the Fitter-placed pins, click Show Fitter Placements in the Pin
Planner. To accept these suggested pin locations, you must back-annotate your pin assignments.
View the I/O Assignment Warnings report to view and resolve all assignment warnings. For example, a
warning that some design pins have undefined drive strength or slew rate. The Fitter recognizes
undefined, single-ended output and bidirectional pins as non-calibrated OCT. To resolve the warning,
assign the Current Strength, Slew Rate or Slow Slew Rate for the reported pin. Alternatively, you could
assign the Termination to the pin. You cannot assign drive strength or slew rate settings when a pin has
an OCT assignment.
Assignments No
Correct?
Yes
You must reserve all pins you intend to use as I/O pins, so that the Fitter can determine each pin type.
After performing I/O assignment analysis, correct any errors reported by the Fitter and rerun I/O
assignment analysis until all errors are corrected. A complete I/O assignment analysis requires all design
files.
Send Feedback
QPS5V2
2015.11.02 Running I/O Assignment Analysis (with Design Files) 2-17
Assignments No
Correct?
Yes
Even if I/O assignment analysis passes on incomplete design files, you may still encounter errors during
full compilation. For example, you can assign a clock to a user I/O pin instead of assigning it to a
dedicated clock pin, or design the clock to drive a PLL that you have not yet instantiated in the design.
This occurs because I/O assignment analysis does not account for the logic that the pin drives, and does
not verify that only dedicated clock inputs can drive the a PLL clock port.
To obtain better coverage, analyze as much of the design as possible over time, especially logic that
connects to pins. For example, if your design includes PLLs or LVDS blocks, define these files prior to full
analysis. After performing I/O assignment analysis, correct any errors reported by the Fitter and rerun
I/O assignment analysis until all errors are corrected.
Send Feedback
QPS5V2
2-18 Overriding Default I/O Pin Analysis 2015.11.02
The following figure shows the compilation time benefit of performing I/O assignment analysis before
running a full compilation.
Figure 2-8: I/O Assignment Analysis Reduces Compilation Time
Without
Start I/O Assignment Analysis First Full Compilation Second Full Compilation
Command
With
Start I/O Assignment Analysis First Full Compilation
Command
I/O Errors
Assignment Reported
Analysis and Fixed
Compilation T ime
Send Feedback
QPS5V2
2015.11.02 Understanding I/O Analysis Reports 2-19
by a unique output enable. In this worst-case scenario the three pins are inputs, and the other 27 pins are
outputs violating the 20 output pin limit.
Because DDR2 DQS and DQ pins are always driven in the same direction, the analysis reports an error
that is not applicable to your design. The Output Enable Group assignment designates the DQS and DQ
pins as a single group driven by a common output enable for I/O assignment analysis. When you use the
Output Enable Group logic option assignment, the DQS and DQ pins are checked as all input pins or all
output pins and are not in violation of the I/O rules.
You can also use the Output Enable Group assignment to designate pins that are driven only at certain
times. For example, the data mask signal in DDR2 interfaces is an output signal, but it is driven only when
the DDR2 is writing (bidirectional signals are outputs). To avoid I/O assignment analysis errors, use the
Output Enable Group logic option assignment to assign the data mask to the same value as the DQ and
DQS signals.
You can also use the Output Enable Group to designate VREF input pins that are inactive during the
time the outputs are driving. This assignment removes the VREF input pins from the VREF analysis. For
example, the QVLD signal for an RLDRAM II interface is active only during a read. During a write, the
QVLD pin is not active and does not count as an active VREF input pin in the VREF group. Place the
QVLD pins in the same output enable group as the RLDRAM II data pins.
Related Information
TimeQuest Timing Analyzer
Send Feedback
QPS5V2
2-20 Verifying I/O Timing 2015.11.02
Advanced I/O Analyze I/O timing with your board trace model to report accurate, “board-aware”
timing analysis simulation models. Configures a complete board trace model for each I/O standard
or pin. TimeQuest applies simulation results of the I/O buffer, package, and board
trace model to generate accurate I/O delays and system level signal information.
Use this information to improve timing and signal integrity.
I/O timing analysis Analyze I/O timing with default or specified capacitive load without signal
integrity analysis. TimeQuest reports tCO to an I/O pin using a default or user-
specified value for a capacitive load.
Send Feedback
QPS5V2
2015.11.02 Running Advanced I/O Timing 2-21
Full board routing Use Altera-provided or Quartus Prime software-generated IBIS or HSPICE I/O
simulation models for simulation in Mentor Graphics HyperLynx and Synopsys HSPICE.
Note: Advanced I/O timing analysis is supported only for .28nm and larger device families. For devices
that support advanced I/O timing, it is the default method of I/O timing analysis. For all other
devices, you must use a default or user-specified capacitive load assignment to determine tCO and
power measurements.
For more information about advanced I/O timing support, refer to the appropriate device handbook for
your target device. For more information about board-level signal integrity and tips on how to improve
signal integrity in your high-speed designs, refer to the Altera Signal Integrity Center page of the Altera
website.
For information about creating IBIS and HSPICE models with the Quartus Prime software and
integrating those models into HyperLynx and HSPICE simulations, refer to theSignal Integrity Analysis
with Third Party Tools chapter in volume 2 of the Quartus Prime Handbook.
Related Information
• Literature and Technical Documentation
• Altera Signal Integrity Center
• Signal Integrity Analysis with Third-Party Tools on page 6-1
Send Feedback
QPS5V2
2-22 Understanding the Board Trace Models 2015.11.02
The following figure shows the template for the LVDS I/O standard. The far-end capacitance (Cf)
represents the external-device or multiple-device capacitive load. If you have multiple devices on the
far-end, you must find the equivalent capacitance at the far-end, taking into account all receiver
capacitances. The far-end capacitance can be the sum of all the receiver capacitances.
The Quartus Prime software models lossless transmission lines, and does not require a transmission-line
resistance value. Only distributed inductance (L) and capacitance (C) values are needed. The distributed L
and C values of transmission lines must be entered on a per-inch basis, and can be obtained from the PCB
vendor or manufacturer, the CAD Design tool, or a signal integrity tool, such as the Mentor Graphics
Hyperlynx software.
Send Feedback
QPS5V2
2015.11.02 Defining the Board Trace Model 2-23
## setting the near end series resistance model of sel_p output pin to 25
ohms
Send Feedback
QPS5V2
2-24 Modifying the Board Trace Model 2015.11.02
Related Information
Board Trace Model
For more information about configuring component values for a board trace model, including a complete
list of the supported unit prefixes and setting the values with Tcl scripts, refer to Quartus Prime Help.
Board Trace Model Summarizes the board trace model component settings for each output and
Assignments report bidirectional signal.
Signal Integrity Metrics Contains all the signal integrity metrics calculated during advanced I/O
report timing analysis based on the board trace model settings for each output or
bidirectional pin. Includes measurements at both the FPGA pin and at the
far-end load of board delay, steady state voltages, and rise and fall times.
Note: By default, the TimeQuest analyzer generates the Slow-Corner Signal Integrity Metrics report. To
generate a Fast-Corner Signal Integrity Metrics report you must change the delay model by clicking
Tools > TimeQuest Timing Analyzer.
Send Feedback
QPS5V2
2015.11.02 Adjusting I/O Timing and Power with Capacitive Loading 2-25
Related Information
The TimeQuest Timing Analyzer
Related Information
Simultaneous Switching Noise (SSN) Analysis and Optimization
Scripting API
You can alternatively use Tcl commands to access I/O management functions, rather than using the GUI.
For detailed information about specific scripting command options and Tcl API packages, type the
following command at a system command prompt to view the Tcl API Help browser:
quartus_sh --qhelp
Related Information
• Tcl Scripting on page 5-1
• Command Line Scripting on page 4-1
Send Feedback
QPS5V2
2-26 Generate Mapped Netlist 2015.11.02
Reserve Pins
Use the following Tcl command to reserve a pin:
set_instance_assignment -name RESERVE_PIN <value> -to <signal name>
Note: You must include the quotation marks when specifying the reserved pin value.
Set Location
Use the following Tcl command to assign a signal to a pin or device location:
Valid locations are pin locations, I/O bank locations, or edge locations. Pin locations include pin names,
such as PIN_A3. I/O bank locations include IOBANK_1 up to IOBANK_ n, where n is the number of I/O
banks in the device.
Use one of the following valid edge location values:
• EDGE_BOTTOM
• EDGE_LEFT
• EDGE_TOP
• EDGE_RIGHT
Send Feedback
QPS5V2
2015.11.02 Slew Rate and Current Strength 2-27
Related Information
Altera Device Package Information Data Sheet
2014.12.15 14.1.0 • Updated Live I/O check device support to include only limited device
families.
2014.08.30 14.0a10.0 • Added link to information about special pin assignment features for
Arria 10 SoC devices.
May 2013 13.0.0 • Added information about overriding I/O placement rules.
November 2012 12.1.0 • Updated Pin Planner description for new task and report windows.
Send Feedback
QPS5V2
2-28 Document Revision History 2015.11.02
November 2009 9.1.0 • Reorganized entire chapter to include links to Help for procedural
information previously included in the chapter
• Added documentation on near-end and far-end advanced I/O timing
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
Simultaneous Switching Noise (SSN) Analysis
and Optimizations 3
QPS5V2 Subscribe Send Feedback
Definitions
The terminology used in this chapter includes the following terms:
• Aggressor: An output or bidirectional signal that contributes to the noise for a victim I/O pin
• PDN: Power distribution network
• QH: Quiet high signal level on a pin
• QHN: Quiet high noise on a pin, measured in volts
• QL: Quiet low signal level on a pin
• QLN: Quiet low noise on a pin, measured in volts
• SI: Signal integrity (a superset of SSN, covering all noise sources)
• SSN: Simultaneous switching noise
• SSO: Simultaneous switching output (which are either the output or bidirectional pins)
• Victim: An input, output, or bidirectional pin that is analyzed during SSN analysis. During SSN
analysis, each pin is analyzed as a victim. If a pin is an output or bidirectional pin, the same pin acts as
an aggressor signal for other pins.
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V2
3-2 Understanding SSN 2015.11.02
Understanding SSN
SSN is defined as a noise voltage induced onto a single victim I/O pin on a device due to the switching
behavior of other aggressor I/O pins on the device. SSN can be divided into two types of noise: voltage
noise and timing noise.
In a sample system with three pins, two of the pins (A and C) are switching, while one pin (B) is quiet. If
the pins are driven in isolation, the voltage waveforms at the output of the buffers appear without noise
interference, as shown by the solid curves at the left of the figure. However, when pins A and C are
switching simultaneously, the noise generated by the switching is injected onto other pins. This noise
manifests itself as a voltage noise on pin B and timing noise on pins A and C.
Figure 3-1: System with Three Pins
In this figure, the dotted curves show the voltage noise on pin B and timing noise on pins A and C.
Voltage noise is measured as the change in voltage of a signal due to SSN. When a signal is QH, it is
measured as the change in voltage toward 0 V. When a signal is QL, it is measured as the change in
voltage toward VCC.
In the Quartus Prime software, only voltage noise is analyzed. Voltage noise can be caused by SSOs under
two worst-case conditions:
• The victim pin is high and the aggressor pins (SSOs) are switching from low to high
• The victim pin is low and the aggressor pins (SSOs) are switching from high to low
Send Feedback
QPS5V2
2015.11.02 Understanding SSN 3-3
Victim pin B
1
A
0
1
B
0
1
C
0
SSN can occur in any system, but the induced noise does not always result in failures. Voltage functional
errors are caused by SSN on quiet victim pins only when the voltage values on the quiet pins change by a
large voltage that the logic listening to that signal reads a change in the logic value. For QH signals, a
voltage functional error occurs when noise events cause the voltage to fall below VIH. Similarly, for QL
signals, a voltage functional error occurs when noise events cause the voltage to rise above VIL. Because
VIH and VIL of the Altera device are different for different I/O standards, and because signals have
different quiet voltage values, the absolute amount of SSN, measured in volts, cannot be used to determine
if a voltage failure occurs. Instead, to assess the level of impact by SSN in the SSN analysis, the Quartus
Prime sofware quantifies the SSN in terms of the percentage of signal margin in Altera devices.
Send Feedback
QPS5V2
3-4 SSN Estimation Tools 2015.11.02
The figure shows four noise events, two on QH signals and two on QL signals. The two noise events on
the right-side of the figure consume 50 percent of the signal margin and do not cause voltage functional
errors. However, the two noise events on the left side of the figure consume 100 percent of the signal
margin, which can cause a voltage functional error.
Noise caused by aggressor signals are synchronously related to the victim pin outside of the sampling
window of a receiver. This noise affects the switching time of a victim pin, but are not considered an input
threshold violation failure.
Figure 3-5: Synchronous Voltage Noise with No Functional Error
Related Information
SSN Analysis Overview on page 3-5
Send Feedback
QPS5V2
2015.11.02 SSN Analysis Overview 3-5
Altera provides many tools for SSN analysis and estimation, including the following tools:
• SSN characterization reports
• An early SSN estimation (ESE) tool
• The SSN Analyzer in the Quartus Prime software
The ESE tool is useful for preliminary SSN analysis of your FPGA design; for more accurate results,
however, you must use the SSN Analyzer in the Quartus Prime software.
Related Information
Signal Integrity Center
For more information on the Altera website about the SSN characterization reports and the ESE tool,
including device support information.
Send Feedback
QPS5V2
3-6 Performing Early Pin-Out SSN Analysis 2015.11.02
criteria, so that you do not spend too much time optimizing the on-FPGA portions of your design when
the SSN metrics for the design may improve after the design is fully specified.
Figure 3-6: Early Flow and Final Pin-Out SSN Analysis
Start
Yes
No Yes
Manual optimization
Design PCB & Extract
Yes board parameters
Can we further No
constrain PCB?
Run Quartus Prime & Yes
No
Noise < final pass? Done
SSN Analyzer
Design is unlikely to
pass final SSN Analysis
Note :
1. Pass criteria determined by customer requirements.
Send Feedback
QPS5V2
2015.11.02 Performing Final Pin-Out SSN Analysis 3-7
specific information, it uses default board trace models and board layer information for SSN analysis, and
as a result the SSN Analyzer confidence level is low. If the noise amounts are larger than the pass criteria
for early pin-out SSN analysis, verify whether the SSN noise violations are true failures or false failures.
For example, sometimes the SSN Analyzer can determine whether pins are switching synchronously and
use that information to filter false positives; however, it may not be able to determine all the synchronous
groups. You can improve the SSN analysis results by adjusting your I/O assignments and other design
settings. After you optimize your design such that it meets the pass criteria for the early pin-out flow, you
can then begin to design your PCB.
If you have complete information for the top-level ports of your design, you can use the SSN Analyzer to
perform an initial SSN evaluation. Use the following steps to perform early pin-out SSN analysis:
1. Create a project in the Quartus Prime software.
2. Specify your top-level design information either in schematic form or in HDL code.
3. Perform Analysis and Synthesis.
4. Create I/O assignments, such as I/O standard assignments, for the top-level ports in your design.
Note: Do not create pin location assignments. The Fitter automatically creates optimized pin location
assignments.
5. If you do not have completed design files and timing constraints, run I/O assignment analysis.
Note: During I/O assignment analysis, the Fitter places all the unplaced pins on the device, and checks
all the I/O placement rules.
6. Run the SSN Analyzer.
Related Information
• Optimizing Your Design for SSN Analysis on page 3-8
• Managing Quartus Prime Projects
For more information about creating and managing projects.
• I/O Management on page 2-1
For more about generating a top-level design file in the Quartus Prime software and I/O assignment
analysis.
Send Feedback
QPS5V2
3-8 Design Factors Affecting SSN Results 2015.11.02
Related Information
Optimizing Your Design for SSN Analysis on page 3-8
Related Information
Signal Integrity Center
For more information on the Altera website about the factors that contribute to SSN voltage noise in your
FPGA design and managing SSN in your system.
Send Feedback
QPS5V2
2015.11.02 Optimizing Pin Placements for Signal Integrity 3-9
Send Feedback
QPS5V2
3-10 Specifying Board Trace Model Settings 2015.11.02
Related Information
• Show Commands
For more information about the Show Fitter Placements feature, refer to Quartus Prime Help.
• Area Optimization
• Compilation Time Optimization
• Timing Optimization
For more information about design optimization features, refer to the Quartus Prime Handbook.
The best way to calculate transmission line parameters is to use a two-dimensional solver to estimate the
inductance per inch and capacitance per inch for the transmission line. The termination resistor topology
information can be obtained from the PCB schematics. The near-end and far-end pin load (capacitance)
values can be obtained from the PCB schematic and other device data sheets. For example, if you know
that an FPGA pin is driving a DIMM, you can obtain the far-end loading information in the data sheet for
your target device.
Related Information
• Understanding the SSN Reports on page 3-15
For more information about the default parameters used by the SSN Analyzer and SSN confidence
levels reported in the Confidence Metric Details Report.
• I/O Management on page 2-1
For more information about defining board trace models and advanced I/O timing , refer to the
Quartus Prime Handbook.
Send Feedback
QPS5V2
2015.11.02 Defining PCB Layers and PCB Layer Thickness 3-11
The cross-section shows the stackup information of a PCB, which tells you the number of layers used in
your PCB. The PCB shown in this example consists of various signal and circuit layers on which FPGA
pins are routed, as well as the power and ground layers.
Send Feedback
QPS5V2
3-12 Defining PCB Layers and PCB Layer Thickness 2015.11.02
Figure 3-9: Snapshot of Stackup of a PCB Shown in the Allegro Board Design Environment
In this example, each of the four signal layers are a different thickness, with the depths shown in the
Thickness (MIL) column. The layer thickness for each signal layer is computed as follows:
• Signal Layer 1 is the L4-SIGNAL, at thickness (1.9+3.6+1.2+3+1.2+4=) 14.9 mils
• Signal Layer 2 is the L5-SIGNAL, at thickness (0.6+6=) 6.6 mils
• Signal Layer 3 is the L8-SIGNAL, at thickness (0.6+4+1.2+3+1.2+4=) 14 mils
• Signal Layer 4 is the L9-SIGNAL, at thickness (0.6+6=) 6.6 mils
Figure 3-10: PCB Layers and Thickness Assignments Specified in the Quartus Prime Software
Send Feedback
QPS5V2
2015.11.02 Specifying Signal Breakout Layers 3-13
Send Feedback
QPS5V2
3-14 Excluding Pins as Aggressor Signals 2015.11.02
assignments for specific types of pins. Use the following group assignments to decrease the pessimism in
SSN analysis results:
• Assign pins to an output enable group—All pins in an output enable group must be either all input
pins or all output pins. If all the pins in a group are always either all inputs or all outputs, it is
impossible for an output pin in the group to cause SSN noise on an input pin in the group. You can
assign pins to an output enable group with the Output Enable Group logic option.
• Assign pins to a synchronous group—I/O pins that are part of a synchronous group (signals that
switch at the same time) may cause SSN, but do not result in any failures because the noise glitch
occurs during the switching period of the signal. The noise, therefore, does not occur in the sampling
window of that signal. You can assign pins to an output enable group with the Synchronous Group
logic option. For example, in your design you have a bus with 32 pins that all belong to the same
group. In a real operation, the bus switches at the same time, so any voltage noise induced by a pin on
its groupmates does not matter, because it does not fall in the sampling window. If you do not assign
the bus to a synchronous group, the other 31 pins can act as aggressors for the first pin in that group,
leading to higher QL and QH noise levels during SSN analysis.
In some cases, the SSN Analyzer can detect the grouping for bidirectional pins by looking at the output
enable signal of the bidirectional pins. However, Altera recommends that you explicitly specify the
bidirectional groups and output groups in your design.
Send Feedback
QPS5V2
2015.11.02 Understanding the SSN Reports 3-15
Summary Report
The Summary report summarizes the SSN Analyzer status and rates the SSN Analyzer confidence level as
low, medium, or high.
The confidence level depends on the completeness of your board trace model assignments. The more
assignments you complete, the higher the confidence level. However, the confidence level does not always
contribute to the accuracy of the QL and QH noise levels on a victim pin. The accuracy of QH and QL
noise levels depends the accuracy of your board trace model assignments.
Send Feedback
QPS5V2
3-16 Decreasing Processing Time for SSN Analysis 2015.11.02
The QL and QH results for each pin are displayed with a different color that represents whether the pin is
below the warning threshold, below the critical threshold, or above the critical threshold. This color
representation is also referred to as the SSN map of your FPGA device.
When you view the SSN map, you can customize which details to display, including input pins, output
pins, QH signals, QL signals, and noise levels. You can also adjust the threshold levels for QH and QL
noise voltages. Adjusting the threshold levels in the Pin Planner does not change the threshold levels
reported during SSN analysis and does not change the data in any of the SSN reports.
You can also you change I/O assignments and board trace information and rerun the SSN Analyzer to
view the SSN analysis results based on those modified settings.
Related Information
Show SSN Analyzer Results
Scripting Support
A Tcl script allows you to run procedures and determine settings. You can also run some of these
procedures at a command prompt.
The Quartus Prime software provides several packages to compile your design and create I/O assignments
for analysis and fitting. You can create a custom Tcl script that maps the design and runs SSN analysis on
your design.
Send Feedback
QPS5V2
2015.11.02 Optimizing Pin Placements for Signal Integrity 3-17
For detailed information about specific scripting command options and Tcl API packages, type the
following command at a system command prompt to run the Quartus Prime Command-Line and Tcl API
Help browser:
quartus_sh --qhelp
Related Information
• Tcl Scripting on page 5-1
• Command-Line Scripting on page 4-1
For more information about Quartus Prime scripting support, including examples, refer to the
Quartus Prime Handbook.
• API Functions for Tcl
For more information about Quartus Prime scripting support, including examples, refer to Quartus
Prime Help.
Related Information
Optimizing Pin Placements for Signal Integrity on page 3-9
These Tcl commands specify that there are seven PCB layers in the design, each with a different thickness.
In each assignment, the letter M indicates the unit of measurement is millimeters. When you specify PCB
layer assignments with Tcl commands, you must list the layers in consecutive order. For example, you
would receive an error during SSN Analysis if your Tcl commands created the following assignments:
Send Feedback
QPS5V2
3-18 Specifying Signal Breakout Layers 2015.11.02
To create assignments with the unit of measurement in mils, refer to the syntax in the following Tcl
commands.
Related Information
Defining PCB Layers and PCB Layer Thickness on page 3-11
When you create PCB breakout layer assignments with Tcl commands, if you do not specify a PCB layer,
or if you specify a PCB layer that does not exist, the SSN Analyzer breaks out the signal at the bottommost
PCB layer.
Note: If you create a PCB layer breakout assignment to a layer that does not exist, the SSN Analyzer will
generate a warning message.
The following Tcl command assigns the bus PCI_ADD_io to a synchronous group:
Related Information
Decreasing Pessimism in SSN Analysis on page 3-13
To analyze just one I/O bank, type the following command at a system command prompt:
Send Feedback
QPS5V2
2015.11.02 Document Revision History 3-19
For example, to run analyze the I/O bank 2A type the following command:
For more information about the quartus_si package, type quartus_si -h at a system command
prompt.
Related Information
Performing SSN Analysis and Viewing Results on page 3-14
November 9.1.0 • Added “Figure 6–9 shows the layout cross-section of a PCB in the
2009 Cadence Allegro PCB tool. The cross-section shows the stackup
information of a PCB, which tells you the number of layers used in
your PCB. The PCB shown in this example consists of various signal
and circuit layers on which FPGA pins are routed, as well as the power
and ground layers.” on page 6–12
• Updated for the Quartus Prime software 9.1 release
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
Command Line Scripting
4
QPS5V2 Subscribe Send Feedback
FPGA design software that easily integrates into your design flow saves time and improves productivity.
The Altera Quartus Prime software provides you with a command-line executable for each step of the
FPGA design flow to make the design process customizable and flexible.
The benefits provided by command-line executables include:
• Command-line control over each step of the design flow
• Reduced memory requirements
• Improved performance
The command-line executables are also completely interchangable with the Quartus Prime GUI,
allowing you to use the exact combination of tools that you prefer.
Related Information
Using the Quartus Prime Executables in Shell Scripts
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V2
4-2 Introductory Example 2015.11.02
Introductory Example
The following introduction to command-line executables demonstrates how to create a project, fit the
design, and generate programming files.
The tutorial design included with the Quartus Prime software is used to demonstrate this functionality. If
installed, the tutorial design is found in the <Quartus Prime directory>/qdesigns/fir_filter directory.
Before making changes, copy the tutorial directory and type the four commands shown in the introduc‐
tory example below at a command prompt in the new project directory.
The <Quartus Prime directory>/quartus/bin directory must be in your PATH environment variable.
family and performs logic synthesis and technology mapping on the design files.
The quartus_fit filtref --part=<part> --pack_--
pack_register=minimize_arearegister=minimize_area command performs fitting on the filtref
project. This command specifies the device, and directs the Fitter to pack sequential and combinational
functions into single logic cells to reduce device resource usage.
The quartus_asm filtref command creates programming files for the filtref project.
The quartus_sta filtref command performs basic timing analysis on the filtref project using the
Quartus Prime TimeQuest Timing Analyzer, reporting worst-case setup slack, worst-case hold slack, and
other measurements.
You can put the four commands from the introductory example into a batch file or script file, and run
them. For example, you can create a simple UNIX shell script called compile.sh, which includes the code
shown in the UNIX shell script example below.
#!/bin/sh
PROJECT=filtref
TOP_LEVEL_FILE=filtref.bdf
FAMILY=”Cyclone V”
PART=EP3C10F256C8
PACKING_OPTION=minimize_area
quartus_map $PROJECT --source=$TOP_LEVEL_FILE --family=$FAMILY
quartus_fit $PROJECT --part=$PART --pack_register=$PACKING_OPTION
quartus_asm $PROJECT
quartus_sta $PROJECT
#!/bin/sh
PROJECT=filtref
TOP_LEVEL_FILE=filtref.bdf
FAMILY=”Arria 10”
PART=<part>
PACKING_OPTION=minimize_area
Send Feedback
QPS5V2
2015.11.02 Command-Line Scripting Help 4-3
quartus_sh --qhelp
This command starts the Quartus Prime Command-Line and Tcl API Help browser, a viewer for
information about the Quartus Prime Command-Line executables and Tcl API.
Use the -h option with any of the Quartus Prime Command-Line executables to get a description and list
of supported options. Use the --help=<option name> option for detailed information about each option.
Send Feedback
QPS5V2
4-4 Project Settings with Command-Line Options 2015.11.02
Figure 4-1: Quartus Prime Command-Line and Tcl API Help Browser
Related Information
• Option Precedence on page 4-4
• Tcl Scripting on page 5-1
• QSF Reference Manual
Option Precedence
If you use command-line executables, you must be aware of the precedence of various project assignments
and how to control the precedence. Assignments for a particular project exist in the Quartus Prime
Settings File (.qsf) for the project. Before the .qsf is updated after assignment changes, the updated
assignments are reflected in compiler database files that hold intermediate compilation results.
Send Feedback
QPS5V2
2015.11.02 Option Precedence 4-5
All command-line options override any conflicting assignments found in the .qsf or the compiler database
files. There are two command-line options to specify whether the .qsf or compiler database files take
precedence for any assignments not specified as command-line options.
Any assignment not specified as a command-line option or found in the .qsf or compiler database file is
set to its default value.
The file precedence command-line options are --read_settings_files and --write_settings_files.
By default, the --read_settings_files and --write_settings_files options are turned on. Turning
on the --read_settings_files option causes a command-line executable to read assignments from
the .qsf instead of from the compiler database files. Turning on the --write_settings_files option
causes a command-line executable to update the .qsf to reflect any specified options, as happens when you
close a project in the Quartus Prime GUI.
If you use command-line executables, be aware of the precedence of various project assignments and how
to control the precedence. Assignments for a particular project can exist in three places:
• The .qsf for the project
• The result of the last compilation, in the /db directory, which reflects the assignments that existed
when the project was compiled
• Command-line options
The precedence for reading assignments depends on the value of the --read_settings_files option.
The table lists the locations to which assignments are written, depending on the value of the --
write_settings_files command-line option.
Send Feedback
QPS5V2
4-6 Compilation with quartus_sh --flow 2015.11.02
The example assumes that a project named fir_filter exists, and that the analysis and synthesis step has
been performed.
The first command, quartus_fit fir_filter --pack_register=off, runs the quartus_fit executable
with no aggressive attempts to reduce device resource usage.
The second command, quartus_sta fir_filter, performs basic timing analysis for the results of the
previous fit.
The third command uses the UNIX mv command to copy the report file output from quartus_sta to a file
with a new name, so that the results are not overwritten by subsequent timing analysis.
The fourth command runs quartus_fit a second time, and directs it to attempt to pack logic into registers
to reduce device resource usage. With the --write_settings_files=off option, the command-line
executable does not update the .qsf to reflect the changed register packing setting. Instead, only the
compiler database files reflect the changed setting. If the --write_settings_files=off option is not
specified, the command-line executable updates the .qsf to reflect the register packing setting.
The fifth command reruns timing analysis, and the sixth command renames the report file, so that it is
not overwritten by subsequent timing anlysis.
Use the options --read_settings_files=off and --write_settings_files=off (where appropriate)
to optimize the way that the Quartus Prime software reads and updates settings files. In the following
example, the quartus_asm executable does not read or write settings files because doing so would not
change any settings for the project.
Send Feedback
QPS5V2
2015.11.02 Text-Based Report Files 4-7
Quartus Shell
quartus_sh
Use the quartus_sh executable with the --flow option to perform a complete compilation flow with a
single command. The --flow option supports the smart recompile feature and efficiently sets command-
line arguments for each executable in the flow.
The following example runs compilation, timing analysis, and programming file generation with a single
command:
Tip: For information about specialized flows, type quartus_sh --help=flow at a command prompt.
Send Feedback
QPS5V2
4-8 Using Command-Line Executables In Scripts 2015.11.02
Report file names contain the revision name and the short-form name of the executable that generated the
report file, in the format <revision>.<executable>.rpt. For example, using the quartus_fit executable to
place and route a project with the revision name design_top generates a report file named design_
top.fit.rpt. Similarly, using the quartus_sta executable to perform timing analysis on a project with the
revision name fir_filter generates a report file named fir_filter.sta.rpt.
As an alternative to parsing text-based report files, you can use the ::quartus::report Tcl package.
Related Information
Tcl Scripting on page 5-1
#!/bin/sh
# Run synthesis first.
# This example assumes you use Synplify software
synplify -batch synthesize.tcl
# If your Quartus Prime project exists already, you can just
# recompile the design.
# You can also use the script described in a later example to
# create a new project from scratch
quartus_sh --flow compile myproject
# Use the quartus_sta executable to do fast and slow-model
# timing analysis
quartus_sta myproject --model=slow
quartus_sta myproject --model=fast
# Use the quartus_eda executable to write out a gate-level
# Verilog simulation netlist for ModelSim
quartus_eda my_project --simulation --tool=modelsim --format=verilog
# Perform the simulation with the ModelSim software
vlib cycloneV_ver
vlog -work cycloneV_ver /opt/quartusii/eda/sim_lib/cycloneV_atoms.v
vlib work
vlog -work work my_project.vo
vsim -L cycloneV_ver -t 1ps work.my_project
Related Information
Tcl Scripting on page 5-1
Send Feedback
QPS5V2
2015.11.02 Common Scripting Examples 4-9
Save the script in a file called setup_proj.tcl and type the commands illustrated in the eample at a
command prompt to create the design, apply constraints, compile the design, and perform fast-corner
and slow-corner timing analysis. Timing analysis results are saved in two files, filtref_sta_1.rpt and filtref_
sta_2.rpt.
quartus_sh -t setup_proj.tcl
quartus_map filtref
quartus_fit filtref
quartus_asm filtref
quartus_sta filtref --model=fast --export_settings=off
mv filtref_sta.rpt filtref_sta_1.rpt
quartus_sta filtref --export_settings=off
mv filtref_sta.rpt filtref_sta_2.rpt
Type the following commands to create the design, apply constraints, and compile the design, without
performing timing analysis:
quartus_sh -t setup_proj.tcl
quartus_sh --flow compile filtref
The quartus_sh --flow compile command performs a full compilation, and is equivalent to clicking
the Start Compilation button in the toolbar.
Send Feedback
QPS5V2
4-10 Create a Project and Synthesize a Netlist Using Netlist Optimizations 2015.11.02
The script checks the exit code of the quartus_map executable to determine whether there is an error
during the syntax check. Files with syntax errors are added to the FILES_WITH_ERRORS variable, and when
all files are checked, the script prints a message indicating syntax errors.
When options are not specified, the executable uses the project database values. If not specified in the
project database, the executable uses the Quartus Prime software default values. For example, the
fir_filter project is set to target the Cyclone device family, so it is not necessary to specify the --family
option.
#!/bin/sh
FILES_WITH_ERRORS=""
# Iterate over each file with a .bdf or .v extension
for filename in `ls *.bdf *.v`
do
# Perform a syntax check on the specified file
quartus_map fir_filter --analyze_file=$filename
# If the exit code is non-zero, the file has a syntax error
if [ $? -ne 0 ]
then
FILES_WITH_ERRORS="$FILES_WITH_ERRORS $filename"
fi
done
if [ -z "$FILES_WITH_ERRORS" ]
then
echo "All files passed the syntax check"
exit 0
else
echo "There were syntax errors in the following file(s)"
echo $FILES_WITH_ERRORS
exit 1
fi
Send Feedback
QPS5V2
2015.11.02 Perform I/O Assignment Analysis 4-11
The archive file is automatically named <project name>.qar. If you want to use a different name, type the
command with the -output option as shown in example the example.
To restore a project archive, type the command shown in the example at a command prompt.
The command restores the project archive to the current directory and overwrites existing files.
Related Information
Managing Quartus Prime Projects
The example shows the commands for a DOS batch file for this example. With a DOS batch file, you can
specify the project name and the revision name once for both commands. To create the DOS batch file,
paste the following lines into a file called update_memory.bat.
To run the batch file, type the following command at a command prompt:
quartus_cpf -w <filename>.opt
Send Feedback
QPS5V2
4-12 Fit a Design as Quickly as Possible 2015.11.02
This interactive command guides you through some questions, then creates an option file based on your
answers. Use --option to cause quartus_cpf to use the option file. For example, the following command
creates a compressed .pof that targets an EPCS64 device:
Alternatively, you can use the Convert Programming Files utility in the Quartus Prime software GUI to
create a Conversion Setup File (.cof). Configure any options you want, including compression, then save
the conversion setup. Use the following command to run the conversion setup you specified.
To attempt to fit the project called top as quickly as possible, type the command shown at a command
prompt.
#!/bin/sh
ERROR_SEEDS=""
quartus_map fir_filter --rev=filtref
# Iterate over a number of seeds
for seed in 1 2 3 4 5
do
echo "Starting fit with seed=$seed"
# Perform a fitting attempt with the specified seed
quartus_fit fir_filter --seed=$seed --rev=filtref
# If the exit-code is non-zero, the fitting attempt was
# successful, so copy the project to a new directory
if [ $? -eq 0 ]
then
mkdir ../fir_filter-seed_$seed
mkdir ../fir_filter-seed_$seed/db
cp * ../fir_filter-seed_$seed
Send Feedback
QPS5V2
2015.11.02 The QFlow Script 4-13
cp db/* ../fir_filter-seed_$seed/db
else
ERROR_SEEDS="$ERROR_SEEDS $seed"
fi
done
if [ -z "$ERROR_SEEDS" ]
then
echo "Seed sweeping was successful"
exit 0
else
echo "There were errors with the following seed(s)"
echo $ERROR_SEEDS
exit 1
fi
Tip: Use Design Space Explorer II (DSE) included with the Quartus Prime software script (by typing
quartus_dse at a command prompt) to improve design performance by performing automated seed
sweeping.
To view floorplans or perform other GUI-intensive tasks, launch the Quartus Prime software.
Start QFlow by typing the following command at a command prompt:
quartus_sh -g
Send Feedback
QPS5V2
4-14 Document Revision History 2015.11.02
July 2010 10.0.0 Updated script examples to use quartus_sta instead of quartus_tan, and
other minor updates throughout document.
November 9.1.0 Updated Table 2–1 to add quartus_jli and quartus_jbcc executables and
2009 descriptions, and other minor updates throughout document.
March 2009 9.0.0 No change to content.
Send Feedback
QPS5V2
2015.11.02 Document Revision History 4-15
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
Tcl Scripting
5
QPS5V2 Subscribe Send Feedback
Tcl Scripting
You can use Tcl scripts to control the Altera® Quartus Prime software and to perform a wide range of
functions, such as compiling a design or scripting common tasks.
For example, use Tcl scripts to perform the following tasks:
• Manage a Quartus Prime project
• Make assignments
• Define design constraints
• Make device assignments
• Compile your design
• Perform timing analysis
• Access reports
Tcl scripts also facilitate project or assignment migration. For example, when designing in different
projects with the same prototype or development board, you can write a script to automate reassignment
of pin locations in each new project. The Quartus Prime software can also generate a Tcl script based on
all the current assignments in the project, which aids in switching assignments to another project.
The Quartus Prime software Tcl commands follow the EDA industry Tcl application programming
interface (API) standards for command-line options. This simplifies learning and using Tcl commands. If
you encounter an error with a command argument, the Tcl interpreter includes help information showing
correct usage.
This chapter includes sample Tcl scripts for automating tasks in the Quartus Prime software. You can
modify these example scripts for use with your own designs. You can find more Tcl scripts in the Design
Examples section of the Support area on the Altera website.
Related Information
Design Examples page on the Altera website
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V2
5-2 Tool Command Language 2015.11.02
Related Information
• External References on page 5-23
For a list of recommended literature on Tcl.
• Tcl Scripting Basics on page 5-18
For more information on Tcl scripting, or if you are are a Tcl beginner.
• tcl.activestate.com/
Send Feedback
QPS5V2
2015.11.02 Quartus Prime Tcl Packages 5-3
synthesis_report Contain the set of Tcl functions for the Dynamic Synthesis Report tool
tdc Obtain information from the TimeQuest Timing Analyzer
By default, only the minimum number of packages loads automatically with each Quartus Prime
executable. This keeps the memory requirement for each executable as low as possible. Because the
number of packages that the Quartus Prime executable loads is limited, you must load other packages
before you can run commands in those packages.
Because different packages are available in different executables, you must run your scripts with executa‐
bles that include the packages you use in the scripts. For example, if you use commands in the sdc_ext
package, you must use the quartus_sta executable to run the script because the quartus_sta executable
is the only one with support for the sdc_ext package.
The following command prints lists of the packages loaded or available to load for an executable, to the
console:
<executable name> --tcl_eval help
Send Feedback
QPS5V2
5-4 Loading Packages 2015.11.02
For example, type the following command to list the packages loaded or available to load by the quartus_
fit executable:
Loading Packages
To load a Quartus Prime Tcl package, use the load_package command as follows:
This command is similar to the package require Tcl command, but you can easily alternate between
different versions of a Quartus Prime Tcl package with the load_package command because of the -
version option.
Related Information
Command-Line Scripting on page 4-1
For additional information about these and other Quartus Prime command-line executables.
quartus_sh --qhelp
This command runs the Quartus Prime Command-Line and Tcl API help browser, which documents all
commands and options in the Quartus Prime Tcl API.
Quartus Prime Tcl help allows easy access to information about the Quartus Prime Tcl commands. To
access the help information, type help at a Tcl prompt.
tcl> help
-------------------------------------------------------------------------
----------------------------------
Available Quartus Prime Tcl Packages:
----------------------------------
Loaded Not Loaded
------------------ ----------------------------------
::quartus::device ::quartus::external_memif_toolkit
::quartus::misc ::quartus::iptclgen
::quartus::project ::quartus::design
::quartus::rtm
::quartus::partial_reconfiguration
::quartus::report
::quartus::names
::quartus::incremental_compilation
::quartus::flow
Send Feedback
QPS5V2
2015.11.02 Quartus Prime Tcl API Help 5-5
Table 5-2: Help Options Available in the Quartus Prime Tcl Environment
If you do not specify the -version option, help for the currently
loaded package is displayed by default. If the package for which
you want help is not loaded, help for the latest version of the
package is displayed by default.
Examples:
help -pkg ::quartus::project
help -pkg project help -pkg project -version 1.0
<command_name> -h To view short help for a Quartus Prime Tcl command for which
the package is loaded.
or
Examples:
<command_name> -help
project_open -h
project_open -help
package To load a Quartus Prime Tcl package with the specified version. If
require ::quartus::<pack <version> is not specified, the latest version of the package is
age name> [<version>] loaded by default.
Example:
package require ::quartus::project 1.0
Send Feedback
QPS5V2
5-6 Command-Line Options: -t, -s, and --tcl_eval 2015.11.02
The Tcl API help is also available in Quartus Prime online help. Search for the command or package
name to find details about that command or package.
Related Information
Command-Line Scripting on page 4-1
For more information about the Tk viewer for Quartus Prime command-line help.
-t <script file> [<script args>] Run the specified Tcl script with optional arguments.
The -t option is the short form of the --script option.
--shell Open the executable in the interactive Tcl shell mode.
-s Open the executable in the interactive Tcl shell mode.
The -s option is the short form of the --shell option.
Send Feedback
QPS5V2
2015.11.02 Run a Tcl Script 5-7
Related Information
Accessing Command-Line Arguments on page 5-15
Commands you type in the Tcl shell are interpreted when you press Enter. You can run a Tcl script in the
interactive shell with the following command:
If a command is not recognized by the shell, it is assumed to be an external command and executed with
the exec command.
Evaluate as Tcl
Running an executable with the --tcl_eval option causes the executable to immediately evaluate the
remaining command-line arguments as Tcl commands. This can be useful if you want to run simple Tcl
commands from other scripting languages.
For example, the following command runs the Tcl command that prints out the commands available in
the project package.
Send Feedback
QPS5V2
5-8 End-to-End Design Flows 2015.11.02
Quartus Prime GUI. All Tcl commands typed in the Tcl Console are interpreted by the Quartus Prime Tcl
shell.
Note: Some shell commands such as cd, ls, and others can be run in the Tcl Console window, with the
Tcl exec command. However, for best results, run shell commands and Quartus Prime executables
from a system command prompt outside of the Quartus Prime software GUI.
Tcl messages appear in the System tab (Messages window). Errors and messages written to stdout and
stderr also are shown in the Quartus Prime Tcl Console window.
load_package flow
# Create the project and overwrite any settings
# files that exist
project_new fir_filter -revision filtref -overwrite
Send Feedback
QPS5V2
2015.11.02 Compiling Designs 5-9
Note: The assignments created or modified while a project is open are not committed to the Quartus
Prime Settings File (.qsf) unless you explicitly call export_assignments or project_close (unless
-dont_export_assignments is specified). In some cases, such as when running execute_flow, the
Quartus Prime software automatically commits the changes.
Related Information
• Interactive Shell Mode on page 5-7
• Constraining Designs on page 1-1
For more information on making assignments.
• QSF Reference Manual
For more information on scripting for all Quartus Prime project settings and assignments.
Compiling Designs
You can run the Quartus Prime command-line executables from Tcl scripts. Use the included flow
package to run various Quartus Prime compilation flows, or run each executable directly.
load_package flow
project_open [lindex $quartus(args) 0]
set original_revision [get_current_revision]
foreach revision [get_project_revisions] {
set_current_revision $revision
execute flow -compile
}
Send Feedback
QPS5V2
5-10 Reporting 2015.11.02
set_current_revision $original_revision
project_close
Reporting
You can extract information from the Compilation Report to evaluate results. The Quartus Prime Tcl API
provides easy access to report data so you do not have to write scripts to parse the text report files.
If you know the exact report cell or cells you want to access, use the get_report_panel_data command
and specify the row and column names (or x and y coordinates) and the name of the appropriate report
panel. You can often search for data in a report panel. To do this, use a loop that reads the report one row
at a time with the get_report_panel_row command.
Column headings in report panels are in row 0. If you use a loop that reads the report one row at a time,
you can start with row 1 to skip row 0 with column headings. The get_number_of_rows command
returns the number of rows in the report panel, including the column heading row. Because the number
of rows includes the column heading row, continue your loop as long as the loop index is less than the
number of rows.
Report panels are hierarchically arranged and each level of hierarchy is denoted by the string “||“ in the
panel name. For example, the name of the Fitter Settings report panel is Fitter||Fitter Settings
because it is in the Fitter folder. Panels at the highest hierarchy level do not use the “||” string. For
example, the Flow Settings report panel is named Flow Settings.
The following Tcl code prints a list of all report panel names in your project. You can run this code with
any executable that includes support for the report package.
load_package report
project_open myproject
load_report
set panel_names [get_report_panel_names]
foreach panel_name $panel_names {
post_message "$panel_name"
}
load_package report
project_open my-project
load_report
# This is the name of the report panel to save as a CSV file
set panel_name "Fitter||Fitter Settings"
set csv_file "output.csv"
set fh [open $csv_file w]
set num_rows [get_number_of_rows -name $panel_name]
Send Feedback
QPS5V2
2015.11.02 Timing Analysis 5-11
Timing Analysis
The Quartus Prime TimeQuest Timing Analyzer includes support for industry-standard SDC commands
in the sdc package. The Quartus Prime software includes comprehensive Tcl APIs and SDC extensions for
the TimeQuest Timing Analyzer in the sta, and sdc_ext packages. The Quartus Prime software also
includes a tdc package that obtains information from the TimeQuest Timing Analyzer.
Related Information
Quartus Prime TimeQuest Timing Analyzer
For information about how to perform timing analysis with the Quartus Prime TimeQuest Timing
Analyzer
Send Feedback
QPS5V2
5-12 Execution Example 2015.11.02
<executable> -t <script name> <flow or module name> <project name> <revision name>
The first argument passed in the argv variable (or quartus(args) variable) is the name of the flow or
module being executed, depending on the assignment you use. The second argument is the name of the
project and the third argument is the name of the revision.
When you use the POST_MODULE_SCRIPT_FILE assignment, the specified script is automatically run after
every executable in a flow. You can use a string comparison with the module name (the first argument
passed in to the script) to isolate script processing to certain modules.
Execution Example
To illustrate how automatic script execution works in a complete flow, assume you have a project called
top with a current revision called rev_1, and you have the following assignments in the .qsf for your
project.
When you compile your project, the PRE_FLOW_SCRIPT_FILE assignment causes the following command
to be run before compilation begins:
quartus_sh -t first.tcl compile top rev_1
Next, the Quartus Prime software starts compilation with analysis and synthesis, performed by the
quartus_map executable. After the Analysis and Synthesis finishes, the POST_MODULE_SCRIPT_FILE
assignment causes the following command to run:
quartus_sh -t next.tcl quartus_map top rev_1
Then, the Quartus Prime software continues compilation with the Fitter, performed by the quartus_fit
executable. After the Fitter finishes, the POST_MODULE_SCRIPT_FILE assignment runs the following
command:
quartus_sh -t next.tcl quartus_fit top rev_1
Corresponding commands are run after the other stages of the compilation. When the compilation is
over, the POST_FLOW_SCRIPT_FILE assignment runs the following command:
quartus_sh -t last.tcl compile top rev_1
Controlling Processing
The POST_MODULE_SCRIPT_FILE assignment causes a script to run after every module. Because the same
script is run after every module, you might have to include some conditional statements that restrict
processing in your script to certain modules.
For example, if you want a script to run only after timing analysis, use a conditional test like the following
example. It checks the flow or module name passed as the first argument to the script and executes code
when the module is quartus_sta.
Send Feedback
QPS5V2
2015.11.02 Displaying Messages 5-13
Displaying Messages
Because of the way the Quartus Prime software runs the scripts automatically, you must use the
post_message command to display messages, instead of the puts command. This requirement applies
only to scripts that are run by the three assignments listed in “Automating Script Execution”.
Related Information
• The post_message Command on page 5-14
For more information about this command.
• Automating Script Execution on page 5-11
For more information on the three scripts capable of scripting-message automation.
The Quartus Prime software defaults to natural bus naming. You can turn off natural bus naming with the
disable_natural_bus_naming command. For more information about natural bus naming, type the
following at a Quartus Prime Tcl prompt:
enable_natural_bus_naming -h
You can use any of the following abbreviations of the -revision option:
• -r
• -re
• -rev
• -revi
• -revis
• -revisio
Send Feedback
QPS5V2
5-14 Collection Commands 2015.11.02
You can use an option as short as -r because in the case of the project_open command no other option
starts with the letter r. However, the report_timing command includes the options -recovery and -
removal. You cannot use -r or -re to shorten either of those options, because the abbreviation would not
be unique to only one option.
Collection Commands
Some Quartus Prime Tcl functions return very large sets of data that would be inefficient as Tcl lists.
These data structures are referred to as collections. The Quartus Prime Tcl API uses a collection ID to
access the collection.
There are two Quartus Prime Tcl commands for working with collections, foreach_in_collection and
get_collection_size. Use the set command to assign a collection ID to a variable.
Related Information
foreach_in_collection
For information about which Quartus Prime Tcl commands return collection IDs.
foreach_in_collection Example
get_collection_size Example
Send Feedback
QPS5V2
2015.11.02 Accessing Command-Line Arguments 5-15
DISPLAY_COMMAND_LINE_MESSAGES_IN_COLOR = on
set i 0
foreach arg $quartus(args) {
puts "The value at index $i is $arg"
incr i
}
If you copy the script in the previous example to a file named print_args.tcl, it displays the following
output when you type the following at a command prompt.
cmdline Package
Send Feedback
QPS5V2
5-16 The quartus() Array 2015.11.02
}
set usage "You need to specify options and values"
array set optshash [::cmdline::getoptions ::argv $options $usage]
puts "The project name is $optshash(project)"
puts "The frequency is $optshash(frequency)"
If you save those commands in a Tcl script called print_cmd_args.tcl you see the following output when
you type the following command at a command prompt.
Virtually all Quartus Prime Tcl scripts must open a project. You can open a project, and you can
optionally specify a revision name with code like the following example. The example checks whether the
specified project exists. If it does, the example opens the current revision, or the revision you specify.
If you do not require this flexibility or error checking, you can use just the project_open command.
Send Feedback
QPS5V2
2015.11.02 The Quartus Prime Tcl Shell in Interactive Mode 5-17
help -quartus
quartus_sh -s
Create a new project called fir_filter, with a revision called filtref by typing the following command at a
Tcl prompt:
Note: If the project file and project name are the same, the Quartus Prime software gives the revision the
same name as the project.
Because the revision named filtref matches the top-level file, all design files are automatically picked up
from the hierarchy tree.
Next, set a global assignment for the device with the following command:
To learn more about assignment names that you can use with the -name option, refer to Quartus Prime
Help.
Note: For assignment values that contain spaces, enclose the value in quotation marks.
To compile a design, use the ::quartus::flow package, which properly exports the new project
assignments and compiles the design with the proper sequence of the command-line executables. First,
load the package:
load_package flow
1.0
To perform a full compilation of the FIR filter design, use the execute_flow command with the -
compile option:
exectue_flow -compile
This command compiles the FIR filter tutorial project, exporting the project assignments and running
quartus_map, quartus_fit, quartus_asm, and quartus_sta. This sequence of events is the same as
selecting Start Compilation from the Processing menu in the Quartus Prime GUI.
When you are finished with a project, close it with the project_close command.
To exit the interactive Tcl shell, type exit at a Tcl prompt.
Send Feedback
QPS5V2
5-18 The tclsh Shell 2015.11.02
Use double quotation marks to group the words hello and world as one argument. Double quotation
marks allow substitutions to occur in the group. Substitutions can be simple variable substitutions, or the
result of running a nested command. Use curly braces {} for grouping when you want to prevent
substitutions.
Variables
Assign a value to a variable with the set command. You do not have to declare a variable before using it.
Tcl variable names are case-sensitive.
set a 1
To access the contents of a variable, use a dollar sign (“$”) before the variable name. The following
example prints "Hello world" in a different way.
set a Hello
set b world
puts "$a $b"
Substitutions
Tcl performs three types of substitution:
• Variable value substitution
• Nested command substitution
• Backslash substitution
Send Feedback
QPS5V2
2015.11.02 Variable Value Substitution 5-19
Backslash Substitution
Backslash substitution allows you to quote reserved characters in Tcl, such as dollar signs (“$”) and braces
(“[ ]”). You can also specify other special ASCII characters like tabs and new lines with backslash
substitutions. The backslash character is the Tcl line continuation character, used when a Tcl command
wraps to more than one line.
Arithmetic
Use the expr command to perform arithmetic calculations. Use curly braces (“{ }”) to group the
arguments of this command for greater efficiency and numeric precision.
set a 5
set b [expr { $a + sqrt(2) }]
Tcl also supports boolean operators such as && (AND), || (OR), ! (NOT), and comparison operators such
as < (less than), > (greater than), and == (equal to).
Lists
A Tcl list is a series of values. Supported list operations include creating lists, appending lists, extracting
list elements, computing the length of a list, sorting a list, and more.
set a { 1 2 3 }
You can use the lindex command to extract information at a specific index in a list. Indexes are zero-
based. You can use the index end to specify the last element in the list, or the index end-<n> to count
from the end of the list. For example to print the second element (at index 1) in the list stored in a use the
following code.
puts [lindex $a 1]
Send Feedback
QPS5V2
5-20 Arrays 2015.11.02
The lappend command appends elements to a list. If a list does not already exist, the list you specify is
created. The list variable name is not specified with a dollar sign (“$”).
lappend a 4 5 6
Arrays
Arrays are similar to lists except that they use a string-based index. Tcl arrays are implemented as hash
tables. You can create arrays by setting each element individually or with the array set command.
To set an element with an index of Mon to a value of Monday in an array called days, use the following
command:
The array set command requires a list of index/value pairs. This example sets the array called days:
Use the array names command to get a list of all the indexes in a particular array. The index values are
not returned in any specified order. The following example is one way to iterate over all the values in an
array.
Arrays are a very flexible way of storing information in a Tcl script and are a good way to build complex
data structures.
Control Structures
Tcl supports common control structures, including if-then-else conditions and for, foreach, and while
loops. The position of the curly braces as shown in the following examples ensures the control structure
commands are executed efficiently and correctly. The following example prints whether the value of
variable a positive, negative, or zero.
If-Then-Else Structure
if { $a > 0 } {
puts "The value is positive"
} elseif { $a < 0 } {
puts "The value is negative"
} else {
puts "The value is zero"
}
The following example uses a for loop to print each element in a list.
Send Feedback
QPS5V2
2015.11.02 Procedures 5-21
For Loop
set a { 1 2 3 }
for { set i 0 } { $i < [llength $a] } { incr i } {
puts "The list element at index $i is [lindex $a $i]"
}
The following example uses a foreach loop to print each element in a list.
foreach Loop
set a { 1 2 3 }
foreach element $a {
puts "The list element is $element"
}
The following example uses a while loop to print each element in a list.
while Loop
set a { 1 2 3 }
set i 0
while { $i < [llength $a] } {
puts "The list element at index $i is [lindex $a $i]"
incr i
}
You do not have to use the expr command in boolean expressions in control structure commands
because they invoke the expr command automatically.
Procedures
Use the proc command to define a Tcl procedure (known as a subroutine or function in other scripting
and programming languages). The scope of variables in a procedure is local to the procedure. If the
procedure returns a value, use the return command to return the value from the procedure. The
following example defines a procedure that multiplies two numbers and returns the result.
Simple Procedure
proc multiply { x y } {
set product [expr { $x * $y }]
return $product
}
The following example shows how to use the multiply procedure in your code. You must define a
procedure before your script calls it.
Using a Procedure
proc multiply { x y } {
set product [expr { $x * $y }]
return $product
}
set a 1
set b 2
puts [multiply $a $b]
Send Feedback
QPS5V2
5-22 File I/O 2015.11.02
Define procedures near the beginning of a script. If you want to access global variables in a procedure, use
the global command in each procedure that uses a global variable.
proc print_global_list_element { i } {
global my_data
puts "The list element at index $i is [lindex $my_data $i]"
}
set my_data { 1 2 3}
print_global_list_element 0
File I/O
Tcl includes commands to read from and write to files. You must open a file before you can read from or
write to it, and close it when the read and write operations are done. To open a file, use the open
command; to close a file, use the close command. When you open a file, specify its name and the mode
in which to open it. If you do not specify a mode, Tcl defaults to read mode. To write to a file, specify w for
write mode.
Tcl supports other modes, including appending to existing files and reading from and writing to the same
file.
The open command returns a file handle to use for read or write access. You can use the puts command
to write to a file by specifying a filehandle.
Write to a File
You can read a file one line at a time with the gets command. The following example uses the gets
command to read each line of the file and then prints it out with its line number.
Send Feedback
QPS5V2
2015.11.02 External References 5-23
Tcl uses the hash or pound character (#) to begin comments. The # character must begin a comment. If
you prefer to include comments on the same line as a command, be sure to terminate the command with
a semicolon before the # character. The following example is a valid line of code that includes a set
command and a comment.
Without the semicolon, it would be an invalid command because the set command would not terminate
until the new line after the comment.
The Tcl interpreter counts curly braces inside comments, which can lead to errors that are difficult to
track down. The following example causes an error because of unbalanced curly braces.
# if { $x > 0 } {
if { $y > 0 } {
# code here
}
External References
For more information about Tcl, refer to the following sources:
• Brent B. Welch and Ken Jones, and Jeffery Hobbs, Practical Programming in Tcl and Tk (Upper Saddle
River: Prentice Hall, 2003)
• John Ousterhout and Ken Jones, Tcl and the Tk Toolkit (Boston: Addison-Wesley Professional, 2009)
• Mark Harrison and Michael McLennan, Effective Tcl/Tk Programming: Writing Better Programs in Tcl
and Tk (Boston: Addison-Wesley Professional, 1997)
Related Information
• Quartus Prime Tcl Examples
For Quartus Prime Tcl example scripts
• tcl.activestate.com
Tcl Developer Xchange
Send Feedback
QPS5V2
5-24 Document Revision History 2015.11.02
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
Signal Integrity Analysis with Third-Party Tools
6
QPS5V2 Subscribe Send Feedback
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V2
6-2 Signal Integrity Simulations with HSPICE and IBIS Models 2015.11.02
In this case, timing and signal integrity metrics between the I/O buffer and the defined far end load are
analyzed and reported in enhanced reports generated by the Quartus Prime TimeQuest Timing Analyzer.
Related Information
I/O Management on page 2-1
For more information about defining capacitive test loads or how to use the Enable Advanced I/O
Timing option to configure a board trace model.
quickly, you can build accurate simulations that can provide data to help improve board-level signal
integrity.
The I/O’s IBIS and HSPICE model creation available in the Quartus Prime software can help prevent
problems before a costly board respin is required. In general, creating and running accurate simulations is
difficult and time consuming. The tools in the Quartus Prime software automate the I/O model setup and
creation process by configuring the models specifically for your design. With these tools, you can set up
and run accurate simulations quickly and acquire data that helps guide your FPGA and board design.
The information about signal integrity in this chapter refers to board-level signal integrity based on I/O
buffer configuration and board parameters, not simultaneous switching noise (SSN), also known as
ground bounce or VCC sag. SSN is a product of multiple output drivers switching at the same time,
causing an overall drop in the voltage of the chip’s power supply. This can cause temporary glitches in the
specified level of ground or VCC for the device.
This chapter is intended for FPGA and board designers and includes details about the concepts and steps
involved in getting designs simulated and how to adjust designs to improve board-level timing and signal
integrity. Also included is information about how to create accurate models from the Quartus Prime
software and how to use those models in simulation software.
The information in this chapter is meant for those who are familiar with the Quartus Prime software and
basic concepts of signal integrity and the design techniques and components in good PCB design. Finally,
you should know how to set up simulations and use your selected third-party simulation tool.
Related Information
• AN 315: Guidelines for Designing High-Speed FPGA PCBs
For a more information about SSN and ways to prevent it.
• Altera Signal Integrity Center
For information about basic signal integrity concepts and signal integrity details pertaining to Altera
FPGA devices.
Send Feedback
QPS5V2
2015.11.02 I/O Model Selection: IBIS or HSPICE 6-3
Related Information
AN 283: Simulating Altera Devices with IBIS Models
For more information about IBIS files created by the Quartus Prime IBIS Writer and IBIS files in general,
as well as links to websites with detailed information.
Send Feedback
QPS5V2
6-4 FPGA to Board Signal Integrity Analysis Flow 2015.11.02
Send Feedback
QPS5V2
2015.11.02 Create I/O and Board Trace Model Assignments 6-5
Yes
Customize Files
Changes
to FPGA I/O
No
required?
Run Simulation
Make Adjustments to
Results No
Models or Simulation Parameters
OK?
and Simulate Again
Yes
Related Information
EDA Tool Support Resource Center
For more information, generic IBIS model files for each device family, and to obtain HSPICE buffer
simulation kits.
Send Feedback
QPS5V2
6-6 Output File Generation 2015.11.02
To configure a board trace model, in the Settings dialog box, in the TimeQuest Timing Analyzer page,
turn on the Enable Advanced I/O Timing option and configure the board trace model assignment
settings for each I/O standard used in your design. You can add series or parallel termination, specify the
transmission line length, and set the value of the far-end capacitive load. You can configure these
parameters either in the Board Trace Model view of the Pin Planner, or click SettingsDeviceDevice and
Pin Options.
The Quartus Prime software can generate IBIS models and HSPICE decks without having to configure a
board trace model with the Enable Advanced I/O Timing option. In fact, IBIS models ignore any board
trace model settings other than the far-end capacitive load. If any load value is set other than the default,
the delay given by IBIS models generated by the IBIS Writer cannot be used to account correctly for the
double counting problem. The load value mismatch between the IBIS delay and the tCO measurement of
the Quartus Prime software prevents the delays from being safely added together. Warning messages
displayed when the EDA Netlist Writer runs indicate when this mismatch occurs.
Related Information
I/O Management on page 2-1
For information about how to use theEnable Advanced I/O Timing option and configure board trace
models for the I/O standards used in your design.
Send Feedback
QPS5V2
2015.11.02 Interpret Simulation Results 6-7
With IBIS models, you can apply them to input, output, or bidirectional buffer entities and quickly set up
and run simulations. For HSPICE decks, the simulation parameters are included in the files. Open the
files in Synopsys HSPICE and run simulations for each pin as required.
With HSPICE decks generated from the HSPICE Writer, the double counting problem is accounted for,
which ensures that your simulations are accurate. Simulations that involve IBIS models created with
anything other than the default loading settings in the Quartus Prime software must take the change in
the size of the load between the IBIS delay and the Quartus Prime tCO measurement into account.
Warning messages during compilation alert you to this change.
2 3
4 5
Rise
Fall L_pkg R_pkg
C_comp C_pkg
1
Send Feedback
QPS5V2
6-8 Creating Accurate IBIS Models 2015.11.02
1. Pulldown—A voltage-current table describes the current when the buffer is driven low based on a
pull-down voltage range of –VCC to 2 VCC.
2. Pullup—A voltage-current table describes the current when the buffer is driven high based on a pull-
up voltage range of –VCC to VCC.
3. Ground and Power Clamps—Voltage-current tables describe the current when clamping diodes for
electrostatic discharge (ESD) are present. The ground clamp voltage range is –VCC to VCC, and the
power clamp voltage range is –VCC to ground.
4. Ramp and Rising/Falling Waveform—A voltage-time (dv/dt) ratio describes the rise and fall time of
the buffer during a logic transition. Optional rising and falling waveform tables can be added to more
accurately describe the characteristics of the rising and falling transitions.
5. Total Output Capacitance and Package RLC—The total output capacitance includes the parasitic
capacitances of the output pad, clamp diodes (if present), and input transistors. The package RLC is
device package-specific and defines the resistance, inductance, and capacitance of the bond wire and
pin of the I/O.
Related Information
AN 283: Simulating Altera Devices with IBIS Models
For more information about IBIS models and Altera-specific features, including links to the official IBIS
specification.
Send Feedback
QPS5V2
2015.11.02 Generate Custom IBIS Models with the IBIS Writer 6-9
To simulate your design with the model accurately, you must adjust the RLC values in the IBIS model file
to match the values for your particular device package by performing the following steps:
1. Download and expand the ZIP file (.zip) of the IBIS model for the device family you are using for your
design. The .zip file contains the .ibs file along with an IBIS model user guide and a model data
correlation report.
2. Download the Package RLC Values spreadsheet for the same device family.
3. Open the spreadsheet and locate the row that describes the device package used in your design.
4. From the package’s I/O row, copy the minimum, maximum, and typical values of resistance,
inductance, and capacitance for your device package.
5. Open the .ibs file in a text editor and locate the [Package] section of the file.
6. Overwrite the listed values copied with the values from the spreadsheet and save the file.
Related Information
Altera IBIS Models
For information about whether models for your selected device are available.
You must integrate IBIS models downloaded from the Altera website or created with the Quartus Prime
IBIS Writer into board design simulations to accurately model timing and signal integrity.
The HyperLynx software from Mentor Graphics is one of the most popular tools for design simulation.
The HyperLynx software makes it easy to integrate IBIS models into simulations.
Send Feedback
QPS5V2
6-10 Design Simulation Using the Mentor Graphics HyperLynx® Software 2015.11.02
The HyperLynx software is a PCB analysis and simulation tool for high-speed designs, consisting of two
products, LineSim and BoardSim. LineSim is an early simulation tool. Before any board routing takes
place, LineSim is used to simulate “what if” scenarios to assist in creating routing rules and defining board
parameters. BoardSim is a post-layout tool used to analyze existing board routing. Specific nets are
selected from a board layout file and simulated in a manner similar to LineSim. With board and routing
parameters, and surrounding signal routing known, highly accurate simulations of the final fabricated
PCB are possible. This section focuses on LineSim. Because the process of creating and running
simulations is very similar for both LineSim and BoardSim, the details of IBIS model use in LineSim
applies to simulations in BoardSim.
Simulations in LineSim are configured using a schematic GUI to create connections and topologies
between I/O buffers, route trace segments, and termination components. LineSim provides two methods
for creating routing schematics: cell-based and free-form. Cell-based schematics are based on fixed cells
consisting of typical placements of buffers, trace impedances, and components. Parts of the grid-based
cells are filled with the desired objects to create the topology. A topology in a cell-based schematic is
limited by the available connections within and between the cells.
A more robust and expandable way to create a circuit schematic for simulation is to use the free-form
schematic format in LineSim. The free-form schematic format makes it easy to place parts into any
configuration and edit them as required. This section describes the use of IBIS models with free-form
schematics, but the process is nearly identical for cell-based schematics.
Figure 6-3: HyperLynx LineSim Free-Form Schematic Editor
Send Feedback
QPS5V2
2015.11.02 Configuring LineSim to Use Altera IBIS Models 6-11
When you use HyperLynx software to perform simulations, you typically perform the following steps:
1. Create a new LineSim free-form schematic document and set up the board stackup for your PCB using
the Stackup Editor. In this editor, specify board layer properties including layer thickness, dielectric
constant, and trace width.
2. Create a circuit schematic for the net you want to simulate. The schematic represents all the parts of
the routed net including source and destination I/O buffers, termination components, transmission
line segments, and representations of impedance discontinuities such as vias or connectors.
3. Assign IBIS models to the source and destination I/O buffers to represent their behavior during
operation.
4. Attach probes from the digital oscilloscope that is built in to LineSim to points in the circuit that you
want to monitor during simulation. Typically, at least one probe is attached to the pin of a destination
I/O buffer. For differential signals, you can attach a differential probe to both the positive and negative
pins at the destination.
5. Configure and run the simulation. You can simulate a rising or falling edge and test the circuit under
different drive strength conditions.
6. Interpret the results and make adjustments. Based on the waveforms captured in the digital oscillo‐
scope, you can adjust anything in the circuit schematic to correct any signal integrity issues, such as
overshoot or ringing. If necessary, you can make I/O assignment changes in the Quartus Prime
software, regenerate the IBIS file with the IBIS Writer, and apply the updated IBIS model to the buffers
in your HyperLynx software schematic.
7. Repeat the simulations and circuit adjustments until you are satisfied with the results. When the
operation of the net meets your design requirements, implement changes to your I/O assignments in
the Quartus Prime software and/or adjust your board routing constraints, component values, and
placement to match the simulation.
Related Information
www.mentor.com
For more information about HyperLynx software, including schematic creation, simulation setup, model
usage, product support, licensing, and training.
Send Feedback
QPS5V2
6-12 Integrating Altera IBIS Models into LineSim Simulations 2015.11.02
2. Click Edit. A dialog box appears where you can add directories and adjust the order in which LineSim
searches them.
Figure 6-5: LineSim Select Directories Dialog Box
3. Click Add
4. Browse to the default IBIS model location, <project directory>/board/ibis. Click OK.
5. Click Up to move the IBIS model directory to the top of the list. Click Generate Model Index to
update LineSim’s model database with the models found in the added directory.
6. Click OK. The IBIS model directory for your project is added to the top of the Model-library file
path(s) list.
7. To close the Set Directories dialog box, click OK.
Send Feedback
QPS5V2
2015.11.02 Integrating Altera IBIS Models into LineSim Simulations 6-13
1. Double-click a buffer symbol in your schematic to open the Assign Models dialog box. You can also
click Assign Models from the buffer symbol’s right-click menu.
Figure 6-6: LineSim Assign Model Dialog Box
2. The pin of the buffer symbol you selected should be highlighted in the Pins list. If you want to assign a
model to a different symbol or pin, select it from the list.
3. Click Select. The Select IC Model dialog box appears.
Send Feedback
QPS5V2
6-14 Running and Interpreting LineSim Simulations 2015.11.02
4. To filter the list of available libraries to display only IBIS models, select .IBS. Scroll through the
Libraries list, and click the name of the library for your design. By default, this is <project name>.ibs.
5. The device for your design should be selected as the only item in the Devices list. If not, select your
device from the list.
6. From the Signal list, select the name of the signal you want to simulate. You can also choose to select
by device pin number.
7. Click OK. The Assign Models dialog box displays the selected .ibs file and signal.
8. If applicable to the signal you chose, adjust the buffer settings as required for the simulation.
9. Select and configure other buffer pins from the Pins list in the same manner.
10.Click OK when all I/O models are assigned.
Send Feedback
QPS5V2
2015.11.02 Running and Interpreting LineSim Simulations 6-15
If you see a discontinuity or other anomalies at the destination, such as slow rise and fall times, adjust the
termination scheme or termination component values. After making these changes, rerun the simulation
to check whether your adjustments solved the problem. In this case, it is not necessary to regenerate
the .ibs file.
Figure 6-9: Example of Signal Integrity Anomaly in HyperLynx with IBIS Models
Related Information
Altera Signal Integrity Center
For more information about board-level signal integrity and to learn about ways to improve it with simple
changes to your design.
Send Feedback
QPS5V2
6-16 Simulation with HSPICE Models 2015.11.02
Related Information
The Double Counting Problem in HSPICE Simulations on page 6-17
Send Feedback
QPS5V2
2015.11.02 The Double Counting Problem in HSPICE Simulations 6-17
HSPICE models for board simulation measure tPD (propagation delay) from an arbitrary reference point
in the output buffer, through the device pin, out along the board routing, and ending at the signal destina‐
tion.
It is apparent immediately that if these two delays were simply added together, the delay between the
output buffer and the device pin would be counted twice in the calculation. A model or simulation that
does not account for this double count would create overly pessimistic simulation results, because the
double-counted delay can limit I/O performance artificially. To fix the problem, it might seem that simply
subtracting the overlap between tCO and tPD would account for the double count. However, this
adjustment would not be accurate because each measurement is based on a different load.
Note: Input signals do not exhibit this problem because the HSPICE models for inputs stop at the FPGA
pin instead of at the input buffer. In this case, simply adding the delays together produces an
accurate measurement of delay timing.
Send Feedback
QPS5V2
6-18 The Solution to Double Counting 2015.11.02
FPGA Core FPGA Output FPGA Pin Quartus Prime Termination Network/ Signal
Logic Buffer Test Load Trace Model Destination
Total Delay
With tTESTLOAD known, the total delay is calculated for the output signal from the FPGA logic to the
signal destination on the board, accounting for the double count.
tdelay = tCO+(tPD-tTESTLOAD)
The preconfigured simulation files generated by the HSPICE Writer in the Quartus Prime software are
designed to account for the double-counting problem based on this calculation automatically. Performing
accurate timing simulations is easy without having to make adjustments for double counting manually.
Related Information
Quartus Prime Handbook
For additional information about standard design flows.
Send Feedback
QPS5V2
2015.11.02 Applying I/O Assignments 6-19
Send Feedback
QPS5V2
6-20 Naming Conventions for HSPICE Files 2015.11.02
As with command-line invocation, specifying the output directory is optional. If not specified, the output
directory defaults to board/hspice.
The <output_directory> option specifies the location where HSPICE model files are saved. By default, the
<project directory>/board/hspice directory is used.
<output_directory> specifies the location where the generated spice decks will be written (relative to the
design directory). This is an optional parameter and defaults to board/hspice.
Send Feedback
QPS5V2
2015.11.02 Running an HSPICE Simulation 6-21
A default board description is included, and a default simulation is set up to measure rise and fall delays
for both input and output simulations, which compensates for the double counting problem. However,
Altera recommends that you customize the board description to more accurately represent your routing
and termination scheme.
The sample board trace loading in the generated HSPICE model files must be replaced by your actual
trace model before you can run a correct simulation. To do this, open the generated HSPICE model files
for all pins you want to simulate and locate the following section.
You must replace the example load with a load that matches the design of your PCB board. This includes
a trace model, termination resistors, and, for output simulations, a receiver model. The spice circuit node
that represents the pin of the FPGA package is called pin. The node that represents the far pin of the
external device is called load-in (for output SPICE decks) and source-in (for input SPICE decks).
For an input simulation, you must also modify the stimulus portion of the spice file. The section of the file
that must be modified is indicated in the following comment block.
Replace the sample stimulus model with a model for the device that will drive the FPGA.
Click Open and browse to the location of the HSPICE model files generated by the Quartus Prime
HSPICE Writer. The default location for HSPICE model files is <project directory>/board/hspice. Select
the .sp file generated by the HSPICE Writer for the signal you want to simulate. Click OK.
To run the simulation, click Simulate. The status of the simulation is displayed in the window and saved
in an .lis file with the same name as the .sp file when the simulation is complete. Check the .lis file if an
error occurs during the simulation requiring a change in the .sp file to fix.
Send Feedback
QPS5V2
6-22 Interpreting the Results of an Output Simulation 2015.11.02
Send Feedback
QPS5V2
2015.11.02 Viewing Graphical Simulation Results 6-23
The Results Browser lets you select which waveform to view quickly in the main viewing window. If
multiple simulations are run on the same signal, the list at the top of the Results Browser displays the
results of each simulation. Click the simulation description to select which simulation to view. By default,
the descriptions are derived from the first line of the HSPICE file, so the description might appear as a line
of asterisks.
Select the type of waveform to view, by performing the following steps:
1. To see the source and destination waveforms with the default simulation, from the Types list, select
Voltages.
2. On the Curves list, double-click the waveform you want to view. The waveform appears in the main
viewing window.
You can zoom in and out and adjust the view as desired.
Send Feedback
QPS5V2
6-24 Making Design Adjustments Based on HSPICE Simulations 2015.11.02
Send Feedback
QPS5V2
2015.11.02 Making Design Adjustments Based on HSPICE Simulations 6-25
If there is a discontinuity or any other anomalies at the destination, adjust the board description in the
Quartus Prime Board Trace Model, or in the generated HSPICE model files to change the termination
scheme or adjust termination component values. After making these changes, regenerate the HSPICE files
if necessary, and rerun the simulation to verify whether your adjustments solved the problem.
Send Feedback
QPS5V2
6-26 Sample Input for I/O HSPICE Simulation Deck 2015.11.02
Figure 6-17: Example of Signal Integrity Anomaly in the AvanWaves Waveform Viewer
Related Information
Altera Signal Integrity Center
For more information about board-level signal integrity and to learn about ways to improve it with simple
changes to your FPGA design.
Header Comment
The first block of an input simulation spice deck is the header comment. The purpose of this block is to
provide an easily readable summary of how the simulation file has been automatically configured by the
Quartus Prime software.
This block has two main components: The first component summarizes the I/O configuration relevant
information such as device, speed grade, and so on. The second component specifies the exact test
condition that the Quartus Prime software assumes for the given I/O standard.
Send Feedback
QPS5V2
2015.11.02 Simulation Conditions 6-27
* Device: EP2S60F1020C3
* Speed Grade: C3
* Pin: AA4 (out96)
* Bank: IO Bank 6 (Row I/O)
* I/O Standard: LVTTL, 12mA
* OCT: Off
*
* Quartus Prime’s default I/O timing delays assume the following slow
* corner simulation conditions.
*
* Specified Test Conditions For Quartus Prime Tco
* Temperature: 85C (Slowest Temperature Corner)
* Transistor Model: TT (Typical Transistor Corner)
* Vccn: 3.135V (Vccn_min = Nominal - 5%)
* Vccpd: 2.97V (Vccpd_min = Nominal - 10%)
* Load: No Load
* Vtt: 1.5675V (Voltage reference is Vccn/2)
*
* Note: The I/O transistors are specified to operate at least as
* fast as the TT transistor corner, actual production
* devices can be as fast as the FF corner. Any simulations
* for hold times should be conducted using the fast process
* corner with the following simulation conditions.
* Temperature: 0C (Fastest Commercial Temperature Corner **)
* Transistor Model: FF (Fastest Transistor Corner)
* Vccn: 1.98V (Vccn_hold = Nominal + 10%)
* Vccpd: 3.63V (Vccpd_hold = Nominal + 10%)
* Vtt: 0.95V (Vtt_hold = Vccn/2 - 40mV)
* Vcc: 1.25V (Vcc_hold = Maximum Recommended)
* Package Model: Short-circuit from pad to pin (no parasitics)
*
* Warnings:
Simulation Conditions
The simulation conditions block loads the appropriate process corner models for the transistors. This
condition is automatically set up for the slow timing corner and is modified only if other simulation
corners are desired.
* Process Settings
.options brief
.inc ‘sii_tt.inc’ * TT process corner
Simulation Options
The simulation options block configures the simulation temperature and configures HSPICE with typical
simulation options.
* Simulation Options
.options brief=0
.options badchr co=132 scale=1e-6 acct ingold=2 nomod dv=1.0
+ dcstep=1 absv=1e-3 absi=1e-8 probe csdf=2 accurate=1
+ converge=1
.temp 85
Note: For a detailed description of these options, consult your HSPICE manual.
Send Feedback
QPS5V2
6-28 Constant Definition 2015.11.02
Constant Definition
The constant definition block of the simulation file instantiates the voltage sources that controls the
configuration modes of the I/O buffer.
* Constant Definition
Where:
• Voltage source voeb controls the output enable of the buffer and is set to disabled for inputs.
• vopdrain controls the open drain mode for the I/O.
• vrambh controls the bus hold circuitry in the I/O.
• vrpullup controls the weak pullup.
• The next 11 voltages sources control the I/O standard of the buffer and are configured through a later
library call.
• vdin is not used on input pins because it is the data pin for the output buffer.
Buffer Netlist
The buffer netlist block of the simulation spice deck loads all the load models required for the
corresponding input pin.
* IO Buffer Netlist
.include ‘vio_buffer.inc’
Drive Strength
The drive strength block of the simulation SPICE deck loads the configuration bits necessary to configure
the I/O into the proper I/O standard and drive strengths.
Although these settings are not relevant to an input buffer, they are provided to allow the SPICE deck to
be modifiable to support bidirectional simulations.
Send Feedback
QPS5V2
2015.11.02 I/O Buffer Instantiation 6-29
Send Feedback
QPS5V2
6-30 Stimulus Model 2015.11.02
Stimulus Model
The stimulus model block of the simulation spice deck is provided only as a place holder example. Replace
this block with your own stimulus model. Options for this include an IBIS or HSPICE model, among
others.
Simulation Analysis
The simulation analysis block of the simulation file is configured to measure the propagation delay from
the source to the FPGA pin. Both the source and end point of the delay are referenced against the 50%
VCCN crossing point of the waveform.
* Print out the voltage waveform at both the source and the pin
.print tran v(source) v(pin)
.tran 0.020ns 17ns
* Measure the propagation delay from the source pin to the pin
* referenced against the 50% voltage threshold crossing point
Header Comment
The first block of an output simulation SPICE deck is the header comment. The purpose of this block is to
provide a readable summary of how the simulation file has been automatically configured by the Quartus
Prime software.
This block has two main components:
• The first component summarizes the I/O configuration relevant information such as device, speed
grade, and so on.
• The second component specifies the exact test condition that the Quartus Prime software assumes
when generating tCO delay numbers. This information is used as part of the double-counting
correction circuitry contained in the simulation file.
The SPICE decks are preconfigured to calculate the slow process corner delay but can also be used to
simulate the fast process corner as well. The fast corner conditions are listed in the header under the notes
section.
Send Feedback
QPS5V2
2015.11.02 Simulation Conditions 6-31
The final section of the header comment lists any warning messages that you must consider when you use
the SPICE decks.
Simulation Conditions
The simulation conditions block loads the appropriate process corner models for the transistors. This
condition is automatically set up for the slow timing corner and must be modified only if other simulation
corners are desired.
* Process Settings
.options brief
.inc ‘sii_tt.inc’ * typical-typical process corner
Note: Two separate corners cannot be simulated at the same time. Instead, simulate the base case using
the Quartus corner as one simulation and then perform a second simulation using the desired
customer corner. The results of the two simulations can be manually added together.
Send Feedback
QPS5V2
6-32 Simulation Options 2015.11.02
Simulation Options
The simulation options block configures the simulation temperature and configures HSPICE with typical
simulation options.
* Simulation Options
.options brief=0
.options badchr co=132 scale=1e-6 acct ingold=2 nomod dv=1.0
+ dcstep=1 absv=1e-3 absi=1e-8 probe csdf=2 accurate=1
+ converge=1
.temp 85
Note: For a detailed description of these options, consult your HSPICE manual.
Constant Definition
The constant definition block of the output simulation SPICE deck instantiates the voltage sources that
controls the configuration modes of the I/O buffer.
* Constant Definition
Where:
• Voltage source voeb controls the output enable of the buffer.
• vopdrain controls the open drain mode for the I/O.
• vrambh controls the bus hold circuitry in the I/O.
• vrpullup controls the weak pullup.
• vpci controls the PCI clamp.
• The next ten voltage sources control the I/O standard of the buffer and are configured through a later
library call.
• vdin is connected to the data input of the I/O buffer.
• The edge rate of the input stimulus is automatically set to the correct value by the Quartus Prime
software.
Send Feedback
QPS5V2
2015.11.02 Drive Strength 6-33
.include ‘hio_buffer.inc’
.include ‘lvds_input_load.inc’
.include ‘lvds_oct_load.inc’
Drive Strength
The drive strength block of the simulation spice deck loads the configuration bits for configuring the I/O
to the proper I/O standard and drive strength. These options are set by the HSPICE Writer tool and are
not changed for expected use.
Send Feedback
QPS5V2
6-34 Board and Trace Termination 2015.11.02
Send Feedback
QPS5V2
2015.11.02 Simulation Analysis 6-35
vrpullup_tl rpullup_tl 0 0
Related Information
The Double Counting Problem in HSPICE Simulations on page 6-17
Simulation Analysis
The simulation analysis block is set up to measure double-counting corrected delays. This is accomplished
by measuring the uncompensated delay of the I/O buffer when connected to the user load, and when
subtracting the simulated amount of double-counting from the test load I/O buffer.
* Print out the voltage waveform at both the pin and far end load
.print tran v(pin) v(load)
.tran 0.020ns 17ns
* Measure the propagation delay to the load pin. This value will
* include some double counting with Quartus Prime’s Tco
.measure TRAN tpd_uncomp_rise TRIG v(din) val=’vc*0.5’ rise=1
+ TARG v(load) val=’vcn*0.5’ rise=1
.measure TRAN tpd_uncomp_fall TRIG v(din) val=’vc*0.5’ fall=1
+ TARG v(load) val=’vcn*0.5’ fall=1
* The test load buffer can calculate the amount of double counting
.measure TRAN t_dblcnt_rise TRIG v(din) val=’vc*0.5’ rise=1
+ TARG v(pin_tl) val=’vcn_tl*0.5’ rise=1
.measure TRAN t_dblcnt_fall TRIG v(din) val=’vc*0.5’ fall=1
+ TARG v(pin_tl) val=’vcn_tl*0.5’ fall=1
Send Feedback
QPS5V2
6-36 Advanced Topics 2015.11.02
Advanced Topics
The information in this section describes some of the more advanced topics and methods employed when
setting up and running HSPICE simulation files.
PVT Simulations
The automatically generated HSPICE simulation files are set up to simulate the slow process corner using
low voltage, high temperature, and slow transistors. To ensure a fully robust link, Altera recommends that
you run simulations over all process corners.
To perform process, voltage, and temperature (PVT) simulations, manually modify the spice decks in a
two step process:
1. Remove the double-counting compensation circuitry from the simulation file. This is required as the
amount of double-counting is dependant upon how the Quartus Prime software calculates delays and
is not based on which PVT corner is being simulated. By default, the Quartus Prime software provides
timing numbers using the slow process corner.
2. Select the proper corner for the PVT simulation by setting the correct HSPICE temperature, changing
the supply voltage sources, and loading the correct transistor models.
A more detailed description of HSPICE process corners can be found in the family-specific HSPICE
model documentation.
Related Information
Accessing HSPICE Simulation Kits on page 6-16
Send Feedback
QPS5V2
2015.11.02 Correlation Report 6-37
Correlation Report
Correlation reports for the HSPICE I/O models are located in the family-specific HSPICE I/O buffer
simulation kits.
Related Information
Accessing HSPICE Simulation Kits on page 6-16
Send Feedback
QPS5V2
6-38 Document Revision History 2015.11.02
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
Mentor Graphics PCB Design Tools Support
7
QPS5V2 Subscribe Send Feedback
You can integrate the Mentor Graphics® I/O Designer or DxDesigner PCB design tools into the Quartus
Prime design flow. This combination provides a complete FPGA-to-board design workflow.
With today’s large, high-pin-count and high-speed FPGA devices, good and correct PCB design practices
are essential to ensure correct system operation. The PCB design takes place concurrently with the design
and programming of the FPGA. The FPGA or ASIC designer initially creates signal and pin assignments,
and the board designer must correctly transfer these assignments to the symbols in their system circuit
schematics and board layout. As the board design progresses, Altera recommends reassigning pins to
optimize the PCB layout. Ensure that you inform the FPGA designer of the pin reassignments so that the
new assignments are included in an updated placement and routing of the design.
The Mentor Graphics I/O Designer software allows you to take advantage of the full FPGA symbol design,
creation, editing, and back-annotation flow supported by the Mentor Graphics tools.
This chapter covers the following topics:
• Mentor Graphics and Altera software integration flow
• Generating supporting files
• Adding Quartus Prime I/O assignments to I/O Designer
• Updating assignment changes between the I/O Designer the Quartus Prime software
• Generating I/O Designer symbols
• Creating DxDesigner symbols from the Quartus Prime output files
This chapter is intended for board design and layout engineers who want to start the FPGA board integra‐
tion while the FPGA is still in the design phase. Alternatively, the board designer can plan the FPGA pin-
out and routing requirements in the Mentor Graphics tools and pass the information back to the Quartus
Prime software for placement and routing. Part librarians can also benefit from this chapter by learning
how to use output from the Quartus Prime software to create new library parts and symbols.
The procedures in this chapter require the following software:
• The Quartus Prime software version 5.1 or later
• DxDesigner software version 2004 or later
• Mentor Graphics I/O Designer software (optional)
Note: To obtain and license the Mentor Graphics tools and for product information, support, and
training, refer to the Mentor Graphics website.
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V2
7-2 FPGA-to-PCB Design Flow 2015.11.02
Generate Symbol
DxDesigner
Instantiate Symbol
in Schematic
Forward to Board
Layout Tool
Board Layout Tool
End
Send Feedback
QPS5V2
2015.11.02 Integrating with I/O Designer 7-3
Note: The Quartus Prime software generates the .fx in the output directory you specify in the Board-
Level page of the Settings dialog box. However, the Quartus Prime software and the I/O Designer
software can import pin assignments from an .fx located in any directory. Use a backup .fx to
prevent overwriting existing assignments or importing invalid assignments.
To integrate the I/O Designer into your design flow, follow these steps:
1. In the Quartus Prime software, click Assignments > Settings > EDA Tool Settings > Board-Level to
specify settings for .fx symbol file generation.
2. Compile your design to generate the .fx and Pin-Out File (.pin) in the Quartus Prime project
directory.
3. Create a board design with the DxDesigner software and the I/O Designer software by performing the
following steps:
a. Create a new I/O Designer database based on the .fx and the .pin files.
b. In the I/O Designer software, make adjustments to signal and pin assignments.
c. Regenerate the .fx in the I/O Designer software to export the I/O Designer software changes to the
Quartus Prime software.
d. Generate a single or fractured symbol for use in the DxDesigner software.
e. Add the symbol to the sym directory of a DxDesigner project, or specify a new DxDesigner project
with the new symbol.
f. Instantiate the symbol in your DxDesigner schematic and export the design to the board layout
tool.
g. Back-annotate pin changes created in the board layout tool to the DxDesigner software and back to
the I/O Designer software and the Quartus Prime software.
4. Create a board design with the DxDesigner software without the I/O Designer software by performing
the following steps:
a. Create a new DxBoardLink symbol with the Symbol wizard and reference the .pin from the
Quartus Prime software in an existing DxDesigner project.
b. Instantiate the symbol in your DxDesigner schematic and export the design to a board layout tool.
Note: You can update these symbols with design changes with or without the I/O Designer software. If
you use the Mentor Graphics I/O Designer software and you change symbols with the DxDesigner
software, you must reimport the symbols into I/O Designer to avoid overwriting your symbol
changes.
Send Feedback
QPS5V2
7-4 Generating Pin Assignment Files 2015.11.02
I/O Designer
Create or Update
.fpc
Create or Change
Pin Assignments
.fx
Regenerate .fx
Generate Symbol
DxDesigner
Instantiate Symbol
in Schematic
Forward to Board
Layout Tool
Board Layout Tool
End
Note: (2) DxDesigner software-specific steps in the design flow are not part of the I/O Designer flow.
Send Feedback
QPS5V2
2015.11.02 I/O Designer Settings 7-5
assignments. You cannot import pin assignment changes from a Mentor Graphics .pin into the Quartus
Prime software.
The .fx is an input or output of either the Quartus Prime or I/O Designer software. You can generate
an .fx in the Quartus Prime software for symbol generation in the Mentor Graphics I/O Designer
software. A Quartus Prime .fx contains the pin name, number, location, direction, I/O standard, drive
strength, termination, slew rate, IOB delay, and differential pins. An I/O Designer .fx additionally
includes information about unused pins and pin set groups.
The I/O Designer software can also read from or update a Quartus Prime Settings File (.qsf). You can use
the .qsf in the same way as use of the .fx, but pin swap group information does not transfer between I/O
Designer and the Quartus Prime software. Use the .fx rather than the .qsf for transferring I/O assignment
information.
Figure 7-3: Generating .pin and .fx files
Set Up to Generate
.fx
.pin
Send Feedback
QPS5V2
7-6 Transferring I/O Assignments 2015.11.02
Send Feedback
QPS5V2
2015.11.02 Updating I/O Designer with Quartus Prime Pin Assignments 7-7
8. Select the appropriate device family, device, package, and speed (if applicable), from the corresponding
menus. Click Next. The Place and route page appears.
9. In the FPGAX file name field, type or browse to the backup copy of the .fx generated by the Quartus
Prime software.
10.In the Pin report file name field, type or browse to the .pin generated by the Quartus Prime software.
Click Next.
You can also select a .qsf for update. The I/O Designer software can update the pin assignment
information in the .qsf without affecting any other information in the file.
Note: You can import a .pin without importing an .fx. The I/O Designer software does not generate
a .pin. To transfer assignment information to the Quartus Prime software, select an additional
file and file type. Altera recommends selecting an .fx in addition to a .pin for transferring all the
assignment information in the .fx and .pin files. In some versions of the I/O Designer software,
the standard file picker may incorrectly look for a .pin instead of an .fx. In this case, select All
Files (*.*) from the Save as type list and select the file from the list.
11.On the Synthesis page, specify an external synthesis tool and a synthesis constraints file for use with
the tool. If you do not use an external synthesis tool, click Next.
12.On the PCB Flow page, you can select an existing schematic project or create a new project as a symbol
information destination.
• To select an existing project, select Choose existing project and click Browse after the Project Path
field. The Select project dialog box appears. Select the project.
• To create a new project, in the Select project dialog box, select Create new empty project. Type the
project file name in the Name field and browse to the location where you want to save the file. Click
OK.
13.If you have not specified a design tool to which you can send symbol information in the I/O Designer
software, click Advanced in the PCB Flow page and select your design tool. If you select the
DxDesigner software, you have the option to specify a Hierarchical Occurrence Attributes (.oat) file to
import into the I/O Designer software. Click Next and then click Finish to create the
database.Updating
Send Feedback
QPS5V2
7-8 Updating Quartus Prime with I/O Designer Pin Assignments 2015.11.02
I/O Designer
Create or Update
.fpc
Create or Change
Pin Assignments
.fx
Regenerate .fx
To update the .fx in your selected output directory and the .pin in your project directory after making
changes to the design, perform the following tasks:
1. In the I/O Designer software, click File > Properties.
2. Under FPGA Xchange, specify the .fx file name and location.
3. Under Place and Route, specify the .pin file name and location.
After you have set up these file locations, the I/O Designer software monitors these files for changes. If
the specified .fx or .pin is modified during design processing, three indicators flash red in the lower
right corner of the I/O Designer GUI. You can click the indicators to open the I/O Designer Update
Wizard dialog box. The I/O Designer Update Wizard dialog box lists the updated files in the
database.
4. Make logic or pin assignment changes in your design.
5. Click Processing > Start > Start I/O Assignment Analysis to validate your latest assignment changes.
6. To preserve your changes an update the corresponding the .fx and .pin files, click Processing > Start >
Start EDA Netlist Writer or Processing > Start Compilation.
Note: Your I/O Designer database should us a backup copy of the .fx generated by the Quartus Prime
software. Otherwise, updating the file in the Quartus Prime software overwrites any changes
made to the file by the I/O Designer software. If there are I/O Designer assignments in the .fx
that you want to preserve, create a backup copy of the file before updating it in the Quartus
Prime software, and verify that your I/O Designer database points to the backup copy.
Send Feedback
QPS5V2
2015.11.02 Generating Schematic Symbols in I/O Designer 7-9
Generate Symbol
(2)
Send Feedback
QPS5V2
7-10 Generating Schematic Symbols 2015.11.02
You can use the I/O Designer Symbol wizard to quickly create symbols that you can subsequently refine.
Alternatively, you can import symbols from another DXDesigner project, and then assign an FPGA to the
symbol. To import symbols in the I/O Designer software, File > Import Symbol.
I/O Designer symbols are either functional, physical (PCB), or both. Signals imported into the database,
usually from Verilog HDL or VHDL files, are the basis of a functional symbol. No physical device pins
must be associated with the signals to generate a functional symbol. This section focuses on board-level
PCB symbols with signals directly mapped to physical device pins through assignments in either the
Quartus Prime Pin Planner or in the I/O Designer database.
Send Feedback
QPS5V2
2015.11.02 DxDesigner Project Settings 7-11
Quartus Prime software. You cannot back-annotate changes made in a board layout tool or in a
DxDesigner symbol to the Quartus Prime software.
Figure 7-6: DxDesigner-only Flow (without I/O Designer)
DxDesigner
Create New or Open
Existing Project
Instantiate in
Schematic
Forward to Board
Layout Tool
Send Feedback
QPS5V2
7-12 Analyzing FPGA Simultaneous Switching Noise (SSN) 2015.11.02
6. Specify the appearance of the generated symbol and how itthe grid you have set in your DxDesigner
project schematic. After making your selections. Click Next.
7. In the FPGA vendor list, select Altera Quartus. In the Pin-Out file to import field, select the .pin
from your Quartus Prime project directory. You can also specify Fracturing Scheme, Bus pin, and
Power pin options. Click Next.
8. Select to create or modify symbol attributes for use in the DxDesigner software. Click Next.
9. On the Pin Settings page, make any final adjustments to pin and label location and information. Each
tabbed spreadsheet represents a fracture of your symbol. Click Save Symbol.
After creating the symbol, you can examine and place any fracture of the symbol in your schematic.
You can locate separate files of all the fractures you created in the library you specified or created in
the /sym directory in your DxDesigner project. You can add the symbols to your schematics or you
can manually edit the symbols or with the Symbol wizard.
Scripting API
The I/O Designer software includes a command line Tcl interpreter. All commands input through the I/O
Designer GUI translate into Tcl commands run by the tool. You can run individual Tcl commands or
scripts in the I/O Designer Console window, rather than using the GUI.
You can use the following Tcl commands to control I/O Designer.
• set_fpga_xchange_file <file name>—specifies the .fx from which the I/O Designer software
updates assignments.
• update_from_fpga_xchange_file—updates the I/O Designer database with assignment updates
from the currently specified .fx.
• generate_fpga_xchange_file—updates the .fx with I/O Designer software changes for transfer back
into the Quartus Prime software.
• set_pin_report_file -quartus_pin <file name>—imports assignment data from a Quartus Prime
software .pin file.
• symbolwizard—runs the I/O Designer Symbol wizard.
• set_dx_designer_project -path <path>
Send Feedback
QPS5V2
2015.11.02 Document Revision History 7-13
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
Cadence PCB Design Tools Support
8
QPS5V2 Subscribe Send Feedback
Related Information
• www.cadence.com
For more information about obtaining and licensing the Cadence tools and for product information,
support, and training
• www.cadence.com
For more information about the OrCAD Capture software and the CIS option
• www.ema-eda.com
For more information about Cadence and OrCAD support and training
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V2
8-2 Product Comparison 2015.11.02
Product Comparison
Table 8-1: Cadence and OrCAD Product Comparison
Related Information
• www.cadence.com
• www.ema-eda.com
Send Feedback
QPS5V2
2015.11.02 FPGA-to-PCB Design Flow 8-3
Figure 8-1: Design Flow with the Cadence Allegro Design Entry HDL Software
.pin
Edit or F racture Symbol
End
Figure 8-2: Design Flow with the Cadence Allegro Design Entry CIS Software
.pin
Forward to Board Developement Tool
End
To create FPGA symbols using the Cadence Allegro PCB Librarian Part Developer tool, you must obtain
the Cadence PCB Librarian Expert license. You can update symbols with changes made to the FPGA
design using any of these tools.
Send Feedback
QPS5V2
8-4 Integrating Altera FPGA Design 2015.11.02
1. In the Quartus Prime software, compile your design to generate a Pin-Out File (.pin) to transfer the
assignments to the Cadence software.
2. If you are using the Cadence Allegro Design Entry HDL software for your schematic design, follow
these steps:
a. Open an existing project or create a new project in the Cadence Allegro Project Manager tool.
b. Construct a new symbol or update an existing symbol using the Cadence Allegro PCB Librarian
Part Developer tool.
c. With the Cadence Allegro PCB Librarian Part Developer tool, edit your symbol or fracture it into
smaller parts (optional).
d. Instantiate the symbol in your Cadence Allegro Design Entry HDL software schematic and transfer
the design to your board layout tool.
or
If you are using the Cadence Allegro Design Entry CIS software for your schematic design, follow
these steps:
e. Generate a new part in a new or existing Cadence Allegro Design Entry CIS project, referencing
the .pin output file from the Quartus Prime software. You can also update an existing symbol with
a new .pin.
f. Split the symbol into smaller parts as necessary.
g. Instantiate the symbol in your Cadence Allegro Design Entry CIS schematic and transfer the design
to your board layout tool.
Related Information
Simultaneous Switching Noise (SSN) Analysis and Optimizations on page 3-1
Send Feedback
QPS5V2
2015.11.02 Generating a .pin File 8-5
The .pin lists all used and unused pins on your selected Altera device. The .pin also provides the following
basic information fields for each assigned pin on the device:
• Pin signal name and usage
• Pin number
• Signal direction
• I/O standard
• Voltage
• I/O bank
• User or Fitter-assigned
Related Information
I/O Management on page 2-1
For more information about using the Quartus Prime Pin Planner to create or change pin assignment
details.
Related Information
I/O Management on page 2-1
For more information about pin and signal assignment transfer and the files that the Quartus Prime
software can import and export.
Related Information
www.cadence.com
Provides information about the Cadence Allegro Design Entry HDL software and the Cadence Allegro
PCB Librarian Part Developer tool, including licensing, support, usage, training, and product updates.
Send Feedback
QPS5V2
8-6 Creating Symbols 2015.11.02
Creating Symbols
In addition to circuit simulation, circuit board schematic creation is one of the first tasks required when
designing a new PCB. Schematics must understand how the PCB works, and to generate a netlist for a
board layout tool for board design and routing. The Cadence Allegro PCB Librarian Part Developer tool
allows you to create schematic symbols based on FPGA designs exported from the Quartus Prime
software.
You can create symbols for the Cadence Allegro Design Entry HDL project with the Cadence Allegro PCB
Librarian Part Developer tool, which is available in the Cadence Allegro Project Manager tool. Altera
recommends using the Cadence Allegro PCB Librarian Part Developer tool to import FPGA designs into
the Cadence Allegro Design Entry HDL software.
You must obtain a PCB Librarian Expert license from Cadence to run the Cadence Allegro PCB Librarian
Part Developer tool. The Cadence Allegro PCB Librarian Part Developer tool provides a GUI with many
options for creating, editing, fracturing, and updating symbols. If you do not use the Cadence Allegro
PCB Librarian Part Developer tool, you must create and edit symbols manually in the Symbol Schematic
View in the Cadence Allegro Design Entry HDL software.
Note: If you do not have a PCB Librarian Expert license, you can automatically create FPGA symbols
using the programmable IC (PIC) design flow found in the Cadence Allegro Project Manager tool.
Before creating a symbol from an FPGA design, you must open a Cadence Allegro Design Entry HDL
project with the Cadence Allegro Project Manager tool. If you do not have an existing Cadence Allegro
Design Entry HDL project, you can create one with the Cadence Allegro Design Entry HDL software. The
Cadence Allegro Design Entry HDL project directory with the name <project name>.cpm contains your
Cadence Allegro Design Entry HDL projects.
While the Cadence Allegro PCB Librarian Part Developer tool refers to symbol fractures as slots, the other
tools use different names to refer to symbol fractures.
Related Information
www.cadence.com
Provides information about using the PIC design flow.
Send Feedback
QPS5V2
2015.11.02 Cadence Allegro PCB Librarian Part Developer Tool in the Design Flow 8-7
Cadence Allegro PCB Librarian Part Developer Tool in the Design Flow
Part Developer
Instantiate Symbol
in Schematic
Forward to Board
These steps are not
Layout Tool
part of the FPGA symbol
creation or update process.
Board Layout Tool
End
To run the Cadence Allegro PCB Librarian Part Developer tool, you must open a Cadence Allegro Design
Entry HDL project in the Cadence Allegro Project Manager tool. To open the Cadence Allegro PCB
Librarian Part Developer tool, on the Flows menu, click Library Management, and then click Part
Developer.
Related Information
FPGA-to-PCB Design Flow on page 8-2
Send Feedback
QPS5V2
8-8 Editing and Fracturing Symbol 2015.11.02
or
Click Use standard component to base your symbol on an existing component.
Note: Altera recommends creating a new component if you previously created a generic
component for an FPGA device. Generic components can cause some problems with your
design. When you create a new component, you can place your pin and signal assignments
from the Quartus Prime software on this component and reuse the component as a base
when you have a new FPGA design.
b. In the Library list, select an existing library. You can select from the cells in the selected library.
Each cell represents all the symbol versions and part fractures for a particular part. In the Cell list,
select the existing cell to use as a base for your part.
c. In the Destination Library list, select a destination library for the component. Click Next.
d. Review and edit the assignments you import into the Cadence Allegro PCB Librarian Part
Developer tool based on the data in the .pin and then click Finish. The location of each pin is not
included in the Preview of Import Data page of the Import and Export wizard, but input pins are
on the left side of the created symbol, output pins on the right, power pins on the top, and ground
pins on the bottom.
d[7..0] yn_out[7..0]
filtref
VCCIO1
VCCIO2
VCCIO3
VCCIO4
VCCINT
DCLK filtref
DATA0
NCONFIG CONF_DONE VCCA_PLL1
clk NSTATUS VCCA_PLL2
NCE ASDO
clkx2 follow NCSO GNDA_PLL1
MSEL0 GNDA_PLL2
MSEL1 filtref NCEO GNDG_PLL1
newt yvalid
TDI TDO GNDG_PLL2
reset TMS
GND
GND
GND
GND
GND
GND
GND
GND
GND
GND
TCK
Send Feedback
QPS5V2
2015.11.02 Updating FPGA Symbols 8-9
To fracture a part into separate slots, or to modify the slot locations of pins on parts fractured in the
Cadence Allegro PCB Librarian Part Developer tool, follow these steps:
1. Start the Cadence Allegro Design Project Manager.
2. On the Flows menu, click Library Management.
3. Click Part Developer.
4. Click the name of the package you want to change in the cell hierarchy.
5. Click Functions/Slots. If you are not creating new slots but want to change the slot location of some
pins, proceed to Step 6. If you are creating new slots, click Add. A dialog box appears, allowing you to
add extra symbol slots. Set the number of extra slots you want to add to the existing symbol, not the
total number of desired slots for the part. Click OK.
6. Click Distribute Pins. Specify the slot location for each pin. Use the checkboxes in each column to
move pins from one slot to another. Click OK.
7. After distributing the pins, click the Package Pin tab and click Generate Symbol(s).
8. Select whether to create a new symbol or modify an existing symbol in each slot. Click OK.
The newly generated or modified slot symbols appear as separate symbols in the cell hierarchy. Each of
these symbols can be edited individually.
Caution: The Cadence Allegro PCB Librarian Part Developer tool allows you to remap pin
assignments in the Package Pin tab of the main Cadence Allegro PCB Librarian Part
Developer window. If signals remap to different pins in the Cadence Allegro PCB Librarian
Part Developer tool, the changes reflect only in regenerated symbols for use in your
schematics. You cannot transfer pin assignment changes to the Quartus Prime software
from the Cadence Allegro PCB Librarian Part Developer tool, which creates a potential
mismatch of the schematic symbols and assignments in the FPGA design. If pin assignment
changes are necessary, make the changes in the Quartus Prime Pin Planner instead of the
Cadence Allegro PCB Librarian Part Developer tool, and update the symbol as described in
the following sections.
For more information about creating, editing, and organizing component symbols with the
Cadence Allegro PCB Librarian Part Developer tool, refer to the Part Developer Help.
Send Feedback
QPS5V2
8-10 Updating FPGA Symbols 2015.11.02
Part Developer
End
To update the symbol using the Cadence Allegro PCB Librarian Part Developer tool after updating
the .pin, follow these steps:
1. On the File menu, click Import and Export. The Import and Export wizard appears.
2. In the list of actions to perform, select Import ECO - FPGA. Click Next. The Select Source dialog box
appears.
3. Select the updated source of the FPGA assignment information. In the Vendor list, select Altera. In
the PnR Tool list, select quartusII. In the PR File field, click browse to specify the updated .pin in
your Quartus Prime project directory. Click Next. The Select Destination window appears.
4. Select the source component and a destination cell for the updated symbol. To create a new
component based on the updated pin assignment data, select Generate Custom Component. Selecting
Generate Custom Component replaces the cell listed under the Specify Library and Cell name
header with a new, nonfractured cell. You can preserve these edits by selecting Use standard
component and select the existing library and cell. Select the destination library for the component
and click Next. The Preview of Import Data dialog box appears.
5. Make any additional changes to your symbol. Click Next. A list of ECO messages appears
summarizing the changes made to the cell. To accept the changes and update the cell, click Finish.
6. The main Cadence Allegro PCB Librarian Part Developer window appears. You can edit, fracture, and
generate the updated symbols as usual from the main Cadence Allegro PCB Librarian Part Developer
window.
Note: If the Cadence Allegro PCB Librarian Part Developer tool is not set up to point to your PCB
Librarian Expert license file, an error message appears in red at the bottom of the message text
window of the Part Developer when you select the Import and Export command. To point to your
PCB Librarian Expert license, on the File menu, click Change Product, and select the correct
product license.
Related Information
FPGA-to-PCB Design Flow on page 8-2
Send Feedback
QPS5V2
2015.11.02 Instantiating the Symbol in the Cadence Allegro Design Entry HDL... 8-11
Instantiating the Symbol in the Cadence Allegro Design Entry HDL Software
To instantiate the symbol in your Cadence Allegro Design Entry HDL schematic after saving the new
symbol in the Cadence Allegro PCB Librarian Part Developer tool, follow these steps:
1. In the Cadence Allegro Project Manager tool, switch to the board design flow.
2. On the Flows menu, click Board Design.
3. To start the Cadence Allegro Design Entry HDL software, click Design Entry.
4. To add the newly created symbol to your schematic, on the Component menu, click Add. The Add
Component dialog box appears.
5. Select the new symbol library location, and select the name of the cell you created from the list of cells.
The symbol attaches to your cursor for placement in the schematic. To fracture the symbol into slots,
right-click the symbol and choose Version to select one of the slots for placement in the schematic.
Related Information
www.cadence.com
Provides more information about the Cadence Allegro Design Entry HDL software, including licensing,
support, usage, training, and product updates.
Send Feedback
QPS5V2
8-12 Creating a Cadence Allegro Design Entry CIS Project 2015.11.02
Figure 8-5: Design Flow with the Cadence Allegro Design Entry CIS Software
.pin
Forward to Board Developement Tool
End
Note: Routing or pin assignment changes made in a board layout tool or a Cadence Allegro Design Entry
CIS symbol cannot be back-annotated to the Quartus Prime software.
Related Information
• www.cadence.com
For more information about the Cadence Allegro Design Entry CIS software, including licensing,
support, usage, training, and product updates.
• www.ema-eda.com
For more information about the Cadence Allegro Design Entry CIS software, including licensing,
support, usage, training, and product updates.
Send Feedback
QPS5V2
2015.11.02 Generating a Part 8-13
Your new project is in the specified location and consists of the following files:
• OrCAD Capture Project File (.opj)
• Schematic Design File (.dsn)
Generating a Part
After you create a new project or open an existing project in the Cadence Allegro Design Entry CIS
software, you can generate a new schematic symbol based on your Quartus Prime FPGA design. You can
also update an existing symbol. The Cadence Allegro Design Entry CIS software stores component
symbols in OrCAD Library File (.olb). When you place a symbol in a library attached to a project, it is
immediately available for instantiation in the project schematic.
You can add symbols to an existing library or you can create a new library specifically for the symbols
generated from your FPGA designs. To create a new library, follow these steps:
1. On the File menu, point to New and click Library in the Cadence Allegro Design Entry CIS software to
create a default library named library1.olb. This library appears in the Library folder in the Project
Manager window of the Cadence Allegro Design Entry CIS software.
2. To specify a desired name and location for the library, right-click the new library and select Save As.
Saving the new library creates the library file.
Send Feedback
QPS5V2
8-14 Splitting a Part 2015.11.02
Splitting a Part
After saving a new symbol in a project library, you can fracture the symbol into multiple parts called
sections. Fracturing a part into separate sections is useful for FPGA designs. A single symbol for most
FPGA packages might be too large for a single schematic page. Splitting the part into separate sections
allows you to organize parts of the symbol by function, creating cleaner circuit schematics. For example,
you can create one slot for an I/O symbol, a second slot for a JTAG symbol, and a third slot for a power/
ground symbol.
Figure 8-6: Splitting a Symbol into Multiple Sections
d[7..0] yn_out[7..0]
filtref
VCCIO1
VCCIO2
VCCIO3
VCCIO4
VCCINT
DCLK filtref
DATA0 CONF_DONE
clk NCONFIG VCCA_PLL1
NCE NSTATUS VCCA_PLL2
ASDO
clkx2 follow NCSO GNDA_PLL1
MSEL0 GNDA_PLL2
MSEL1 filtref NCEO GNDG_PLL1
newt yvalid
TDI TDO GNDG_PLL2
reset TMS
GND
GND
GND
GND
GND
GND
GND
GND
GND
GND
TCK
Note: Although symbol generation in the Design Entry CIS software refers to symbol fractures as
sections, other tools use different names to refer to symbol fractures.
To split a part into sections, select the part in its library in the Project Manager window of the Cadence
Allegro Design Entry CIS software. On the Tools menu, click Split Part or right-click the part and choose
Split Part. The Split Part Section Input Spreadsheet appears.
Send Feedback
QPS5V2
2015.11.02 Instantiating a Symbol in a Design Entry CIS Schematic 8-15
Each row in the spreadsheet represents a pin in the symbol. The Section column indicates the section of
the symbol to which each pin is assigned. You can locate all pins in a new symbol in section 1. You can
change the values in the Section column to assign pins to various sections of the symbol. You can also
specify the side of a section on the location of the pin by changing the values in the Location column.
When you are ready, click Split. A new symbol appears in the same library as the original with the name
<original part name>_Split1.
View and edit each section individually. To view the new sections of the part, double-click the part. The
Part Symbol Editor window appears and the first section of the part displays for editing. On the View
menu, click Package to view thumbnails of all the part sections. To edit the section of the symbol, double-
click the thumbnail.
For more information about splitting parts into sections and editing symbol sections in the Cadence
Allegro Design Entry CIS software, refer to the Help in the software.
Send Feedback
QPS5V2
8-16 Altera Libraries for the Cadence Allegro Design Entry CIS Software 2015.11.02
Select the new symbol library location and the newly created part name. If you select a part that is split
into sections, you can select the section to place from the Part pop-up menu. Click OK. The symbol
attaches to your cursor for placement in the schematic. To place the symbol, click on the schematic page.
For more information about using the Cadence Allegro Design Entry CIS software, refer to the Help in
the software.
Altera Libraries for the Cadence Allegro Design Entry CIS Software
Altera provides downloadable .olb for many of its device packages. You can add these libraries to your
Cadence Allegro Design Entry CIS project and update the symbols with the pin assignments contained in
the .pin generated by the Quartus Prime software. You can use the downloaded library symbols as a base
for creating custom schematic symbols with your pin assignments that you can edit or fracture. This
method increases productivity by reducing the amount of time it takes to create and edit a new symbol.
Using the Altera-provided Libraries with your Cadence Allegro Design Entry CIS Project
To use the Altera-provided libraries with your Cadence Allegro Design Entry CIS project, follow these
steps:
1. Download the library of your target device from the Download Center page found through the
Support page on the Altera website.
2. Create a copy of the appropriate .olb to maintain the original symbols. Place the copy in a convenient
location, such as your Cadence Allegro Design Entry CIS project directory.
3. In the Project Manager window of the Cadence Allegro Design Entry CIS software, click once on the
Library folder to select it. On the Edit menu, click Project or right-click the Library folder and choose
Add File to select the copy of the downloaded .olb and add it to your project. You can locate the new
library in the list of part libraries for your project.
4. On the Tools menu, click Generate Part. The Generate Part dialog box appears.
5. In the Netlist/source file field, click Browse to specify the .pin in your Quartus Prime design.
6. From the Netlist/source file type list, select Altera Pin File.
7. For Part name, type the name of the target device the same as it appears in the downloaded library file.
For example, if you are using a device from the CYCLONE06.OLB library, type the part name to
match one of the devices in this library such as ep1c6f256. You can rename the symbol in the Project
Manager window after updating the part.
Send Feedback
QPS5V2
2015.11.02 Document Revision History 8-17
8. Set the Destination part library to the copy of the downloaded library you added to the project.
9. Select Update pins on existing part in library. Click OK.
10.Click Yes.
The symbol is updated with your pin assignments. Double-click the symbol in the Project Manager
window to view and edit the symbol. On the View menu, click Package if you want to view and edit
other sections of the symbol. If the symbol in the downloaded library is fractured into sections, you can
edit each section but you cannot further fracture the part. You can generate a new part without using
the downloaded part library if you require additional sections.
For more information about creating, editing, and fracturing symbols in the Cadence Allegro Design
Entry CIS software, refer to the Help in the software.
March 2009 9.0.0 • Chapter 9 was previously Chapter 7 in the 8.1 software release.
• No change to content.
Send Feedback
QPS5V2
8-18 Document Revision History 2015.11.02
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
Reviewing Printed Circuit Board Schematics
with the Quartus Prime Software 9
QPS5V2 Subscribe Send Feedback
Altera FPGAs and CPLDs offer a multitude of configurable options to allow you to implement a custom
application-specific circuit on your PCB.
Your Quartus Prime project provides important information specific to your programmable logic design,
which you can use in conjunction with the device literature available on Altera's website to ensure that
you implement the correct board-level connections in your schematic.
Refer to the Settings dialog box options, the Fitter report, and Messages window when creating and
reviewing your PCB schematic. The Quartus Prime software also provides the Pin Planner to assist you
during your PCB schematic review process.
Related Information
• Schematic Review Worksheets
• Pin Connection Guidelines
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V2
9-2 Device and Pins Options Dialog Box Settings 2015.11.02
If you are migrating from a smaller device with NC (no-connect) pins to a larger device with power or
ground pins in the same package, you can safely connect the NC pins to power or ground pins to facilitate
successful migration.
Related Information
Migration Devices Dialog Box
For more information about the Migration Devices dialog box in the Quartus Prime software
Configuration Settings
The Configuration page of the Device and Pin Options dialog box specifies the configuration scheme
and configuration device for the target device. Use the Configuration page settings to verify the
configuration scheme with the MSEL pin settings used on your PCB schematic and the I/O voltage of the
configuration scheme.
Your specific configuration settings may impact the availability of some dual-purpose I/O pins in user
mode.
Related Information
Dual-Purpose Pins Settings on page 9-2
Altera Corporation Reviewing Printed Circuit Board Schematics with the Quartus Prime Software
Send Feedback
QPS5V2
2015.11.02 Voltage Settings 9-3
Voltage Settings
The Voltage page specifies the default VCCIO I/O bank voltage and the default I/O bank voltage for the
pins on the target device. VCCIO I/O bank voltage settings made in the Voltage page are overridden by
I/O standard assignments made on I/O pins in their respective banks.
Related Information
Reviewing Device Pin-Out Information in the Fitter Report on page 9-3
Related Information
Device and Pin Options Dialog Box
For more information about the Device and Pins Options dialog box in the Quartus Prime software
Voltage Settings
The Voltage page, under Operating Settings and Conditions in the Settings dialog box, allows you to
specify voltage operating conditions for timing and power analyses. Ensure that the settings in the
Voltage page match the settings in your PCB schematic, especially if the target device includes
transceivers.
The Voltage page settings requirements differ depending on the settings of the transceiver instances in
the design. Refer to the Fitter report for the required settings, and verify that the voltage settings are
correctly set up for your PCB schematic.
After verifying your settings in the Device and Settings dialog boxes, you can verify your device pin-out
with the Fitter report.
Related Information
Pin Connection Guidelines
For more information about voltage settings
Reviewing Printed Circuit Board Schematics with the Quartus Prime Software Altera Corporation
Send Feedback
QPS5V2
9-4 Reviewing Device Pin-Out Information in the Fitter Report 2015.11.02
clamp diodes, and on-chip termination (OCT) pin assignments in these sections of the Fitter report. You
can check the pin assignments reported in the Input Pins, Output Pins, and Bidirectional Pins reports
against your PCB schematic to determine whether your PCB requires external components.
These reports also identify whether you made pin assignments or if the Fitter automatically placed the
pins. If the Fitter changed your pin assignments, you should make these changes user assignments
because the location of pin assignments made by the Fitter may change with subsequent compilations.
Figure 9-1: Resource Section Report
This figure shows the pins the Fitter chose for the OCT external calibration resistor connections (RUP/
RDN) and the name of the associated termination block in the Input Pins report. You should make these
types of assignments user assignments.
The I/O Bank Usage report provides a high-level overview of the VCCIO and VREF requirements for
your design, based on your I/O assignments. Verify that the requirements in this report match the settings
in your PCB schematic. All unused I/O banks, and all banks with I/O pins with undefined I/O standards,
default the VCCIO voltage to the voltage defined in the Voltage page of the Device and Pin Options
dialog box.
The All Package Pins report lists all the pins on your device, including unused pins, dedicated pins and
power/ground pins. You can use this report to verify pin characteristics, such as the location, name, usage,
direction, I/O standard and voltage for each pin with the pin information in your PCB schematic. In
particular, you should verify the recommended voltage levels at which you connect unused dedicated
inputs and I/O and power pins, especially if you selected a migration device. Use the All Package Pins
report to verify that you connected all the device voltage rails to the voltages reported.
Altera Corporation Reviewing Printed Circuit Board Schematics with the Quartus Prime Software
Send Feedback
QPS5V2
2015.11.02 Reviewing Compilation Error and Warning Messages 9-5
Errors commonly reported include connecting the incorrect voltage to the predriver supply (VCCPD) pin
in a specific bank, or leaving dedicated clock input pins floating. Unused input pins that should be
connected to ground are designated as GND+ in the Pin Name/Usage column in the All Package Pins
report.
You can also use the All Package Pins report to check transceiver-specific pin connections and verify that
they match the PCB schematic. Unused transceiver pins have the following requirements, based on the
pin designation in the Fitter report:
• GXB_GND—Unused GXB receiver or dedicated reference clock pin. This pin must be connected to
GXB_GND through a 10k Ohm resistor.
• GXB_NC—Unused GXB transmitter or dedicated clock output pin. This pin must be disconnected.
Some transceiver power supply rails have dual voltage capabilities, such as VCCA_L/R and VCCH_L/R,
that depend on the settings you created for the ALTGX parameter editor. Because these user-defined
settings overwrite the default settings, you should use the All Package Pins report to verify that these
power pins on the device symbol in the PCB schematics are connected to the voltage required by the
transceiver. An incorrect connection may cause the transceiver to function not as expected.
If your design includes a memory interface, the DQS Summary report provides an overview of each DQ
pin group. You can use this report to quickly confirm that the correct DQ/DQS pins are grouped together.
Finally, the Fitter Device Options report summarizes some of the settings made in the Device and Pin
Options dialog box. Verify that these settings match your PCB schematics.
Related Information
• Signal Integrity Analysis with Third-Party Tools on page 6-1
For more information about signal integrity analysis in the Quartus Prime software
Reviewing Printed Circuit Board Schematics with the Quartus Prime Software Altera Corporation
Send Feedback
QPS5V2
9-6 Using Additional Quartus Prime Software Tools 2015.11.02
Pin Planner
The Quartus Prime Pin Planner helps you visualize, plan, and assign device I/O pins in a graphical view of
the target device package. You can quickly locate various I/O pins and assign them design elements or
other properties to ensure compatibility with your PCB layout.
You can use the Pin Planner to verify the location of clock inputs, and whether they have been placed on
dedicated clock input pins, which is recommended when your design uses PLLs.
You can also use the Pin Planner to verify the placement of dedicated SERDES pins. SERDES receiver
inputs can be placed only on DIFFIO_RX pins, while SERDES transmitter outputs can be placed only on
DIFFIO_TX pins.
The Pin Planner gives a visual indication of signal-to-signal proximity in the Pad View window, and also
provides information about differential pin pair placement, such as the placement of pseudo-differential
signals.
Related Information
I/O Management on page 2-1
For more information about the Pin Planner
SSN Analyzer
The SSN Analyzer supports pin planning by estimating the voltage noise caused by the simultaneous
switching of output pins on the device. Because of the importance of the potential SSN performance for a
specific I/O placement, you can use the SSN Analyzer to analyze the effects of aggressor I/O signals on a
victim I/O pin.
Altera Corporation Reviewing Printed Circuit Board Schematics with the Quartus Prime Software
Send Feedback
QPS5V2
2015.11.02 Document Revision History 9-7
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Reviewing Printed Circuit Board Schematics with the Quartus Prime Software Altera Corporation
Send Feedback
2016.05.03
Design Optimization Overview
10
QPS5V2 Subscribe Send Feedback
Device Settings
Device assignments determine the timing model that the Quartus Prime software uses during
compilation.
Choose the correct speed grade to obtain accurate results and the best optimization. The device size and
the package determine the device pin-out and the available resources in the device.
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V2
10-2 I/O Assignments 2016.05.03
I/O Assignments
The I/O standards and drive strengths specified for a design affect I/O timing. Specify I/O assignments so
that the Quartus Prime software uses accurate I/O timing delays in timing analysis and Fitter
optimizations.
If there is no PCB layout requirement, then you do not need to specify pin locations. If your pin locations
are not fixed due to PCB layout requirements, then leave the pin locations unconstrained. If your pin
locations are already fixed, then make pin assignments to constrain the compilation appropriately.
Use the Assignment Editor and Pin Planner to assign I/O standards and pin locations.
Related Information
• Timing Closure and Optimization on page 12-1
For more information about recommendations for making pin assignments that can have a large effect
on your results in smaller macrocell-based architectures.
• I/O Management on page 2-1
For more information about I/O standards and pin constraints, refer to the appropriate device
handbook. For more information about planning and checking I/O assignments.
Send Feedback
QPS5V2
2016.05.03 Partitions and Floorplan Assignments for Incremental Compilation 10-3
pins with different I/O requirements, make multiple clock settings and individual I/O assignments instead
of using a global constraint.
Make any complex timing assignments required in your design, including false path and multicycle path
assignments. Common situations for these types of assignments include reset or static control signals
(when the time required for a signal to reach a destination is not important) or paths that have more than
one clock cycle available for operation in a design. These assignments enable the Quartus Prime software
to make appropriate trade-offs between timing paths and can enable the Compiler to improve timing
performance in other parts of your design.
Note: To ensure that you apply constraints or assignments to all design nodes, you can report all
unconstrained paths in your design with the Report Unconstrained Paths command in the Task
pane of the Quartus Prime TimeQuest Timing Analyzer or the report_ucp Tcl command.
Related Information
• Timing Closure and Optimization on page 12-1
For more information about optimization with physical synthesis.
• Advanced Settings (Fitter)
For more information about reducing runtime by changing Fitter effort.
• The Quartus Prime TimeQuest Timing Analyzer
For more information about timing assignments and timing analysis.
• Quartus Prime TimeQuest Timing Analyzer Cookbook
For more information about timing assignments and timing analysis.
Send Feedback
QPS5V2
10-4 Physical Implementation 2016.05.03
Physical Implementation
Most optimization issues involve preserving previous results, reducing area, reducing critical path delay,
reducing power consumption, and reducing runtime.
The Quartus Prime software includes advisors to address each of these issues and helps you optimize your
design. Run these advisors during physical implementation for advice about your specific design.
You can reduce the time spent on design iterations by following the recommended design practices for
designing with Altera devices. Design planning is critical for successful design timing implementation
®
and closure.
Related Information
Design Planning with the Quartus Prime Software
Send Feedback
QPS5V2
2016.05.03 Reducing Area 10-5
Related Information
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Designs
Reducing Area
By default, the Quartus Prime Fitter might physically spread a design over the entire device to meet the set
timing constraints. If you prefer to optimize your design to use the smallest area, you can change this
behavior. If you require reduced area, you can enable certain physical synthesis options to modify your
netlist to create a more area-efficient implementation, but at the cost of increased runtime and decreased
performance.
Related Information
• Netlist Optimizations and Physical Synthesis on page 16-1
• Timing Closure and Optimization on page 12-1
• Recommended HDL Coding Styles
Send Feedback
QPS5V2
10-6 Reducing Runtime 2016.05.03
Related Information
Power Optimization on page 13-1
Reducing Runtime
Many Fitter settings influence compilation time. Most of the default settings in the Quartus Prime
software are set for reduced compilation time. You can modify these settings based on your project
requirements.
The Quartus Prime software supports parallel compilation in computers with multiple processors. This
can reduce compilation times by up to 15%.
You can also reduce compilation time with your iterations by using incremental compilation. Use
incremental compilation when you want to change parts of your design, while keeping most of the
remaining logic unchanged.
Design Analysis
The Quartus Prime software provides tools that help with a visual representation of your design. You can
use the RTL Viewer to see a schematic representation of your design before synthesis and place-and-
route.The Technology Map Viewer provides a schematic representation of the design implementation in
the selected device architecture after synthesis and place-and-route. It can also include timing
information.
With incremental compilation, the Design Partition Planner and the Chip Planner allow you to partition
and layout your design at a higher level. In addition, you can perform many different tasks with the Chip
Planner, including: making floorplan assignments, implementing engineering change orders (ECOs), and
performing power analysis. Also, you can analyze your design and achieve a faster timing closure with the
Chip Planner. The Chip Planner provides physical timing estimates, critical path display, and a routing
congestion view to help guide placement for optimal performance.
Advisors
The Quartus Prime software includes several advisors to help you optimize your design and reduce
compilation time.
You can complete your design faster by following the recommendations in the following advisor. These
advisors give recommendations based on your project settings and your design constraints:
• Resource Optimization Advisor
• Timing Optimization Advisor
• Power Optimization Advisor
• Compilation Time Advisor
• Pin Optimization Advisor
• Arria 10 to Stratix 10 Migration Advisor
• Incremental Compilation Advisor
Send Feedback
QPS5V2
2016.05.03 Design Space Explorer II 10-7
Send Feedback
QPS5V2
10-8 Document Revision History 2016.05.03
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2016.05.02
Reducing Compilation Time
11
QPS5V2 Subscribe Send Feedback
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V2
11-2 Using Rapid Recompile 2016.05.02
A Changed
J
B G
y
C x z
D
Unchanged
Regular Compile
Rapid
Recompile
You can use Rapid Recompile to implement HDL-based functional ECO changes that affect a small subset
of a large or complex design (less than 5% of total design logic), without full recompilation. Rapid
Recompile can achieve up to 4x reduction in compilation time for impacted portions of the design.
Note: Rapid Recompile supports only Arria V, Cyclone V, Stratix V, and Arria 10 devices.
To start Rapid Recompilation following an initial compilation, click Processing > Start > Start Rapid
Recompile. Rapid Recompile implements the following type of design changes without full recompilation:
• Changes to nodes tapped by the SignalTap II Logic Analyzer
• Changes to combinational logic functions
• Changes to state machine logic (for example, new states, state transition changes)
• Changes to signal or bus latency or addition of pipeline registers
• Changes to coefficients of an adder or multiplier
• Changes register packing behavior of DSP, RAM, or I/O
• Removal of unnecessary logic
• Changes to synthesis directives
The Rapid Recompile Preservation Summary report provides detailed information about the percentage
of preserved compilation results.
Send Feedback
QPS5V2
2016.05.02 Using Parallel Compilation with Multiple Processors 11-3
The Incremental Compilation Preservation Summary report provides details about placement and
routing implementation.
Send Feedback
QPS5V2
11-4 Using Parallel Compilation with Multiple Processors 2016.05.02
You can also set the number of processors available for Quartus Prime compilation using the following
Tcl command in your script:
Different Maximum processors allowed specifications produce different results of the same quality. The
impact is similar to changing the Fitter seed setting.
The Parallel Compilation report provides detailed information about compilation using multiple
processors.
Figure 11-3: Parallel Compilation Report
Related Information
• Processing Page (Options Dialog Box)
Send Feedback
QPS5V2
2016.05.02 Using Incremental Compilation 11-5
Send Feedback
QPS5V2
11-6 Reducing Placement Time 2016.05.02
Related Information
Recommended HDL Coding Styles
For more information about coding guidelines.
Send Feedback
QPS5V2
2016.05.02 Reducing Routing Time 11-7
Related Information
Using Incremental Compilation on page 11-5
Send Feedback
QPS5V2
11-8 Reducing Static Timing Analysis Time 2016.05.02
Related Information
Processing Page (Options Dialog Box)
For more information about setting process priority, refer to Quartus Prime Help.
Send Feedback
QPS5V2
2016.05.02 Document Revision History 11-9
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2016.05.02
Timing Closure and Optimization
12
QPS5V2 Subscribe Send Feedback
The application techniques vary between designs. Applying each technique does not always improve
results. Settings and options in the Quartus Prime software have default values that provide the best trade-
off between compilation time, resource utilization, and timing performance. You can adjust these settings
to determine whether other settings provide better results for your design.
Related Information
Advanced Fitter Setting Dialog Box online help
For scripting and device family support information of the Optimize Hold Timing and Optimize Multi-
Corner Timing settings
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V2
12-2 Optimize Multi-Corner Timing 2016.05.02
If you select All Paths, the Fitter also works to meet hold requirements from registers to registers, as
highlighted in blue in the figure, in which a derived clock generated with logic causes a hold time problem
on another register.
Figure 12-1: Optimize Hold Timing Option Fixing an Internal Hold Time Violation
D Q
clk D Q
Logic
However, if your design still has internal hold time violations between registers, correct the violations by
manually adding some delays by instantiating LCELL primitives, or by making changes to your design,
such as using a clock enable signal instead of a derived or gated clock.
Related Information
Recommended Design Practices documentation
For design practices that help to eliminate internal hold time violations
Send Feedback
QPS5V2
2016.05.02 Fitter Aggressive Routability Optimization 12-3
When this option is off, the Fitter optimizes designs considering only slow-corner delays from the slow-
corner timing model (slowest manufactured device for a given speed grade, operating in low-voltage
conditions).
Settings Description
Always The Fitter always performs aggressive routability optimizations. If you set the
Fitter Aggressive Routability Optimizations logic option to Always, reducing
wire utilization may affect the performance of your design.
Never The Fitter never performs aggressive routability optimizations. If improving
timing is more important than reducing wire usage, then set this option to
Automatically or Never.
Automatically The Fitter performs aggressive routability optimizations automatically, based on
the routability and timing requirements of the design. If improving timing is
more important than reducing wire usage, then set this option to Automatically
or Never.
Design Analysis
The initial compilation establishes whether the design achieves a successful fit and meets the specified
timing requirements. This section describes how to analyze your design results in the Quartus Prime
software.
You should analyze any constraints that the Quartus Prime software ignores. If necessary, correct the
constraints and recompile your design before proceeding with design optimization.
You can view a list of ignored assignment in the Ignored Assignment Report generated by the Fitter.
Send Feedback
QPS5V2
12-4 I/O Timing (Including tPD) 2016.05.02
Related Information
• Quartus Prime TimeQuest Timing Analyzer documentation
For more information about the report_sdc command and its options
• Fitter Summary Reports online help
Related Information
Quartus Prime TimeQuest Timing Analyzer documentation
Information about how timing numbers are calculated
Register-to-Register Timing
Timing Analysis with the TimeQuest Timing Analyzer
Analyze all valid register-to-register paths by using the appropriate constraints in the TimeQuest analyzer.
To view all timing summaries, run the Report All Summaries command by double-clicking Report All
Summaries in the Tasks pane in the TimeQuest analyzer.
If any clock domains have failing paths (highlighted in red in the Report panel), right-click the Clock
Name listed in the Clocks Summary panel and go to Report Timing to get more details. Your design
meets timing requirements when you do not have negative slack on any register-to-register path on any of
the clock domains.
When timing requirements are not met, a report on the failed paths (highlighted in red) can uncover
more detail.
When you select a path listed in the TimeQuest Report Timing pane, the tabs in the corresponding path
detail pane show a path summary of source and destination registers and their timing, statistics about the
path delay, detailed information about the complete data path with all nodes in the path, and the
waveforms of the relevant signals. The Extra Fitter Information tab will show a Graphical Data Path of
where the offending path lies on the physical device. This can reveal whether the timing failure may be
distance related, due to the source and destination node being too close or too far. The Chip Planner can
also be used to investigate the physical layout of a failing path in more detail. To locate a selected path in
the Chip Planner, right-click a node, point to Locate, and select Locate in Chip Planner. The Chip
Planner appears with the path highlighted. Use this to show fanout, fanin, routing congestion, and region
assignments information, and to determine whether those factors might be contributing to the timing
critical path. Additionally, if you know that a path is not a valid path, you can set it to be a false path using
the shortcut menu.
Send Feedback
QPS5V2
2016.05.02 Tips for Analyzing Failing Paths 12-5
The Data Path tab can also be useful for determining contributions to timing critical paths. The Data
Path tab shows details of the paths that the clock and data took to get from source to destination nodes,
and the time it took on an incremental and cumulative basis. It also provides information about the
routing types and elements used, and their locations.
To view the path details of any selected path, click the Data Path tab in the path details pane. The Data
Path tab displays the details of the Data Arrival Path, as well as the Data Required Path.
The Waveform tab will show the slack relationship between arrival data and required data. This could be
useful for determining how close or far off the path is from meeting timing.
To aid in timing debug, the RTL Viewer or Technology Map Viewer allow you to see schematic represen‐
tations of your design. These viewers allow you to view a gate-level or technology-mapped representation
of your design netlist. By providing a view of the path from source and destination nodes, the viewers can
help identify areas in a design that may benefit from reducing the number of logic levels between the
nodes. To locate a timing path in one of the viewers, right-click a path in the report, point to Locate, and
click Locate in RTL Viewer or Locate in Technology Map Viewer.
Related Information
• Quartus Prime TimeQuest Timing Analyzer documentation
Information about how timing analysis results are calculated
• Analyzing Designs with Quartus Prime Netlist Viewers documentation
Related Information
Design Evaluation for Timing Closure on page 12-26
Send Feedback
QPS5V2
12-6 Tips for Analyzing Failing Clock Paths that Cross Clock Domains 2016.05.02
Tips for Analyzing Failing Clock Paths that Cross Clock Domains
When analyzing clock path failures, check whether these paths cross two clock domains. This is the case if
the From Clock and To Clock in the timing analysis report are different.
Figure 12-2: Different Value in From Clock and To Clock Field
There can also be paths that involve a different clock in the middle of the path, even if the source and
destination register clock are the same.
When you run Report Timing on your design, the report shows the launch clock and latch clock for each
failing path. Check whether these failing paths between these clock domains should be analyzed synchro‐
nously. If the failing paths are not to be analyzed synchronously, they must be set as false paths. Also
check the relationship between the launch clock and latch clock to make sure it is realistic and what you
expect from your knowledge of the design. For example, the path can start at a rising edge and end at a
falling edge, which reduces the setup relationship by one half clock cycle.
Review the clock skew reported in the Timing Report. A large skew may indicate a problem in your
design, such as a gated clock or a problem in the physical layout (for example, a clock using local routing
instead of dedicated clock routing). When you have made sure the paths are analyzed synchronously and
that there is no large skew on the path, and that the constraints are correct, you can analyze the data
path.These steps help you fine tune your constraints for paths across clock domains to ensure you get an
accurate timing report.
Check if the PLL phase shift is reducing the setup requirement. You might be able to adjust this using PLL
parameters and settings.
Paths that cross clock domains are generally protected with synchronization logic (for example, FIFOs or
double-data synchronization registers) to allow asynchronous interaction between the two clock domains.
In such cases, you can ignore the timing paths between registers in the two clock domains while running
timing analysis, even if the clocks are related.
The Fitter attempts to optimize all failing timing paths. If there are paths that can be ignored for optimiza‐
tion and timing analysis, but the paths do not have constraints that instruct the Fitter to ignore them, the
Fitter tries to optimize those paths as well. In some cases, optimizing unnecessary paths can prevent the
Fitter from meeting the timing requirements on timing paths that are critical to the design. It is beneficial
to specify all paths that can be ignored by setting false path constraints on them, so that the Fitter can put
more effort into the paths that must meet their timing requirements instead of optimizing paths that can
be ignored.
Related Information
Quartus Prime TimeQuest Timing Analyzer
Details about how to ignore timing paths that cross clock domains
Send Feedback
QPS5V2
2016.05.02 Tips for Analyzing Paths from/to the Source and Destination of Critical... 12-7
Tips for Analyzing Paths from/to the Source and Destination of Critical Path
When analyzing the failing paths in a design, it is often helpful to get a fuller picture of the many
interactions the fitter may be working on around the paths. To understand what may be pulling on a
critical path, the following report_timing command can be useful.
In the project directory, run the report_timing command, shown in the example below, in a .tcl file to
analyze the nodes in a critical path.
Copy the node names from the From Node and To Node columns of the worst path into the first two
variables, and then in the TimeQuest timing analyzer, in the Script menu, source the .tcl script.
In the resulting timing panel, timing failed paths (highlighted in red) can be located in the Chip Planner,
where information such as distance between the nodes and large fanouts can be viewed.
The figure shows a simplified example of what these reports analyzed.
Figure 12-3: Timing Report
Source Register
of Worst Path
LUT
LUT
LUT LUT LUT
LUT
LUT LUT
LUT
Legend Destination
wrst_src -> * Register of
* -> wrst_dst Worst Path
* -> wrst_src LUT
wrst_dst -> *
Critical Path
The critical path of the design is in red. The script analyzes the path between the worst source and
destination registers. The first report_timing command analyzes other path that the source is driving, as
shown in green. The second report_timing command analyzes the critical path and other path going to
the destination, shown in yellow. These commands report everything inside these two endpoints that are
pulling them in different directions. The last two report_timing commands show everything outside of
Send Feedback
QPS5V2
12-8 Tips for Locating Multiple Paths to the Chip Planner 2016.05.02
the endpoints pulling them in other directions. If any of these reports have slacks near the critical path,
then the Fitter is balancing these paths with the critical path, trying to achieve the best slack. The figure is
quite simple compared to the critical path in most designs, but it is easy to see how this can get very
complicated quickly.
Tips for Creating a .tcl Script to Monitor Critical Paths Across Compiles
Many designs have the same critical paths show up after each compile, but some suffer from having
critical paths bounce around between different hierarchies, changing with each compile.
This could happen in high speed designs where many register to register paths have very little slack.
Different placements can then result in timing failures in the marginal paths. In designs like this, create a
TQ_critical_paths.tcl script in the project directory. For a given compile, view the critical paths and then
write a generic report_timing command to capture those paths. For example, if several paths fail in a
low-level hierarchy, you can add the following command:
If there is a specific path, such as a bit of a state-machine going to other *count_sync* registers, you can
add a command as shown by the following:
This file can be sourced in the TimeQuest timing analyzer after every compilation, and new
report_timing commands can be added as new critical paths appear. This helps you monitor paths that
consistently fail and paths that are only marginal, so you can prioritize effectively.
Send Feedback
QPS5V2
2016.05.02 Optimizing Timing (LUT-Based Devices) 12-9
For details about the number and types of global routing resources available, refer to the relevant device
handbook.
Check the global signal utilization in your design to ensure that the appropriate signals have been placed
on the global routing resources. In the Compilation Report, open the Fitter report and click Resource
Section. Analyze the Global & Other Fast Signals and Non-Global High Fan-out Signals reports to
determine whether any changes are required.
You might be able to reduce skew for high fan-out signals by placing them on global routing resources.
Conversely, you can reduce the insertion delay of low fan-out signals by removing them from global
routing resources. Doing so can improve clock enable timing and control signal recovery/removal timing,
but increases clock skew. Use the Global Signal setting in the Assignment Editor to control global routing
resources.
Related Information
Report Timing Closure Recommendations Dialog Box online help
Send Feedback
QPS5V2
12-10 Timing Optimization Advisor 2016.05.02
When you expand one of the categories in the Timing Optimization Advisor, such as Maximum
Frequency (fmax) or I/O Timing (tsu, tco, tpd), the recommendations are divided into stages. The stages
show the order in which to apply the recommended settings. The first stage contains the options that are
easiest to change, make the least drastic changes to your design optimization, and have the least effect on
compilation time. Icons indicate whether each recommended setting has been made in the current
project. In the figure, the checkmark icons in the list of recommendations for Stage 1 indicate recommen‐
dations that are already implemented. The warning icons indicate recommendations that are not followed
for this compilation. The information icons indicate general suggestions. For these entries, the advisor
Send Feedback
QPS5V2
2016.05.02 I/O Timing Optimization 12-11
does not report whether these recommendations were followed, but instead explains how you can achieve
better performance. For a legend that provides more information for each icon, refer to the “How to use”
page in the Timing Optimization Advisor.
There is a link from each recommendation to the appropriate location in the Quartus Prime GUI where
you can change the settings. For example, consider the Synthesis Netlist Optimizations page of the
Settings dialog box or the Global Signals category in the Assignment Editor. This approach provides the
most control over which settings are made and helps you learn about the settings in the software. In some
cases, you can also use the Correct the Settings button to automatically make the suggested change to
global settings.
For some entries in the Timing Optimization Advisor, a button appears that allows you to further analyze
your design and gives you more information. The advisor provides a table with the clocks in the design
and indicates whether they have been assigned a timing constraint.
Send Feedback
QPS5V2
12-12 Timing-Driven Compilation 2016.05.02
Timing-Driven Compilation
This option moves registers into I/O elements if required to meet tSU or tCO assignments, duplicating the
register if necessary (as in the case in which a register fans out to multiple output locations). This option is
turned on by default and is a global setting. The option does not apply to MAX II series devices because
they do not contain I/O registers.
The Optimize IOC Register Placement for Timing option affects only pins that have a tSU or tCO
requirement. Using the I/O register is possible only if the register directly feeds a pin or is fed directly by a
pin. This setting does not affect registers with any of the following characteristics:
• Have combinational logic between the register and the pin
• Are part of a carry or cascade chain
• Have an overriding location assignment
• Use the asynchronous load port and the value is not 1 (in device families where the port is available)
Registers with the characteristics listed are optimized using the regular Quartus Prime Fitter optimiza‐
tions.
Related Information
Optimize IOC Register Placement for Timing Logic Option online help
Send Feedback
QPS5V2
2016.05.02 Programmable Delays 12-13
For more information about the Fast Input Register option, Fast Output Register option, Fast Output
Enable Register option, and Fast OCT (on-chip termination) Register option, refer to Quartus Prime
Help.
In MAX II series devices, which have no I/O registers, these assignments lock the register into the LAB
adjacent to the I/O pin if there is a pin location assignment for that I/O pin.
If the fast I/O setting is on, the register is always placed in the I/O element. If the fast I/O setting is off, the
register is never placed in the I/O element. This is true even if the Optimize IOC Register Placement for
Timing option is turned on. If there is no fast I/O assignment, the Quartus Prime software determines
whether to place registers in I/O elements if the Optimize IOC Register Placement for Timing option is
turned on.
You can also use the four fast I/O options (Fast Input Register, Fast Output Register, Fast Output
Enable Register, and Fast OCT Register) to override the location of a register that is in a LogicLock
region and force it into an I/O cell. If you apply this assignment to a register that feeds multiple pins, the
register is duplicated and placed in all relevant I/O elements. In MAX II series devices, the register is
duplicated and placed in each distinct LAB location that is next to an I/O pin with a pin location
assignment.
Programmable Delays
You can use various programmable delay options to minimize the tSU and tCO times. For Arria, Cyclone,
MAX II, MAX V, and Stratix series devices, the Quartus Prime software automatically adjusts the
applicable programmable delays to help meet timing requirements. Programmable delays are advanced
options to use only after you compile a project, check the I/O timing, and determine that the timing is
unsatisfactory. For detailed information about the effect of these options, refer to the device family
handbook or data sheet.
After you have made a programmable delay assignment and compiled the design, you can view the
implemented delay values for every delay chain for every I/O pin in the Delay Chain Summary section of
the Compilation Report.
You can assign programmable delay options to supported nodes with the Assignment Editor. You can
also view and modify the delay chain setting for the target device with the Chip Planner and Resource
Property Editor. When you use the Resource Property Editor to make changes after performing a full
compilation, recompiling the entire design is not necessary; you can save changes directly to the netlist.
Because these changes are made directly to the netlist, the changes are not made again automatically when
you recompile the design. The change management features allow you to reapply the changes on
subsequent compilations.
Although the programmable delays in newer devices are user-controllable, Altera recommends their use
for advanced users only. However, the Quartus Prime software might use the programmable delays
internally during the Fitter phase.
For details about the programmable delay logic options available for Altera devices, refer to the following
Quartus Prime Help topics:
Input Delay from Pin to Input Register logic option
Input Delay from Pin to Internal Cells logic option
Output Enable Pin Delay logic option
Delay from Output Register to Output Pin logic option
Send Feedback
QPS5V2
12-14 Use PLLs to Shift Clock Edges 2016.05.02
Input Delay from Dual-Purpose Clock Pin to Fan-Out Destinations logic option
You can achieve the same type of effect in certain devices by using the programmable delay called Input
Delay from Dual Purpose Clock Pin to Fan-Out Destinations.
Related Information
Input Delay from Dual-Purpose Clock Pin to Fan-Out Destinations Logic Option online help
Send Feedback
QPS5V2
2016.05.02 Change How Hold Times are Optimized for MAX II Devices 12-15
• Some periphery features may ignore LogicLock region assignments. When this happens, the
global promotion process may not function properly. To ensure that the global promotion
process uses the correct locations, assign specific pins to the I/Os using these periphery features.
• By default, some IP MegaCore functions apply a global signal assignment with a value of dual-
regional clock. If you constrain your logic to a regional clock region and set the global signal
assignment to Regional instead of Dual-Regional, you can reduce clock resource contention.
Related Information
Recommended Design Practices documentation
Details about synchronous design practices and coding styles
Send Feedback
QPS5V2
12-16 Improving Register-to-Register Timing Summary 2016.05.02
encoding for each state machine that was recognized during compilation. If your state machine is not
recognized, you might have to change your source code to enable it to be recognized.
Related Information
• Recommended HDL Coding Styles documentation
Coding style guidelines including examples of HDL code for inferring memory, functions, guidelines,
and sample HDL code for state machines
• AN 584: Timing Closure Methodology for Advanced FPGA Designs application note.
Send Feedback
QPS5V2
2016.05.02 Physical Synthesis Optimizations 12-17
Related Information
Design Space Explorer II online help
Related Information
• Perform WYSIWYG Primitive Resynthesis Logic Option online help
• Optimization Technique Logic Option online help
Related Information
• PowerPlay Power Optimization Logic Option online help
• Power Optimization documentation on page 13-1
Send Feedback
QPS5V2
12-18 Optimize Synthesis for Speed, Not Area 2016.05.02
Related Information
• Optimization Technique Logic Option online help
• Design Space Explorer II online help
Related Information
State Machine Processing Logic Option online help
Send Feedback
QPS5V2
2016.05.02 Duplicate Logic for Fan-Out Control 12-19
Related Information
Manual Logic Duplication Logic Option online help
Send Feedback
QPS5V2
12-20 Fitter Seed 2016.05.02
Fitter Seed
The Fitter seed affects the initial placement configuration of the design. Changing the seed value changes
the Fitter results because the fitting results change whenever there is a change in the initial conditions.
Each seed value results in a somewhat different fit, and you can experiment with several different seeds to
attempt to obtain better fitting results and timing performance.
When there are changes in your design, there is some random variation in performance between compila‐
tions. This variation is inherent in placement and routing algorithms—there are too many possibilities to
try them all and get the absolute best result, so the initial conditions change the compilation result.
Note: Any design change that directly or indirectly affects the Fitter has the same type of random effect as
changing the seed value. This includes any change in source files, Compiler Settings or Timing
Analyzer Settings. The same effect can appear if you use a different computer processor type or
different operating system, because different systems can change the way floating point numbers
are calculated in the Fitter.
If a change in optimization settings slightly affects the register-to-register timing or number of failing
paths, you cannot always be certain that your change caused the improvement or degradation, or whether
it could be due to random effects in the Fitter. If your design is still changing, running a seed sweep
(compiling your design with multiple seeds) determines whether the average result has improved after an
optimization change and whether a setting that increases compilation time has benefits worth the
increased time, such as with physical synthesis settings. The sweep also shows the amount of random
variation to expect for your design.
If your design is finalized, you can compile your design with different seeds to obtain one optimal result.
However, if you subsequently make any changes to your design, you might need to perform seed sweep
again.
On the Assignments menu, select Compiler Settings to control the initial placement with the seed. You
can use the DSE II to perform a seed sweep easily.
You can use the following Tcl command from a script to specify a Fitter seed:
Related Information
Design Space Explorer II online help
Information about compiling your design with different seeds using Design Space Explorer II
Related Information
Router Timing Optimization Level Logic Option online help
Send Feedback
QPS5V2
2016.05.02 LogicLock Assignments 12-21
LogicLock Assignments
Using LogicLock assignments to improve timing performance is only recommended for older Altera
devices, such as the MAX II family. For other device families, especially for larger devices such as Arria
and Stratix series devices, Altera does not recommend using LogicLock assignments to improve timing
performance. For these devices, use the LogicLock feature for performance preservation and to floorplan
your design.
LogicLock assignments do not always improve the performance of the design. In many cases, you cannot
improve upon results from the Fitter by making location assignments. If there are existing LogicLock
assignments in your design, remove the assignments if your design methodology permits it. Recompile
the design, and then check if the assignments are making the performance worse.
When making LogicLock assignments, it is important to consider how much flexibility to give the Fitter.
LogicLock assignments provide more flexibility than hard location assignments. Assignments that are
more flexible require higher Fitter effort, but reduce the chance of design overconstraint. The following
types of LogicLock assignments are available, listed in the order of decreasing flexibility:
• Auto size, floating location regions
• Fixed size, floating location regions
• Fixed size, locked location regions
If you are unsure of how big or where a LogicLock region should go, the Auto/Floating options are useful
for your first pass. After you determine where a LogicLock region must go, modify the Fixed/Locked
regions, as Auto/Floating LogicLock regions can hurt your overall performance. To determine what to put
into a LogicLock region, refer to the timing analysis results and analyze the critical paths in the Chip
Planner. The register-to-register timing paths in the Timing Analyzer section of the Compilation Report
help you recognize patterns.
Related Information
Analyzing and Optimizing the Design Floorplan with the Chip Planner on page 15-1
Hierarchy Assignments
For a design with the hierarchy shown in the figure, which has failing paths in the timing analysis results
similar to those shown in the table, mod_A is probably a problem module. In this case, a good strategy to
fix the failing paths is to place the mod_A hierarchy block in a LogicLock region so that all the nodes are
closer together in the floorplan.
Figure 12-6: Design Hierarchy
Top
mod_A mod_B
Send Feedback
QPS5V2
12-22 Location Assignments 2016.05.02
From To
|mod_A|reg1 |mod_A|reg9
|mod_A|reg3 |mod_A|reg5
|mod_A|reg4 |mod_A|reg6
|mod_A|reg7 |mod_A|reg10
|mod_A|reg0 |mod_A|reg2
Hierarchical LogicLock regions are also important if you are using an incremental compilation flow. Place
each design partition for incremental compilation in a separate LogicLock region to reduce conflicts and
ensure good results as the design develops. You can use the auto size and floating location regions to find
a good design floorplan, but fix the size and placement to achieve the best results in future compilations.
Related Information
Analyzing and Optimizing the Design Floorplan with the Chip Planner on page 15-1
Location Assignments
If a small number of paths are failing to meet their timing requirements, you can use hard location
assignments to optimize placement. Location assignments are less flexible for the Quartus Prime Fitter
than LogicLock assignments. In some cases, when you are familiar with your design, you can enter
location constraints in a way that produces better results.
Note: Improving fitting results, especially for larger devices, such as Arria and Stratix series devices, can
be difficult. Location assignments do not always improve the performance of the design. In many
cases, you cannot improve upon the results from the Fitter by making location assignments.
Send Feedback
QPS5V2
2016.05.02 Periphery to Core Register Placement and Routing Optimization 12-23
Related Information
• Understanding Metastability in FPGAs white paper
• Managing Metastability with the Quartus Prime Software documentation
This option is available as a global assignment, or can be applied to specific instances within your design.
Figure 12-7: Periphery to Core Register Placement and Routing Optimization (P2C) Flow
P2C runs after periphery placement, and generates placement for core registers on corresponding
P2C/C2P paths, and core routing to and from these core registers.
User Design
Synthesis
Routing
Design Implementation
Related Information
• Setting Periphery to Core Optimizations in the Advanced Fitter Setting Dialog Box on page 12-24
• Setting Periphery to Core Optimizations in the Assignment Editor on page 12-24
• Viewing Periphery to Core Optimizations in the Fitter Report on page 12-25
Send Feedback
QPS5V2
12-24 Setting Periphery to Core Optimizations in the Advanced Fitter Setting... 2016.05.02
Setting Periphery to Core Optimizations in the Advanced Fitter Setting Dialog Box
The Periphery to Core Placement and Routing Optimization setting specifies whether the Fitter should
perform targeted placement and routing optimization on direct connections between periphery logic and
registers in the FPGA core.
You can optionally perform periphery to core optimizations by instance with settings in the Assignment
Editor.
1. In the Quartus Prime software, click Assignments > Settings > Compiler Settings > Advanced
Settings (Fitter).
2. In the Advanced Fitter Settings dialog box, for the Periphery to Core Placement and Routing
Optimization option, select one of the following options depending on how you want to direct
periphery to core optimizations in your design:
a. Select Auto to direct the software to automatically identify transfers with tight timing windows,
place the core registers, and route all connections to or from the periphery.
b. Select On to direct the software to globally optimize all transfers between the periphery and core
registers, regardless of timing requirements.
Note: Setting this option to On in the Advanced Fitter Settings is not recommended. The
intended use for this setting is in the Assignment Editor to force optimization for a targeted
set of nodes or instance.
c. Select Off to disable periphery to core path optimization in your design.
Related Information
• Periphery to Core Register Placement and Routing Optimization on page 12-23
• Setting Periphery to Core Optimizations in the Assignment Editor on page 12-24
Send Feedback
QPS5V2
2016.05.02 Viewing Periphery to Core Optimizations in the Fitter Report 12-25
Related Information
• Periphery to Core Register Placement and Routing Optimization on page 12-23
• Setting Periphery to Core Optimizations in the Advanced Fitter Setting Dialog Box on page 12-24
Table 12-4: Fitter Report - Periphery to Core Transfer Optimization (P2C) Summary
Send Feedback
QPS5V2
12-26 Design Evaluation for Timing Closure 2016.05.02
Related Information
Periphery to Core Register Placement and Routing Optimization on page 12-23
Send Feedback
QPS5V2
2016.05.02 Evaluate Physical Synthesis Results 12-27
for example, unconnected ports, ignored constraints, missing files, and assumptions or optimizations that
the software made.
When you enable physical synthesis, the compilation messages include a information about the physical
synthesis algorithm performance improvement. The reported improvement is the sum of the largest
improvement in each timing-critical clock domain. Although typically similar, the values for the slack
improvements vary per compilation due to the random starting point of compilation algorithms.
Send Feedback
QPS5V2
12-28 Evaluate Resource Usage 2016.05.02
registers the same way. If the changes are made to match what the physical synthesis algorithms did, the
physical synthesis options can be turned off to save compile time while getting the same type of
performance improvement.
The Non-Global High Fan-Out Signals report lists the highest fan-out nodes that are not routed on global
signals. Reset and enable signals are at the top of the list. If there is routing congestion in the design, and
there are high fan-out non-global nodes in the congested area, consider using global or regional signals to
fan-out the nodes, or duplicate the high fan-out registers so that each of the duplicates can have fewer fan-
outs. Use the Chip Planner to locate high fan-out nodes, to report routing congestion, and to determine
whether the alternatives are viable.
Routing Usage
Review routing usage reported in the Fitter Resource Usage Summary report. The figure shows an
example of the report.
Send Feedback
QPS5V2
2016.05.02 Wires Added for Hold 12-29
The average interconnect usage reports the average amount of interconnect that is used, out of what is
available on the device. The peak interconnect usage reports the largest amount of interconnect used in
the most congested areas. Designs with an average value below 50% typically do not have any problems
with routing. Designs with an average between 50-65% may have difficulty routing. Designs with an
average over 65% typically have difficulty meeting timing unless the RTL is well designed to tolerate a
highly utilized chip. Peak values at or above 90% are likely to have problems with timing closure; a 100%
peak value indicates that all routing in an area of the device has been used, so there is a high possibility of
degradation in timing performance. The figure shows the Report Routing Utilization report.
Figure 12-11: Report Routing Utilization Report
Send Feedback
QPS5V2
12-30 Wires Added for Hold 2016.05.02
An example of an incorrect constraint which can cause the router to add wire for hold requirements is
when there is data transfer from 1x to 2x clocks. Assume the design intent is to allow two cycles per
transfer. Data can arrive any time in the two destination clock cycles by adding a multicycle setup
constraint as shown in the example:
The timing requirement is relaxed by one 2x clock cycle, as shown in the black line in the waveform in the
figure.
Figure 12-13: Timing Requirement Relaxed Waveform
However, the default hold requirement, shown with the dashed blue line, may cause the router to add wire
to guarantee that data is delayed by one cycle. To correct the hold requirement, add a multicycle
constraint with a hold option.
Send Feedback
QPS5V2
2016.05.02 Wires Added for Hold 12-31
The orange dashed line in the figure above represents the hold relationship, and no extra wire is required
to delay the data.
The router can also add wire for hold timing requirements when data is transferred in the same clock
domain, but between clock branches that use different buffering. Transferring between clock network
types happens more often between the periphery and the core. The figure below shows a case where data
is coming into a device, and uses a periphery clock to drive the source register, and a global clock to drive
the destination register. A global clock buffer has larger insertion delay than a periphery clock buffer. The
clock delay to the destination register is much larger than to the source register, hence extra delay is
necessary on the data path to ensure that it meets its hold requirement.
Figure 12-14: Clock Delay
To identify cases where a path has different clock network types, review the path in the TimeQuest timing
analyzer, and check nodes along the source and destination clock paths. Also, check the source and
destination clock frequencies to see whether they are the same, or multiples, and whether there are
multicycle exceptions on the paths. In some cases, cross-domain paths may also be false by intent, so
make sure there are false path exceptions on those.
If you suspect that routing is added to fix real hold problems, then disable the Optimize hold timing
option. Recompile the design and rerun timing analysis to uncover paths that fail hold time.
Figure 12-15: Optimize Hold Timing Option
Send Feedback
QPS5V2
12-32 Evaluate Other Reports and Adjust Settings Accordingly 2016.05.02
Disabling the Optimize hold timing option is a debug step, and should be left enabled (default state)
during normal compiles. Wire added for hold is a normal part of timing optimization during routing and
is not always a problem.
Review Floorplan
Use the Chip Planner for reviewing placement. The Chip Planner can be used to locate hierarchical
entities, and colors each located entity in the floorplan. Look for logic that seems out of place, based on
where you would expect it to be. For example, logic that interfaces with I/Os should be close to the I/Os,
and logic that interfaces with an IP or memory must be close to the IP or memory. The figure shows an
example of a floorplan with color-coded entities. In the floorplan, the green block is spread apart. Check
to see if those paths are failing timing, and if so, what connects to that module that could affect placement.
The blue and aqua blocks are spread out and mixed together. Check and see if there are many connections
between the two modules that may contribute to this. The pink logic at the bottom should interface with
I/Os at the bottom edge.
Send Feedback
QPS5V2
2016.05.02 Evaluate Placement and Routing 12-33
Check fan-in and fan-out of a highlighted module by using the buttons on the task bar shown in the figure
below.
Figure 12-17: Fan-in and Fan-Out Buttons
Look for signals that go a long way across the chip and see if they are contributing to timing failures.
Check global signal usage for signals that may affect logic placement. Logic feeding a global buffer may be
pulled close to the buffer, away from related logic. High fan-out on non-global resource may pull logic
together.
Check for routing congestion. Highly congested areas may cause logic to be spread out, and the design
may be difficult to route.
Send Feedback
QPS5V2
12-34 Adjust Fitter Effort 2016.05.02
reviewing and optimizing other settings and RTL. Try an increased value, up to 4, and reset to default if
performance or compile time does not improve.
Figure 12-18: Placement Effort Multiplier
Send Feedback
QPS5V2
2016.05.02 Review Timing Constraints 12-35
Send Feedback
QPS5V2
12-36 Global Network Buffers 2016.05.02
The Extra Fitter Information tab shows a miniature floorplan with the path highlighted. The path can
also be located in the Chip Planner for viewing routing congestion, and to view whether nodes in a path
are placed close together or far apart.
Source Location
If the register feeding the global buffer cannot be moved closer, then consider changing either the design
logic or the routing type.
Insertion Delay
If a global signal is required, consider adding half a cycle to timing by using a negative-edge triggered
register to generate the signal (top figure) and use a multicycle setup constraint (bottom figure).
Figure 12-21: Negative-Edge Triggered Register
Send Feedback
QPS5V2
2016.05.02 Fan-Out 12-37
Fan-Out
Nodes with very high fan-out that use local routing tend to pull logic that they drive close to the source
node. This can make other paths fail timing. Duplicating registers can help reduce the impact of high fan-
out paths. Consider manually duplicating and preserving these registers. Using a MAX_FANOUT assignment
may make arbitrary groups of fan-out nodes, whereas a designer can make more intelligent fan-out
groups.
Global Networks
If a signal should use a different type of global signal than it has automatically been assigned, use the
Global Signal assignment to control the global signal usage on a per-signal basis. For example, if local
routing is desired, set the Global Signal assignment to OFF.
Figure 12-23: Global Signal Assignment
Suspicious Setup
Suspicious setup failures include paths with very small or very large requirements. One typical cause is
math precision error. For example, 10Mhz/3 = 33.33 ns per period. In three cycles, the time would be
99.999 ns vs 100.000 ns. Setting a maximum delay could provide an appropriate setup relationship.
Another cause of failure would be paths that should be false by design intent, such as:
• asynchronous paths that are handled through FIFOs, or
• slow asynchronous paths that rely on handshaking for data that remain available for multiple clock
cycles.
To prevent the Fitter from having to meet unnecessarily restrictive timing requirements, consider adding
false or multicycle path statements.
Send Feedback
QPS5V2
12-38 Logic Depth 2016.05.02
Logic Depth
The Statistics tab in the TimeQuest path report shows the levels of logic in a path. If the path fails timing
and the number of logic levels is high, consider adding pipelining in that part of the design.
Clocking Architecture
Review the clock region boundaries in the Chip Planner. You must place registers driven by a regional
clock in one quadrant of the chip.
Figure 12-24: Clock Regions
Send Feedback
QPS5V2
2016.05.02 Timing Closure Recommendations 12-39
Timing failure can occur when the I/O interface at the top of the device connects to logic driven by a
regional clock which is in one quadrant of the device, and placement restrictions force long paths to and
from some of the I/Os to logic across quadrants.
Use a different type of clock source to drive the logic - global, which covers the whole device, or dual-
regional which covers half the device. Alternatively, you can reduce the frequency of the I/O interface to
accommodate the long path delays. You can also redesign the pinout of the device to place all the specified
I/Os adjacent to the regional clock quadrant. This issue can happen when register locations are restricted,
such as with LogicLock regions, clocking resources, or hard blocks (memories, DSPs, IPs). The Extra
Fitter Information tab in the TimeQuest report informs you when placement is restricted for nodes in a
path.
Scripting Support
You can run procedures and make settings described in this manual in a Tcl script. You can also run some
procedures at a command prompt. For detailed information about scripting command options, refer to
the Quartus Prime command-line and Tcl API Help browser. To run the Help browser, type the following
command at the command prompt:
quartus_sh --qhelp
You can specify many of the options described in this section either in an instance, or at a global level, or
both.
Send Feedback
QPS5V2
12-40 Initial Compilation Settings 2016.05.02
Note: If the <value> field includes spaces (for example, ‘Standard Fit’), you must enclose the value in
straight double quotation marks.
Related Information
• Tcl Scripting documentation on page 5-1
• Quartus Prime Settings Reference File Manual
• Command-Line Scripting documentation on page 4-1
Send Feedback
QPS5V2
2016.05.02 Resource Utilization Optimization Techniques (LUT-Based Devices) 12-41
(1)
Allowed values for this setting depend on the device family that you select.
Send Feedback
QPS5V2
12-42 I/O Timing Optimization Techniques (LUT-Based Devices) 2016.05.02
Send Feedback
QPS5V2
2016.05.02 Document Revision History 12-43
2014.12.15 14.1.0 • Updated location of Fitter Settings, Analysis & Synthesis Settings,
and Physical Synthesis Optimizations to Compiler Settings.
• Updated DSE II content.
Send Feedback
QPS5V2
12-44 Document Revision History 2016.05.02
May 2013 13.0.0 • Renamed chapter title from Area and Timing Optimization to
Timing Closure and Optimization.
• Removed design and area/resources optimization information.
• Added the following sections:
Fitter Aggressive Routability Optimization.
Tips for Analyzing Paths from/to the Source and Destination of
Critical Path.
Tips for Locating Multiple Paths to the Chip Planner.
Tips for Creating a .tcl Script to Monitor Critical Paths Across
Compiles.
Send Feedback
QPS5V2
2016.05.02 Document Revision History 12-45
Send Feedback
QPS5V2
12-46 Document Revision History 2016.05.02
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
Power Optimization
13
QPS5V2 Subscribe Send Feedback
Power Optimization
The Quartus Prime software offers power-driven compilation to fully optimize device power
consumption. Power-driven compilation focuses on reducing your design’s total power consumption
using power-driven synthesis and power-driven place-and-route.
This chapter describes the power-driven compilation feature and flow in detail, as well as low power
design techniques that can further reduce power consumption in your design. The techniques primarily
target Arria®, Stratix®, and Cyclone® series of devices. These devices utilize a low-k dielectric material that
dramatically reduces dynamic power and improves performance. Arria series, Stratix IV, and Stratix V
device families include efficient logic structures called adaptive logic modules (ALMs) that obtain
maximum performance while minimizing power consumption. Cyclone device families offer the optimal
blend of high performance and low power in a low-cost FPGA.
Altera provides the Quartus Prime PowerPlay Power Analyzer to aid you during the design process by
delivering fast and accurate estimations of power consumption. You can minimize power consumption,
while taking advantage of the industry’s leading FPGA performance, by using the tools and techniques
described in this chapter.
Total FPGA power consumption is comprised of I/O power, core static power, and core dynamic power.
This chapter focuses on design optimization options and techniques that help reduce core dynamic power
and I/O power. In addition to these techniques, there are additional power optimization techniques
available for specific devices. These techniques include:
• Programmable Power Technology
• Device Speed Grade Selection
Related Information
• Literature and Technical Documentation
For more information about a device-specific architecture, refer to the device handbook on the Altera
website.
• PowerPlay Power Analysis
For more information about the PowerPlay Power Analyzer, refer to volume 3 of the Quartus Prime
Handbook.
• AN 514: Power Optimization in Stratix IV FPGAs
For more information about power optimization techniques available for Stratix IV devices.
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V2
13-2 Power Dissipation 2015.11.02
Power Dissipation
You can refine techniques that reduce power consumption in your design by understanding the sources of
power dissipation.
The following figure shows the power dissipation of Stratix and Cyclone devices in different designs. All
designs were analyzed at a fixed clock rate of 100 MHz and exhibited varied logic resource utilization
across available resources.
Figure 13-1: Average Core Dynamic Power Dissipation
Average Core Dynamic Power Dissipation by Block Average Core Dynamic Power Dissipation by Block
Type in Stratix III Devices at a 12.5% Toggle Rate (1) Type in Cyclone III Devices at a 12.5% Toggle Rate (2)
Memory Memory
21% 20%
Combinational Logic
DSP Blocks Combinational Logic Multipliers 11%
1% (3) 16% 1% (3)
Registered Logic Registered Logic
18% 23%
Notes:
1. 103 different designs were used to obtain these results.
2. 96 different designs were used to obtain these results.
3. In designs using DSP blocks, DSPs consumed 5% of core dynamic power.
In Stratix and Cyclone device families, a series of column and row interconnect wires of varying lengths
provide signal interconnections between logic array blocks (LABs), memory block structures, and digital
signal processing (DSP) blocks or multiplier blocks. These interconnects dissipate the largest component
of device power.
FPGA combinational logic is another source of power consumption. The basic building block of logic in
the latest Stratix series devices is the ALM, and in Cyclone IV GX devices, it is the logic element (LE).
For more information about ALMs and LEs in Cyclone or Stratix devices, refer to the respective device
handbook.
Memory and clock resources are other major consumers of power in FPGAs. Stratix devices feature the
TriMatrix memory architecture. TriMatrix memory includes 512-bit M512 blocks, 4-Kbit M4K blocks,
and 512-Kbit M-RAM blocks, which are configurable to support many features. Stratix IV TriMatrix on-
chip memory is an enhancement based upon the Stratix II FPGA TriMatrix memory and includes three
sizes of memory blocks: MLAB blocks, M9K blocks, and M144K blocks. Stratix IV and Stratix V devices
feature Programmable Power Technology, an advanced architecture that enables a smooth trade-off
between speed and power. The core of each Stratix IV and Stratix V device is divided into tiles, each of
which may be put into a high-speed or low-power mode. The primary benefit of Programmable Power
Send Feedback
QPS5V2
2015.11.02 Design Space Explorer II 13-3
Technology is to reduce static power, with a secondary benefit being a small reduction in dynamic power.
Cyclone IV GX devices have 9-Kbit M9K memory blocks.
The power optimizations, under Exploration mode, target overall design power improvements. These
settings focus on applying different options that specifically reduce total design thermal power.
By default, the Quartus Prime PowerPlay Power Analyzer is run for every exploration performed by DSE
II when power optimizations are selected. This helps you debug your design and determine trade-offs
between power requirements and performance optimization.
DSE II automatically tries different combinations of netlist optimizations and advanced Quartus Prime
software compiler settings, and reports the best settings for your design, based on your chosen primary
Send Feedback
QPS5V2
13-4 Power-Driven Compilation 2015.11.02
optimization goal. You can try different seeds with DSE II if you are fairly close to meeting your timing or
area requirements and find one seed that meets timing or area requirements. Finally, DSE II can run
compilations on a remote compute farm, which shortens the timing closure process
• Name your DSE II session and specify the type of compilation to perform.
• Set Exploration Points and specify Exploration mode and the number and types of Seeds to use.
• Specify the Design File Setup including the use of a specified Quartus Archive File (.qar) or create a
new one.
• Specify Limits to the operation of DSE II.
• Specify the type of Results to save.
• When using a remote compute farm, DSE II uses the values in the DSE Server Settings box to specify
a registration host and network ports to connect.
• Options in the Advanced settings allow you to specify options such as:
• Turn on the option to specify exploration points without compiling.
• Specify the Maximum number of parallel compilations used by DSE II.
• Specify the Maximum number of CPUs that can be used by DSE II.
• Specify a quality of fit formula.
When you have completed your configuration, you can perform an exploration by clicking Start.
Related Information
Launch the Design Space Explorer II
For more information about the DSE II, refer to Quartus Prime Help.
Power-Driven Compilation
The standard Quartus Prime compilation flow consists of Analysis and Synthesis, placement and routing,
Assembly, and Timing Analysis. Power-driven compilation takes place at the Analysis and Synthesis and
Place-and-Route stages.
Quartus Prime software settings that control power-driven compilation are located in the PowerPlay
power optimization during synthesis list in the Advanced Settings (Synthesis) dialog box, and the
PowerPlay power optimization during fitting list on the Advanced Fitter Settings dialog box. The
following sections describes these power optimization options at the Analysis and Synthesis and Fitter
levels.
Power-Driven Synthesis
Synthesis netlist optimization occurs during the synthesis stage of the compilation flow. The optimization
technique makes changes to the synthesis netlist to optimize your design according to the selection of
area, speed, or power optimization. This section describes power optimization techniques at the synthesis
level.
To access the PowerPlay Power Optimization During Synthesis option, click Assignments > Settings >
Compiler Settings > Advanced Settings (Synthesis).
You can apply these settings on a project or entity level.
Send Feedback
QPS5V2
2015.11.02 Power-Driven Synthesis 13-5
Settings Description
Off No netlist, placement, or routing optimizations are performed
to minimize power.
Normal Low compute effort algorithms are applied to minimize power
compilation through netlist optimizations as long as they are not expected
(Default) to reduce design performance.
Extra effort High compute effort algorithms are applied to minimize
power through netlist optimizations. Max performance might
be impacted.
The Normal compilation setting is turned on by default. This setting performs memory optimization and
power-aware logic mapping during synthesis.
Memory blocks can represent a large fraction of total design dynamic power. Minimizing the number of
memory blocks accessed during each clock cycle can significantly reduce memory power. Memory
optimization involves effective movement of user-defined read/write enable signals to associated read-
and-write clock enable signals for all memory types.
A default implementation of a simple dual-port memory block in which write-clock enable signals and
read-clock enable signals are connected to VCC, making both read and write memory ports active during
each clock cycle.
Figure 13-3: Memory Transformation
Clock Clock
Memory transformation effectively moves the read-enable and write-enable signals to the respective read-
clock enable and write-clock enable signals. By using this technique, memory ports are shut down when
they are not accessed. This significantly reduces your design’s memory power consumption. For Stratix IV
and Stratix V devices, the memory transformation takes place at the Fitter level by selecting the Normal
compilation settings for the power optimization option.
In Cyclone IV GX and Stratix IV devices, the specified read-during-write behavior can significantly
impact the power of single-port and bidirectional dual-port RAMs. It is best to set the read-during-write
parameter to “Don’t care” (at the HDL level), as it allows an optimization whereby the read-enable
signal can be set to the inversion of the existing write-enable signal (if one exists). This allows the core
of the RAM to shut down (that is, not toggle), which saves a significant amount of power.
The other type of power optimization that takes place with the Normal compilation setting is power-
aware logic mapping. The power-aware logic mapping reduces power by rearranging the logic during
synthesis to eliminate nets with high toggle rates.
Send Feedback
QPS5V2
13-6 Power-Driven Synthesis 2015.11.02
The Extra effort setting performs the functions of the Normal compilation setting and other memory
optimizations to further reduce memory power by shutting down memory blocks that are not accessed.
This level of memory optimization can require extra logic, which can reduce design performance.
The Extra effort setting also performs power-aware memory balancing. Power-aware memory balancing
automatically chooses the best memory configuration for your memory implementation and provides
optimal power saving by determining the number of memory blocks, decoder, and multiplexer circuits
required. If you have not previously specified target-embedded memory blocks for your design’s memory
functions, the power-aware balancer automatically selects them during memory implementation.
The following figure is an example of a 4k × 4 (4k deep and 4 bits wide) memory implementation in two
different configurations using M4K memory blocks available in some Stratix devices.
Figure 13-4: 4K × 4 Memory Implementation Using Multiple M4K Blocks
Addr[10:11] Addr
Decoder
Data[0:3]
4
Addr[10:11]
Data[0:3]
The minimum logic area implementation uses M4K blocks configured as 4k × 1. This implementation is
the default in the Quartus Prime software because it has the minimum logic area (0 logic cells) and the
highest speed. However, all four M4K blocks are active on each memory access in this implementation,
which increases RAM power. The minimum RAM power implementation is created by selecting Extra
effort in the PowerPlay power optimization list. This implementation automatically uses four M4K
blocks configured as 1k × 4 for optimal power saving. An address decoder is implemented by the RAM
megafunction to select which of the four M4K blocks should be activated on a given cycle, based on the
state of the top two user address bits. The RAM megafunction automatically implements a multiplexer to
feed the downstream logic by choosing the appropriate M4K output. This implementation reduces RAM
power because only one M4K block is active on any cycle, but it requires extra logic cells, costing logic
area and potentially impacting design performance.
There is a trade-off between power saved by accessing fewer memories and power consumed by the extra
decoder and multiplexor logic. The Quartus Prime software automatically balances the power savings
against the costs to choose the lowest power configuration for each logical RAM. The benchmark data
shows that the power-driven synthesis can reduce memory power consumption by as much as 60% in
Stratix devices.
Memory optimization options can also be controlled by the Low_Power_Mode parameter in the Default
Parameters page of the Settings dialog box. The settings for this parameter are None, Auto, and ALL.
None corresponds to the Off setting in the PowerPlay power optimization list. Auto corresponds to the
Normal compilation setting and ALL corresponds to the Extra effort setting, respectively. You can apply
PowerPlay power optimization either on a compiler basis or on individual entities. The Low_Power_Mode
Send Feedback
QPS5V2
2015.11.02 Power-Driven Fitter 13-7
parameter always takes precedence over the Optimize Power for Synthesis option for power optimiza‐
tion on memory.
You can also set the MAXIMUM_DEPTH parameter manually to configure the memory for low power
optimization. This technique is the same as the power-aware memory balancer, but it is manual rather
than automatic like the Extra effort setting in the PowerPlay power optimization list. You can set the
MAXIMUM_DEPTH parameter for memory modules manually in the megafunction instantiation or in the IP
Catalog for power optimization. The MAXIMUM_DEPTH parameter always takes precedence over the
Optimize Power for Synthesis options for power optimization on memory optimization.
Related Information
Reducing Memory Power Consumption on page 13-11
For more information about clock enable signals.
Power-Driven Fitter
The Compiler Settings page provides access to PowerPlay power optimization settings.
You can apply these settings only on a project-wide basis. The Extra effort setting for the Fitter requires
extensive effort to optimize the design for power and can increase the compilation time.
Settings Description
Off No netlist, placement, or routing optimizations are performed to minimize power.
Normal Low compute effort algorithms are applied to minimize power through placement
compilation and routing optimizations as long as they are not expected to reduce design
(Default) performance.
Extra effort High compute effort algorithms are applied to minimize power through placement
and routing optimizations. Max performance might be impacted.
The Normal compilation setting is selected by default and performs DSP optimization by creating
power-efficient DSP block configurations for your DSP functions. For Stratix IV and Stratix V devices,
this setting, which is based on timing constraints entered for the design, enables the Programmable Power
Technology to configure tiles as high-speed mode or low-power mode. Programmable Power Technology
is always turned ON even when the OFF setting is selected for the PowerPlay power optimization
option. Tiles are the combination of LAB and MLAB pairs (including the adjacent routing associated with
LAB and MLAB), which can be configured to operate in high-speed or low-power mode. This level of
power optimization does not have any affect on the fitting, timing results, or compile time.
The Extra effort setting performs the functions of the Normal compilation setting and other place-and-
route optimizations during fitting to fully optimize the design for power. The Fitter applies an extra effort
to minimize power even after timing requirements have been met by effectively moving the logic closer
during placement to localize high-toggling nets, and using routes with low capacitance. However, this
effort can increase the compilation time.
The Extra effort setting uses a Value Change Dump File (.vcd) that guides the Fitter to fully optimize the
design for power, based on the signal activity of the design. The best power optimization during fitting
results from using the most accurate signal activity information. Signal activities from full post-fit netlist
(timing) simulation provide the highest accuracy because all node activities reflect the actual design
behavior, provided that supplied input vectors are representative of typical design operation. If you do not
have a .vcd file, the Quartus Prime software uses assignments, clock assignments, and vectorless
estimation values (PowerPlay Power Analyzer Tool settings) to estimate the signal activities. This
information is used to optimize your design for power during fitting. The benchmark data shows that the
Send Feedback
QPS5V2
13-8 Area-Driven Synthesis 2015.11.02
power-driven Fitter technique can reduce power consumption by as much as 19% in Stratix devices. On
average, you can reduce core dynamic power by 16% with the Extra effort synthesis and Extra effort fitting
settings, as compared to the Off settings in both synthesis and Fitter options for power-driven compila‐
tion.
Note: Only the Extra effort setting in the PowerPlay power optimization list for the Fitter option uses
the signal activities (from .vcd files) during fitting. The settings made in the PowerPlay Power
Analyzer Settings page in the Settings dialog box are used to calculate the signal activity of your
design.
Related Information
• AN 514: Power Optimization in Stratix IV FPGAs
For more information about Stratix IV power optimization.
• PowerPlay Power Analysis
For more information about .vcd files and how to create them, refer to the Quartus Prime Handbook.
Area-Driven Synthesis
Using area optimization rather than timing or delay optimization during synthesis saves power because
you use fewer logic blocks. Using less logic usually means less switching activity. The Quartus Prime
integrated synthesis tool provides Speed, Balanced, or Area for the Optimization Technique option. You
can also specify this logic option for specific modules in your design with the Assignment Editor in cases
where you want to reduce area using the Area setting (potentially at the expense of register-to-register
timing performance) while leaving the default Optimization Technique setting at Balanced (for the best
trade-off between area and speed for certain device families). The Speed Optimization Technique can
increase the resource usage of your design if the constraints are too aggressive, and can also result in
increased power consumption.
The benchmark data shows that the area-driven technique can reduce power consumption by as much as
31% in Stratix devices and as much as 15% in Cyclone devices.
Send Feedback
QPS5V2
2015.11.02 Design Guidelines 13-9
Before
10 ns 5 ns
After
7 ns 8 ns
Note: Gate-level register retiming makes changes at the gate level. If you are using an atom netlist from a
third-party synthesis tool, you must also select the Perform WYSIWYG primitive resynthesis
option to undo the atom primitives to gates mapping (so that register retiming can be performed),
and then to remap gates to Altera primitives. When using Quartus Prime integrated synthesis,
retiming occurs during synthesis before the design is mapped to Altera primitives. The benchmark
data shows that the combination of WYSIWYG remapping and gate-level register retiming
techniques can reduce power consumption by as much as 6% in Stratix devices and as much as 21%
in Cyclone devices.
Related Information
Netlist Optimizations and Physical Synthesis on page 16-1
For more information about register retiming, refer to the Quartus Prime Handbook.
Design Guidelines
Several low-power design techniques can reduce power consumption when applied during FPGA design
implementation. This section provides detailed design techniques for Cyclone IV GXdevices that affect
overall design power. The results of these techniques might be different from design to design.
Send Feedback
QPS5V2
13-10 Clock Power Management 2015.11.02
Stratix IV, and Stratix V devices provide clock control blocks for global clock networks. In addition,
Stratix IV, and Stratix V devices have clock control blocks for regional clock networks. The dynamic clock
enable feature lets internal logic control the clock network. When a clock network is powered down, all
the logic fed by that clock network does not toggle, thereby reducing the overall power consumption of
the device. For example, the following shows a 4-input clock control block diagram.
Figure 13-6: Clock Control Block Diagram
ena
inclk 3×
inclk 2×
outclk
inclk 1×
inclk 0×
clkselect[1..0]
The enable signal is applied to the clock signal before being distributed to global routing. Therefore, the
enable signal can either have a significant timing slack (at least as large as the global routing delay) or it
can reduce the fMAX of the clock signal.
Another contributor to clock power consumption is the LAB clock that distributes a clock to the registers
within a LAB. LAB clock power can be the dominant contributor to overall clock power. For example, in
Cyclone devices, each LAB can use two clocks and two clock enable signals, as shown in the following
figure. Each LAB’s clock signal and clock enable signal are linked. For example, an LE in a particular LAB
using the labclk1 signal also uses the labclkena1 signal.
Figure 13-7: LAB-Wide Control Signals
Dedicated 6
LAB Row
Clocks
Local
Interconnect
Local
Interconnect
Local
Interconnect
Local
Interconnect
To reduce LAB-wide clock power consumption without disabling the entire clock tree, use the LAB-wide
clock enable to gate the LAB-wide clock. The Quartus Prime software automatically promotes register-
level clock enable signals to the LAB-level. All registers within an LAB that share a common clock and
clock enable are controlled by a shared gated clock. To take advantage of these clock enables, use a clock
enable construct in the relevant HDL code for the registered logic.
Related Information
Clock Control Block Megafunction User Guide (ALTCLKCTRL)
For more information about using clock control blocks.
Send Feedback
QPS5V2
2015.11.02 LAB-Wide Clock Enable Example 13-11
1
Enable 0 Internal Memory Clk
Clk
Using the clock enable signal enables the memory only when necessary and shuts it down for the rest of
the time, reducing the overall memory power consumption. You can create these enable signals by
selecting the Clock enable signal option for the appropriate port when generating the memory block
function.
Send Feedback
QPS5V2
13-12 Reducing Memory Power Consumption 2015.11.02
For example, consider a design that contains a 32-bit-wide M4K memory block in ROM mode that is
running at 200 MHz. Assuming that the output of this block is only required approximately every four
cycles, this memory block will consume 8.45 mW of dynamic power according to the demands of the
downstream logic. By adding a small amount of control logic to generate a read clock enable signal for the
memory block only on the relevant cycles, the power can be cut 75% to 2.15 mW.
You can also use the MAXIMUM_DEPTH parameter in your memory megafunction to save power in
Cyclone IV GX, Stratix IV, and Stratix V devices; however, this approach might increase the number of
LEs required to implement the memory and affect design performance.
You can set the MAXIMUM_DEPTH parameter for memory modules manually in the megafunction instantia‐
tion. The Quartus Prime software automatically chooses the best design memory configuration for
optimal power.
Send Feedback
QPS5V2
2015.11.02 Memory Power Reduction Example 13-13
Related Information
• Power-Driven Compilation on page 13-4
• Clock Power Management on page 13-9
For more information on clock network-wide gating.
Table 13-3: 4K × 36 Simple Dual-Port Memory Implemented Using Multiple M4K Blocks
Using the MAXIMUM_DEPTH parameter can save power. For all implementations, a user-provided read
enable signal is present to indicate when read data is required. Using this power-saving technique can
reduce power consumption by as much as 60%.
Send Feedback
QPS5V2
13-14 Pipelining and Retiming 2015.11.02
70%
60%
50%
Power Savings
40%
30%
20%
10%
0%
4K × 1 2K × 2 1K × 4 512 × 9 256 × 18 128 × 36
M4K Configuration
As the memory depth becomes more shallow, memory dynamic power decreases because unaddressed
M4K blocks can be shut off using a decoded combination of address bits and the read enable signal. For a
128-deep memory block, power used by the extra LEs starts to outweigh the power gain achieved by using
a more shallow memory block depth. The power consumption of the memory blocks and associated LEs
depends on the memory configuration.
Note: The SOPC Builder and Qsys system do not offer specific power savings control for on-chip
memory block. There is no read enable, write enable, or clock enable that you can enable in the on-
chip RAM megafunction to shut down the RAM block in the SOPC Builder and Qsys system.
A
Q B Glitch
B
XOR (Exclusive OR) Gate
Q
t
Timing Diagram for the 2-Input XOR Gate
This glitch can propagate to subsequent logic and create unnecessary switching activity, increasing power
consumption. Circuits with many XOR functions, such as arithmetic circuits or cyclic redundancy check
(CRC) circuits, tend to have many glitches if there are several levels of combinational logic between
registers.
Pipelining can reduce design glitches by inserting flipflops into long combinational paths. Flipflops do not
allow glitches to propagate through combinational paths. Therefore, a pipelined circuit tends to have less
glitching. Pipelining has the additional benefit of generally allowing higher clock speed operations,
although it does increase the latency of a circuit (in terms of the number of clock cycles to a first result).
An example where pipelining is applied to break up a long combinational path.
Send Feedback
QPS5V2
2015.11.02 Architectural Optimization 13-15
Non-Pipelined
Combinational
Logic
Long Logic
Depth
Pipelined
Combinational Combinational
Logic Logic
Pipelining is very effective for glitch-prone arithmetic systems because it reduces switching activity,
resulting in reduced power dissipation in combinational logic. Additionally, pipelining allows higher-
speed operation by reducing logic-level numbers between registers. The disadvantage of this technique is
that if there are not many glitches in your design, pipelining can increase power consumption by adding
unnecessary registers. Pipelining can also increase resource utilization. The benchmark data shows that
pipelining can reduce dynamic power consumption by as much as 30% in Cyclone and Stratix devices.
Architectural Optimization
You can use design-level architectural optimization by taking advantage of specific device architecture
features. These features include dedicated memory and DSP or multiplier blocks available in FPGA
devices to perform memory or arithmetic-related functions. You can use these blocks in place of LUTs to
reduce power consumption. For example, you can build large shift registers from RAM-based FIFO
buffers instead of building the shift registers from the LE registers.
The Stratix device family allows you to efficiently target small, medium, and large memories with the
TriMatrix memory architecture. Each TriMatrix memory block is optimized for a specific function. M512
memory blocks are more power-efficient than the distributed memory structures in some competing
FPGAs. The M4K memory blocks are used to implement buffers for a wide variety of applications,
including processor code storage, large look-up table implementation, and large memory applications.
The M-RAM blocks are useful in applications where a large volume of data must be stored on-chip.
Effective utilization of these memory blocks can have a significant impact on power reduction in your
design.
The latest Stratix and Cyclone device families have configurable M9K memory blocks that provide various
memory functions such as RAM, FIFO buffers, and ROM.
Related Information
Area and Timing Optimization on page 12-1
For more information about using DSP and memory blocks efficiently, refer to the Quartus Prime
Handbook.
Send Feedback
QPS5V2
13-16 I/O Power Guidelines 2015.11.02
Send Feedback
QPS5V2
2015.11.02 Power Optimization Advisor 13-17
The static current consumed by parallel OCT is equal to the VCCIO voltage divided by 100 W . For DDR3
interfaces that use SSTL-15, the static current is 1.5 V/100 W = 15 mA per pin. Therefore, the static power
is 1.5 V ×15 mA = 22.5 mW. For an interface with 72 DQ and 18 DQS pins, the static power is 90 pins ×
22.5 mW = 2.025 W. Dynamic parallel OCT disables parallel termination during write operations, so if
writing occurs 50% of the time, the power saved by dynamic parallel OCT is 50% × 2.025 W = 1.0125 W.
Related Information
Stratix IV Device I/O Features
For more information about dynamic OCT in Stratix IV devices, refer to the chapter in the Stratix IV
Device Handbook.
The Power Optimization Advisor shows the recommendations that can reduce power in your design. The
recommendations are split into stages to show the order in which you should apply the recommended
settings. The first stage shows mostly CAD setting options that are easy to implement and highly effective
in reducing design power. An icon indicates whether each recommended setting is made in the current
project. The checkmark icons for Stage 1 shows the recommendations that are already implemented. The
warning icons indicate recommendations that are not followed for this compilation. The information icon
shows the general suggestions. Each recommendation includes the description, summary of the effect of
the recommendation, and the action required to make the appropriate setting.
Send Feedback
QPS5V2
13-18 Document Revision History 2015.11.02
There is a link from each recommendation to the appropriate location in the Quartus Prime user interface
where you can change the setting. After making the recommended changes, recompile your design. The
Power Optimization Advisor indicates with green check marks that the recommendations were
implemented successfully. You can use the PowerPlay Power Analyzer to verify your design power results.
Figure 13-15: Implementation of Power Optimization Advisor Recommendations
The recommendations listed in Stage 2 generally involve design changes, rather than CAD settings
changes as in Stage 1. You can use these recommendations to further reduce your design power consump‐
tion. Altera recommends that you implement Stage 1 recommendations first, then the Stage 2 recommen‐
dations.
2015.05.04 15.0.0
2014.12.15 14.1.0 • Updated location of Fitter Settings, Analysis & Synthesis Settings, and
Physical Synthesis Optimizations to Compiler Settings.
• Updated DSE II GUI and optimization settings.
Send Feedback
QPS5V2
2015.11.02 Document Revision History 13-19
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2016.05.02
Area Optimization
14
QPS5V2 Subscribe Send Feedback
This chapter describes techniques to reduce resource usage when designing for Altera devices.
Resource Utilization
Determining device utilization is important regardless of whether your design achieved a successful fit. If
your compilation results in a no-fit error, resource utilization information is important for analyzing the
fitting problems in your design.If your fitting is successful, review the resource utilization information to
determine whether the future addition of extra logic or other design changes might introduce fitting
difficulties. Also, review the resource utilization information to determine if it is impacting timing
performance.
To determine resource usage, refer to the Flow Summary section of the Compilation Report. This section
reports resource utilization, including pins, memory bits, digital signal processing (DSP) blocks, and
phase-locked loops (PLLs). Flow Summary indicates whether your design exceeds the available device
resources. More detailed information is available by viewing the reports under Resource Section in the
Fitter section of the Compilation Report.
Flow Summary shows the overall logic utilization. The Fitter can spread logic throughout the device,
which may lead to higher overall utilization.
As the device fills up, the Fitter automatically searches for logic functions with common inputs to place in
one ALM. The number of packed registers also increases. Therefore, a design that has high overall utiliza‐
tion might still have space for extra logic if the logic and registers can be packed together more tightly.
The reports under the Resource Section in the Fitter section of the Compilation Report provide more
detailed resource information. The Fitter Resource Usage Summary report breaks down the logic utiliza‐
tion information and provides other resource information, including the number of bits in each type of
memory block. This panel also contains a summary of the usage of global clocks, PLLs, DSP blocks, and
other device-specific resources.
You can also view reports describing some of the optimizations that occurred during compilation. For
example, if you use Quartus Prime integrated synthesis, the reports in the Optimization Results folder in
the Analysis & Synthesis section include information about registers that integrated synthesis removed
during synthesis. Use this report to estimate device resource utilization for a partial design to ensure that
registers were not removed due to missing connections with other parts of the design.
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V2
14-2 Optimizing Resource Utilization (LUT-Based Devices) 2016.05.02
If a specific resource usage is reported as less than 100% and a successful fit cannot be achieved, either
there are not enough routing resources or some assignments are illegal. In either case, a message appears
in the Processing tab of the Messages window describing the problem.
If the Fitter finishes unsuccessfully and runs much faster than on similar designs, a resource might be
over-utilized or there might be an illegal assignment. If the Quartus Prime software seems to run for an
excessively long time compared to runs on similar designs, a legal placement or route probably cannot be
found. In the Compilation Report, look for errors and warnings that indicate these types of problems.
You can use the Chip Planner to find areas of the device that have routing congestion on specific types of
routing resources. If you find areas with very high congestion, analyze the cause of the congestion. Issues
such as high fan-out nets not using global resources, an improperly chosen optimization goal (speed
versus area), very restrictive floorplan assignments, or the coding style can cause routing congestion. After
you identify the cause, modify the source or settings to reduce routing congestion.
Related Information
• Fitter Resources Report
For more information about Fitter Resources Report
• Analyzing and Optimizing the Design Floorplan with the Chip Planner on page 15-1
For details about using the Chip Planner tool
Related Information
• Design Optimization Overview on page 10-1
Provides information about setting basic constraints
• Timing Closure and Optimization on page 12-1
Provides information about optimizing I/O timing. These tips are valid for all FPGA families and the
MAX II family of CPLDs.
Send Feedback
QPS5V2
2016.05.02 Resolving Resource Utilization Issues Summary 14-3
tions in these categories might conflict with each other. Altera recommends evaluating the options and
choosing the settings that best suit your requirements.
Related Information
Resource Optimization Advisor Command Tools Menu
For more information about the Resource Optimization Advisor
Related Information
• I/O Pin Utilization or Placement on page 14-3
• Logic Utilization or Placement on page 14-4
• Routing on page 14-8
Send Feedback
QPS5V2
14-4 Guideline: Modify Pin Assignments or Choose a Larger Package 2016.05.02
Send Feedback
QPS5V2
2016.05.02 Guideline: Restructure Multiplexers 14-5
If resource utilization is an important concern, some synthesis tools offer an easy way to optimize for area
instead of speed. If you are using Quartus Prime integrated synthesis, select Balanced or Area for the
Optimization Technique. You can also specify an Optimization Technique logic option for specific
modules in your design with the Assignment Editor in cases where you want to reduce area using the
Area setting (potentially at the expense of register-to-register timing performance) while leaving the
default Optimization Technique setting at Balanced (for the best trade-off between area and speed for
certain device families) or Speed. You can also use the Speed Optimization Technique for Clock
Domains logic option to specify that all combinational logic in or between the specified clock domain(s)
is optimized for speed.
In some synthesis tools, not specifying an fMAX requirement can result in less resource utilization.
Note: In the Quartus Prime software, the Balanced setting typically produces utilization results that are
very similar to those produced by the Area setting, with better performance results. The Area
setting can give better results in some cases.
The Quartus Prime software provides additional attributes and options that can help improve the quality
of your synthesis results.
Related Information
Synthesis
For information about setting the timing requirements and synthesis options in Quartus Prime integrated
synthesis and other synthesis tools
Related Information
• Restructure Multiplexers logic option
For more information about the Restructure Multiplexers option
• Recommended HDL Coding Styles
For design guidelines to achieve optimal resource utilization for multiplexer designs
Send Feedback
QPS5V2
14-6 Guideline: Use Register Packing 2016.05.02
Related Information
Auto Packed Registers logic option
For more information about the Auto Packed Registers logic option
Send Feedback
QPS5V2
2016.05.02 Guideline: Use Physical Synthesis Options to Reduce Area 14-7
in logic instead of in memory blocks. Also, for improved timing performance, you can turn this inference
off to prevent registers from being moved into RAM.
Depending on your synthesis tool, you can also set the RAM block type for inferred memory blocks. In
Quartus Prime integrated synthesis, set the ramstyle attribute to the desired memory type for the inferred
RAM blocks, or set the option to logic, to implement the memory block in standard logic instead of a
memory block.
Consider the Resource Utilization by Entity report in the report file and determine whether there is an
unusually high register count in any of the modules. Some coding styles can prevent the Quartus Prime
software from inferring RAM blocks from the source code because of the blocks’ architectural implemen‐
tation, and force the software to implement the logic in flipflops. As an example, a function such as an
asynchronous reset on a register bank might make the resistor bank incompatible with the RAM blocks in
the device architecture, so that the register bank is implemented in flipflops. It is often possible to move a
large register bank into RAM by slight modification of associated logic.
DSP blocks also can be inferred from your HDL code for multipliers, multiply-adders, and multiply-
accumulators. You can turn off this inference in your synthesis tool. When you are using Quartus Prime
integrated synthesis, you can disable inference by turning off the Auto DSP Block Replacement logic
option for your entire project. Click Assignments > Settings > Compiler Settings > Advanced Settings
(Synthesis). Turn off Auto DSP Block Replacement. Alternatively, you can disable the option for a
specific block with the Assignment Editor.
The Quartus Prime software also offers the DSP Block Balancing logic option, which implements DSP
block elements in logic cells or in different DSP block modes. The default Auto setting allows DSP block
balancing to convert the DSP block slices automatically as appropriate to minimize the area and maximize
the speed of the design. You can use other settings for a specific node or entity, or on a project-wide basis,
to control how the Quartus Prime software converts DSP functions into logic cells and DSP blocks. Using
any value other than Auto or Off overrides the DEDICATED_MULTIPLIER_CIRCUITRY parameter used in IP
core variations.
Send Feedback
QPS5V2
14-8 Routing 2016.05.02
Routing
Resolve routing resource problems with these guidelines.
Related Information
Auto Packed Registers logic option
Send Feedback
QPS5V2
2016.05.02 Guideline: Optimize Synthesis for Area, Not Speed 14-9
Related Information
Analyzing and Optimizing the Design Floorplan with the Chip Planner on page 15-1
For more information about the Routing Congestion task in the Chip Planner
Scripting Support
You can run procedures and make settings described in this chapter in a Tcl script. You can also run some
procedures at a command prompt. For detailed information about scripting command options, refer to
Send Feedback
QPS5V2
14-10 Initial Compilation Settings 2016.05.02
the Quartus Prime command-line and Tcl API Help browser. To run the Help browser, type the following
command at the command prompt:
quartus_sh --qhelp
You can specify many of the options described in this section either in an instance, or at a global level, or
both.
Use the following Tcl command to make a global assignment:
Note: If the <value> field includes spaces (for example, ‘Standard Fit’), you must enclose the value in
straight double quotation marks.
Related Information
• Tcl Scripting on page 5-1
For more information about Tcl scripting
• Quartus Prime Settings File Manual
For more information about all settings and constraints in the Quartus Prime software
• Command-Line Scripting on page 4-1
For more information about command-line scripting
Send Feedback
QPS5V2
2016.05.02 Resource Utilization Optimization Techniques (LUT-Based Devices) 14-11
(2)
Allowed values for this setting depend on the device family that you select.
Send Feedback
QPS5V2
14-12 Document Revision History 2016.05.02
Send Feedback
2016.05.02
Analyzing and Optimizing the Design
Floorplan with the Chip Planner 15
QPS5V2 Subscribe Send Feedback
Analyzing and Optimizing the Design Floorplan with the Chip Planner
As FPGA designs grow larger in density, the ability to analyze the design for performance, routing
congestion, and logic placement is critical to meet the design requirements. This chapter discusses how to
analyze the design floorplan with the Chip Planner.
Design floorplan analysis helps to close timing and ensure optimal performance in highly complex
designs. With analysis capability, the Quartus Prime Chip Planner helps you close timing quickly on your
designs. Use the Chip Planner together with LogicLock regions to compile your designs hierarchically,
preserving the timing results from individual compilation runs. Use LogicLock regions to improve your
productivity.
You can perform design analysis, as well as create and optimize the design floorplan with the Chip
Planner. To make I/O assignments, use the Pin Planner.
Related Information
• I/O Management on page 2-1
For information about the Pin Planner.
• Altera Training
For training courses on the Chip Planner.
Related Information
Migrating to Quartus Prime Pro Edition
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V2
15-2 Chip Planner Overview 2016.05.02
Related Information
Engineering Change Orders with the Chip Planner
Altera Corporation Analyzing and Optimizing the Design Floorplan with the Chip Planner
Send Feedback
QPS5V2
2016.05.02 Locate History Window 15-3
The Chip Planner provides a set of default presets, and you can create custom presets to customize the
display for your particular needs. The Basic, Detailed, and Floorplan Editing presets provided with the
Chip Planner are useful for general assignment-related activities. The Design Partition Planner preset is
optimized for specific activities.
The Chip Planner editing modes determine the operations that you can perform. The assignment editing
mode allows you to make assignment changes that are applied by the Fitter during the next place and
route operation.
The Chip Planner editing modes determine the operations that you can perform. The assignment editing
mode allows you to make assignment changes that are applied by the Fitter during the next place and
route operation. The ECO editing mode allows you to make post-compilation changes, commonly
referred to as engineering change orders (ECOs).
You should choose the editing mode appropriate for the work that you want to perform, and a preset that
displays the resources that you want to view, in a level of detail appropriate for your design.
LogicLock Regions
LogicLock regions are floorplan location constraints that help you constrain logic in the target device.
When you assign entity instances or nodes to a LogicLock region, you direct the Fitter to place those
entity instances or nodes within the region during fitting. Your floorplan can contain multiple LogicLock
regions.
A LogicLock region is defined by its height, width, and location; you can specify the size or location of a
region, or both, or the Quartus Prime Standard Edition software can generate these properties automati‐
cally. The Quartus Prime software bases the size and location of a region on the contents of the region and
the timing requirements of the module. LogicLock regions are color coded to indicate the percentage of
resources available in the region. An orange LogicLock region indicates a nearly full LogicLock region.
Analyzing and Optimizing the Design Floorplan with the Chip Planner Altera Corporation
Send Feedback
QPS5V2
15-4 Creating LogicLock Regions 2016.05.02
Note: The Quartus Prime software cannot automatically define the size of a region if the location is
locked. Therefore, if you want to specify the exact location of the region, you must also specify the
size.
You can use the Design Partition Planner in conjunction with LogicLock regions to create a floorplan for
your design.
Note: LogicLock Plus assignments are not compatible with Quartus Prime Standard Edition LogicLock
assignments. Additionally, Quartus Prime Pro Edition cannot use LogicLock assignments and
Standard Edition cannot use LogicLock assignments.
Altera Corporation Analyzing and Optimizing the Design Floorplan with the Chip Planner
Send Feedback
QPS5V2
2016.05.02 Creating Non-Rectangular LogicLock Regions 15-5
Analyzing and Optimizing the Design Floorplan with the Chip Planner Altera Corporation
Send Feedback
QPS5V2
15-6 Hierarchical (Parent and Child) LogicLock Regions 2016.05.02
Figure 15-1: Using the Merge LogicLock Region command to create a nonrectangular region
Related Information
Creating LogicLock Regions on page 15-4
Altera Corporation Analyzing and Optimizing the Design Floorplan with the Chip Planner
Send Feedback
QPS5V2
2016.05.02 Placing Device Resources into LogicLock Regions 15-7
You should consider the following if you manually place or size a LogicLock region:
• LogicLock regions with pin assignments must be placed on the periphery of the device, adjacent to the
pins. For the Arria series, Cyclone series, Stratix series, MAX II, and MAX V devices, you must also
include the I/O block within the LogicLock Region.
• Floating LogicLock regions can overlap with their ancestors or descendants, but not with other floating
LogicLock regions.
Analyzing and Optimizing the Design Floorplan with the Chip Planner Altera Corporation
Send Feedback
QPS5V2
15-8 Reserved LogicLock Region 2016.05.02
The LogicLock Region Properties dialog box provides a summary of all LogicLock regions in your
design. Use the LogicLock Region Properties dialog box to obtain detailed information about your
LogicLock region, such as which entities and nodes are assigned to your region and which resources are
required. The LogicLock Region Properties dialog box shows the properties of the current selected
regions and allows you to modify them. To open the LogicLock Region Properties dialog box, double-
click any region in the LogicLock Regions window, or right-click the region and click Properties.
Note: For designs that target Arria series, Cyclone series, Stratix series, MAX II, and MAX V devices, the
Quartus Prime software automatically creates a LogicLock region that encompasses the entire
device. This default region is labelled Root_Region, and is locked and fixed.
Note: For Arria series, Cyclone series, Stratix series, MAX II, and MAX V devices, the origin of the
LogicLock region is located at the lower-left corner of the region. For all other supported devices,
the origin is located at the upper-left corner of the region.
Excluded Resources
The Excluded Resources feature allows you to easily exclude specific device resources such as DSP blocks
or M4K memory blocks from a LogicLock region.
For example, you can assign a specific entity to a LogicLock region but allow the DSP blocks of that entity
to be placed anywhere on the device. Use the Excluded Resources feature on a per-LogicLock region
member basis.
To exclude certain device resources from an entity, in the LogicLock Region Properties dialog box,
highlight the entity in the Design Element column, and click Edit. In the Edit Node dialog box, under
Excluded Element Types, click the Browse button. In the Excluded Resources Element Types dialog
box, you can select the device resources you want to exclude from the entity. When you have selected the
resources to exclude, the Excluded Resources column is updated in the LogicLock Region Properties
dialog box to reflect the excluded resources.
Altera Corporation Analyzing and Optimizing the Design Floorplan with the Chip Planner
Send Feedback
QPS5V2
2016.05.02 Additional Quartus Prime LogicLock Design Features 15-9
Note: The Excluded Resources feature prevents certain resource types from being included in a region,
but it does not prevent the resources from being placed inside the region unless you set the region’s
Reserved property to On. To indicate to the Fitter that certain resources are not required inside a
LogicLock region, define a resource filter.
Virtual Pins
A virtual pin is an I/O element that is temporarily mapped to a logic element and not to a pin during
compilation. The software implements it as a LUT.
When you apply the Virtual Pin assignment to an input pin, the pin no longer appears as an FPGA pin,
but is fixed to GND or VCC in the design. The assigned pin is not an open node.
Analyzing and Optimizing the Design Floorplan with the Chip Planner Altera Corporation
Send Feedback
QPS5V2
15-10 Using LogicLock Regions in the Chip Planner 2016.05.02
Virtual pins should be used only for I/O elements in lower-level design entities that become nodes when
imported to the top-level design. You can create virtual pins by assigning the Virtual Pin logic option to
an I/O element.
You might use virtual pin assignments when you compile a partial design, because not all the I/Os from a
partial design drive chip pins at the top level.
The virtual pin assignment identifies the I/O ports of a design module that are internal nodes in the top-
level design. These assignments prevent the number of I/O ports in the lower-level modules from
exceeding the total number of available device pins. Every I/O port that you designate as a virtual pin
becomes mapped to either a logic cell or an adaptive logic module (ALM), depending on the target device.
Note: The Virtual Pin logic option must be assigned to an input or output pin. If you assign this option
to a bidirectional pin, tri-state pin, or registered I/O element, Analysis & Synthesis ignores the
assignment. If you assign this option to a tri-state pin, the Fitter inserts an I/O buffer to account for
the tri-state logic; therefore, the pin cannot be a virtual pin. You can use multiplexer logic instead
of a tri-state pin if you want to continue to use the assigned pin as a virtual pin. Do not use tri-state
logic except for signals that connect directly to device I/O pins.
In the top-level design, you connect these virtual pins to an internal node of another module. By making
assignments to virtual pins, you can place those pins in the same location or region on the device as that
of the corresponding internal nodes in the top-level module. You can use the Virtual Pin option when
compiling a LogicLock module with more pins than the target device allows. The Virtual Pin option can
enable timing analysis of a design module that more closely matches the performance of the module after
you integrate it into the top-level design.
Note: In the Node Finder, you can set Filter Type to Pins: Virtual to display all assigned virtual pins in
the design. Alternatively, to access the Node Finder from the Assignment Editor, double-click the
To field; when the arrow appears on the right side of the field, click the arrow and select Node
Finder.
Altera Corporation Analyzing and Optimizing the Design Floorplan with the Chip Planner
Send Feedback
QPS5V2
2016.05.02 Design Floorplan Analysis in the Chip Planner 15-11
By default, the Fitter usually places closely connected entities in the same area of the device; however, you
can use LogicLock regions, together with the Design Partition Planner and the Chip Planner, to help
ensure that logically connected entities retain optimal placement from one compilation to the next.
You can view the logical connectivity between entities with the Design Partition Planner, and the physical
placement of those entities with the Chip Planner. In the Design Partition Planner, you can identify
entities that are highly interconnected, and place those entities in a partition. In the Chip Planner, you can
create LogicLock regions and assign each partition to a LogicLock region, thereby preserving the
placement of the entities.
Properties Window
The Properties Window displays detailed properties of the objects (such as atoms, paths, LogicLock
regions, or routing elements) currently selected in the Chip Planner. To display the Properties Window,
click Properties on the View menu in the Chip Planner.
Related Information
• Engineering Change Orders with the Chip Planner
• Displaying Resources and Information
Analyzing and Optimizing the Design Floorplan with the Chip Planner Altera Corporation
Send Feedback
QPS5V2
15-12 Viewing Architecture-Specific Design Information 2016.05.02
Altera Corporation Analyzing and Optimizing the Design Floorplan with the Chip Planner
Send Feedback
QPS5V2
2016.05.02 Viewing Critical Paths 15-13
Analyzing and Optimizing the Design Floorplan with the Chip Planner Altera Corporation
Send Feedback
QPS5V2
15-14 Viewing I/O Banks 2016.05.02
Highlight Routing
The Show Physical Routing command in the Locate History pane enables you to highlight the routing
resources used by a selected path or connection.
Altera Corporation Analyzing and Optimizing the Design Floorplan with the Chip Planner
Send Feedback
QPS5V2
2016.05.02 Show Delays 15-15
Related Information
Engineering Change Orders with the Chip Planner
Show Delays
With the Show Delays command, you can view timing delays for paths located from TimeQuest Timing
Analyzer reports. For example, you can view the delay between two logic resources or between a logic
resource and a routing resource.
Analyzing and Optimizing the Design Floorplan with the Chip Planner Altera Corporation
Send Feedback
QPS5V2
15-16 Exploring Paths in the Chip Planner 2016.05.02
Locate Path from the Timing Analysis Report to the Chip Planner
To locate a path from the Timing Analysis report to the Chip Planner, perform the following steps:
1. Select the path you want to locate in the Timing Analysis report.
2. Right-click the path and point to Locate Path > Locate in Chip Planner. The path is displayed with its
timing data in the Chip Planner main window and is listed in the Locate History window.
3. To view the routing resources taken for a path you have located in the Chip Planner, use of one the
following methods:
• Select the path and then click the Highlight Routing icon in the Chip Planner toolbar, or from the
View menu, click Highlight Routing.
• Right-click the path and choose Expand Connections.
Altera Corporation Analyzing and Optimizing the Design Floorplan with the Chip Planner
Send Feedback
QPS5V2
2016.05.02 Analyzing Connections for a Path 15-17
Analyzing and Optimizing the Design Floorplan with the Chip Planner Altera Corporation
Send Feedback
QPS5V2
15-18 Viewing High-Speed and Low-Power Tiles in the Chip Planner 2016.05.02
You can make node and pin location assignments to LogicLock regions and custom regions using the
drag-and-drop method in the Chip Planner. The Fitter applies the assignments that you create during the
next place-and-route operation.
Altera Corporation Analyzing and Optimizing the Design Floorplan with the Chip Planner
Send Feedback
QPS5V2
2016.05.02 Scripting Support 15-19
Figure 15-8: Viewing High-Speed and Low Power Tiles in a Stratix Device
Related Information
AN 514: Power Optimization in Stratix IV FPGAs
To learn more about power analyses and optimizations in Stratix IV devices.
Scripting Support
You can run procedures and specify the settings described in this chapter in a Tcl script. You can also run
some procedures at a command prompt.
For detailed information about scripting command options, refer to the Quartus Prime command-line
and Tcl API Help browser. To run the Help browser, type the following command at the command
prompt:
quartus_sh --qhelp
Related Information
• API Functions for Tcl on page 5-1
For more information about Tcl scripting in Quartus Prime Help.
• Tcl Scripting on page 5-1
API Functions for Tcl For more information about Tcl scripting .
• Command-Line Scripting on page 4-1
For more information about command-line scripting.
Analyzing and Optimizing the Design Floorplan with the Chip Planner Altera Corporation
Send Feedback
QPS5V2
15-20 Initializing and Uninitializing a LogicLock Region 2016.05.02
initialize_logiclock
Use the following Tcl command to uninitialize the LogicLock data structures before closing your project:
uninitialize_logiclock
Note: The command in the above example sets the size of the region to auto and the state to floating.
If you specify a region name that does not exist in the design, the command creates the region with the
specified properties. If you specify the name of an existing region, the command changes all properties
you specify and leaves unspecified properties unchanged.
Related Information
Creating LogicLock Regions on page 15-4
You can also make path-based assignments with the following Tcl command:
Altera Corporation Analyzing and Optimizing the Design Floorplan with the Chip Planner
Send Feedback
QPS5V2
2016.05.02 Save a Node-Level Netlist for the Entire Design into a Persistent... 15-21
Save a Node-Level Netlist for the Entire Design into a Persistent Source File
Make the following assignments to cause the Quartus Prime Fitter to save a node-level netlist for the
entire design into a .vqm file:
set_global_assignment-name LOGICLOCK_INCREMENTAL_COMPILE_ASSIGNMENT ON
set_global_assignment-name LOGICLOCK_INCREMENTAL_COMPILE_FILE <file name>
Any path specified in the file name is relative to the project directory. For example, specifying atom_
netlists/top.vqm places top.vqm in the atom_netlists subdirectory of your project directory.
A .vqm file is saved in the directory specified at the completion of a full compilation.
Note: The saving of a node-level netlist to a persistent source file is not supported for designs targeting
newer devices such as MAX V, Stratix IV, or Stratix V.
Related Information
• Virtual Pins on page 15-9
• Tcl Scripting on page 5-1
For more information about Tcl scripting.
Analyzing and Optimizing the Design Floorplan with the Chip Planner Altera Corporation
Send Feedback
QPS5V2
15-22 Document Revision History 2016.05.02
Altera Corporation Analyzing and Optimizing the Design Floorplan with the Chip Planner
Send Feedback
QPS5V2
2016.05.02 Document Revision History 15-23
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Analyzing and Optimizing the Design Floorplan with the Chip Planner Altera Corporation
Send Feedback
2016.05.02
Netlist Optimizations and Physical Synthesis
16
QPS5V2 Subscribe Send Feedback
Options Location/Description
Enable physical synthesis Assignments > Settings > Compiler Settings > Advanced Settings
options. (Fitter). Physical synthesis optimizations apply at different stages of the
compilation flow, either during synthesis, fitting, or both.
Enable netlist optimization Assignments > Settings > Compiler Settings > Advanced Settings
options. (Synthesis). Netlist optimizations operate with the atom netlist of your
design, which describes a design in terms of specific primitives. An atom
netlist file can be an Electronic Design Interchange Format (.edf) file or a
Verilog Quartus Mapping (.vqm) file generated by a third-party synthesis
tool. Quartus Prime synthesis generates and internally uses the atom netlist
internally
Note: Because the node names for primitives in the design can change when you use physical synthesis
optimizations, you should evaluate whether your design depends on fixed node names. If you use a
verification flow that might require fixed node names, such as the SignalTap II Logic Analyzer,
®
formal verification, or the LogicLock based optimization flow (for legacy devices), disable physical
synthesis options.
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V2
16-2 Spectra-Q Physical Synthesis Optimization 2016.05.02
focuses timing-driven optimizations at those critical parts of the design. The tight integration of the
synthesis and fitting processes is known as physical synthesis.
To enable or disable physical synthesis options, click Assignments > Settings > Compiler Settings >
Advanced Settings (Fitter).
The following sections describe the physical synthesis optimizations available in the Quartus Prime
software, and how they can help improve performance and fitting for the selected device.
Note: To disable global physical synthesis optimizations for specific elements of your design, assign the
Netlist Optimizations logic option to Never Allow to the specific nodes or entities.
Some physical synthesis options affect only registered logic, while others affect only combinational logic.
Select options based on whether you want to keep the registers intact. For example, if your verification
flow involves formal verification, you might want to keep the registers intact.
Related Information
Compiler Settings Page (Settings Dialog Box)
Send Feedback
QPS5V2
2016.05.02 Setting Physical Synthesis Options 16-3
Send Feedback
QPS5V2
16-4 Physical Synthesis Options 2016.05.02
Option Description
Perform asynchronous Automatically inserts pipeline stages for asynchronous clear and asynchro‐
signal pipelining (no nous load signals during fitting to increase circuit performance. This option is
Arria 10 support) useful for asynchronous signals that are failing recovery and removal timing
because they feed registers using a high-speed clock. You can use this option
if asynchronous control signal recovery and removal times are not achieving
requirements. This option adds registers and potential latency to nets driving
the asynchronous clear or asynchronous load ports of registers. The
additional register delays can change the behavior of the signal in the design;
therefore, you should use this option only if additional latency on the reset
signals does not violate any design requirements. This option also prevents
the promotion of signals to global routing resources.
Perform Register Duplica‐ Duplicates registers based on Fitter placement information to reduce the
tion for Performance (no delay of one path without degrading the delay of another. You can also
Arria 10 support) duplicate combinational logic when you enable this option. The Fitter can
place the new logic cell closer to critical logic without affecting the other fan-
out paths of the original logic cell. This setting does not apply to logic cells
that are part of a chain, drive global signals, are constrained to a single LAB,
or the Netlist Optimizations option set to Never Allow.
Perform Register Enables the movement of registers across combinational logic, allowing the
Retiming for Performance Quartus Prime software to trade off the delay between timing-critical paths
(no Arria 10 support) and non-critical paths.
Send Feedback
QPS5V2
2016.05.02 Perform Register Retiming for Performance 16-5
Option Description
Physical Synthesis Effort Specifies the amount of effort, in terms of compile time, physical synthesis
Level (no Arria 10 should use. Compared to the Default setting, a setting of Extra uses extra
support) compile time to try to gain extra circuit performance. Conversely, a setting of
Fast uses less compile time but may reduce the performance gain that
physical synthesis is able to achieve.
Spectra-Q Physical Uses the Spectra-Q physical synthesis engine to perform combinational and
Synthesis (Arria 10 only) sequential optimization during fitting to improve circuit performance.
Netlist Optimizations You can use the Assignment Editor to apply the Netlist Optimizations logic
option. Use this option to disable physical synthesis optimizations for parts of
your design.
Send Feedback
QPS5V2
16-6 Preventing Register Movement During Retiming 2016.05.02
Figure 16-2: Reducing Critical Delay by Moving the Register Relative to Combinational Logic
Retiming can create multiple registers at the input of a combinational block from a register at the output
of a combinational block. In this case, the new registers have the same clock and clock enable. The
asynchronous control signals and power-up level are derived from previous registers to provide
equivalent functionality. Retiming can also combine multiple registers at the input of a combinational
block to a single register.
Figure 16-3: Combining Registers with Register Retiming
To move registers across combinational logic to balance timing, click Assignments > Settings >
Compiler Settings > Advanced Settings (Fitter). Specify your preferred option under Optimize for
performance (physical synthesis) and Effort level .
Send Feedback
QPS5V2
2016.05.02 Applying Netlist Optimizations 16-7
The Quartus Prime software does not perform register retiming on logic cells that have the following
properties:
• Are part of a cascade chain
• Contain registers that drive asynchronous control signals on another register
• Contain registers that drive the clock of another register
• Contain registers that drive a register in another clock domain
• Contain registers that are driven by a register in another clock domain
Note: The Quartus Prime software does not usually retime registers across different clock domains;
however, if you use the Classic Timing Analyzer and specify a global fMAX requirement, the
Quartus Prime software interprets all clocks as related. Consequently, the Quartus Prime software
might try to retime register-to-register paths associated with different clocks.
To avoid this circumstance, provide individual fMAX requirements to each clock when using Classic
Timing Analysis. When you constrain each clock individually, the Quartus Prime software assumes
no relationship between different clock domains and considers each clock domain to be asychro‐
nous to other clock domains; hence no register-to-register paths crossing clock domains are
retimed.
When you use the TimeQuest Timing Analyzer, register-to-register paths across clock domains are
never retimed, because the TimeQuest Timing Analyzer treats all clock domains as asychronous to
each other unless they are intentionally grouped.
• Contain registers that are constrained to a single LAB location
• Contain registers that are connected to SERDES
• Are considered virtual I/O pins
• Registers that have the Netlist Optimizations logic option set to Never Allow
The Quartus Prime software assumes that a synchronization register chain consists of two registers. If
your design has synchronization register chains with more than two registers, you must indicate the
number of registers in your synchronization chains so that they are not affected by register retiming. To
do this, perform the following steps:
1. Click Assignments > Settings > Compiler Settings > Advanced Settings (Synthesis).
2. Modify the Synchronization Register Chain Length setting to match the synchronization register
length used in your design. If you set a value of 1 for the Synchronization Register Chain Length, it
means that any registers connected to the first register in a register-to-register connection can be
moved during retiming. A value of n > 1 means that any registers in a sequence of length 1, 2,… n are
not moved during register retiming.
If you want to consider logic cells that meet any of these conditions for physical synthesis, you can
override these rules by setting the Netlist Optimizations logic option to Always Allow on a given set
of registers.
Related Information
Analyzing and Optimizing the Design Floorplan on page 15-1
For more information about virtual I/O pins.
Send Feedback
QPS5V2
16-8 WYSIWYG Primitive Resynthesis 2016.05.02
You may have to experiment with available options to see which combination of settings works best for a
particular design. Refer to the messages in the compilation report to see the magnitude of improvement
with each option, and to help you decide whether you should turn on a given option or specific effort
level.
Turning on more netlist optimization options can result in more changes to the node names in the design;
bear this in mind if you are using a verification flow, such as the SignalTap II Logic Analyzer or formal
verification that requires fixed or known node names.
Applying all of the physical synthesis options at the Extra effort level generally produces the best results
for those options, but adds significantly to the compilation time. You can also use the Physical synthesis
effort level options to decrease the compilation time. The WYSIWYG primitive resynthesis option does
not add much compilation time relative to the overall design compilation time.
To find the best results, you can use the Quartus Prime Design Space Explorer II (DSE) to apply various
sets of netlist optimization options.
Related Information
About Design Space Explorer II
Send Feedback
QPS5V2
2016.05.02 Saving a Node-Level Netlist 16-9
Send Feedback
QPS5V2
16-10 Viewing Synthesis and Netlist Optimization Reports 2016.05.02
To preserve the nodes from Quartus Prime physical synthesis optimization options for devices that do not
support incremental compilation, perform the following steps:
1. On the Assignments menu, click Settings. The Settings dialog box appears.
2. In the Category list, select Compilation Process Settings. The Compilation Process Settings page
appears.
3. Turn on Save a node-level netlist of the entire design into a persistent source file. This setting is not
available for some devices.
Click OK.
Scripting Support
You can run procedures and make settings described in this chapter in a Tcl script. You can also run some
procedures at a command prompt. For detailed information about scripting command options, refer to
the Quartus Prime Command-Line and Tcl API Help browser. To run the Help browser, type the
following command at the command prompt:
quartus_sh --qhelp
You can specify many of the options described in this section on either an instance or global level, or both.
Use the following Tcl command to make a global assignment:
Related Information
• Tcl Scripting on page 5-1
• API Functions for Tcl
• Command-Line Scripting on page 4-1
• Quartus Prime Settings File Manual
Send Feedback
QPS5V2
2016.05.02 Physical Synthesis Optimizations 16-11
Setting Name Quartus Prime Settings File Variable Name Values Type
Perform ADV_NETLIST_OPT_SYNTH_WYSIWYG_ ON, OFF Global, Instance
WYSIWYG REMAP
Primitive
Resynthesis
Optimization OPTIMIZATION_MODE BALANCEDHIGH Global, Instance
Mode PERFORMANCE EFFOR
AGGRESSIVE
PERFORMANCE
Setting Name Quartus Prime Settings File Variable Name Values Type
Perform PHYSICAL_SYNTHESIS_COMBO_LOGIC ON, OFF Global
Physical
Synthesis for
Combinational
Logic for
Performance
(no Arria 10
support)
Perform PHYSICAL_SYNTHESIS_COMBO_LOGIC_FOR_ ON, OFF Global
Physical AREA
Synthesis for
Combinational
Logic for
Fitting (no
Arria 10
support)
Send Feedback
QPS5V2
16-12 Back-Annotating Assignments 2016.05.02
Setting Name Quartus Prime Settings File Variable Name Values Type
Spectra-Q SPECTRAQ_PHYSICAL_SYNTHESIS ON, OFF Global
Physical
Synthesis
Automatic PHYSICAL_SYNTHESIS_ASYNCHRONOUS_ ON, OFF Global
Asynchronous SIGNAL_PIPELINING
Signal
Pipelining
Perform PHYSICAL_SYNTHESIS_REGISTER_ ON, OFF Global
Register DUPLICATION
Duplication
for Perform‐
ance (no Arria
10 support)
Perform PHYSICAL_SYNTHESIS_REGISTER_ ON, OFF Global
Register RETIMING
Retiming for
Performance
(no Arria 10
support)
Power-Up ALLOW_POWER_UP_DONT_CARE ON, OFF Global,
Don’t Care Instance
Power-Up POWER_UP_LEVEL HIGH,LOW Instance
Level
Allow Netlist ADV_NETLIST_OPT_ALLOWED "ALWAYS Instance
Optimizations ALLOW",
DEFAULT,
"NEVER
ALLOW"
Back-Annotating Assignments
You can use the logiclock_back_annotate Tcl command to back-annotate resources in your design.
This command can back-annotate resources in LogicLock regions, and resources in designs without
LogicLock regions.
The following Tcl command back-annotates all registers in your design:
Send Feedback
QPS5V2
2016.05.02 Document Revision History 16-13
Related Information
Preserving Your Physical Synthesis Results
For more information about back-annotating assignments.
Send Feedback
QPS5V2
16-14 Document Revision History 2016.05.02
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
Engineering Change Orders with the Chip
Planner 17
QPS5V2 Subscribe Send Feedback
Programmable logic can accommodate changes to a system specification late in the design cycle. In a
typical engineering project development cycle, the specification of the programmable logic portion is
likely to change after engineering begins or while integrating all system elements. Last-minute design
changes, commonly referred to as engineering change orders (ECOs), are small targeted changes to the
functionality of a design after the design has been fully compiled.
The Chip Planner supports ECOs by allowing quick and efficient changes to your logic late in the design
cycle. The Chip Planner provides a visual display of your post-place-and-route design mapped to the
device architecture of your chosen FPGA and allows you to create, move, and delete logic cells and I/O
atoms.
Note: In addition to making ECOs, the Chip Planner allows you to perform detailed analysis on routing
congestion, relative resource usage, logic placement, LogicLock regions, fan-ins and fan-outs, paths
between registers, and delay estimates for paths.
ECOs directly apply to atoms in the target device. As such, performing an ECO relies on your
understanding of the device architecture of the target device.
Related Information
• Analyzing and Optimizing the Design Floorplan on page 15-1
For more information about using the Chip Planner for design analysis
• Literature
For more information about the architecture of your device
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V2
17-2 Performance Preservation 2015.11.02
Performance Preservation
You can preserve the results of previous design optimizations when you make changes to an existing
design with one of the following methods:
• Incremental compilation
• Rapid recompile
• ECOs
Choose the method to modify your design based on the scope of the change. The methods above are
arranged from the larger scale change to the smallest targeted change to a compiled design.
The incremental compilation feature allows you to preserve compilation results at an RTL component or
module level. After the initial compilation of your design, you can assign modules in your design
hierarchy to partitions. Upon subsequent compilations, incremental compilation recompiles changed
partitions based on the chosen preservation levels.
The rapid recompilation feature leverages results from the latest post-fit netlist to determine the changes
required to honor modifications you have made to the source code. If you run a rapid recompilation, the
Compiler refits only changed portion of the netlist.
ECOs provide a finer granularity of control compared to the incremental compilation and the rapid
recompilation feature. All modifications are performed directly on the architectural elements of the
device. You should use ECOs for targeted changes to the post-fit netlist.
Note: In the Quartus Prime software versions 10.0 and later, the software does not preserve ECO
modifications to the netlist when you recompile a design with the incremental compilation feature
turned on. You can reapply ECO changes made during a previous compilation with the Change
Manager.
Related Information
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Compilation Time
In the traditional programmable logic design flow, a small change in the design requires a complete
recompilation of the design. A complete recompilation of the design consists of synthesis and place-and-
route. Making small changes to the design to reach the final implementation on a board can be a long
process. Because the Chip Planner works only on the post-place-and-route database, you can implement
your design changes in minutes without performing a full compilation.
Verification
After you make a design change, you can verify the impact on your design. To verify that your changes do
not violate timing requirements, perform static timing analysis with the Quartus Prime TimeQuest
Timing Analyzer after you check and save your netlist changes in the Chip Planner.
Additionally, you can perform a gate-level or timing simulation of the ECO-modified design with the
post-place-and-route netlist generated by the Quartus Prime software.
Related Information
Quartus Prime TimeQuest Timing Analyzer
Send Feedback
QPS5V2
2015.11.02 Change Modification Record 17-3
Send Feedback
QPS5V2
17-4 ECO Design Flow 2015.11.02
Verilog HDL VHDL AHDL Block Design EDIF Netlist VQM Netlist
(.v) (.vhdl) (.tdf) File (.bdf) (.edf) (.vqm)
PartitionTop
Partition 1
Design Partition Assignment Partition 2
Assembler
Modify
Logic cells, I/O cells,
PLL, Floorplan location
Timing Analyzer Analysis and Synthesis Changes
assignments in Chip Planner
Program/Configuration Device
no Requirements no
Make ECO Satisfied? Make design change
at Netlist level in your HDL
yes
A typical ECO application occurs when you uncover a problem on the board and isolate the problem to
the appropriate nodes or I/O cells on the device. You must be able to correct the functionality quickly and
generate a new programming file. By making small changes with the Chip Planner, you can modify the
post-place-and-route netlist directly without having to perform synthesis and logic mapping, thus
decreasing the turnaround time for programming file generation during the verification cycle. If the
Send Feedback
QPS5V2
2015.11.02 The Chip Planner Overview 17-5
change corrects the problem, no modification of the HDL source code is necessary. You can use the Chip
Planner to perform the following ECO-related changes to your design:
• Document the changes made with the Change Manager
• Easily recreate the steps taken to produce design changes
• Generate EDA simulation netlists for design verification
Note: For more complex changes that require HDL source code modifications, the incremental compila‐
tion feature can help reduce recompilation time.
Send Feedback
QPS5V2
17-6 The Chip Planner Tasks and Layers 2015.11.02
Related Information
• Performing ECOs in the Resource Property Editor on page 17-6
• Analyzing and Optimizing the Design Floorplan on page 15-1
Related Information
Performing ECOs in the Resource Property Editor on page 17-6
Logic Elements
An Altera LE contains a four-input LUT, which is a function generator that can implement any function
®
of four variables. In addition, each LE contains a register fed by the output of the LUT or by an
independent function generated in another LE.
Send Feedback
QPS5V2
2015.11.02 Logic Element Properties 17-7
You can use the Resource Property Editor to view and edit any LE in the FPGA. To open the Resource
Property Editor for an LE, on the Project menu, point to Locate, and then click Locate in Resource
Property Editor in one of the following views:
• RTL Viewer
• Technology Map Viewer
• Node Finder
• Chip Planner
For more information about LE architecture for a particular device family, refer to the device family
handbook or data sheet.
You can use the Resource Property Editor to change the following LE properties:
• Data input to the LUT
• LUT mask or LUT
Modes of Operation
LUTs in an LE can operate in either normal or arithmetic mode.
When an LE is configured in normal mode, the LUT in the LE can implement a function of four inputs.
When the LE is configured in arithmetic mode, the LUT in the LE is divided into two 3-input LUTs. The
first LUT generates the signal that drives the output of the LUT, while the second LUT generates the
carry-out signal. The carry-out signal can drive only a carry-in signal of another LE.
For more information about LE modes of operation, refer to volume 1 of the appropriate device
handbook.
Send Feedback
QPS5V2
17-8 sload and sclr Signals 2015.11.02
The LUT mask is the hexadecimal representation of the LUT equation output. When you change the LUT
equation, the Quartus Prime software automatically changes the LUT mask. Conversely, when you change
the LUT mask, the Quartus Prime software automatically computes the LUT equation.
Send Feedback
QPS5V2
2015.11.02 Adaptive Logic Modules 17-9
Send Feedback
QPS5V2
17-10 Adaptive Logic Module Properties 2015.11.02
Send Feedback
QPS5V2
2015.11.02 Stratix V I/O Elements 17-11
• Extend OE disable
• PCI I/O
• Register reset mode
• Register synchronous reset mode
• Register power up
• Register mode
complete embedded bidirectional single data rate (SDR) or double data rate (DDR) transfer.
I/O registers are composed of the input path for handling data from the pin to the core, the output path
for handling data from the core to the pin, and the output enable path for handling the output enable
signal to the output buffer. These registers allow faster source-synchronous register-to-register transfers
and resynchronization. The input path consists of the DDR input registers, alignment and synchroniza‐
tion registers, and half data rate blocks; you can bypass each block in the input path. The input path uses
the deskew delay to adjust the input register clock delay across process, voltage, and temperature (PVT)
variations.
By default, the Quartus Prime software displays the used resources in blue and the unused resources in
gray.
Figure 17-5: Stratix V Device I/O Element Structure
Related Information
Stratix V Device Handbook
Send Feedback
QPS5V2
17-12 Stratix IV I/O Elements 2015.11.02
Related Information
Literature
For more information about I/O elements in Stratix IV devices
Send Feedback
QPS5V2
2015.11.02 Cyclone V I/O Elements 17-13
Send Feedback
QPS5V2
17-14 MAX V I/O Elements 2015.11.02
adjacent LABs to or from the bidirectional I/O buffer of the I/O element. By default, the Quartus Prime
software displays the used resources in blue and the unused resources in gray.
Figure 17-9: MAX V Device I/O Elements and Structure
Send Feedback
QPS5V2
2015.11.02 FPGA DSP Blocks 17-15
input and output ports. By default, the Quartus Prime software displays the used resources in blue and the
unused resources in gray.
Figure 17-10: M9K RAM View in a Stratix V Device
Send Feedback
QPS5V2
17-16 Change Manager 2015.11.02
and from the DSP blocks. By default, theQuartus Prime software displays the used resources in blue and
the unused resources in gray.
Figure 17-11: DSP Block View in a Stratix V Device
Change Manager
The Change Manager maintains a record of every change you perform with the Chip Planner, the
Resource Property Editor, the SignalProbe feature, or a Tcl script. Each row of data in the Change
Manager represents one ECO.
Send Feedback
QPS5V2
2015.11.02 Complex Changes in the Change Manager 17-17
The Change Manager allows you to apply changes, roll back changes, delete changes, and export change
records to a Text File (.txt), a Comma-Separated Value File (.csv), or a Tcl Script File (.tcl). The Change
Manager tracks dependencies between changes, so that when you apply, roll back, or delete a change, any
prerequisite or dependent changes are also applied, rolled back, or deleted.
Related Information
Example of Managing Changes With the Change Manager
Related Information
Quick Design Debugging Using SignalProbe
Exporting Changes
You can export changes to a .txt, a .csv, or a .tcl. Tcl scripts allow you to reapply changes that were deleted
during compilation.
Related Information
Quartus Prime Incremental Compilation for Hierarchical and Team-Based Design
Scripting Support
You can run procedures and make settings described in this chapter in a Tcl script. You can also run some
procedures at a command prompt. The Tcl commands for controlling the Chip Planner are located in the
chip_planner package of the quartus_cdb executable.
Related Information
• About Quartus Prime Scripting
• Tcl Scripting on page 5-1
• Quartus Prime Settings File Manual
• Command Line Scripting on page 4-1
Send Feedback
QPS5V2
17-18 Adjust the Drive Strength of an I/O with the Chip Planner 2015.11.02
To help build your system quickly, you can use Chip Planner functions to perform the following activities:
• Adjust the drive strength of an I/O with the Chip Planner
• Modify the PLL properties with the Resource Property Editor, see Modify the PLL Properties With
the Chip Planner
• Modify the connectivity between new resource atoms with the Chip Planner and Resource Property
Editor
Related Information
Modify the PLL Properties With the Chip Planner on page 17-19
1. In the Editing Mode list at the top of the Chip Planner, select the ECO editing mode.
2. Locate the I/O in the Resource Property Editor.
3. In the Resource Property Editor, point to the Current Strength option in the Properties pane and
double-click the value to enable the drop-down list.
4. Change the value for the Current Strength option.
5. Right-click the ECO change in the Change Manager and click Check & Save All Netlist Changes to
apply the ECO change.
Send Feedback
QPS5V2
2015.11.02 Modify the PLL Properties With the Chip Planner 17-19
Note: You can change the pin locations of input or output ports with the ECO flow. You
can drag and move the signal from an existing pin location to a new location while
in the Post Compilation Editing (ECO) task in the Chip Planner. You can then
click Check & Save All Netlist Changes to compile the ECO.
Send Feedback
QPS5V2
17-20 PLL Properties 2015.11.02
Figure 17-13: PLL View in the Resource Property Editor of a Stratix Device
PLL Properties
The Resource Property Editor allows you to modify PLL options, such as phase shift, output clock
frequency, and duty cycle.
You can also change the following PLL properties with the Resource Property Editor:
• Input frequency
• M VCO tap
• M initial
• M value
• N value
Send Feedback
QPS5V2
2015.11.02 Adjusting the Duty Cycle 17-21
• M counter delay
• N counter delay
• M2 value
• N2 value
• SS counter
• Charge pump current
• Loop filter resistance
• Loop filter capacitance
• Counter delay
• Counter high
• Counter low
• Counter mode
• Counter initial
• VCO tap
You can also view post-compilation PLL properties in the Compilation Report. To do so, in the Compila‐
tion Report, select Fitter and then select Resource Section.
Counter High
High % = (Counter High + Counter Low)
For normal mode, Tap VCO, Initial VCO, and Period VCO are governed by the following settings:
Tap VCO= Counter Delay- M Tap VCO
Initial VCO= Counter Delay- M Initial
Period VCO= In Clock Period x N÷M
For external feedback mode, Tap VCO, Initial VCO, and Period VCO are governed by the following settings:
Tap VCO= Counter Delay- M Tap VCO
Initial VCO= Counter Delay- M Initial
Period VCO= In Clock Period x N
(M+ Counter High+Counter Low)
Related Information
Stratix Device Handbook
Send Feedback
QPS5V2
17-22 Adjusting the Output Clock Frequency 2015.11.02
M Value
Output Clock Frequency = Input Frequency • N Value + Counter High + Counter Low
Use the equation to adjust the PLL output clock in external feedback mode.
M Value + External Feedback Counter High + External Feedback Counter Low
OUTCLK = N Value + Counter High + Counter Low
MN
% Spread = M2N1
1 2
Send Feedback
QPS5V2
2015.11.02 Post ECO Steps 17-23
you position your mouse pointer over the appropriate resource. Refer to the device data sheet
for more information about the architecture of the routing interconnects of your device.
Related Information
Quartus Prime TimeQuest Timing Analyzer
For more information about performing a static timing analysis of your design
Send Feedback
QPS5V2
17-24 Document Revision History 2015.11.02
November 8.1.0 • Corrected preservation attributes for ECOs in the section “Using
2008 Incremental Compilation in the ECO Flow” on page15–32.
• Minor editorial updates.
• Changed to 8½” x 11” page size.
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
Quartus Prime Standard Edition Handbook Volume 3: Verification
This document describes simulating designs that target Altera devices. Simulation verifies design behavior
before device programming. The Quartus® Prime software supports RTL- and gate-level design
simulation in supported EDA simulators. Simulation involves setting up your simulator working environ‐
ment, compiling simulation model libraries, and running your simulation.
Simulator Support
The Quartus Prime software supports specific EDA simulator versions for RTL and gate-level simulation.
Simulation Levels
The Quartus Prime software supports RTL and gate-level simulation of IP cores in supported EDA
simulators.
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V3
1-2 Simulation Levels 2016.05.02
Note: Gate-level timing simulation of an entire design can be slow and should be avoided. Gate-level
timing simulation is supported only for the Stratix IV and Cyclone IV device families. Use
TimeQuest static timing analysis rather than gate-level timing simulation.
Send Feedback
QPS5V3
2016.05.02 HDL Support 1-3
HDL Support
The Quartus® Prime software provides the following HDL support for EDA simulators.
Language Description
VHDL • For VHDL RTL simulation, compile design files directly in your simulator. You
must also compile simulation models from the Altera simulation libraries and
simulation models for the IP cores in your design. Use the Simulation Library
Compiler to compile simulation models.
• To use NativeLink automation, analyze and elaborate your design in the Quartus
Prime software, and then use the NativeLink simulator scripts to compile the
design files in your simulator.
• For gate-level simulation, the EDA Netlist Writer generates a synthesized design
netlist VHDL Output File (.vho). Compile the .vho in your simulator. You may
also need to compile models from the Altera simulation libraries.
• IEEE 1364-2005 encrypted Verilog HDL simulation models are encrypted
separately for each Altera-supported simulation vendor. If you want to simulate
the model in a VHDL design, you need either a simulator that is capable of
VHDL/Verilog HDL co-simulation, or any Mentor Graphics single language
VHDL simulator.
Verilog HDL • For RTL simulation in Verilog HDL or SystemVerilog, compile your design files
in your simulator. You must also compile simulation models from the Altera
SystemVerilog simulation libraries and simulation models for the IP cores in your design. Use
the Simulation Library Compiler to compile simulation models.
• For gate-level simulation, the EDA Netlist Writer generates a synthesized design
netlist Verilog Output File (.vo). Compile the .vo in your simulator.
Mixed HDL • If your design is a mix of VHDL, Verilog HDL, and SystemVerilog files, you must
use a mixed language simulator. Choose the most convenient supported language
for generation of Altera IP cores in your design.
• Altera provides the entry-level ModelSim-Altera software, along with
precompiled Altera simulation libraries, to simplify simulation of Altera designs.
Starting in version 15.0, the ModelSim-Altera software supports native, mixed-
language (VHDL/Verilog HDL/SystemVerilog) co-simulation of plain text HDL.
If you have a VHDL-only simulator and need to simulate Verilog HDL modules
and IP cores, you can either acquire a mixed-language simulator license from the
simulator vendor, or use the ModelSim-Altera software.
Schematic You must convert schematics to HDL format before simulation. You can use the
converted VHDL or Verilog HDL files for RTL simulation.
Send Feedback
QPS5V3
1-4 Simulation Flows 2016.05.02
Simulation Flows
The Quartus® Prime software supports various method for integrating your supported simulator into the
design flow.
Specialized Altera supports specialized simulation flows for specific design variations, including
Simulation Flows the following:
• For simulation of Altera example designs, refer to the documentation for the
example design or to the IP core user guide.
• For simulation of Qsys designs, refer to Creating a System with Qsys.
• For simulation of designs that include the Nios II embedded processor, refer to
Simulating a Nios II Embedded Processor.
Related Information
• IP User Guide Documentation
• Creating a System with Qsys
• Simulating a Nios II Embedded Processor
Send Feedback
QPS5V3
2016.05.02 Simulating Altera IP Cores 1-5
eda/sim_lib directory. These models include IEEE encrypted Verilog HDL models for both Verilog HDL
and VHDL simulation.
Before running simulation, you must compile the appropriate simulation models from the Altera
simulation libraries using any of the following methods:
• Use the NativeLink feature to automatically compile your design, Altera IP, simulation model libraries,
and testbench.
• Run the Simulation Library Compiler to compile all RTL and gate-level simulation model libraries for
your device, simulator, and design language.
• Compile Altera simulation models manually with your simulator.
After you compile the simulation model libraries, you can reuse these libraries in subsequent simulations.
Note: The specified timescale precision must be within 1ps when using Altera simulation models.
Related Information
Altera Simulation Models
Related Information
Simulating Altera Designs
Send Feedback
QPS5V3
1-6 Generating IP Simulation Files 2016.05.02
parameter editor or command-line including for each IP core. Use the following to control the generation
of IP simulation files:
• Click Assignment > Settings > EDA Tool Settings > Simulation to specify your supported simulator
and options for IP simulation file generation.
• Click Tools > IP Catalog to parameterize a new IP variation, enable generation of simulation files, and
generate the IP core synthesis and simulation files.
• Click View > Utility Windows > Project Navigator > IP Components to edit parameters and
regenerate synthesis or simulation files for an existing IP core variation.
Send Feedback
QPS5V3
2016.05.02 Generating IP Functional Simulation Models for 40nm Devices 1-7
accurate models. The models support fast functional simulation of your IP core instance using
industry-standard VHDL or Verilog HDL simulators. For some cores, IP generation only produces
the plain text RTL model, and you can simulate that model. Use the simulation models only for
simulation and not for synthesis or any other purposes. Using these models for synthesis creates a
nonfunctional design.
Scripting IP Simulation
The Quartus Prime software supports the use of scripts to automate simulation processing in your
preferred simulation environment. You can use your preferred scripting methodology to control
simulation.
Altera recommends the use of a version-independent, top-level simulation script to control design,
testbench, and IP core simulation. Because Quartus Prime-generated simulation file names may change
after IP upgrade or regeneration, Altera recommends that your top-level simulation script "sources" any
generated setup scripts, rather than using the generated setup scripts directly. You can click Project >
Upgrade IP Components > Generate Simulator Script for IP (or run the ip-setup-simulation utility)
to generate or regenerate a combined simulator setup script for all IP for each simulator. Use the
templates in the generated script to source the combined script in your top-level simulation script. Each
simulator's combined script file contains a rudimentary template that you can adapt for integration of the
setup script into a top-level simulation script. This technique eliminates the requirement to manually
update simulation scripts when you modify or upgrade the IP variation.
Send Feedback
QPS5V3
1-8 Generating a Combined Simulator Setup Script 2016.05.02
Figure 1-1: Incorporating Generated Simulator Setup Scripts into a Top-Level Simulation Script
Send Feedback
QPS5V3
2016.05.02 Generating a Combined Simulator Setup Script 1-9
3. To incorporate the generated simulator setup script into your top-level simulation script, refer to the
template section in the generated simulator setup script as a guide to creating a top-level script:
a. Copy the specified template sections from the simulator-specific generated scripts and paste them
into a new top-level file.
b. Remove the comments at the beginning of each line from the copied template sections.
c. Specify the customizations required to match your design simulation requirements, for example:
• Specify the TOP_LEVEL_NAME variable to the design’s simulation top-level file. The top-level
entity of your simulation is often a testbench that instantiates your design, and then your design
instantiates IP cores and/or Qsys systems. Set the value of TOP_LEVEL_NAME to the top-level
entity.
• If necessary, set the QSYS_SIMDIR variable to point to the location of the generated IP simulation
files.
• Compile the top-level HDL file (e.g. a test program) and all other files in the design.
• Specify any other changes, such as using the grep command-line utility to search a transcript file
for error signatures, or e-mail a report.
4. Re-run Tools > Generate Simulator Setup Script for IP (or ip-setup-simulation) after regenera‐
tion of an IP variation.
Utility Syntax
ip-setup-simulation generates a combined,
ip-setup-simulation
version-independent simulation script for all Altera --quartus-project=<my proj>
IP cores in your project, and automates regenera‐ --output-directory=<my_dir>
tion of the script after upgrading software or IP --use-relative-paths
--compile-to-work
versions. Use the compile-to-work option to
compile all simulation files into a single work --use-relative-paths and --compile-to-work
library if your simulation environment requires that are optional. For command-line help listing all
structure. Use the --use-relative-paths option options for these executables, type: <utility name> --
to use relative paths whenever possible. help.
Send Feedback
QPS5V3
1-10 Incorporating Simulator Setup Scripts from the Generated Template 2016.05.02
Utility Syntax
ip-make-simscript generates a combined
ip-make-simscript
simulation script for all IP cores specified on the --spd=<ipA.spd,ipB.spd>
command line. Specify one or more .spd files and --output-directory=<directory>
an output directory in the command. Running the
script compiles IP simulation models into various
simulation libraries.
Note: Generate Simulator Script for IP is also available by clicking Project > Upgrade IP
Components.
The following sections provide step-by-step instructions for sourcing each simulator setup script in your
top-level simulation script.
# # Start of template
# # If the copied and modified template file is "aldec.do", run it as:
# # vsim -c -do aldec.do
# #
# # Source the generated sim script
# source rivierapro_setup.tcl
# # Compile eda/sim_lib contents first
# dev_com
# # Override the top-level name (so that elab is useful)
# set TOP_LEVEL_NAME top
# # Compile the standalone IP.
# com
# # Compile the user top-level
# vlog -sv2k5 ../../top.sv
# # Elaborate the design.
# elab
# # Run the simulation
# run
# # Report success to the shell
# exit -code 0
# # End of template
2. Delete the first two characters of each line (comment and space):
# Start of template
# If the copied and modified template file is "aldec.do", run it as:
# vsim -c -do aldec.do
#
# Source the generated sim script source rivierapro_setup.tcl
# Compile eda/sim_lib contents first dev_com
# Override the top-level name (so that elab is useful)
set TOP_LEVEL_NAME top
Send Feedback
QPS5V3
2016.05.02 Sourcing Cadence Simulator Setup Scripts 1-11
3. Modify the TOP_LEVEL_NAME and compilation step appropriately, depending on the simulation’s top-
level file. For example:
4. If necessary, add the QSYS_SIMDIR variable to point to the location of the generated IP simulation files.
Specify any other changes required to match your design simulation requirements. The scripts offer
variables to set compilation or simulation options. Refer to the generated script for details.
5. Run the new top-level script from the generated simulation directory:
# # Start of template
# # If the copied and modified template file is "ncsim.sh", run it as:
# # ./ncsim.sh
# #
# # Do the file copy, dev_com and com steps
# source ncsim_setup.sh \
# SKIP_ELAB=1 \
# SKIP_SIM=1
#
# # Compile the top level module
# ncvlog -sv "$QSYS_SIMDIR/../top.sv"
#
# # Do the elaboration and sim steps
# # Override the top-level name
# # Override the user-defined sim options, so the simulation
# # runs forever (until $finish()).
# source ncsim_setup.sh \
# SKIP_FILE_COPY=1 \
# SKIP_DEV_COM=1 \
# SKIP_COM=1 \
# TOP_LEVEL_NAME=top \
# USER_DEFINED_SIM_OPTIONS=""
# # End of template
2. Delete the first two characters of each line (comment and space):
# Start of template
# If the copied and modified template file is "ncsim.sh", run it as:
# ./ncsim.sh
#
# Do the file copy, dev_com and com steps
Send Feedback
QPS5V3
1-12 Sourcing ModelSim Simulator Setup Scripts 2016.05.02
source ncsim_setup.sh \
SKIP_ELAB=1 \
SKIP_SIM=1
# Compile the top level module
ncvlog -sv "$QSYS_SIMDIR/../top.sv"
# Do the elaboration and sim steps
# Override the top-level name
# Override the user-defined sim options, so the simulation
# runs forever (until $finish()).
source ncsim_setup.sh \
SKIP_FILE_COPY=1 \
SKIP_DEV_COM=1 \
SKIP_COM=1 \
TOP_LEVEL_NAME=top \
USER_DEFINED_SIM_OPTIONS=""
# End of template
3. Modify the TOP_LEVEL_NAME and compilation step appropriately, depending on the simulation’s top-
level file. For example:
TOP_LEVEL_NAME=sim_top \
ncvlog -sv "$QSYS_SIMDIR/../top.sv"
4. If necessary, add the QSYS_SIMDIR variable to point to the location of the generated IP simulation files.
Specify any other changes required to match your design simulation requirements. The scripts offer
variables to set compilation or simulation options. Refer to the generated script for details.
5. Run the resulting top-level script from the generated simulation directory by specifying the path to
ncsim.sh.
# # Start of template
# # If the copied and modified template file is "mentor.do", run it
# # as: vsim -c -do mentor.do
# #
# # Source the generated sim script
# source msim_setup.tcl
# # Compile eda/sim_lib contents first
# dev_com
# # Override the top-level name (so that elab is useful)
# set TOP_LEVEL_NAME top
# # Compile the standalone IP.
# com
# # Compile the user top-level
# vlog -sv ../../top.sv
# # Elaborate the design.
# elab
# # Run the simulation
# run -a
# # Report success to the shell
# exit -code 0
# # End of template
2. Delete the first two characters of each line (comment and space):
# Start of template
# If the copied and modified template file is "mentor.do", run it
Send Feedback
QPS5V3
2016.05.02 Sourcing VCS Simulator Setup Scripts 1-13
3. Modify the TOP_LEVEL_NAME and compilation step appropriately, depending on the simulation’s top-
level file. For example:
4. If necessary, add the QSYS_SIMDIR variable to point to the location of the generated IP simulation files.
Specify any other changes required to match your design simulation requirements. The scripts offer
variables to set compilation or simulation options. Refer to the generated script for details.
5. Run the resulting top-level script from the generated simulation directory:
# # Start of template
# # If the copied and modified template file is "vcs_sim.sh", run it
# # as: ./vcs_sim.sh
# #
# # Override the top-level name
# # specify a command file containing elaboration options
# # (system verilog extension, and compile the top-level).
# # Override the user-defined sim options, so the simulation
# # runs forever (until $finish()).
# source vcs_setup.sh \
# TOP_LEVEL_NAME=top \
# USER_DEFINED_ELAB_OPTIONS="'-f ../../../synopsys_vcs.f'" \
# USER_DEFINED_SIM_OPTIONS=""
#
# # helper file: synopsys_vcs.f
# +systemverilogext+.sv
# ../../../top.sv
# # End of template
2. Delete the first two characters of each line (comment and space) for the vcs.sh file, as shown below:
# Start of template
# If the copied and modified template file is "vcs_sim.sh", run it
# as: ./vcs_sim.sh
#
Send Feedback
QPS5V3
1-14 Sourcing VCS MX Simulator Setup Scripts 2016.05.02
3. Delete the first two characters of each line (comment and space) for the synopsys_vcs.f file, as shown
below:
4. Modify the TOP_LEVEL_NAME and compilation step appropriately, depending on the simulation’s top-
level file. For example:
TOP_LEVEL_NAME=sim_top \
5. If necessary, add the QSYS_SIMDIR variable to point to the location of the generated IP simulation files.
Specify any other changes required to match your design simulation requirements. The scripts offer
variables to set compilation or simulation options. Refer to the generated script for details.
6. Run the resulting top-level script from the generated simulation directory by specifying the path to
vcs_sim.sh.
# # Start of template
# # If the copied and modified template file is "vcsmx_sim.sh", run
# # it as: ./vcsmx_sim.sh
# #
# # Do the file copy, dev_com and com steps
# source vcsmx_setup.sh \
# SKIP_ELAB=1 \
# SKIP_SIM=1
#
# # Compile the top level module vlogan +v2k
+systemverilogext+.sv "$QSYS_SIMDIR/../top.sv"
Send Feedback
QPS5V3
2016.05.02 Using NativeLink Simulation 1-15
# USER_DEFINED_SIM_OPTIONS=""
# # End of template
2. Delete the first two characters of each line (comment and space), as shown below:
# Start of template
# If the copied and modified template file is "vcsmx_sim.sh", run
# it as: ./vcsmx_sim.sh
#
# Do the file copy, dev_com and com steps
source vcsmx_setup.sh \
SKIP_ELAB=1 \
SKIP_SIM=1
3. Modify the TOP_LEVEL_NAME and compilation step appropriately, depending on the simulation’s top-
level file. For example:
TOP_LEVEL_NAME=”-top sim_top’” \
4. Make the appropriate changes to the compilation of the your top-level file, for example:
5. If necessary, add the QSYS_SIMDIR variable to point to the location of the generated IP simulation files.
Specify any other changes required to match your design simulation requirements. The scripts offer
variables to set compilation or simulation options. Refer to the generated script for details.
6. Run the resulting top-level script from the generated simulation directory by specifying the path to
vcsmx_sim.sh.
Send Feedback
QPS5V3
1-16 Setting Up NativeLink Simulation 2016.05.02
Simulator Path
Mentor Graphics <drive letter>:\<simulator install path>\win32aloem (Windows)
ModelSim-Altera
/<simulator install path>/bin (Linux)
3. Click Assignments > Settings and specify options on the Simulation page and More NativeLink
Settings dialog box. Specify default options for simulation library compilation, netlist and tool
command script generation, and for launching RTL or gate-level simulation automatically following
Quartus Prime processing.
4. If your design includes a testbench, turn on Compile test bench and then click Test Benches to specify
options for each testbench. Alternatively, turn on Use script to compile testbench and specify the
script file.
5. If you want to use a script to setup a simulation, turn on Use script to setup simulation.
NativeLink compiles simulation libraries and launches and runs your RTL simulator automatically
according to the NativeLink settings.
4. Review and analyze the simulation results in your simulator. Correct any functional errors in your
design. If necessary, re-simulate the design to verify correct behavior.
Send Feedback
QPS5V3
2016.05.02 Running Gate-Level Simulation (NativeLink Flow) 1-17
Send Feedback
QPS5V3
1-18 Document Revision History 2016.05.02
Send Feedback
QPS5V3
2016.05.02 Document Revision History 1-19
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2016.05.02
Mentor Graphics ModelSim and QuestaSim
Support 2
QPS5V3 Subscribe Send Feedback
You can integrate a supported EDA simulator into the Quartus Prime design flow. This document
provides guidelines for simulation of designs with Mentor Graphics® ModelSim-Altera®, ModelSim, or
QuestaSim software. Altera provides the entry-level ModelSim-Altera software, along with precompiled
Altera simulation libraries, to simplify simulation of Altera designs.
Note: The latest version of the ModelSim-Altera software supports native, mixed-language (VHDL/
Verilog HDL/SystemVerilog) co-simulation of plain text HDL. If you have a VHDL-only
simulator, you can use the ModelSim-Altera software to simulate Verilog HDL modules and IP
cores. Alternatively, you can purchase separate co-simulation software.
Related Information
• Simulating Altera Designs on page 1-1
• Managing Quartus Prime Projects
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V3
2-2 ModelSim, ModelSim-Altera, and QuestaSim Guidelines 2016.05.02
• Run NativeLink RTL simulation to compile required design files, simulation models, and run your
simulator. Verify results in your simulator. If you complete this step you can ignore the remaining
steps.
• Use Quartus Prime Simulation Library Compiler to automatically compile all required simulation
models for your design.
• Type the following commands to create and map Altera simulation libraries manually, and then
compile the models manually:
vlib <lib1>_ver
vmap <lib1>_ver <lib1>_ver
vlog -work <lib1> <lib1>
Send Feedback
QPS5V3
2016.05.02 Passing Parameter Information from Verilog HDL to VHDL 2-3
disable the x_on_violation_option logic option for the specific register, as shown in the following
example from the Quartus Prime Settings File (.qsf).
set_instance_assignment -name X_ON_VIOLATION_OPTION OFF -to \ <register_name>
lpm_add_sub#(.lpm_width(12), .lpm_direction("Add"),
.lpm_type("LPM_ADD_SUB"),
.lpm_hint("ONE_INPUT_IS_CONSTANT=NO,CIN_USED=NO" ))
lpm_add_sub_component (
.dataa (dataa),
.datab (datab),
.result (sub_wire0)
);
Note: The sequence of the parameters depends on the sequence of the GENERIC in the
VHDL component declaration.
Send Feedback
QPS5V3
2-4 Viewing Simulation Messages 2016.05.02
Option Description
+transport_path_delays Use when simulation pulses are shorter than the
delay in a gate-level primitive. You must include the
+pulse_e/number and +pulse_r/number options.
# ** Error: C:/altera_trn/DUALPORT_TRY/simulation/modelsim/DUALPORT_TRY.vho(31):
(vcom-1136) Unknown identifier "stratixiv"
Note: If your design includes deep levels of hierarchy, and the Maintain hierarchy EDA tools option is
turned on, this may result in a large number of module instances in post-fit or post-map netlist.
This condition can exceed the ModelSim-Altera instance limitation.
To avoid exceeding any ModelSim-Altera instance limit, turn off Maintain hierarchy to reduce the
number of modules instances to 1 in the post-fit or post-map netlist. To acces this option, click
Assignments > Settings > EDA Tool Settings > More Settings.
Send Feedback
QPS5V3
2016.05.02 Generating Power Analysis Files 2-5
Send Feedback
QPS5V3
2-6 ModelSim Simulation Setup Script Example 2016.05.02
window in ModelSim-Altera. With the ModelSim-Altera waveform editor, you can create and edit
waveforms, drive simulation directly from created waveforms, and save created waveforms into a stimulus
file.
Related Information
ModelSim Web Page
In this example the top-level-simulate.do custom top-level simulation script sets the hierarchy variable
TOP_LEVEL_NAME to top_testbench for the design, and sets the variable QSYS_SIMDIR to the location of
the generated simulation files.
In this example, the top-level simulation files are stored in the same directory as the original IP core, so
this variable is set to the IP-generated directory structure. The QSYS_SIMDIR variable provides the relative
hierarchy path for the generated IP simulation files. The script calls the generated msim_setup.tcl script
and uses the alias commands from the script to compile and elaborate the IP files required for simulation
along with the top-level simulation testbench. You can specify additional simulator elaboration command
options when you run the elab command, for example, elab +nowarnTFMPC. The last command run in
the example starts the simulation.
Unsupported Features
The Quartus Prime software does not support the following ModelSim simulation features:
Send Feedback
QPS5V3
2016.05.02 Document Revision History 2-7
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2016.05.02
Synopsys VCS and VCS MX Support
3
QPS5V3 Subscribe Send Feedback
You can integrate your supported EDA simulator into the Quartus Prime design flow. This document
provides guidelines for simulation of Quartus Prime designs with the Synopsys VCS or VCS MX software.
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V3
3-2 Simulating Transport Delays 2016.05.02
Table 3-1: Transport Delay Simulation Options (VCS and VCS MX)
Option Description
+transport_path_delays Use when simulation pulses are shorter than the
delay in a gate-level primitive. You must include the
+pulse_e/number and +pulse_r/number options.
Send Feedback
QPS5V3
2016.05.02 VCS Simulation Setup Script Example 3-3
Note: Include the script within the testbench module block. If you include the script outside of the
testbench module block, syntax errors occur during compilation.
6. Run the simulation with the VCS command. Exit the VCS software when the simulation is finished
and the <revision_name>.vcd file is generated in the simulation directory.
sh vcsmx_setup.sh\
USER_DEFINED_ELAB_OPTIONS=+rad\
USER_DEFINED_SIM_OPTIONS=+vcs+lic+wait
Send Feedback
QPS5V3
3-4 Document Revision History 2016.05.02
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2016.05.02
Cadence Incisive Enterprise (IES) Support
4
QPS5V3 Subscribe Send Feedback
You can integrate your supported EDA simulator into the Quartus Primedesign flow. This chapter
provides specific guidelines for simulation of Quartus Prime designs with the Cadence Incisive Enterprise
(IES) software.
include ${CDS_INST_DIR}/tools/inca/files/cds.lib
DEFINE <lib1>_ver <lib1_ver>
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V3
4-2 Cadence Incisive Enterprise (IES) Guidelines 2016.05.02
Program Function
ncvlog ncvlog compiles your Verilog HDL code and performs syntax and
ncvhdl static semantics checks.
ncvhdl compiles your VHDL code and performs syntax and static
semantics checks.
Send Feedback
QPS5V3
2016.05.02 Back-Annotating Simulation Timing Data (VHDL Only) 4-3
Note: If you do not specify an output name, ncsdfc uses <project name>.sdo.X
2. Specify the compiled .sdf file for the project by adding the following command to an ASCII SDF
command file for the project:
3. After compiling the .sdf file, type the following command to elaborate the design:
Send Feedback
QPS5V3
4-4 Viewing Simulation Waveforms 2016.05.02
Program Function
-PULSE_R Use when simulation pulses are shorter than the delay in a gate-level
primitive. The argument is the percentage of delay for pulse reject
limit for the path
-PULSE_INT_R Use when simulation pulses are shorter than the interconnect delay
between gate-level primitives. The argument is the percentage of delay
for pulse reject limit for the path
Example 4-2: Example Top-Level Simulation Shell Script for Incisive (NCSIM)
Send Feedback
QPS5V3
2016.05.02 Document Revision History 4-5
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2016.05.02
Aldec Active-HDL and Riviera-PRO Support
5
QPS5V3 Subscribe Send Feedback
You can integrate your supported EDA simulator into the Quartus Prime design flow. This chapter
provides specific guidelines for simulation of Quartus Prime designs with the Aldec Active-HDL or
Riviera-PRO software.
4. Create the work library and compile the netlist and testbench files:
vlib work
vcom -strict93 -dbg -work work <output netlist> <testbench file>
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V3
5-2 Aldec Active-HDL and Riviera-PRO Guidelines 2016.05.02
Option Description
+transport_path_delays Use when simulation pulses are shorter than the
delay in a gate-level primitive. You must include the
+pulse_e/number and +pulse_r/number options.
Send Feedback
QPS5V3
2016.05.02 Using Simulation Setup Scripts 5-3
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2016.05.02
Timing Analysis Overview
6
QPS5V3 Subscribe Send Feedback
Related Information
The Quartus Prime TimeQuest Timing Analyzer on page 7-1
For more information about the TimeQuest analyzer flow and TimeQuest examples.
Term Definition
nodes Most basic timing netlist unit. Used to represent ports, pins,
and registers.
cells Look-up tables (LUT), registers, digital signal processing (DSP)
blocks, memory blocks, input/output elements, and so on. (1)
pins Inputs or outputs of cells.
nets Connections between pins.
ports Top-level module inputs or outputs; for example, device pins.
clocks Abstract objects representing clock domains inside or outside
of your design.
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V3
6-2 Timing Netlists and Timing Paths 2016.05.02
Term Definition
Notes:
1. For Stratix devices, the LUTs and registers are contained in logic
®
data1 reg1
and_inst
reg3
data2 reg2
clk
The timing netlist for the sample design shows how different design elements are divided into cells, pins,
nets, and ports.
Send Feedback
QPS5V3
2016.05.02 Timing Paths 6-3
Cells
Cell
Pin
data1
combout datain reg1
regout Cell
clk
Port and_inst
datac combout reg3 data_out
Pin Net datain
data2 datad
reg2
regout
Net
Net
Port
clk clk~clkctrl
inclk0
outclk
Timing Paths
Timing paths connect two design nodes, such as the output of a register to the input of another register.
Understanding the types of timing paths is important to timing closure and optimization. The TimeQuest
analyzer uses the following commonly analyzed paths:
• Edge paths—connections from ports-to-pins, from pins-to-pins, and from pins-to-ports.
• Clock paths—connections from device ports or internally generated clock pins to the clock pin of a
register.
• Data paths—connections from a port or the data output pin of a sequential element to a port or the
data input pin of another sequential element.
• Asynchronous paths—connections from a port or asynchronous pins of another sequential element
such as an asynchronous reset or asynchronous clear.
Figure 6-3: Path Types Commonly Analyzed by the TimeQuest Analyzer
data D Q D Q
Clock Path Data Path
clk CLRN CLRN
In addition to identifying various paths in a design, the TimeQuest analyzer analyzes clock characteristics
to compute the worst-case requirement between any two registers in a single register-to-register path. You
must constrain all clocks in your design before analyzing clock characteristics.
Send Feedback
QPS5V3
6-4 Data and Clock Arrival Times 2016.05.02
D Q D Q
The basic calculations for data arrival and data required times including the launch and latch edges.
Figure 6-5: Data Arrival and Data Required Time Equations
Data Arrival Time = Launch Edge + Source Clock Delay + µtCO + Register-to-Register Delay
Data Required Time = Latch Edge + Destination Clock Delay – µtSU
Send Feedback
QPS5V3
2016.05.02 Clock Setup Check 6-5
Figure 6-6: Setup and Hold Relationship for Launch and Latch Edges 10ns Apart
Launch Clock
Latch Clock
In timing analysis, and with the TimeQuest analyzer specifically, you create clock constraints and assign
those constraints to nodes in your design. These clock constraints provide the structure required for
repeatable data relationships. The primary relationships between clocks, in the same or different domains,
are the setup relationship and the hold relationship.
Note: If you do not constrain the clocks in your design, the Quartus Prime software analyzes in terms of a
1 GHz clock to maximize timing based Fitter effort. To ensure realistic slack values, you must
constrain all clocks in your design with real values.
Source Clock
Setup A Setup B
Destination Clock
0 ns 8 ns 16 ns 24 ns 32 ns
The TimeQuest analyzer reports the result of clock setup checks as slack values. Slack is the margin by
which a timing requirement is met or not met. Positive slack indicates the margin by which a requirement
is met; negative slack indicates the margin by which a requirement is not met.
Figure 6-8: Clock Setup Slack for Internal Register-to-Register Paths
Send Feedback
QPS5V3
6-6 Clock Hold Check 2016.05.02
The TimeQuest analyzer performs setup checks using the maximum delay when calculating data arrival
time, and minimum delay when calculating data required time.
Figure 6-9: Clock Setup Slack from Input Port to Internal Register
Figure 6-10: Clock Setup Slack from Internal Register to Output Port
Source Clock
Hold Setup A
Hold Hold Setup B Hold
Check A1 Check A2 Check B1 Check B2
Destination Clock
0 ns 8 ns 16 ns 24 ns 32 ns
Send Feedback
QPS5V3
2016.05.02 Recovery and Removal Time 6-7
The TimeQuest analyzer performs hold checks using the minimum delay when calculating data arrival
time, and maximum delay when calculating data required time.
Figure 6-13: Clock Hold Slack Calculation from Input Port to Internal Register
Figure 6-14: Clock Hold Slack Calculation from Internal Register to Output Port
Figure 6-16: Recovery Slack Calculation if the Asynchronous Control Signal is not Registered
Note: If the asynchronous reset signal is from a device I/O port, you must create an input delay
constraint for the asynchronous reset port for the TimeQuest analyzer to perform recovery analysis
on the path.
Removal time is the minimum length of time the deassertion of an asynchronous control signal must be
stable after the active clock edge. The TimeQuest analyzer removal slack calculation is similar to the clock
hold slack calculation, but it applies asynchronous control signals.
Send Feedback
QPS5V3
6-8 Multicycle Paths 2016.05.02
Figure 6-17: Removal Slack Calcuation if the Asynchronous Control Signal is Registered
Figure 6-18: Removal Slack Calculation if the Asynchronous Control Signal is not Registered
If the asynchronous reset signal is from a device pin, you must assign the Input Minimum Delay timing
assignment to the asynchronous reset pin for the TimeQuest analyzer to perform removal analysis on the
path.
Multicycle Paths
Multicycle paths are data paths that require a non-default setup and/or hold relationship for proper
analysis.
For example, a register may be required to capture data on every second or third rising clock edge. An
example of a multicycle path between the input registers of a multiplier and an output register where the
destination latches data on every other clock edge.
Figure 6-19: Multicycle Path
D Q
ENA
D Q
ENA
D Q
ENA
2 Cycles
A register-to-register path used for the default setup and hold relationship, the respective timing diagrams
for the source and destination clocks, and the default setup and hold relationships, when the source clock,
src_clk, has a period of 10 ns and the destination clock, dst_clk, has a period of 5 ns. The default setup
relationship is 5 ns; the default hold relationship is 0 ns.
Send Feedback
QPS5V3
2016.05.02 Metastability 6-9
Figure 6-20: Register-to-Register Path and Default Setup and Hold Timing Diagram
reg reg
data_in D Q D Q
data_out
src_clk
dst_clk
setup
hold
0 10 20 30
To accommodate the system requirements you can modify the default setup and hold relationships with a
multicycle timing exception.
The actual setup relationship after you apply a multicycle timing exception. The exception has a
multicycle setup assignment of two to use the second occurring latch edge; in this example, to 10 ns from
the default value of 5 ns.
Figure 6-21: Modified Setup Diagram
new setup
default setup
0 10 20 30
Related Information
The Quartus Prime TimeQuest Timing Analyzer on page 7-1
For more information about creating exceptions with multicycle paths.
Metastability
Metastability problems can occur when a signal is transferred between circuitry in unrelated or
asynchronous clock domains because the designer cannot guarantee that the signal will meet setup and
hold time requirements.
To minimize the failures due to metastability, circuit designers typically use a sequence of registers, also
known as a synchronization register chain, or synchronizer, in the destination clock domain to
resynchronize the data signals to the new clock domain.
The mean time between failures (MTBF) is an estimate of the average time between instances of failure
due to metastability.
Send Feedback
QPS5V3
6-10 Common Clock Path Pessimism Removal 2016.05.02
The TimeQuest analyzer analyzes the potential for metastability in your design and can calculate the
MTBF for synchronization register chains. The MTBF of the entire design is then estimated based on the
synchronization chains it contains.
In addition to reporting synchronization register chains found in the design, the Quartus Prime software
also protects these registers from optimizations that might negatively impact MTBF, such as register
duplication and logic retiming. The Quartus Prime software can also optimize the MTBF of your design if
the MTBF is too low.
Related Information
• Understanding Metastability in FPGAs
For more information about metastability, its effects in FPGAs, and how MTBF is calculated.
• Managing Metastability with the Quartus Prime Software
For more information about metastability analysis, reporting, and optimization features in the Quartus
Prime software.
D Q
B
2.2 ns
2.0 ns reg1
A 3.2 ns
3.0 ns
clk 5.5 ns
5.0 ns D Q
C
2.2 ns
2.0 ns reg2
Segment A is the common clock path between reg1 and reg2. The minimum delay is 5.0 ns; the
maximum delay is 5.5 ns. The difference between the maximum and minimum delay value equals the
common clock path pessimism removal value; in this case, the common clock path pessimism is 0.5 ns.
The TimeQuest analyzer adds the common clock path pessimism removal value to the appropriate slack
equation to determine overall slack. Therefore, if the setup slack for the register-to-register path in the
example equals 0.7 ns without common clock path pessimism removal, the slack would be 1.2 ns with
common clock path pessimism removal.
You can also use common clock path pessimism removal to determine the minimum pulse width of a
register. A clock signal must meet a register’s minimum pulse width requirement to be recognized by the
register. A minimum high time defines the minimum pulse width for a positive-edge triggered register. A
minimum low time defines the minimum pulse width for a negative-edge triggered register.
Send Feedback
QPS5V3
2016.05.02 Clock-As-Data Analysis 6-11
Clock pulses that violate the minimum pulse width of a register prevent data from being latched at the
data pin of the register. To calculate the slack of the minimum pulse width, the TimeQuest analyzer
subtracts the required minimum pulse width time from the actual minimum pulse width time. The
TimeQuest analyzer determines the actual minimum pulse width time by the clock requirement you
specified for the clock that feeds the clock port of the register. The TimeQuest analyzer determines the
required minimum pulse width time by the maximum rise, minimum rise, maximum fall, and minimum
fall times.
Figure 6-23: Required Minimum Pulse Width time for the High and Low Pulse
Low Pulse
0.8 Width 0.5
0.5 0.7 0.8
0.9
With common clock path pessimism, the minimum pulse width slack can be increased by the smallest
value of either the maximum rise time minus the minimum rise time, or the maximum fall time minus the
minimum fall time. In the example, the slack value can be increased by 0.2 ns, which is the smallest value
between 0.3 ns (0.8 ns – 0.5 ns) and 0.2 ns (0.9 ns – 0.7 ns).
Related Information
TimeQuest Timing Analyzer Page (Settings Dialog Box)
For more information, refer to the Quartus Prime Help.
Clock-As-Data Analysis
The majority of FPGA designs contain simple connections between any two nodes known as either a data
path or a clock path.
A data path is a connection between the output of a synchronous element to the input of another synchro‐
nous element.
A clock is a connection to the clock pin of a synchronous element. However, for more complex FPGA
designs, such as designs that use source-synchronous interfaces, this simplified view is no longer
sufficient. Clock-as-data analysis is performed in circuits with elements such as clock dividers and DDR
source-synchronous outputs.
The connection between the input clock port and output clock port can be treated either as a clock path or
a data path. A design where the path from port clk_in to port clk_out is both a clock and a data path.
The clock path is from the port clk_in to the register reg_data clock pin. The data path is from port
clk_in to the port clk_out.
Send Feedback
QPS5V3
6-12 Multicycle Clock Setup Check and Hold Check Analysis 2016.05.02
D Q
reg_data
clk_in
clk_out
With clock-as-data analysis, the TimeQuest analyzer provides a more accurate analysis of the path based
on user constraints. For the clock path analysis, any phase shift associated with the phase-locked loop
(PLL) is taken into consideration. For the data path analysis, any phase shift associated with the PLL is
taken into consideration rather than ignored.
The clock-as-data analysis also applies to internally generated clock dividers. An internally generated
clock divider. In this figure, waveforms are for the inverter feedback path, analyzed during timing
analysis. The output of the divider register is used to determine the launch time and the clock port of the
register is used to determine the latch time.
Figure 6-25: Clock Divider
D Q
D Q
Launch Clock (2 T)
Send Feedback
QPS5V3
2016.05.02 Multicycle Clock Setup 6-13
REG1 REG2
SET Combinational SET
D Q D Q
Logic
Tclk1 Tdata
CLR CLR
Tclk2
TCO TSU / TH
CLK
-10 0 10 20
REG1.CLK
EMS = 1 EMS = 3
(default) EMS = 2
REG2.CLK
A start multicycle setup assignment modifies the launch edge of the source clock by moving the launch
edge the specified number of clock periods to the left of the determined default launch edge. A start
multicycle setup (SMS) assignment with various values can result in a specific launch edge.
Send Feedback
QPS5V3
6-14 Multicycle Clock Hold 2016.05.02
0 10 20 30 40
Source Clock
SMS = 2
SMS = 3 SMS = 1
(Default)
Destination Clock
The setup relationship reported by the TimeQuest analyzer for the negative setup relationship.
Figure 6-29: Start Multicycle Setup Values Reported by the TimeQuest Analyzer
-10 0 10 20
Source Clock
SMS = 1
(default)
SMS = 3
SMS = 2
Destination Clock
Tip: If a hold check overlaps a setup check, the hold check is ignored.
Send Feedback
QPS5V3
2016.05.02 Multicycle Clock Hold 6-15
A start multicycle hold assignment modifies the launch edge of the destination clock by moving the latch
edge the specified number of clock periods to the right of the determined default launch edge. The
following figure shows various values of the start multicycle hold (SMH) assignment and the resulting
launch edge.
Figure 6-31: Start Multicycle Hold Values
-10 0 10 20
Source Clock
SMH = 0
(default) SMH = 2
SMH = 1
Destination Clock
An end multicycle hold assignment modifies the latch edge of the destination clock by moving the latch
edge the specific ed number of clock periods to the left of the determined default latch edge. The following
figure shows various values of the end multicycle hold (EMH) assignment and the resulting latch edge.
Figure 6-32: End Multicycle Hold Values
-20 -10 0 10 20
EMH = 2
Source Clock
EMH = 0
EMH = 1 (Default)
Destination Clock
Send Feedback
QPS5V3
6-16 Multicorner Analysis 2016.05.02
The hold relationship reported by the TimeQuest analyzer for the negative hold relationship shown in the
figure above would look like this:
Figure 6-33: End Multicycle Hold Values Reported by the TimeQuest Analyzer
-10 0 10 20
Source Clock
EMH = 0 EMH = 2
(Default)
EMH = 1
Destination Clock
Multicorner Analysis
The TimeQuest analyzer performs multicorner timing analysis to verify your design under a variety of
operating conditions—such as voltage, process, and temperature—while performing static timing
analysis.
To change the operating conditions or speed grade of the device used for timing analysis, use the
set_operating_conditions command.
If you specify an operating condition Tcl object, the -model, speed, -temperature, and -voltage options
are optional. If you do not specify an operating condition Tcl object, the -model option is required; the -
speed, -temperature, and -voltage options are optional.
Tip: To obtain a list of available operating conditions for the target device, use the
get_available_operating_conditions -all command.
To ensure that no violations occur under various conditions during the device operation, perform static
timing analysis under all available operating conditions.
In your design, you can set the operating conditions for to the slow timing model, with a voltage of
1100 mV, and temperature of 85° C with the following code:
Send Feedback
QPS5V3
2016.05.02 Document Revision History 6-17
You can set the same operating conditions with a Tcl object:
set_operating_conditions 3_slow_1100mv_85c
The following block of code shows how to use the set_operating_conditions command to generate
different reports for various operating conditions.
Related Information
• set_operating_conditions
• get_available_operating_conditions
For more information about the get_available_operating_conditions command
Send Feedback
QPS5V3
6-18 Document Revision History 2016.05.02
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
The Quartus Prime TimeQuest Timing Analyzer
7
QPS5V3 Subscribe Send Feedback
The Quartus Prime TimeQuest Timing Analyzer is a powerful ASIC-style timing analysis tool that
validates the timing performance of all logic in your design using an industry-standard constraint,
analysis, and reporting methodology. Use the TimeQuest analyzer GUI or command-line interface to
constrain, analyze, and report results for all timing paths in your design.
This document is organized to allow you to refer to specific subjects relating to the TimeQuest analyzer
and timing analysis. The sections cover the following topics:
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V3
7-2 Enhanced Timing Analysis for Arria 10 2015.11.02
Related Information
• Timing Analysis Overview on page 6-1
For more information about basic timing analysis concepts and how they pertain to the TimeQuest
analyzer.
• TimeQuest Timing Analyzer Resource Center
For more information about Altera resources available for the TimeQuest analyzer.
• Altera Training
For more information about the TimeQuest analyzer.
Send Feedback
QPS5V3
2015.11.02 Creating and Setting Up your Design 7-3
Send Feedback
QPS5V3
7-4 Performing an Initial Analysis and Synthesis 2015.11.02
Related Information
• Creating a Constraint File from Quartus Prime Templates with the Quartus Prime Text Editor on
page 7-4
For more information on using the <keyword keyref="qts-all" /> Text Editor templates for SDC
constraints.
• Identifying the Quartus Prime Software Executable from the SDC File on page 7-69
quartus_map <design>
quartus_fit <design> --floorplan
quartus_sta <design> --post_map
When compiling for other devices, you can exclude the quartus_fit <design> --floorplan
step:
quartus_map <design>
quartus_sta <design> --post_map
Creating a Constraint File from Quartus Prime Templates with the Quartus Prime Text Editor
You can create an SDC file from constraint templates in the Quartus Prime software with the Quartus
Prime Text Editor, or with your preferred text editor.
Send Feedback
QPS5V3
2015.11.02 Performing a Full Compilation 7-5
or
4. Click the Insert Template button on the text editor menu, or, right-click in the blank SDC file in the
Quartus Prime Text Editor, then click Insert TemplateTimeQuest.
a. In the Insert Template dialog box, expand the TimeQuest section, then expand the SDC
Commands section.
b. Expand a command category, for example, Clocks.
c. Select a command. The SDC constraint appears in the Preview pane.
d. Click Insert to paste the SDC constraint into the blank SDC file you created in step 2.
This creates a generic constraint for you to edit manually, replacing variables such as clock names,
period, rising and falling edges, ports, etc.
5. Repeat as needed with other constraints, or click Close to close the Insert Template dialog box.
You can now use any of the standard features of the Quartus Prime Text Editor to modify the SDC file, or
save the SDC file to edit in a text editor. Your SDC can be saved with the same name as the project, and
generally should be stored in the project directory.
Related Information
• Create Clocks Dialog Box
• Set Clock Groups Dialog Box
For more information on Create Clocks and Set Clock Groups, refer to the Quartus Prime Help.
Verifying Timing
The TimeQuest analyzer examines the timing paths in the design, calculates the propagation delay along
each path, checks for timing constraint violations, and reports timing results as positive slack or negative
slack. Negative slack indicates a timing violation. If you encounter violations along timing paths, use the
timing reports to analyze your design and determine how best to optimize your design. If you modify,
remove, or add constraints, you should perform a full compilation again. This iterative process helps
resolve timing violations in your design.
There is a recommended flow for constraining and analyzing your design within the TimeQuest analyzer,
and each part of the flow has a corresponding Tcl command.
Send Feedback
QPS5V3
7-6 Analyzing Timing in Designs Compiled in Previous Versions 2015.11.02
Open Project
project_open
Timing Constraints
Timing analysis in the Quartus Prime software with the TimeQuest Timing Analyzer relies on
constraining your design to make it meet your timing requirements. When discussing these constraints,
they can be referred to as timing constraints, SDC constraints, or SDC commands interchangeably.
Send Feedback
QPS5V3
2015.11.02 create_clock 7-7
Related Information
Creating a Constraint File from Quartus Prime Templates with the Quartus Prime Text Editor on
page 7-4
create_clock
The first statements in a SDC file should be constraints for clocks, for example, constrain the external
clocks coming into the FPGA with create_clock. An example of the basic syntax is:
create_clock -name sys_clk -period 8.0 [get_ports fpga_clk]
This command creates a clock called sys_clk with an 8ns period and applies it to the port called
fpga_clk.
Note: Both Tcl files and SDC files are case-sensitive, so make sure references to pins, ports, or nodes,
such as fpga_clk match the case used in your design.
By default, the clock has a rising edge at time 0ns, and a 50% duty cycle, hence a falling edge at time 4ns. If
you require a different duty cycle or to represent an offset, use the -waveform option, however, this is
seldom necessary.
It is common to create a clock with the same name as the port it is applied to. In the example above, this
would be accomplished by:
create_clock -name fpga_clk -period 8.0 [get_ports fpga_clk]
There are now two unique objects called fpga_clk, a port in your design and a clock applied to that port.
Note: In Tcl syntax, square brackets execute the command inside them, so [get_ports fpga_clk]
executes a command that finds all ports in the design that match fpga_clk and returns a collection
of them. You can enter the command without using the get_ports collection command, as shown
in the following example. There are benefits to using collection commands, which are described in
"Collection Commands".
create_clock -name sys_clk -period 8.0 fpga_clk
Repeat this process, using one create_clock command for each known clock coming into your design.
Later on you can use Report Unconstrained Paths to identify any unconstrained clocks.
Note: Rather than typing constraints, users can enter constraints through the GUI. After launching
TimeQuest, open the SDC file from TimeQuest or Quartus Prime, place the cursor where the new
constraint will go, and go to Edit > Insert Constraint, and choose the constraint.
Warning: Using the Constraints menu option in the TimeQuest GUI applies constraints directly to the
timing database, but makes no entry in the SDC file. An advanced user may find reasons to do
this, but if you are new to TimeQuest, Altera recommends entering your constraints directly
into your SDC with the Edit > Insert Constraint command.
Send Feedback
QPS5V3
7-8 derive_pll_clocks 2015.11.02
Related Information
Creating Base Clocks on page 7-11
derive_pll_clocks
After the create_clock commands add the following command into your SDC file:
derive_pll_clocks
This command automatically creates a generated clock constraint on each output of the PLLs in your
design..
When PLLs are created, you define how each PLL output is configured. Because of this, the TimeQuest
analyzer can automatically constrain them, wit thet derive_pll_clocks command.
This command also creates other constraints. It constrains transceiver clocks. It adds multicycles between
LVDS SERDES and user logic.
The derive_pll_clocks command prints an Info message to show each generated clock it creates.
If you are new to the TimeQuest analyzer, you may decide not to use derive_pll_clocks, and instead
cut-and-paste each create_generated_clock assignment into the SDC file. There is nothing wrong with
this, since the two are identical. The problem is that when you modifiy a PLL setting, you must remember
to change its generated clock in the SDC file. Examples of this type of change include modifying an
existing output clock, adding a new PLL output, or making a change to the PLL's hierarchy. Too many
designers forget to modify the SDC file and spend time debugging something that derive_pll_clocks
would have updated automatically.
Related Information
• Creating Base Clocks on page 7-11
• Deriving PLL Clocks on page 7-18
derive_clock_uncertainty
Add the following command to your SDC file:
derive_clock_uncertainty
This command calculates clock-to-clock uncertainties within the FPGA, due to characteristics like PLL
jitter, clock tree jitter, etc. This should be in all SDC files and the TimeQuest analyzer generates a warning
if this command is not found in your SDC files.
Related Information
Accounting for Clock Effect Characteristics on page 7-21
derive_pll_clocks
derive_clock_uncertainty
Send Feedback
QPS5V3
2015.11.02 set_clock_groups 7-9
set_clock_groups
With the constraintsdiscusssed previously, most, if not all, of the clocks in the design are now constrained.
In the TimeQuest analyzer, all clocks are related by default, and you must indicate which clocks are not
related. For example, if there are paths between an 8ns clock and 10ns clock, even if the clocks are
completely asynchronous, the TimeQuest analyzer attempts to meet a 2ns setup relationship between
these clocks unless you indicate that they are not related. The TimeQuest analyzer analyzes everything
known, rather than assuming that all clocks are unrelated and requiring that you relate them. The SDC
language has a powerful constraint for setting unrelated clocks called set_clock_groups. A template for
the the typical use of the set_clock_groups command is:
The set_clock_groups command does not actually group clocks. Since the TimeQuest analyzer assumes
all clocks are related by default, all clocks are effectively in one big group. Instead, the set_clock_groups
command cuts timing between clocks in different groups.
There is no limit to the number of times you can specify a group option with -group {<group of
clocks>}. When entering constraints through the GUI with Edit > Insert Constraint, the Set Clock
Groups dialog box only permits two clock groups, but this is only a limitation of that dialog box. You can
always manually add more into the SDC file.
Any clock not listed in the assignment is related to all clocks. If you forget a clock, the TimeQuest analyzer
acts conservatively and analyzes that clock in context with all other domains to which it connects.
The set_clock_groups command requires either the -asynchronous or -exclusive option. The -
asynchronous flag means the clocks are both toggling, but not in a way that can synchronously pass data.
The -exclusive flag means the clocks do not toggle at the same time, and hence are mutually exclusive.
An example of this might be a clock multiplexor that has two generated clock assignments on its output.
Since only one can toggle at a time, these clocks are -exclusive. TimeQuest does not currently analyze
crosstalk explicitly. Instead, the timing models use extra guard bands to account for any potential
crosstalk-induced delays. TimeQuest treats the -asynchronous and -exclusive options the same.
A clock cannot be within multiple -group groupings in a single assignment, however, you can have
multiple set_clock_groups assignments.
Another way to cut timing between clocks is to use set_false_path. To cut timing between sys_clk and
dsp_clk, a user might enter:
This works fine when there are only a few clocks, but quickly grows to a huge number of assignments that
are completely unreadable. In a simple design with three PLLs that have multiple outputs, the
set_clock_groups command can clearly show which clocks are related in less than ten lines, while
set_false_path may be over 50 lines and be very non-intuitive on what is being cut.
Related Information
• Creating Generated Clocks on page 7-15
• Relaxing Setup with set_multicyle_path on page 7-31
• Accounting for a Phase Shift on page 7-32
Send Feedback
QPS5V3
7-10 Tips for Writing a set_clock_groups Constraint 2015.11.02
Cut and paste clocks into groups to define how they’re related, adding or removing groups as necessary.
Format to make the code readable.
Note: This command can be difficult to read on a single line. Instead, you should make use of the Tcl line
continuation character "\". By putting a space after your last character and then "\", the end-of-line
character is escaped. (And be careful not to have any whitespace after the escape character, or else
it will escape the whitespace, not the end-of-line character).
set_clock_groups -asynchronous \
-group {adc_clk \
the_adc_pll|altpll_component_autogenerated|pll|clk[0] \
the_adc_pll|altpll_component_autogenerated|pll|clk[1] \
the_adc_pll|altpll_component_autogenerated|pll|clk[2] \
} \
-group {sys_clk \
the_system_pll|altpll_component_autogenerated|pll|clk[0] \
the_system_pll|altpll_component_autogenerated|pll|clk[1] \
} \
-group {the_system_pll|altpll_component_autogenerated|pll|clk[2] \
}
Note: The last group has a PLL output system_pll|..|clk[2] while the input clock and other PLL
outputs are in different groups. If PLLs are used, and the input clock frequency is not related to the
frequency of the PLL's outputs, they must be treated asynchronously. Usually most outputs of a
PLL are related and hence in the same group, but this is not a requirement, and depends on the
requirements of your design.
For designs with complex clocking, writing this constraint can be an iterative process. For example, a
design with two DDR3 cores and high-speed transceivers could easily have thirty or more clocks. In those
cases, you can just add the clocks you’ve created. Since clocks not in the command are still related to every
clock, you are conservatively grouping what is known. If there are still failing paths in the design between
unrelated clock domains, you can start adding in the new clock domains as necessary. In this case, a large
number of the clocks won't actually be in the set_clock_groups command, since they are either cut in
Send Feedback
QPS5V3
2015.11.02 Creating Clocks and Clock Constraints 7-11
the SDC file for the IP core (such as the SDC files generated by the DDR3 cores), or they only connect to
clock domains to which they are related.
For many designs, that is all that's necessary to constrain the core. Some common core constraints that
will not be covered in this quick start section that user's do are:
• Add multicycles between registers which can be analyzed at a slower rate than the default analysis, in
other words, increasing the time when data can be read, or 'opening the window'. For example, a 10ns
clock period will have a 10ns setup relationship. If the data changes at a slower rate, or perhaps the
registers toggle at a slower rate due to a clock enable, then you should apply a multicycle that relaxes
the setup relationship (opens the the window so that valid data can pass). This is a multiple of the clock
period, making the setup relationship 20ns, 40ns, etc., while keeping the hold relationship at 0ns.
These types of multicycles are generally applied to paths.
• The second common form of multicycle is when the user wants to advance the cycle in which data is
read, or 'shift the window'. This generally occurs when your design performs a small phase-shift on a
clock. For example, if your design has two 10ns clocks exiting a PLL, but the second clock has a 0.5ns
phase-shift, the default setup relationship from the main clock to the phase-shifted clock is 0.5ns and
the hold relationship is -9.5ns. It is almost impossible to meet a 0.5ns setup relationship, and most
likely you intend the data to transfer in the next window. By adding a multicycle from the main clock
to the phase-shifted clock, the setup relationship becomes 10.5ns and the hold relationship becomes
0.5ns. This multicycle is generally applied between clocks and is something the user should think about
as soon as they do a small phase-shift on a clock. This type of multicycle is called shifting the window.
• Add a create_generated_clock to ripple clocks. When a register's output drives the clk port of
another register, that is a ripple clock. Clocks do not propagate through registers, so all ripple clocks
must have a create_generated_clock constraint applied to them for correct analysis. Unconstrained
ripple clocks appear in the Report Unconstrained Paths report, so they are easily recognized. In
general, ripple clocks should be avoided for many reasons, and if possible, a clock enable should be
used instead.
• Add a create_generated_clock to clock mux outputs. Without this, all clocks propagate through the
mux and are related. TimeQuest analyze paths downstream from the mux where one clock input feeds
the source register and the other clock input feeds the destination, and vice-versa. Although it could be
valid, this is usually not preferred behavior. By putting create_generated_clock constraints on the
mux output, which relates them to the clocks coming into the mux, you can correctly group these
clocks with other clocks.
Send Feedback
QPS5V3
7-12 Creating Base Clocks 2015.11.02
Use the create_clock command to create a base clock. Use other constraints, such as those described in
Accounting for Clock Effect Characteristics, to specify clock characteristics such as uncertainty and latency.
The following examples show the most common uses of the create_clock constraint:
create_clock Command
To specify a 100 MHz requirement on a clk_sys input clock port you would enter the following in your
SDC file:
Although it is not common to have more than two base clocks defined on a port, you can define as many
as are appropriate for your design, making sure you specify -add for all clocks after the first.
Related Information
• Accounting for Clock Effect Characteristics on page 7-21
• create_clock
• get_ports
For more information about these commands, refer to Quartus Prime Help.
Send Feedback
QPS5V3
2015.11.02 Automatically Detecting Clocks and Creating Default Clock Constraints 7-13
derive_clocks -period 10
Warning: Do not use the derive_clocks command for final timing sign-off; instead, you should create
clocks for all clock sources with the create_clock and create_generated_clock commands.
If your design has more than a single clock, the derive_clocks command constrains all the
clocks to the same specified frequency. To achieve a thorough and realistic analysis of your
design’s timing requirements, you should make individual clock constraints for all clocks in
your design.
If you want to have some base clocks created automatically, you can use the -create_base_clocks
option to derive_pll_clocks. With this option, the derive_pll_clocks command automatically
creates base clocks for each PLL, based on the input frequency information specified when the PLL was
instantiated. The base clocks are named matching the port names. This feature works for simple port-to-
PLL connections. Base clocks are not automatically generated for complex PLL connectivity, such as
cascaded PLLs. You can also use the command derive_pll_clocks -create_base_clocks to create the
input clocks for all PLL inputs automatically.
Related Information
derive_clocks
For more information about this command, refer to Quartus Prime Help.
Send Feedback
QPS5V3
7-14 Example of Specifying an I/O Interface Clock 2015.11.02
system_clk virt_clk
You can create a 10 ns virtual clock named virt_clk with a 50% duty cycle where the first rising edge
occurs at 0 ns by adding the following code to your SDC file. The virtual clock is then used as the clock
source for an output delay constraint.
Related Information
• set_input_delay
• set_output_delay
For more information about these commands, refer to Quartus Prime Help.
Send Feedback
QPS5V3
2015.11.02 I/O Interface Uncertainty 7-15
clk_in
100 MHz
Related Information
Clock Uncertainty on page 7-21
For more information about clock uncertainty and clock transfers.
Send Feedback
QPS5V3
7-16 Creating Generated Clocks 2015.11.02
way, the source of the generated clock is decoupled from the naming and hierarchy of its clock source. If
you change its clock source, you don't have to edit the generated clock constraint.
If you have multiple base clocks feeding a node that is the source for a generated clock, you must define
multiple generated clocks. Each generated clock is associated to one base clock using the -master_clock
option in each generated clock statement. In some cases, generated clocks are generated with combina‐
tional logic. Depending on how your clock-modifying logic is synthesized, the name can change from
compile to compile. If the name changes after you write the generated clock constraint, the generated
clock is ignored because its target name no longer exists in the design. To avoid this problem, use a
synthesis attribute or synthesis assignment to keep the final combinational node of the clock-modifying
logic. Then use the kept name in your generated clock constraint. For details on keeping combinational
nodes or wires, refer to the Implement as Output of Logic Cell logic option topic in Quartus Prime Help.
When a generated clock is created on a node that ultimately feeds the data input of a register, this creates a
special case referred to as “clock-as-data”. Instances of clock-as-data are treated differently by TimeQuest.
For example, when clock-as-data is used with DDR, both the rise and the fall of this clock need to be
considered since it is a clock, and TimeQuest reports both rise and fall. With clock-as-data, the From
Node is treated as the target of the generated clock, and the Launch Clock is treated as the generated
clock. In the figure below, the first path is from toggle_clk (INVERTED) to clk, whereas the second path
is from toggle_clk to clk. The slack in both cases is slightly different due to the difference in rise and fall
times along the path; the ~5 ps difference can be seen in the Data Delay column. Only the path with the
lowest slack value need be considered. This would also be true if this were not a clock-as-data case, but
normally TimeQuest only reports the worst-case path between the two (rise and fall). In this example, if
the generated clock were not defined on the register output, then only one path would be reported and it
would be the one with the lowest slack value. If your design targets an Arria 10 device, the enhanced
timing algorithms remove all common clock pessimism on paths treated as clock-as-data.
Figure 7-5: Example of clock-as-data
The TimeQuest analyzer provides the derive_pll_clocks command to automatically generate clocks for
all PLL clock outputs. The properties of the generated clocks on the PLL outputs match the properties
defined for the PLL.
Send Feedback
QPS5V3
2015.11.02 Clock Divider Example 7-17
Related Information
• Deriving PLL Clocks on page 7-18
For more information about deriving PLL clock outputs.
• Implement as Output of Logic Cell logic option
For more information on keeping combinational nodes or wires, refer to Quartus Prime Help.
• create_generate_clock
• derive_pll_clocks
• create_generated_clocks
For information about these commands, refer to Quartus Prime Help.
reg
clk_sys
Edges 1 2 3 4 5 6 7 8
clk_sys
clk_div_2
Time
0 10 20 30
Or in order to have the clock source be the clock pin of the register you can use:
Send Feedback
QPS5V3
7-18 Deriving PLL Clocks 2015.11.02
to indicate that the two generated clocks can never be active simultaneously in the design, so the
TimeQuest analyzer does not analyze cross-domain paths between the generated clocks on the output of
the clock mux.
Figure 7-8: Clock Mux
clk_a mux_out
clk_b
If your design contains transceivers, LVDS transmitters, or LVDS receivers, you must use the
derive_pll_clocks command. The command automatically constrains this logic in your design and
creates timing exceptions for those blocks.
Include the derive_pll_clocks command in your SDC file after any create_clock command Each time
the TimeQuest analyzer reads your SDC file, the appropriate generate clock is created for each PLL output
clock pin. If a clock exists on a PLL output before running derive_pll_clocks, the pre-existing clock has
precedence, and an auto-generated clock is not created for that PLL output.
A simple PLL design with a register-to-register path.
Figure 7-9: Simple PLL Design
dataout
reg_1 reg_2
pll_inclk pll_inst
The TimeQuest analyzer generates messages when you use the derive_pll_clocks command to
automatically constrain the PLL for a design similar to the previous image.
Send Feedback
QPS5V3
2015.11.02 Creating Clock Groups 7-19
Info:
Info: Deriving PLL Clocks:
Info: create_generated_clock -source pll_inst|altpll_component|pll|inclk[0] -
divide_by 2 -name
pll_inst|altpll_component|pll|clk[0] pll_inst|altpll_component|pll|clk[0]
Info:
The input clock pin of the PLL is the node pll_inst|altpll_component|pll|inclk[0] which is used
for the -source option. The name of the output clock of the PLL is the PLL output clock node, pll_inst|
altpll_component|pll|clk[0].
If the PLL is in clock switchover mode, multiple clocks are created for the output clock of the PLL; one for
the primary input clock (for example, inclk[0]), and one for the secondary input clock (for example,
inclk[1]). You should create exclusive clock groups for the primary and secondary output clocks since
they are not active simultaneously.
Related Information
• Creating Clock Groups on page 7-19
For more information about creating exclusive clock groups.
• derive_pll_clocks
• Derive PLL Clocks
For more information about the derive_pll_clocks command.
Dest\Source A B C D
A Analyzed Cut Cut Cut
B Cut Analyzed Analyzed Analyzed
C Cut Analyzed Analyzed Analyzed
D Cut Analyzed Analyzed Analyzed
Dest\Source A B C D
A Analyzed Analyzed Cut Cut
Send Feedback
QPS5V3
7-20 Exclusive Clock Groups 2015.11.02
Dest\Source A B C D
A Analyzed Cut Cut Cut
B Cut Analyzed Cut Cut
C Cut Cut Analyzed Analyzed
D Cut Cut Analyzed Analyzed
Dest\Source A B C D
A Analyzed Cut Analyzed Cut
B Cut Analyzed Cut Analyzed
C Analyzed Cut Analyzed Cut
D Cut Analyzed Cut Analyzed
Dest\Source A B C D
A Analyzed Cut Analyzed Analyzed
B Cut Analyzed Cut Cut
C Analyzed Cut Analyzed Analyzed
D Analyzed Cut Analyzed Analyzed
Related Information
set_clock_groups
For more information about this command, refer to Quartus Prime Help.
Send Feedback
QPS5V3
2015.11.02 Asynchronous Clock Groups 7-21
Figure 7-10: Clock Mux with Synchronous Path Across the Mux
clk_a
mux_out
clk_b
Related Information
set_clock_groups
For more information about this command, refer to Quartus Prime Help.
Clock Latency
There are two forms of clock latency, clock source latency and clock network latency. Source latency is the
propagation delay from the origin of the clock to the clock definition point (for example, a clock port).
Network latency is the propagation delay from a clock definition point to a register’s clock pin. The total
latency at a register’s clock pin is the sum of the source and network latencies in the clock path.
To specify source latency to any clock ports in your design, use the set_clock_latency command.
Note: The TimeQuest analyzer automatically computes network latencies; therefore, you only can
characterize source latency with the set_clock_latency command. You must use the -source
option.
Related Information
set_clock_latency
For more information about this command, refer to Quartus Prime Help.
Clock Uncertainty
When clocks are created, they are ideal and have perfect edges. It is important to add uncertainty to those
perfect edges, to mimic clock-level effects like jitter. You should include the derive_clock_uncertainty
command in your SDC file so that appropriate setup and hold uncertainties are automatically calculated
and applied to all clock transfers in your design. If you don't include the command, the TimeQuest
analyzer performs it anyway; it is a critical part of constraining your design correctly.
Send Feedback
QPS5V3
7-22 Clock Uncertainty 2015.11.02
The TimeQuest analyzer subtracts setup uncertainty from the data required time for each applicable path
and adds the hold uncertainty to the data required time for each applicable path. This slightly reduces the
setup and hold slack on each path.
The TimeQuest analyzer accounts for uncertainty clock effects for three types of clock-to-clock transfers;
intraclock transfers, interclock transfers, and I/O interface clock transfers.
• Intraclock transfers occur when the register-to-register transfer takes place in the device and the source
and destination clocks come from the same PLL output pin or clock port.
• Interclock transfers occur when a register-to-register transfer takes place in the core of the device and
the source and destination clocks come from a different PLL output pin or clock port.
• I/O interface clock transfers occur when data transfers from an I/O port to the core of the device or
from the core of the device to the I/O port.
To manually specify clock uncertainty, use the set_clock_uncertainty command. You can specify the
uncertainty separately for setup and hold. You can also specify separate values for rising and falling clock
transitions, although this is not commonly used. You can override the value that was automatically
applied by the derive_clock_uncertainty command, or you can add to it.
The derive_clock_uncertainty command accounts for PLL clock jitter if the clock jitter on the input to
a PLL is within the input jitter specification for PLL's in the specified device. If the input clock jitter for
the PLL exceeds the specification, you should add additional uncertainty to your PLL output clocks to
account for excess jitter with the set_clock_uncertainty -add command. Refer to the device handbook
for your device for jitter specifications.
Another example is to use set_clock_uncertainty -add to add uncertainty to account for peak-to-peak
jitter from a board when the jitter exceeds the jitter specification for that device. In this case you would
add uncertainty to both setup and hold equal to 1/2 the jitter value:
There is a complex set of precedence rules for how the TimeQuest analyzer applies values from
derive_clock_uncertainty and set_clock_uncertainty, which depend on the order the commands
appear in your SDC files, and various options used with the commands. The Help topics referred to below
contain complete descriptions of these rules. These precedence rules are much simpler to understand and
implement if you follow these recommendations:
• If you want to assign your own clock uncertainty values to any clock transfers, the best practice is to
put your set_clock_uncertainty exceptions after the derive_clock_uncertainty command in
your SDC file.
• When you use the -add option for set_clock_uncertainty, the value you specify is added to the
value from derive_clock_uncertainty. If you don't specify -add, the value you specify replaces the
value from derive_clock_uncertainty.
Related Information
• set_clock_uncertainty
• derive_clock_uncertainty
• remove_clock_uncertainty
For more information about these commands, refer to Quartus Prime Help.
Send Feedback
QPS5V3
2015.11.02 Creating I/O Requirements 7-23
Input Constraints
Input constraints allow you to specify all the external delays feeding into the device. Specify input
requirements for all input ports in your design.
You can use the set_input_delay command to specify external input delay requirements. Use the -
clock option to reference a virtual clock. Using a virtual clock allows the TimeQuest analyzer to correctly
derive clock uncertainties for interclock and intraclock transfers. The virtual clock defines the launching
clock for the input port. The TimeQuest analyzer automatically determines the latching clock inside the
device that captures the input data, because all clocks in the device are defined.
Figure 7-11: Input Delay
dd
tco_ext
Oscillator
cd_ext cd_altr
The calculation the TimeQuest analyzer performs to determine the typical input delay.
Figure 7-12: Input Delay Calculation
Output Constraints
Output constraints allow you to specify all external delays from the device for all output ports in your
design.
You can use the set_output_delay command to specify external output delay requirements. Use the -
clock option to reference a virtual clock. The virtual clock defines the latching clock for the output port.
The TimeQuest analyzer automatically determines the launching clock inside the device that launches the
output data, because all clocks in the device are defined. The following figure is an example of an output
delay referencing a virtual clock.
Send Feedback
QPS5V3
7-24 Creating Delay and Skew Constraints 2015.11.02
dd tsu_ext/th_ext
cd_ext
Oscillator
cd_altr
The calculation the TimeQuest analyzer performs to determine the typical out delay.
Figure 7-14: Output Delay Calculation
Related Information
• set_intput_delay
• set_output_delay
For more information about these commands, refer to Quartus Prime Help.
create_timing_netlist -force_dat
Related Information
• Using Advanced I/O Timing
• I/O Management
For more information about advanced I/O timing.
Send Feedback
QPS5V3
2015.11.02 Maximum Skew 7-25
Maximum Skew
To specify the maximum path-based skew requirements for registers and ports in the design and report
the results of maximum skew analysis, use the set_max_skew command in conjunction with the
report_max_skew command.
Use the set_max_skew constraint to perform maximum allowable skew analysis between sets of registers
or ports. In order to constrain skew across multiple paths, all such paths must be defined within a single
set_max_skew constraint. set_max_skew timing constraint is not affected by set_max_delay,
set_min_delay, and set_multicycle_path but it does obey set_false_path and set_clock_groups. If
your design targets an Arria 10 device, skew constraints are not affected by set_clock_groups.
Arguments Description
-h | -help Short help
-long_help Long help with examples and possible return values
-exclude <Tcl list> A Tcl list of parameters to exclude during skew analysis. This
list can include one or more of the following: utsu, uth, utco,
from_clock, to_clock, clock_uncertainty, ccpp, input_
delay, output_delay, odv.
-fall_from_clock <names> Valid source clocks (string patterns are matched using Tcl
string matching)
-fall_to_clock <names> Valid destination clocks (string patterns are matched using Tcl
string matching)
-from <names>(1) Valid sources (string patterns are matched using Tcl string
matching
-from_clock <names> Valid source clocks (string patterns are matched using Tcl
string matching)
-get_skew_value_from_clock_period Option to interpret skew constraint as a multiple of the clock
<src_clock_period|dst_clock_ period
period|min_clock_period>
-include <Tcl list> Tcl list of parameters to include during skew analysis. This list
can include one or more of the following: utsu, uth, utco,
from_clock, to_clock, clock_uncertainty, ccpp, input_
delay, output_delay, odv.
-rise_from_clock <names> Valid source clocks (string patterns are matched using Tcl
string matching)
-rise_to_clock <names> Valid destination clocks (string patterns are matched using Tcl
string matching)
(1)
Legal values for the -from and -to options are collections of clocks, registers, ports, pins, cells or partitions in
a design.
Send Feedback
QPS5V3
7-26 Net Delay 2015.11.02
Arguments Description
-skew_value_multiplier Value by which the clock period should be multiplied to
<multiplier> compute skew requirement.
-to <names>(1) Valid destinations (string patterns are matched using Tcl string
matching)
-to_clock <names> Valid destination clocks (string patterns are matched using Tcl
string matching)
<skew> Required skew
Applying maximum skew constraints between clocks applies the constraint from all register or ports
driven by the clock specified with the -from option to all registers or ports driven by the clock specified
with the -to option.
Use the -include and -exclude options to include or exclude one or more of the following: register
micro parameters (utsu, uth, utco), clock arrival times (from_clock, to_clock), clock uncertainty
(clock_uncertainty), common clock path pessimism removal (ccpp), input and output delays
(input_delay, output_delay) and on-die variation (odv). Max skew analysis can include data arrival
times, clock arrival times, register micro parameters, clock uncertainty, on-die variation and ccpp
removal. Among these, only ccpp removal is disabled during the Fitter by default. When -include is
used, those in the inclusion list are added to the default analysis. Similarly, when -exclude is used, those
in the exclusion list are excluded from the default analysis. When both the -include and -exclude
options specify the same parameter, that parameter is excluded.
Note: If your design targets an Arria 10 device, -exclude and -include are not supported.
Use -get_skew_value_from_clock_period to set the skew as a multiple of the launching or latching
clock period, or whichever of the two has a smaller period. If this option is used, then -
skew_value_multiplier must also be set, and the positional skew option may not be set. If the set of
skew paths is clocked by more than one clock, TimeQuest uses the one with smallest period to compute
the skew constraint.
When this constraint is used, results of max skew analysis are displayed in the Report Max Skew
(report_max_skew) report from the TimeQuest Timing Analyzer. Since skew is defined between two or
more paths, no results are displayed if the -from/-from_clock and -to/-to_clock filters satisfy less than
two paths.
Related Information
• set_max_skew
• report_max_skew
For more information about these commands, refer to Quartus Prime Help.
Net Delay
Use the set_net_delay command to set the net delays and perform minimum or maximum timing
analysis across nets. The -from and -to options can be string patterns or pin, port, register, or net
collections. When pin or net collection is used, the collection should include output pins or nets.
Send Feedback
QPS5V3
2015.11.02 Using create_timing_netlist 7-27
Arguments Description
-h | -help Short help
-long_help Long help with examples and possible return values
-from <names> Valid source pins, ports, registers or nets(string patterns are
matched using Tcl string matching)
-get_value_from_clock_period Option to interpret net delay constraint as a multiple of the
<src_clock_period|dst_clock_ clock period.
period|min_clock_period|max_
clock_period>
When you use the -min option, slack is calculated by looking at the minimum delay on the edge. If you
use -max option, slack is calculated with the maximum edge delay.
Use -get_skew_value_from_clock_period to set the net delay requirement as a multiple of the
launching or latching clock period, or whichever of the two has a smaller or larger period. If this option is
used, then -value_multiplier must also be set, and the positional delay option may not be set. If the set
of nets is clocked by more than one clock, TimeQuest uses the net with smallest period to compute the
constraint for a -max constraint, and the largest period for a -min constraint. If there are no clocks
clocking the endpoints of the net (e.g. if the endpoints of the nets are not registers or constraint ports),
then the net delay constraint will be ignored.
Related Information
• set_net_delay
• report_net_delay
For more information about these commands, refer to Quartus Prime Help.
Using create_timing_netlist
You can onfigure or load the timing netlist that the TimeQuest analyzer uses to calculate path delay data.
Your design should have a timing netlist before running the TimeQuest analyzer. You can use the Create
Timing Netlist dialog box or the Create Timing Netlist command in the Tasks pane. The command also
generates Advanced I/O Timing reports if you turned on Enable Advanced I/O Timing in the
TimeQuest Timing Analyzer page of the Settings dialog box.
Note: The timing netlist created is based on the initial configuration of the design. Any configuration
changes done by the design after the device enters user mode, for example, dynamic transceiver
(2)
If the -to option is unused or if the -to filter is a wildcard ( "*") character, all the output pins and registers on
timing netlist became valid destination points.
Send Feedback
QPS5V3
7-28 Creating Timing Exceptions 2015.11.02
reconfiguration, are not reflected in the timing netlist. This applies to all device families except
transceivers on Arria 10 devices with the Multiple Reconfiguration Profiles feature.
The following diagram shows how the TimeQuest analyzer interprets and classifies timing netlist data for
a sample design.
Figure 7-15: How TimeQuest Interprets the Timing Netlist
Precedence
If a conflict of node names occurs between timing exceptions, the following order of precedence applies:
1. False path
2. Minimum delays and maximum delays
3. Multicycle path
The false path timing exception has the highest precedence. Within each category, assignments to
individual nodes have precedence over assignments to clocks. Finally, the remaining precedence for
additional conflicts is order-dependent, such that the assignments most recently created overwrite, or
partially overwrite, earlier assignments.
False Paths
Specifying a false path in your design removes the path from timing analysis.
Use the set_false_path command to specify false paths in your design. You can specify either a point-
to-point or clock-to-clock path as a false path. For example, a path you should specify as false path is a
static configuration register that is written once during power-up initialization, but does not change state
again. Although signals from static configuration registers often cross clock domains, you may not want
to make false path exceptions to a clock-to-clock path, because some data may transfer across clock
domains. However, you can selectively make false path exceptions from the static configuration register to
all endpoints.
Send Feedback
QPS5V3
2015.11.02 Minimum and Maximum Delays 7-29
To make false path exceptions from all registers beginning with A to all registers beginning with B, use the
following code in your SDC file.
The TimeQuest analyzer assumes all clocks are related unless you specify otherwise. Clock groups are a
more efficient way to make false path exceptions between clocks, compared to writing multiple
set_false_path exceptions between every clock transfer you want to eliminate.
Related Information
• Creating Clock Groups on page 7-19
For more information about creating exclusive clock groups.
• set_false_path
For more information about this command, refer to Quartus Prime Help.
Delay Annotation
To modify the default delay values used during timing analysis, use the set_annotated_delay and
set_timing_derate commands. You must update the timing netlist to see the results of these commands
Send Feedback
QPS5V3
7-30 Multicycle Paths 2015.11.02
To specify different operating conditions in a single SDC file, rather than having multiple SDC files that
specify different operating conditions, use the set_annotated_delay -operating_conditions
command.
Related Information
• set_timing_derate
• set_annotated_delay
For more information about these commands, refer to the Quartus Prime Help.
Multicycle Paths
By default, the TimeQuest analyzer performs a single-cycle analysis, which is the most restrictive type of
analysis. When analyzing a path, the setup launch and latch edge times are determined by finding the
closest two active edges in the respective waveforms.
For a hold analysis, the timing analyzer analyzes the path against two timing conditions for every possible
setup relationship, not just the worst-case setup relationship. Therefore, the hold launch and latch times
may be completely unrelated to the setup launch and latch edges. The TimeQuest analyzer does not report
negative setup or hold relationships. When either a negative setup or a negative hold relationship is
calculated, the TimeQuest analyzer moves both the launch and latch edges such that the setup and hold
relationship becomes positive.
A multicycle constraint adjusts setup or hold relationships by the specified number of clock cycles based
on the source (-start) or destination (-end) clock. An end setup multicycle constraint of 2 extends the
worst-case setup latch edge by one destination clock period. If -start and -end values are not specified,
the default constraint is -end.
Hold multicycle constraints are based on the default hold position (the default value is 0). An end hold
multicycle constraint of 1 effectively subtracts one destination clock period from the default hold latch
edge.
When the objects are timing nodes, the multicycle constraint only applies to the path between the two
nodes. When an object is a clock, the multicycle constraint applies to all paths where the source node (-
from) or destination node (-to) is clocked by the clock. When you adjust a setup relationship with a
multicycle constraint, the hold relationship is adjusted automatically.
You can use TimeQuest analyzer commands to modify either the launch or latch edge times that the uses
to determine a setup relationship or hold relationship.
Send Feedback
QPS5V3
2015.11.02 Relaxing Setup with set_multicyle_path 7-31
multicycle variations are relaxing setup to allow a slower data transfer rate, and altering the setup to
account for a phase shift.
0 ns 10 ns 20 ns 30 ns No Multicycles
(Default Relationship)
Setup = 10 ns
Hold = 0 ns
0 ns 10 ns 20 ns 30 ns Setup = 2
Hold = 1
Setup = 20 ns
Hold = 0 ns
0 ns 10 ns 20 ns 30 ns Setup = 3
Hold = 2
Setup = 30 ns
Hold = 0 ns
This pattern can be extended to create larger setup relationships in order to ease timing closure require‐
ments. A common use for this exception is when writing to asynchronous RAM across an I/O interface.
The delay between address, data, and a write enable may be several cycles. A multicycle exception to I/O
ports can allow extra time for the address and data to resolve before the enable occurs.
You can relax the setup by three cycles with the following code in your SDC file.
Send Feedback
QPS5V3
7-32 Accounting for a Phase Shift 2015.11.02
The default setup relationship for this phase-shift is 0.2 ns, shown in Figure A, creating a scenario where
the hold relationship is negative, which makes achieving timing closure nearly impossible.
Figure 7-17: Phase-Shifted Setup and Hold
-10 ns 0 ns 10 ns 20 ns No Multicycles
(Default Relationship)
Setup = 0.2 ns
Hold = -9.8 ns
-10 ns 0 ns 10 ns 20 ns
Setup = 2
Setup = 10.2 ns
Hold = 0.2 ns
Adding the following constraint in your SDC allows the data to transfer to the following edge.
The hold relationship is derived from the setup relationship, making a multicyle hold constraint unneces‐
sary.
Related Information
• Same Frequency Clocks with Destination Clock Offset on page 7-41
Refer to this topic for a more complete example.
• Same Frequency Clocks with Destination Clock Offset on page 7-41
Refer to this topic for a more complete example.
• set_multicycle_path
For more information about this command, refer to the Quartus Prime Help.
Send Feedback
QPS5V3
2015.11.02 Examples of Basic Multicycle Exceptions 7-33
Default Settings
By default, the TimeQuest analyzer performs a single-cycle analysis to determine the setup and hold
checks. Also, by default, the TimeQuest analyzer sets the end multicycle setup assignment value to one
and the end multicycle hold assignment value to zero.
The source and the destination timing waveform for the source register and destination register,
respectively where HC1 and HC2 are hold checks one and two and SC is the setup check.
Figure 7-18: Default Timing Diagram
-10 0 10 20
Current Launch
REG1.CLK
HC1 SC HC2
REG2.CLK 0 1 2
Current Latch
The calculation that the TimeQuest analyzer performs to determine the setup check.
Figure 7-19: Setup Check
The most restrictive setup relationship with the default single-cycle analysis, that is, a setup relationship
with an end multicycle setup assignment of one, is 10 ns.
The setup report for the default setup in the TimeQuest analyzer with the launch and latch edges
highlighted.
Send Feedback
QPS5V3
7-34 Default Settings 2015.11.02
The calculation that the TimeQuest analyzer performs to determine the hold check. Both hold checks are
equivalent.
Figure 7-21: Hold Check
The most restrictive hold relationship with the default single-cycle analysis, that a hold relationship with
an end multicycle hold assignment of zero, is 0 ns.
The hold report for the default setup in the TimeQuest analyzer with the launch and latch edges
highlighted.
Send Feedback
QPS5V3
2015.11.02 End Multicycle Setup = 2 and End Multicycle Hold = 0 7-35
Multicycle Exceptions
Note: An end multicycle hold value is not required because the default end multicycle hold value is zero.
In this example, the setup relationship is relaxed by a full clock period by moving the latch edge to
the next latch edge. The hold analysis is unchanged from the default settings.
The setup timing diagram for the analysis that the TimeQuest analyzer performs. The latch edge is
a clock cycle later than in the default single-cycle analysis.
Send Feedback
QPS5V3
7-36 End Multicycle Setup = 2 and End Multicycle Hold = 0 2015.11.02
-10 0 10 20
Current
Launch
REG1.CLK
SC
REG2.CLK 0 1 2
Current
Latch
The calculation that the TimeQuest analyzer performs to determine the setup check.
Figure 7-24: Setup Check
The most restrictive setup relationship with an end multicycle setup assignment of two is 20 ns.
The setup report in the TimeQuest analyzer with the launch and latch edges highlighted.
Figure 7-25: Setup Report
Send Feedback
QPS5V3
2015.11.02 End Multicycle Setup = 2 and End Multicycle Hold = 0 7-37
Because the multicycle hold latch and launch edges are the same as the results of hold analysis with
the default settings, the multicycle hold analysis in this example is equivalent to the single-cycle
hold analysis. The hold checks are relative to the setup check. Usually, the TimeQuest analyzer
performs hold checks on every possible setup check, not only on the most restrictive setup check
edges.
Figure 7-26: Hold Timing DIagram
-10 0 10 20
Current Launch
REG1.CLK
REG2.CLK
Current Latch
The calculation that the TimeQuest analyzer performs to determine the hold check. Both hold
checks are equivalent.
Figure 7-27:
The most restrictive hold relationship with an end multicycle setup assignment value of two and an
end multicycle hold assignment value of zero is 10 ns.
The hold report for this example in the TimeQuest analyzer with the launch and latch edges
highlighted.
Send Feedback
QPS5V3
7-38 End Multicycle Setup = 2 and End Multicycle Hold = 1 2015.11.02
Multicycle Exceptions
In this example, the setup relationship is relaxed by two clock periods by moving the latch edge to the left
two clock periods. The hold relationship is relaxed by a full period by moving the latch edge to the
previous latch edge.
The setup timing diagram for the analysis that the TimeQuest analyzer performs.
Send Feedback
QPS5V3
2015.11.02 End Multicycle Setup = 2 and End Multicycle Hold = 1 7-39
-10 0 10 20
Current
Launch
SRC.CLK
SC
DST.CLK 0 1 2
Current
Latch
The calculation that the TimeQuest analyzer performs to determine the setup check.
Figure 7-30: Setup Check
The most restrictive hold relationship with an end multicycle setup assignment value of two is 20 ns.
The setup report for this example in the TimeQuest analyzer with the launch and latch edges highlighted.
Figure 7-31: Setup Report
Send Feedback
QPS5V3
7-40 End Multicycle Setup = 2 and End Multicycle Hold = 1 2015.11.02
The timing diagram for the hold checks for this example. The hold checks are relative to the setup check.
Figure 7-32: Hold Timing Diagram
-10 0 10 20
Current
Launch
SRC.CLK
SC
HC1
HC2
DST.CLK
Current
Latch
The calculation that the TimeQuest analyzer performs to determine the hold check. Both hold checks are
equivalent.
Figure 7-33: Hold Check
The most restrictive hold relationship with an end multicycle setup assignment value of two and an end
multicycle hold assignment value of one is 0 ns.
The hold report for this example in the TimeQuest analyzer with the launch and latch edges highlighted.
Send Feedback
QPS5V3
2015.11.02 Application of Multicycle Exceptions 7-41
REG1 REG2
SET Combinational SET
In D Q
Logic
D Q Out
clk1
The timing diagram for default setup check analysis that the TimeQuest analyzer performs.
Send Feedback
QPS5V3
7-42 Same Frequency Clocks with Destination Clock Offset 2015.11.02
-10 0 10 20
Launch
REG1.CLK
SC
REG2.CLK 1 2
Latch
The calculation that the TimeQuest analyzer performs to determine the setup check.
Figure 7-37: Setup Check
The setup relationship shown is too pessimistic and is not the setup relationship required for typical
designs. To correct the default analysis, you must use an end multicycle setup exception of two. A
multicycle exception used to correct the default analysis in this example in your SDC file.
Multicycle Exceptions
The timing diagram for the preferred setup relationship for this example.
.
Figure 7-38: Preferred Setup Relationship
-10 0 10 20
Launch
REG1.CLK
SC
REG2.CLK 1 2
Latch
Send Feedback
QPS5V3
2015.11.02 Same Frequency Clocks with Destination Clock Offset 7-43
The timing diagram for default hold check analysis that the TimeQuest analyzer performs with an end
multicycle setup value of two.
Figure 7-39: Default Hold Check
-10 0 10 20
Current
Launch
REG1.CLK
HC1 SC HC2
REG2.CLK
Current
Latch
The calculation that the TimeQuest analyzer performs to determine the hold check.
Figure 7-40: Hold Check
In this example, the default hold analysis returns the preferred hold requirements and no multicycle hold
exceptions are required.
The associated setup and hold analysis if the phase shift is –2 ns. In this example, the default hold analysis
is correct for the negative phase shift of 2 ns, and no multicycle exceptions are required.
Send Feedback
QPS5V3
7-44 Destination Clock Frequency is a Multiple of the Source Clock Frequency 2015.11.02
-10 0 10 20
Current
Launch
REG1.CLK
HC1 SC HC2
REG2.CLK
Current
Latch
REG1 REG2
SET Combinational SET
In D Q
Logic
D Q Out
clk0
CLR CLR
clk
clk1
The timing diagram for default setup check analysis that the TimeQuest analyzer performs.
Figure 7-43: Setup Timing Diagram
-10 0 10 20
Launch
REG1.CLK
SC
REG2.CLK 1 2
Latch
The calculation that the TimeQuest analyzer performs to determine the setup check.
Send Feedback
QPS5V3
2015.11.02 Destination Clock Frequency is a Multiple of the Source Clock Frequency 7-45
The setup relationship demonstrates that the data does not need to be captured at edge one, but can be
captured at edge two; therefore, you can relax the setup requirement. To correct the default analysis, you
must shift the latch edge by one clock period with an end multicycle setup exception of two. The
multicycle exception assignment used to correct the default analysis in this example.
Multicycle Exceptions
The timing diagram for the preferred setup relationship for this example.
Figure 7-45: Preferred Setup Analysis
-10 0 10 20
Launch
REG1.CLK
SC
REG2.CLK 1 2
Latch
The timing diagram for default hold check analysis performed by the TimeQuest analyzer with an end
multicycle setup value of two.
Figure 7-46: Default Hold Check
-10 0 10 20
Current
Launch
REG1.CLK
SC HC2
HC1
REG2.CLK
Current
Latch
Send Feedback
QPS5V3
7-46 Destination Clock Frequency is a Multiple of the Source Clock Frequency... 2015.11.02
The calculation that the TimeQuest analyzer performs to determine the hold check.
Figure 7-47: Hold Check
In this example, hold check one is too restrictive. The data is launched by the edge at 0 ns and should
check against the data captured by the previous latch edge at 0 ns, which does not occur in hold check
one. To correct the default analysis, you must use an end multicycle hold exception of one.
Destination Clock Frequency is a Multiple of the Source Clock Frequency with an Offset
This example is a combination of the previous two examples. The destination clock frequency is an
integer multiple of the source clock frequency and the destination clock has a positive phase shift. The
destination clock frequency is 5 ns and the source clock frequency is 10 ns. The destination clock also has
a positive offset of 2 ns with respect to the source clock. The destination clock frequency can be an integer
multiple of the source clock frequency with an offset when a PLL is used to generate both clocks with a
phase shift applied to the destination clock. The following example shows a design in which the destina‐
tion clock frequency is a multiple of the source clock frequency with an offset.
Figure 7-48: Destination Clock is Multiple of Source Clock with Offset
REG1 REG2
SET Combinational SET
In D Q
Logic
D Q Out
clk0
CLR CLR
clk
clk1
The timing diagram for the default setup check analysis the TimeQuest analyzer performs.
Send Feedback
QPS5V3
2015.11.02 Destination Clock Frequency is a Multiple of the Source Clock Frequency... 7-47
-10 0 10 20
Launch
REG1.CLK
SC
REG2.CLK 1 2 3
Latch
The calculation that the TimeQuest analyzer performs to determine the setup check.
Figure 7-50: Hold Check
The setup relationship in this example demonstrates that the data does not need to be captured at edge
one, but can be captured at edge two; therefore, you can relax the setup requirement. To correct the
default analysis, you must shift the latch edge by one clock period with an end multicycle setup exception
of three.
The multicycle exception code you can use to correct the default analysis in this example.
Multicycle Exceptions
The timing diagram for the preferred setup relationship for this example.
Figure 7-51: Preferred Setup Analysis
-10 0 10 20
Launch
REG1.CLK
SC
REG2.CLK 1 2 3
Latch
Send Feedback
QPS5V3
7-48 Source Clock Frequency is a Multiple of the Destination Clock Frequency 2015.11.02
The timing diagram for default hold check analysis the TimeQuest analyzer performs with an end
multicycle setup value of three.
Figure 7-52: Default Hold Check
-10 0 10 20
Current
Launch
REG1.CLK
SC HC2
HC1
REG2.CLK
Current
Latch
The calculation that the TimeQuest analyzer performs to determine the hold check.
Figure 7-53: Hold Check
In this example, hold check one is too restrictive. The data is launched by the edge at 0 ns and should
check against the data captured by the previous latch edge at 2 ns, which does not occur in hold check
one. To correct the default analysis, you must use an end multicycle hold exception of one.
REG1 REG2
SET Combinational SET
In D Q
Logic
D Q Out
clk0
CLR CLR
clk
clk1
Send Feedback
QPS5V3
2015.11.02 Source Clock Frequency is a Multiple of the Destination Clock Frequency 7-49
The timing diagram for default setup check analysis performed by the TimeQuest analyzer.
Figure 7-55: Default Setup Check Analysis
-10 0 10 20
Launch
REG1.CLK 2 1
SC
REG2.CLK
Latch
The calculation that the TimeQuest analyzer performs to determine the setup check.
Figure 7-56: Setup Check
The setup relationship shown demonstrates that the data launched at edge one does not need to be
captured, and the data launched at edge two must be captured; therefore, you can relax the setup require‐
ment. To correct the default analysis, you must shift the launch edge by one clock period with a start
multicycle setup exception of two.
The multicycle exception code you can use to correct the default analysis in this example.
Multicycle Exceptions
The timing diagram for the preferred setup relationship for this example.
Send Feedback
QPS5V3
7-50 Source Clock Frequency is a Multiple of the Destination Clock Frequency 2015.11.02
-10 0 10 20
Launch
REG1.CLK 2 1
SC
REG2.CLK
Latch
The timing diagram for default hold check analysis the TimeQuest analyzer performs for a start
multicycle setup value of two.
Figure 7-58: Default Hold Check
-10 0 10 20
Current
Launch
REG1.CLK
HC1 SC HC2
REG2.CLK
Current
Latch
The calculation that the TimeQuest analyzer performs to determine the hold check.
Figure 7-59: Hold Check
In this example, hold check two is too restrictive. The data is launched next by the edge at 10 ns and
should check against the data captured by the current latch edge at 10 ns, which does not occur in hold
check two. To correct the default analysis, you must use a start multicycle hold exception of one.
Send Feedback
QPS5V3
2015.11.02 Source Clock Frequency is a Multiple of the Destination Clock Frequency... 7-51
Source Clock Frequency is a Multiple of the Destination Clock Frequency with an Offset
In this example, the source clock frequency is an integer multiple of the destination clock frequency and
the destination clock has a positive phase offset. The source clock frequency is 5 ns and destination clock
frequency is 10 ns. The destination clock also has a positive offset of 2 ns with respect to the source clock.
The source clock frequency can be an integer multiple of the destination clock frequency with an offset
when a PLL is used to generate both clocks, different multiplication.
Figure 7-60: Source Clock Frequency is Multiple of Destination Clock Frequency with Offset
REG1 REG2
SET Combinational SET
In D Q
Logic
D Q Out
clk0
CLR CLR
clk
clk1
Timing diagram for default setup check analysis the TimeQuest analyzer performs.
Figure 7-61: Setup Timing Diagram
-10 0 10 20
Launch
REG1.CLK 3 2 1
SC
REG2.CLK
Latch
The calculation that the TimeQuest analyzer performs to determine the setup check.
Figure 7-62: Setup Check
The setup relationship in this example demonstrates that the data is not launched at edge one, and the
data that is launched at edge three must be captured; therefore, you can relax the setup requirement. To
correct the default analysis, you must shift the launch edge by two clock periods with a start multicycle
setup exception of three.
The multicycle exception used to correct the default analysis in this example.
Send Feedback
QPS5V3
7-52 Source Clock Frequency is a Multiple of the Destination Clock Frequency... 2015.11.02
Multicycle Exceptions
The timing diagram for the preferred setup relationship for this example.
Figure 7-63: Preferred Setup Check Analysis
-10 0 10 20
Launch
REG1.CLK 3 2 1
SC
REG2.CLK
Latch
The timing diagram for default hold check analysis the TimeQuest analyzer performs for a start
multicycle setup value of three.
Figure 7-64: Default Hold Check Analysis
-10 0 10 20
Current
Launch
REG1.CLK
HC2
HC1 SC
REG2.CLK
Current
Latch
The calculation that the TimeQuest analyzer performs to determine the hold check.
Send Feedback
QPS5V3
2015.11.02 A Sample Design with SDC File 7-53
In this example, hold check two is too restrictive. The data is launched next by the edge at 10 ns and
should check against the data captured by the current latch edge at 12 ns, which does not occur in hold
check two. To correct the default analysis, you must use a start multicycle hold exception of one.
inst1
data2
clk1
clk2
altpll0
The following SDC file contains basic constraints for the example circuit.
Send Feedback
QPS5V3
7-54 Running the TimeQuest Analyzer 2015.11.02
The SDC file contains the following basic constraints you should include for most designs:
• Definitions of clockone and clocktwo as base clocks, and assignment of those settings to
nodes in the design.
• Definitions of clockone_ext and clocktwo_ext as virtual clocks, which represent clocks
driving external devices interfacing with the FPGA.
• Automated derivation of generated clocks on PLL outputs.
• Derivation of clock uncertainty.
• Specification of two clock groups, the first containing clockone and its related clocks, the
second containing clocktwo and its related clocks, and the third group containing the output
of the PLL. This specification overrides the default analysis of all clocks in the design as related
to each other.
• Specification of input and output delays for the design.
Related Information
Asynchronous Clock Groups on page 7-21
For more information about asynchronous clock groups.
Send Feedback
QPS5V3
2015.11.02 Running the TimeQuest Analyzer 7-55
Send Feedback
QPS5V3
7-56 Quartus Prime Settings 2015.11.02
Related Information
• Constraining and Analyzing with Tcl Commands on page 7-65
For more information about using Tcl commands to constrain and analyze your design
• Recommended Flow for First Time Users on page 7-2
For more information about steps to perform before opening the TimeQuest analyzer.
Send Feedback
QPS5V3
2015.11.02 Understanding Results 7-57
through with a .qip, do not re-add them manually. An SDC file can also be added from a Quartus Prime
IP File (.qip) included in the .qsf.
Figure 7-67: .sdc File Order of Precedence
Yes
Is one or more .sdc file specified in
the .qsf?
No
Note: If you type the read_sdc command at the command line without any arguments, the TimeQuest
analyzer reads constraints embedded in HDL files, then follows the SDC file precedence order.
The SDC file must contain only SDC commands that specify timing constraints. There are some
techniques to control which constraints are applied during different parts of the compilation flow. Tcl
commands to manipulate the timing netlist or control the compilation must be in a separate Tcl script.
Understanding Results
Knowing how your constraints are displayed when analyzing a path is one of the most important skills of
timing analysis. This information completes your understanding of timing analysis and lets you correlate
the SDC input to the back-end analysis, and determine how the delays in the FPGA affect timing.
Send Feedback
QPS5V3
7-58 Set Operating Conditions Dialog Box 2015.11.02
Generate the appropriate reports —Use the Report All Summaries task under Macros to generate
setup, hold, recovery, and removal summaries, as well as minimum pulse width checks, and a list of all the
defined clocks. These summaries cover all constrained paths in your design. Especially when you are
modifying or correcting constraints, you should also perform the Diagnostic task to create reports to
identify unconstrained parts of your design, or ignored constraints. Double-click on any of the report
tasks to automatically run the three tasks under Netlist Setup if they haven't already run. One of those
tasks reads all SDC files.
Analyze your results—When you are modifying or correcting constraints, review the reports to find any
unexpected results. For example, a cross-domain path might indicate that you forgot to cut a transfer by
including a clock in a clock group.
Edit your SDC file and save it—Create or edit the appropriate constraints in your SDC files. If you edit
your SDC file in the Quartus Prime Tex Editor, you can benefit from tooltips showing constraint options,
and dialog boxes that guide you when creating constraints.
Reset the design—Double click Reset Design task to remove all constraints from your design. Removing
all constraints from your design prepares it to reread the SDC files, including your changes.
Be aware that this method just performs timing analysis using new constraints, but the fit being analyzed
has not changed. The place-and-route was performed with the old constraints, but you are analyzing with
new constraints, so if something is failing timing against these new constraints,you may need to run
place-and-route again.
For example, the Fitter may concentrate on a very long path in your design, trying to close timing. For
example, you may realize that a path runs at a lower rate, and so have added set_multicycle_path
assignments to relax the relationship (open the window when data is valid). When you perform
TimeQuest analysis iteratively with these new multicycles, new paths replace the old. The new paths may
have sub-optimal placement since the Fitter was concentrating on the previous paths when it ran, because
they were more critical. The iterative method is recommend for getting your SDC files correct, but you
should perform a full compilation to see what the Quartus Prime software can do with those constraints.
Related Information
Relaxing Setup with set_multicyle_path on page 7-31
Send Feedback
QPS5V3
2015.11.02 Set Operating Conditions Dialog Box 7-59
Reports that fail timing appear in red type, reports that pass appear in black type. Reports that have not
yet been run are in gold with a question mark (?). Selecting another voltage/temperature combination
creates a new report, but any reports previously run persist.
You can use the following context menu options to generate or regenerate reports in the Report window:
• Regenerate—Regenerate the selected report.
• Generate in All Corners—Generate a timing report using all corners.
• Regenerate All Out of Date—Regenerate all reports.
• Delete All Out of Date—Flush all the reports that have been run to clear the way for new reports with
modifications to timing.
Each operating condition generates its own set of reports which appear in their own folders under the
Reports list. Reports that have not yet been generated display a '?' icon in gold. As each report is
generated, the folder is updated with the appropriate output.
Note: Reports for a corner not being generated persist until that particular operating condition is
modifyed and a new report is created.
Send Feedback
QPS5V3
7-60 Report Timing (Dialog Box) 2015.11.02
Clocks
The From Clock and To Clock in the Clocks box are used to filter paths where the selected clock is used
as the launch or latch. The pull-down menu allows you to choose from existing clocks (although
admittedly has a "limited view" for long clock names).
Targets
The boxes in the Targets box are targets for the From Clock and To Clocksettings, and allow you to
report paths with only particular endpoints. These are usually filled with register names or I/O ports, and
can be wildcarded. For example, you might use the following to only report paths within a hierarchy of
interest:
report_timing -from *|egress:egress_inst|* -to *|egress:egress_inst|* -(other options)
If the From, To, or Through boxes are empty, then the TimeQuest analyzer assumes you are refering to
all possible targets in the device, which can also be represented with a wildcard (*). The From and To
options cover the majority of situations. TheThrough option is used to limit the report for paths that pass
through combinatorial logic, or a particular pin on a cell. This is seldom used, and may not be very
reliable due to combinatorial node name changes during synthesis. Clicking the browse Browse box after
Send Feedback
QPS5V3
2015.11.02 Analyzing Results with Report Timing 7-61
each target opens the Name Finder dialog box to search for specific names. This is especially useful to
make sure the name being entered matches nodes in the design, since the Name Finder can immediately
show what matches a user's wildcard.
Analysis type
The Analysis type options are Setup, Hold, Recovery, or Removal. These will be explained in more detail
later, as understanding them is the underpinning of timing analysis.
Output
The Detail level, is an option often glanced over that should be understood. It has four options, but I will
only discuss three.
The first level is called Summary, and produces a report which only displays Summary information such
as
• Slack
• From Node
• To Node
• Launch Clock
• Latch Clock
• Relationship
• Clock Skew
• Data Delay
The Summary report is always reported with more detailed reports, so the user would choose this if they
want less info. A good use for summary detail is when writing the report to a text file, where Summary
can be quite brief.
The next level is Path only. This report displays all the detailed information, except the Data Path tab
displays the clock tree as one line item. This is useful when you know the clock tree is correct, details are
not relevant. This is common for most paths within the FPGA. A useful data point is to look at the Clock
Skew column in the Summary report, and if it's a small number, say less than +/-150ps, then the clock
tree is well balanced between source and destination.
If there is clock skew, you should select the Full path option.. This breaks the clock tree out into explicit
detail, showing every cell it goes through, including such things as the input buffer, PLL, global buffer
(called CLKCTRL_), and any logic. If there is clock skew, this is where you can determine what is causing
the clock skew in your design. The Full path option is also recommended for I/O analysis, since only the
source clock or destination clock is inside the FPGA, and therefore its delay plays a critical role in meeting
timing.
The Data Path tab of a detailed report gives the delay break-downs, but there is also useful information in
the Path Summary and Statistics tabs, while the Waveform tab is useful to help visualize the Data Path
analysis. I would suggest taking a few minutes to look at these in the user's design. The whole analysis
takes some time to get comfortable with, but hopefully is clear in what it's doing.
Enable multi corner reports allows you to enable or disable multi-corner timing analysis. This option is
on by default.
Report Timing also has the Report panel name, which displays the name used in TimeQuest's Report
section. There is also an optional File name switch, which allows you to write the information to a file. If
you append .htm as a suffix, the TimeQuest analyzer produces the report as HTML. The File options
radio buttons allow you to choose between Overwrite and Append when saving the file.
Send Feedback
QPS5V3
7-62 Correlating Constraints to the Timing Report 2015.11.02
Paths
The default value for Report number of paths is 10. Two endpoints may have a lot of combinatorial logic
between them and might have many different paths. Likewise, a single destination may have hundreds of
paths leading to it. Because of this, you might list hundreds of paths, many of which have the same
destination and might have the same source. By turning on Pairs only you can list only one path for each
pair of source and destination. An even more powerful way to filter the report is limit the Maximum
number of paths per endpoints. You can also filter paths by entering a value in the Maximum slack limit
field.
Tcl command
Finally, at the bottom is the Tcl commandfield, which displays the Tcl syntax of what is run in
TimeQuest. You can edit this directly before running the Report Timing command.
Note:
A useful addition is to addis the -false_path option to the command line string. With this option, only
false paths are listed. A false path is any path where the launch and latch clock have been defined, but the
path was cut with either a set_false_path assignment or set_clock_groups_assignment. Paths where
the launch or latch clock was never constrained are not considered false paths. This option is useful to see
if a false path assignment worked and what paths it covers, or to look for paths between clock domains
that should not exist. The Task window's Report False Path custom report is nothing more than Report
Timing with the -false_path flag enabled.
Send Feedback
QPS5V3
2015.11.02 Correlating Constraints to the Timing Report 7-63
In the next figure, using set_multicycle_path adds multicycles to relax the setup relationship, or open
the window, making the setup relationship 20ns while the hold relationship is still 0ns:
Send Feedback
QPS5V3
7-64 Correlating Constraints to the Timing Report 2015.11.02
In the last figure, using the set_max_delay and set_min_delay constraints lets you explicitly override
the relationships. Note that the only thing changing for these different constraints is the Launch Edge
Time and Latch Edge Times for setup and hold analysis. Every other line item comes from delays inside
the FPGA and are static for a given fit. Whenever analyzing how your constraints affect the timing
requirements, this is the place to look.
Figure 7-70: Using set_max_delay and set_min_delay
Send Feedback
QPS5V3
2015.11.02 Constraining and Analyzing with Tcl Commands 7-65
For I/O, this all holds true except we must add in the -max and -min values. They are displayed as iExt or
oExt in the Type column. An example would be an output port with a set_output_delay -max 1.0 and
set_output_delay -min -0.5:
Once again, the launch and latch edge times are determined by the clock relationships, multicycles and
possibly set_max_delay or set_min_delay constraints. The value of set_output_delay is also added in
as an oExt value. For outputs this value is part of the Data Required Path, since this is the external part of
the analysis. The setup report on the left will subtract the -max value, making the setup relationship harder
to meet, since we want the Data Arrival Path to be shorter than the Data Required Path. The -min value
is also subtracted, which is why a negative number makes hold timing more restrictive, since we want the
Data Arrival Path to be longer than the Data Required Path.
Related Information
Relaxing Setup with set_multicyle_path on page 7-31
Send Feedback
QPS5V3
7-66 Collection Commands 2015.11.02
Related Information
• ::quartus::sta
For more information about TimeQuest analyzer Tcl commands and a complete list of commands,
refer to Quartus Prime Help.
• ::quartus::sdc
For more information about standard SDC commands and a complete list of commands, refer to
Quartus Prime Help.
• ::quartus::sdc_ext
For more information about Altera extensions of SDC commands and a complete list of commands,
refer to Quartus Prime Help.
Collection Commands
The TimeQuest analyzer Tcl commands often return data in an object called a collection. In your Tcl
scripts you can iterate over the values in collections to access data contained in them. The software returns
collections instead of Tcl lists because collections are more efficient than lists for large sets of data.
The TimeQuest analyzer supports collection commands that provide easy access to ports, pins, cells, or
nodes in the design. Use collection commands with any constraints or Tcl commands specified in the
TimeQuest analyzer.
You can also examine collections and experiment with collections using wildcards in the TimeQuest
analyzer by clicking Name Finder from the View menu.
Send Feedback
QPS5V3
2015.11.02 Wildcard Characters 7-67
Wildcard Characters
To apply constraints to many nodes in a design, use the “*” and “?” wildcard characters. The “*” wildcard
character matches any string; the “?” wildcard character matches any single character.
If you make an assignment to node reg*, the TimeQuest analyzer searches for and applies the assignment
to all design nodes that match the prefix reg with any number of following characters, such as reg, reg1,
reg[2], regbank, and reg12bank.
If you make an assignment to a node specified as reg?, the TimeQuest analyzer searches and applies the
assignment to all design nodes that match the prefix reg and any single character following; for example,
reg1, rega, and reg4.
add_to_collection Command
add_to_collection <first collection> <second collection>
Note: The add_to_collection command creates a new collection that is the union of the two specified
collections.
The remove_from_collection command allows you to remove items from an existing collection.
remove_from_collection Command
remove_from_collection <first collection> <second collection>
You can use the following code as an example for using add_to_collection for adding items to a
collection.
In the Quartus Prime software, keepers are I/O ports or registers. A SDC file that includes get_keepers
can only be processed as part of the TimeQuest analyzer flow and is not compatible with third-party
timing analysis flows.
Send Feedback
QPS5V3
7-68 Getting Other Information about Collections 2015.11.02
Related Information
• add_to_collection
• remove_from_collection
For more information about theadd_to_collection and remove_from_collection commands, refer
to Quartus Prime Help.
Use the get_collection_size command to return the size of a collection; the number of items it
contains. If your collection is in a variable named col, it is more efficient to use set num_items
[get_collection_size $col] than set num_items [llength [query_collection -list_format
$col]]
(3)
The search result is <empty> because the wildcard character (*) does not match more than one hierarchy
level, indicated by a pipe character (|), by default. This command would match any pin named datac in
instances at the top level of the design.
Send Feedback
QPS5V3
2015.11.02 Identifying the Quartus Prime Software Executable from the SDC File 7-69
The default method separates hierarchy levels of instances from nodes and pins with the pipe character
(|). A match occurs when the levels of hierarchy match, and the string values including wildcards match
the instance and/or pin names. For example, the command get_pins <instance_name>|*|datac
returns all the datac pins for registers in a given instance. However, the command get_pins *|datac
returns and empty collection because the levels of hierarchy do not match.
Use the -hierarchical matching scheme to return a collection of cells or pins in all hierarchies of your
design.
For example, the command get_pins -hierarchical *|datac returns all the datac pins for all
registers in your design. However, the command get_pins -hierarchical *|*|datac returns an empty
collection because more than one pipe character (|) is not supported.
The -compatibility_mode option returns collections matching wildcard strings through any number of
hierarchy levels. For example, an asterisk can match a pipe character when using -compatibility_mode.
Identifying the Quartus Prime Software Executable from the SDC File
To identify which Quartus Prime software executable is currently running you can use the
$::TimeQuestInfo(nameofexecutable) variable from within an SDC file. This technique is most
commonly used when you want to use an overconstraint to cause the Fitter to work harder on a particular
path or set of paths in the design.
Examples of different executable names are quartus_map for Analysis & Synthesis, quartus_fit for
Fitter, and quartus_sta for the TimeQuest analyzer.
(4)
When you use -compatibility_mode, pipe characters (|) are not treated as special characters when
used with wildcards.
Send Feedback
QPS5V3
7-70 Generating Timing Reports 2015.11.02
Use the Locate or Locate Path command in the TimeQuest analyzer GUI or the locate command in the
Tcl console in the TimeQuest analyzer GUI. Right-click on most paths or node names in the TimeQuest
analyzer GUI to access the Locate or Locate Path options.
The following commands are examples of how to locate the ten paths with the worst timing slack from
TimeQuest analyzer to the Technology Map Veiwer and locate all ports matching data* in the Chip
Planner.
# Locate in the Technology Map Viewer the ten paths with the worst slack
locate [get_timing_paths -npaths 10] -tmv
# locate all ports that begin with data in the Chip Planner
locate [get_ports data*] -chip
Related Information
• Viewing Timing Analysis Results
For more information about locating paths from the TimeQuest analyzer, refer to Quartus Prime Help.
• locate
For more information on this command, refer to Quartus Prime Help.
During compilation, the Quartus Prime software generates timing reports on different timing areas in the
design. You can configure various options for the TimeQuest analyzer reports generated during compila‐
tion.
You can also use the TIMEQUEST_REPORT_WORST_CASE_TIMING_PATHS assignment to generate a report of
the worst-case timing paths for each clock domain. This report contains worst-case timing data for setup,
hold, recovery, removal, and minimum pulse width checks.
Send Feedback
QPS5V3
2015.11.02 Document Revision History 7-71
2015.05.04 15.0.0 Added and updated contents in support of new timing algorithms for
Arria 10:
• Enhanced Timing Analysis for Arria 10
• Maximum Skew (set_max_skew command)
• Net Delay (set_net_delay command)
• Create Generated Clocks (clock-as-data example)
Send Feedback
QPS5V3
7-72 Document Revision History 2015.11.02
August 14.0a10. Added command line compliation requirements for Arria 10 devices.
2014 0
June 2014 14.0.0 • Minor updates.
• Updated format.
November 11.1.0 • Consolidated content from the Best Practices for the Quartus Prime
2011 TimeQuest Timing Analyzer chapter.
• Changed to new document template.
July 2010 10.0.0 Updated to link to content on SDC commands and the TimeQuest
analyzer GUI in Quartus Prime Help.
Send Feedback
QPS5V3
2015.11.02 Document Revision History 7-73
November 8.1.0 Updated for the Quartus Prime software version 8.1, including:
2008
• Added the following sections:
“set_net_delay” on page 7–42
“Annotated Delay” on page 7–49
“report_net_delay” on page 7–66
• Updated the descriptions of the -append and -file <name> options in
tables throughout the chapter
• Updated entire chapter using 8½” × 11” chapter template
• Minor editorial updates
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
PowerPlay Power Analysis
8
QPS5V3 Subscribe Send Feedback
The PowerPlay Power Analysis tools allow you to estimate device power consumption accurately.
As designs grow larger and process technology continues to shrink, power becomes an increasingly
important design consideration. When designing a PCB, you must estimate the power consumption of a
device accurately to develop an appropriate power budget, and to design the power supplies, voltage
regulators, heat sink, and cooling system.
The following figure shows the PowerPlay Power Analysis tools ability to estimate power consumption
from early design concept through design implementation.
Figure 8-1: PowerPlay Power Analysis From Design Concept Through Design Implementation
Routing
Results
Quartus Prime
User Input Design Profile
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V3
8-2 Types of Power Analyses 2015.11.02
The toggle rates are derived using the PowerPlay Power Analyzer with a .vcd file generated from a gate
level simulation representative of the system operation.
Related Information
PowerPlay Early Power Estimators (EPE) and Power Analyzer
Related Information
PowerPlay Early Power Estimator (EPE) User Guide
Differences between the PowerPlay EPE and the Quartus Prime PowerPlay Power
Analyzer
The following table lists the differences between the PowerPlay EPE and the Quartus Prime PowerPlay
Power Analyzer.
Send Feedback
QPS5V3
2015.11.02 Differences between the PowerPlay EPE and the Quartus Prime PowerPlay... 8-3
Table 8-1: Comparison of the PowerPlay EPE and Quartus Prime PowerPlay Power Analyzer
Data outputs (1) • Total thermal power dissipation • Total thermal power
• Thermal static power • Thermal static power
• Thermal dynamic power • Thermal dynamic power
• Off-chip power dissipation • Thermal I/O power
• Current drawn from voltage supplies • Thermal power by design
hierarchy
• Thermal power by block
type
• Thermal power dissipation
by clock domain
• Off-chip (non-thermal)
power dissipation
• Device supply currents
The result of the PowerPlay Power Analyzer is only an estimation of power. Altera does not recommend
using the result as a specification. The purpose of the estimation is to help you establish guidelines for the
power budget of your design. It is important that you verify the actual power during device operation as
the information is sensitive to the actual device design and the environmental operating conditions.
(5)
PowerPlay EPE and PowerPlay Power Analyzer outputs vary by device family. For more information, refer
to the device-specific PowerPlay Early Power Estimators (EPE) and Power Analyzer Page and PowerPlay
Power Analyzer Reports in the Quartus Prime Help.
Send Feedback
QPS5V3
8-4 Factors Affecting Power Consumption 2015.11.02
Note: The PowerPlay Power Analyzer does not include the transceiver power for features that can only be
enabled through dynamic reconfiguration (DFE, ADCE/AEQ, EyeQ). Use the EPE to estimate the
incremental power consumption by these features.
Related Information
• PowerPlay Early Power Estimators (EPE) and Power Analyzer Page
For more information, refer to the device-specific PowerPlay Early Power Estimators (EPE) page on
the Altera website.
• PowerPlay Power Analyzer Reports
For more information, refer to this page for device-specific information about the PowerPlay Early
Power Estimator.
Device Selection
Device families have different power characteristics. Many parameters affect the device family power
consumption, including choice of process technology, supply voltage, electrical design, and device
architecture.
Power consumption also varies in a single device family. A larger device consumes more static power than
a smaller device in the same family because of its larger transistor count. Dynamic power can also increase
with device size in devices that employ global routing architectures.
The choice of device package also affects the ability of the device to dissipate heat. This choice can impact
your required cooling solution choice to comply to junction temperature constraints.
Process variation can affect power consumption. Process variation primarily impacts static power because
sub-threshold leakage current varies exponentially with changes in transistor threshold voltage. Therefore,
you must consult device specifications for static power and not rely on empirical observation. Process
variation has a weak effect on dynamic power.
Environmental Conditions
Operating temperature primarily affects device static power consumption. Higher junction temperatures
result in higher static power consumption. The device thermal power and cooling solution that you use
must result in the device junction temperature remaining within the maximum operating range for the
device. The main environmental parameters affecting junction temperature are the cooling solution and
ambient temperature.
The following table lists the environmental conditions that could affect power consumption.
Send Feedback
QPS5V3
2015.11.02 Device Resource Usage 8-5
Heat Sink and Thermal A heat sink allows more efficient heat transfer from the device to the
Compound surrounding area because of its large surface area exposed to the air. The
thermal compound that interfaces the heat sink to the device also
influences the rate of heat dissipation. The case-to-ambient thermal
resistance (θCA) parameter describes the cooling capacity of the heat sink
and thermal compound employed at a given airflow. Larger heat sinks and
more effective thermal compounds reduce θCA.
Junction Temperature The junction temperature of a device is equal to:
TJunction = TAmbient + PThermal · θJA
in which θJA is the total thermal resistance from the device transistors to
the environment, having units of degrees Celsius per watt. The value θJA is
equal to the sum of the junction-to-case (package) thermal resistance (θJC)
, and the case-to-ambient thermal resistance (θCA) of your cooling
solution.
Board Thermal Model The junction-to-board thermal resistance (θJB) is the thermal resistance of
the path through the board, having units of degrees Celsius per watt. To
compute junction temperature, you can use this board thermal model
along with the board temperature, the top-of-chip θJA and ambient
temperatures.
Send Feedback
QPS5V3
8-6 Signal Activities 2015.11.02
• Number, Type, and Loading of I/O Pins—Output pins drive off-chip components, resulting in high-
load capacitance that leads to a high-dynamic power per transition. Terminated I/O standards require
external resistors that draw constant (static) power from the output pin.
• Number and Type of Hard Logic Blocks—A design with more logic elements (LEs), multiplier
elements, memory blocks, transceiver blocks or HPS system tends to consume more power than a
design with fewer circuit elements. The operating mode of each circuit element also affects its power
consumption. For example, a DSP block performing 18 × 18 multiplications and a DSP block
performing multiply-accumulate operations consume different amounts of dynamic power because of
different amounts of charging internal capacitance on each transition. The operating mode of a circuit
element also affects static power.
• Number and Type of Global Signals—Global signal networks span large portions of the device and
have high capacitance, resulting in significant dynamic power consumption. The type of global signal
is important as well. For example, Stratix V devices support global clocks and quadrant (regional)
clocks. Global clocks cover the entire device, whereas quadrant clocks only span one-fourth of the
device. Clock networks that span smaller regions have lower capacitance and tend to consume less
power. The location of the logic array blocks (LABs) driven by the clock network can also have an
impact because the Quartus Prime software automatically disables unused branches of a clock.
Signal Activities
The behavior of each signal in your design is an important factor in estimating power consumption. The
following table lists the two vital behaviors of a signal, which are toggle rate and static probability:
Static probability • The static probability of a signal is the fraction of time that the signal is
logic 1 during the period of device operation that is being analyzed. Static
probability ranges from 0 (always at ground) to 1 (always at logic-high).
• Static probabilities of their input signals can sometimes affect the static
power that routing and logic consume. This effect is due to state-
dependent leakage and has a larger effect on smaller process geometries.
The Quartus Prime software models this effect on devices at 90 nm or
smaller if it is important to the power estimate. The static power also
varies with the static probability of a logic 1 or 0 on the I/O pin when
output I/O standards drive termination resistors.
Send Feedback
QPS5V3
2015.11.02 PowerPlay Power Analyzer Flow 8-7
Note: To get accurate results from the power analysis, the signal activities for analysis must represent the
actual operating behavior of your design. Inaccurate signal toggle rate data is the largest source of
power estimation error.
User Design
(Post-Fit)
Power Analysis
Report
To obtain accurate I/O power estimates, the PowerPlay Power Analyzer requires you to synthesize your
design and then fit your design to the target device. You must specify the electrical standard on each I/O
cell and the board trace model on each I/O standard in your design.
Send Feedback
QPS5V3
8-8 Signal Activities Data Sources 2015.11.02
Note: The Quartus Prime Fitter may override some of the supply voltages settings specified in this
chapter. For example, supply voltages for several Stratix V transceiver power supplies depend on
the data rate used. If the Fitter detects that voltage required is different from the one specified in
the Voltage page, it will automatically set the correct voltage for relevant rails. The Quartus Prime
PowerPlay Power Analyzer uses voltages selected by the Fitter if they conflict with the settings
specified in the Voltage page.
On the Temperature page of the Settings dialog box, you can specify the thermal operating conditions of
the device.
Related Information
• Operating Settings and Conditions Page (Settings Dialog Box)
• Voltage Page (Settings Dialog Box)
• Temperature Page (Settings Dialog Box)
Start
Send Feedback
QPS5V3
2015.11.02 Simulation Results 8-9
Simulation Results
The PowerPlay Power Analyzer directly reads the waveforms generated by a design simulation. Static
probability and toggle rate can be calculated for each signal from the simulation waveform. Power analysis
is most accurate when you use representative input stimuli to generate simulations.
The PowerPlay Power Analyzer reads results generated by the following simulators:
• ModelSim®
• ModelSim-Altera
• QuestaSim
• Active-HDL
• NCSim
• VCS
• VCS MX
• Riviera-PRO
Signal activity and static probability information are derived from a Verilog Value Change Dump File
(.vcd). For more information, refer to Signal Activities on page 8-6.
For third-party simulators, use the EDA Tool Settings to specify the Generate Value Change Dump
(VCD) file script option in the Simulation page of the Settings dialog box. These scripts instruct the third-
party simulators to generate a .vcd that encodes the simulated waveforms. The Quartus Prime PowerPlay
Power Analyzer reads this file directly to derive the toggle rate and static probability data for each signal.
Third-party EDA simulators, other than those listed, can generate a .vcd that you can use with the
PowerPlay Power Analyzer. For those simulators, you must manually create a simulation script to
generate the appropriate .vcd.
Note: You can use a .vcd created for power analysis to optimize your design for power during fitting by
utilizing the appropriate settings in the PowerPlay power optimization list, available from
Assignments > Settings > Compiler Settings > Advanced Settings (Fitter).
Send Feedback
QPS5V3
8-10 Using Simulation Files in Modular Design Flows 2015.11.02
When specifying a simulation file (a .vcd), the software provides support to specify an associated design
entity name, such that the PowerPlay Power Analyzer imports the signal activities derived from that file
for the specified design entity. The PowerPlay Power Analyzer also supports the specification of
multiple .vcd files for power analysis, with each having an associated design entity name to enable the
integration of partial design simulations into a complete design power analysis. When specifying
multiple .vcd files for your design, more than one simulation file can contain signal-activity information
for the same signal.
Note: When you apply multiple .vcd files to the same design entity, the signal activity used in the power
analysis is the equal-weight arithmetic average of each .vcd.
Note: When you apply multiple simulation files to design entities at different levels in your design
hierarchy, the signal activity in the power analysis derives from the simulation file that applies to
the most specific design entity.
The following figure shows an example of a hierarchical design. The top-level module of your design,
called Top, consists of three 8b/10b decoders, followed by a mux. The software then encodes the output of
the mux to produce the final output of the top-level module. An error-handling module handles any
8b/10b decoding errors. The Top module contains the top-level entity of your design and any logic not
defined as part of another module. The design file for the top-level module might be a wrapper for the
hierarchical entities below it, or it might contain its own logic. The following usage scenarios show
common ways that you can simulate your design and import the .vcd into the PowerPlay Power Analyzer.
Send Feedback
QPS5V3
2015.11.02 Complete Design Simulation 8-11
Top
8b10b_dec:decode1
8b10b_rxerr:err1
8b10b_dec:decode2
mux:mux1
8b10b_dec:decode3 8b10b_enc:encode1
8b10b_dec.vcd Top|8b10b_dec:decode2
8b10b_dec.vcd Top|8b10b_dec:decode3
8b10b_rxerr.vcd Top|8b10b_rxerr:err1
8b10b_enc.vcd Top|8b10b_enc:encode1
mux.vcd Top|mux:mux1
The resulting power analysis applies the simulation vectors in each file to the assigned entity. Simulation
provides signal activities for the pins and for the outputs of functional blocks. If the inputs to an entity
instance are input pins for the entire design, the simulation file associated with that instance does not
Send Feedback
QPS5V3
8-12 Multiple Simulations on the Same Entity 2015.11.02
provide signal activities for the inputs of that instance. For example, an input to an entity such as mux1 has
its signal activity specified at the output of one of the decode entities.
corner1.vcd Top
corner2.vcd Top
The resulting power analysis uses an arithmetic average of the signal activities calculated from each
simulation file to obtain the final signal activities used. If a signal err_out has a toggle rate of zero
transition per second in normal.vcd, 50 transitions per second in corner1.vcd, and 70 transitions per
second in corner2.vcd, the final toggle rate in the power analysis is 40 transitions per second.
If you do not want the PowerPlay Power Analyzer to read information from multiple instances and take
an arithmetic average of the signal activities, use a .vcd that includes only signals from the instance that
you care about.
Overlapping Simulations
You can perform a simulation on the entire design, and more exhaustive simulations on a submodule,
such as 8b10b_rxerr. The following table lists the import specification for overlapping simulations.
error_cases.vcd Top|8b10b_rxerr:err1
In this case, the software uses signal activities from error_cases.vcd for all the nodes in the generated .vcd
and uses signal activities from full_design.vcd for only those nodes that do not overlap with nodes in
error_cases.vcd. In general, the more specific hierarchy (the most bottom-level module) derives signal
activities for overlapping nodes.
Partial Simulations
You can perform a simulation in which the entire simulation time is not applicable to signal-activity
calculation. For example, if you run a simulation for 10,000 clock cycles and reset the chip for the first
2,000 clock cycles. If the PowerPlay Power Analyzer performs the signal-activity calculation over all
10,000 cycles, the toggle rates are only 80% of their steady state value (because the chip is in reset for the
Send Feedback
QPS5V3
2015.11.02 Specifying Start and End Time when Performing Signal-Activity... 8-13
first 20% of the simulation). In this case, you must specify the useful parts of the .vcd for power analysis.
The Limit VCD Period option enables you to specify a start and end time when performing signal-
activity calculations.
Specifying Start and End Time when Performing Signal-Activity Calculations using the Limit VCD
Period Option
To specify a start and end time when performing signal-activity calculations using the Limit VCD period
option, follow these steps:
1. In the Quartus Prime software, on the Assignments menu, click Settings.
2. Under the Category list, click PowerPlay Power Analyzer Settings.
3. Turn on the Use input file(s) to initialize toggle rates and static probabilities during power analysis
option.
4. Click Add.
5. In the File name and Entity fields, browse to the necessary files.
6. Under Simulation period, turn on VCD file and Limit VCD period options.
7. In the Start time and End time fields, specify the desired start and end time.
8. Click OK.
You can also use the following tcl or qsf assignment to specify .vcd files:
Related Information
• set_power_file_assignment
• Add/Edit Power Input File Dialog Box
Send Feedback
QPS5V3
8-14 Glitch Filtering 2015.11.02
Glitch Filtering
The PowerPlay Power Analyzer defines a glitch as two signal transitions so closely spaced in time that the
pulse, or glitch, occurs faster than the logic and routing circuitry can respond. The output of a transport
delay model simulator contains glitches for some signals. The logic and routing structures of the device
form a low-pass filter that filters out glitches that are tens to hundreds of picoseconds long, depending on
the device family.
Some third-party simulators use different models than the transport delay model as the default model.
Different models cause differences in signal activity and power estimation. The inertial delay model,
which is the ModelSim default model, filters out more glitches than the transport delay model and usually
yields a lower power estimate.
Note: Altera recommends that you use the transport simulation model when using the Quartus Prime
software glitch filtering support with third-party simulators. Simulation glitch filtering has little
effect if you use the inertial simulation model.
Glitch filtering in a simulator can also filter a glitch on one logic element (LE) (or other circuit element)
output from propagating to downstream circuit elements to ensure that the glitch does not affect
simulated results. Glitch filtering prevents a glitch on one signal from producing non-physical glitches on
all downstream logic, which can result in a signal toggle rate and a power estimate that are too high.
Circuit elements in which every input transition produces an output transition, including multipliers and
logic cells configured to implement XOR functions, are especially prone to glitches. Therefore, circuits
with such functions can have power estimates that are too high when glitch filtering is not used.
Note: Altera recommends that you use the glitch filtering feature to obtain the most accurate power
estimates. For .vcd files, the PowerPlay Power Analyzer flows support two levels of glitch filtering.
Send Feedback
QPS5V3
2015.11.02 Node and Entity Assignments 8-15
Note: When running simulation for design verification (rather than to produce input to the PowerPlay
Power Analyzer), Altera recommends that you turn off the glitch filtering option to produce the
most rigorous and conservative simulation from a functionality viewpoint. When performing
simulation to produce input for the PowerPlay Power Analyzer, Altera recommends that you turn
on the glitch filtering to produce the most accurate power estimates.
Related Information
Constraining Designs
For more information about how to use the Assignment Editor in the Quartus Prime software, refer to
this document.
Send Feedback
QPS5V3
8-16 Default Toggle Rate Assignment 2015.11.02
Vectorless Estimation
For some device families, the PowerPlay Power Analyzer automatically derives estimates for signal activity
on nodes with no simulation or user-entered signal-activity data. Vectorless estimation statistically
estimates the signal activity of a node based on the signal activities of nodes feeding that node, and on the
actual logic function that the node implements. Vectorless estimation cannot derive signal activities for
primary inputs. Vectorless estimation is accurate for combinational nodes, but not for registered nodes.
Therefore, the PowerPlay Power Analyzer requires simulation data for at least the registered nodes and
I/O nodes for accuracy.
The PowerPlay Power Analyzer Settings dialog box allows you to disable vectorless estimation. When
turned on, vectorless estimation takes precedence over default toggle rates. Vectorless estimation does not
override clock assignments.
To disable vectorless estimation, perform the following steps:
1. In the Quartus Prime software, on the Assignments menu, click Settings.
2. In the Category list, select PowerPlay Power Analyzer Settings.
3. Turn off the Use vectorless estimation option.
Send Feedback
QPS5V3
2015.11.02 Signal Activities from RTL (Functional) Simulation, Supplemented by... 8-17
Signal Activities from Vectorless Estimation and User-Supplied Input Pin Activities
The vectorless estimation flow provides a low level of accuracy, because vectorless estimation for registers
is not entirely accurate.
Importance of .vcd
Altera recommends that you use a .vcd or a .saf generated by gate-level timing simulation for an accurate
power estimation because gate-level timing simulation takes all the routing resources and the exact logic
array resource usage into account.
Generating a .vcd
In previous versions of the Quartus Prime software, you could use either the Quartus Prime simulator or
an EDA simulator to perform your simulation. The Quartus Prime software no longer supports a built-in
simulator, and you must use an EDA simulator to perform simulation. Use the .vcd as the input to the
PowerPlay Power Analyzer to estimate power for your design.
To create a .vcd for your design, follow these steps:
1. On the Assignments menu, click Settings.
2. In the Category list, under EDA Tool Settings, click Simulation.
3. In the Tool name list, select your preferred EDA simulator.
4. In the Format for output netlist list, select Verilog HDL, or SystemVerilog HDL, or VHDL.
5. Turn on Generate Value Change Dump (VCD) file script.
This option turns on the Map illegal HDL characters and Enable glitch filtering options. The Map
illegal HDL characters option ensures that all signals have legal names and that signal toggle rates are
available later in the PowerPlay Power Analyzer. The Enable glitch filtering option directs the EDA
Netlist Writer to perform glitch filtering when generating VHDL Output Files, Verilog Output Files,
and the corresponding Standard Delay Format Output Files for use with other EDA simulation tools.
This option is available regardless of whether or not you want to generate .vcd scripts.
Note: When performing simulation using ModelSim, the +nospecify option for the vsim command
disables the specify path delays and timing checks option in ModelSim. By enabling glitch
filtering on the Simulation page, the simulation models include specified path delays. Thus,
ModelSim might fail to simulate a design if you enabled glitch filtering and specified the
Send Feedback
QPS5V3
8-18 Generating a .vcd from ModelSim Software 2015.11.02
+nospecify option. Altera recommends that you remove the +nospecify option from the
ModelSim vsim command to ensure accurate simulation for power estimation.
6. Click Script Settings. Select the signals that you want to output to the .vcd.
With All signals selected, the generated script instructs the third-party simulator to write all connected
output signals to the .vcd. With All signals except combinational lcell outputs selected, the generated
script tells the third-party simulator to write all connected output signals to the .vcd, except logic cell
combinational outputs.
Note: The file can become extremely large if you write all output signals to the file because the file size
depends on the number of output signals being monitored and the number of transitions that
occur.
7. Click OK.
8. In the Design instance name box, type a name for your testbench.
9. Compile your design with the Quartus Prime software and generate the necessary EDA netlist and
script that instructs the third-party simulator to generate a .vcd.
10.Perform a simulation with the third-party EDA simulation tool. Call the generated script in the
simulation tool before running the simulation. The simulation tool generates the .vcd and places it in
the project directory.
Send Feedback
QPS5V3
2015.11.02 PowerPlay Power Analyzer Compilation Report 8-19
Altera recommends that you use the Standard Delay Format Output File (.sdo) for gate-level timing
simulation. The .sdo contains the delay information of each architecture primitive and routing
element in your design; however, you must exclude the .sdo for zero delay simulation.
3. Generate a .vcd for power estimation by performing the steps in Generating a .vcd on page 8-17.
Section Description
Summary The Summary section of the report shows the estimated total thermal power
consumption of your design. This includes dynamic, static, and I/O thermal
power consumption. The I/O thermal power includes the total I/O power drawn
from the VCCIO and VCCPD power supplies and the power drawn from VCCINT in
the I/O subsystem including I/O buffers and I/O registers. The report also
includes a confidence metric that reflects the overall quality of the data sources
for the signal activities. For example, a Low power estimation confidence value
reflects that you have provided insufficient toggle rate data, or most of the signal-
activity information used for power estimation is from default or vectorless
estimation settings. For more information about the input data, refer to the
PowerPlay Power Analyzer Confidence Metric report.
Settings The Settings section of the report shows the PowerPlay Power Analyzer settings
information of your design, including the default input toggle rates, operating
conditions, and other relevant setting information.
Simulation Files Read The Simulation Files Read section of the report lists the simulation output file
that the .vcd used for power estimation. This section also includes the file ID, file
type, entity, VCD start time, VCD end time, the unknown percentage, and the
toggle percentage. The unknown percentage indicates the portion of the design
module unused by the simulation vectors.
Operating Conditions The Operating Conditions Used section of the report shows device characteris‐
Used tics, voltages, temperature, and cooling solution, if any, during the power
estimation. This section also shows the entered junction temperature or auto-
computed junction temperature during the power analysis.
Thermal Power The Thermal Power Dissipated by Block section of the report shows estimated
Dissipated by Block thermal dynamic power and thermal static power consumption categorized by
atoms. This information provides you with estimated power consumption for
each atom in your design.
By default, this section does not contain any data, but you can turn on the report
with the Write power dissipation by block to report file option on the
PowerPlay Power Analyzer Settings page.
Send Feedback
QPS5V3
8-20 PowerPlay Power Analyzer Compilation Report 2015.11.02
Section Description
Thermal Power This Thermal Power Dissipation by Block Type (Device Resource Type) section
Dissipation by Block of the report shows the estimated thermal dynamic power and thermal static
Type (Device Resource power consumption categorized by block types. This information is further
Type) categorized by estimated dynamic and static power and provides an average
toggle rate by block type. Thermal power is the power dissipated as heat from the
FPGA device.
Thermal Power This Thermal Power Dissipation by Hierarchy section of the report shows
Dissipation by estimated thermal dynamic power and thermal static power consumption
Hierarchy categorized by design hierarchy. This information is further categorized by the
dynamic and static power that was used by the blocks and routing in that
hierarchy. This information is useful when locating modules with high power
consumption in your design.
Core Dynamic The Core Dynamic Thermal Power Dissipation by Clock Domain section of the
Thermal Power report shows the estimated total core dynamic power dissipation by each clock
Dissipation by Clock domain, which provides designs with estimated power consumption for each
Domain clock domain in the design. If the clock frequency for a domain is unspecified by
a constraint, the clock frequency is listed as “unspecified.” For all the combina‐
tional logic, the clock domain is listed as no clock with zero MHz.
Current Drawn from The Current Drawn from Voltage Supplies section of the report lists the current
Voltage Supplies drawn from each voltage supply. The VCCIO and VCCPD voltage supplies are
further categorized by I/O bank and by voltage. This section also lists the
minimum safe power supply size (current supply ability) for each supply voltage.
Minimum current requirement can be higher than user mode current require‐
ment in cases in which the supply has a specific power up current requirement
that goes beyond user mode requirement, such as the VCCPD power rail in Stratix
III and Stratix IV devices, and the VCCIO power rail in Stratix IV devices.
The I/O thermal power dissipation on the summary page does not correlate
directly to the power drawn from the VCCIO and VCCPD voltage supplies listed in
this report. This is because the I/O thermal power dissipation value also includes
portions of the VCCINT power, such as the I/O element (IOE) registers, which are
modeled as I/O power, but do not draw from the VCCIO and VCCPD supplies.
The reported current drawn from the I/O Voltage Supplies (ICCIO and ICCPD)
as reported in the PowerPlay Power Analyzer report includes any current drawn
through the I/O into off-chip termination resistors. This can result in ICCIO and
ICCPD values that are higher than the reported I/O thermal power, because this
off-chip current dissipates as heat elsewhere and does not factor in the calcula‐
tion of device temperature. Therefore, total I/O thermal power does not equal
the sum of current drawn from each VCCIO and VCCPD supply multiplied by
VCCIO and VCCPD voltage.
For SoC devices or for Arria V SoC and Cyclone V SoC devices, there is no
standalone ICC_AUX_SHARED current drawn information. The ICC_AUX_
SHARED is reported together with ICC_AUX.
Send Feedback
QPS5V3
2015.11.02 Scripting Support 8-21
Section Description
Confidence Metric The Confidence Metric is defined in terms of the total weight of signal activity
Details data sources for both combinational and registered signals. Each signal has two
data sources allocated to it; a toggle rate source and a static probability source.
The Confidence Metric Details section also indicates the quality of the signal
toggle rate data to compute a power estimate. The confidence metric is low if the
signal toggle rate data comes from poor predictors of real signal toggle rates in
the device during an operation. Toggle rate data that comes from simulation,
user-entered assignments on specific signals or entities are reliable. Toggle rate
data from default toggle rates (for example, 12.5% of the clock period) or
vectorless estimation are relatively inaccurate. This section gives an overall
confidence rating in the toggle rate data, from low to high. This section also
summarizes how many pins, registers, and combinational nodes obtained their
toggle rates from each of simulation, user entry, vectorless estimation, or default
toggle rate estimations. This detailed information helps you understand how to
increase the confidence metric, letting you determine your own confidence in
the toggle rate data.
Signal Activities The Signal Activities section lists toggle rates and static probabilities assumed by
power analysis for all signals with fan-out and pins. This section also lists the
signal type (pin, registered, or combinational) and the data source for the toggle
rate and static probability. By default, this section does not contain any data, but
you can turn on the report with the Write signal activities to report file option
on the PowerPlay Power Analyzer Settings page.
Altera recommends that you keep the Write signal activities to report file
option turned off for a large design because of the large number of signals
present. You can use the Assignment Editor to specify that activities for
individual nodes or entities are reported by assigning an on value to those nodes
for the Power Report Signal Activities assignment.
Messages The Messages section lists the messages that the Quartus Prime software
generates during the analysis.
Scripting Support
You can run procedures and create settings described in this chapter in a Tcl script. You can also run
some procedures at a command prompt. For more information about scripting command options, refer
to the Quartus Prime Command-Line and Tcl API Help browser. To run the Help browser, type the
following command at the command prompt:
quartus_sh --qhelp ←
Related Information
• Tcl Scripting
• API Functions for Tcl
Send Feedback
QPS5V3
8-22 Running the PowerPlay Power Analyzer from the Command–Line 2015.11.02
quartus_pow --help ←
or-
quartus_sh --qhelp ←
The following lists the examples of using the quartus_pow executable. Type the command listed in the
following section at a system command prompt. These examples assume that operations are performed
on Quartus Prime project called sample.
To instruct the PowerPlay Power Analyzer to generate a PowerPlay EPE File:
To instruct the PowerPlay Power Analyzer to generate a PowerPlay EPE File without performing the
power estimate:
To instruct the PowerPlay Power Analyzer to use two .vcd files as input files (sample1.vcd and
sample2.vcd), perform glitch filtering on the .vcd and use a default input I/O toggle rate of 10,000
transitions per second:
To instruct the PowerPlay Power Analyzer to not use an input file, a default input I/O toggle rate of
60%, no vectorless estimation, and a default toggle rate of 20% on all remaining signals:
Note: No command–line options are available to specify the information found on the PowerPlay Power
Analyzer Settings Operating Conditions page. Use the Quartus Prime GUI to specify these
options.
The quartus_pow executable creates a report file, <revision name>.pow.rpt. You can locate the report file
in the main project directory. The report file contains the same information in PowerPlay Power
Analyzer Compilation Report on page 8-19.
Send Feedback
QPS5V3
2015.11.02 Document Revision History 8-23
2014.08.18 14.0a10.0 Updated "Current Drawn from Voltage Supplies" to clarify that for SoC
devices or for Arria V SoC and Cyclone V SoC devices, there is no
standalone ICC_AUX_SHARED current drawn information. The ICC_
AUX_SHARED is reported together with ICC_AUX.
November 2012 12.1.0 • Updated “Types of Power Analyses” on page 8–2, and “Confidence
Metric Details” on page 8–23.
• Added “Importance of .vcd” on page 8–20, and “Avoiding Power
Estimation and Hardware Measurement Mismatch” on page 8–24
June 2012 12.0.0 • Updated “Current Drawn from Voltage Supplies” on page 8–22.
• Added “Using the HPS Power Calculator” on page 8–7.
December 2010 10.1.0 • Added links to Quartus Prime Help, removed redundant material.
• Moved “Creating PowerPlay EPE Spreadsheets” to page 8–6.
• Minor edits.
Send Feedback
QPS5V3
8-24 Document Revision History 2015.11.02
November 2008 8.1.0 • Updated for the Quartus Prime software version 8.1.
• Replaced Figure 11-3.
• Replaced Figure 11-14.
Send Feedback
2015.11.02
System Debugging Tools Overview
9
QPS5V3 Subscribe Send Feedback
continue to increase in complexity, the time you spend on design verification continues to rise. This
manual provides a quick overview of the tools available in the system debugging suite and discusses the
criteria for selecting the best tool for your design.
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V3
9-2 System Debugging Tools Comparison 2015.11.02
System Console Uses a Tcl interpreter to communi‐ You need to perform system-
cate with hardware modules level debugging. For example, if
instantiated in your design. You can you have an Avalon-MM slave
use it with the Transceiver Toolkit or Avalon-ST interfaces, you can
to monitor or debug your design. debug your design at a transac‐
tion level. The tool supports
System Console provides real-time
JTAG connectivity and TCP/IP
in-system debugging capabilities.
connectivity to the target FPGA
Using System Console, you can read
you wish to debug.
from and write to Memory Mapped
components in our system without
the help of a processor or additional
software.
System Console uses Tcl as the
fundamental infrastructure which
means you can source scripts, set
variables, write procedures, and take
advantage of all the features of the
Tcl scripting language.
Transceiver Toolkit The Transceiver Toolkit allows you You need to debug or optimize
to test and tune transceiver link signal integrity of your board
signal quality. You can use a layout even before the actual
combination of bit error rate (BER), design to be run on the FPGA is
bathtub curve, and eye contour ready.
graphs as quality metrics. Auto
Sweeping of physical medium
attachment (PMA) settings allows
you to quickly find an optimal
solution.
SignalTap II Logic Analyzer This logic analyzer uses FPGA You have spare on-chip memory
®
resources to sample test nodes and and you want functional verifica‐
outputs the information to the tion of your design running in
Quartus Prime software for display hardware.
and analysis.
Send Feedback
QPS5V3
2015.11.02 Altera JTAG Interface (AJI) 9-3
SignalProbe This tool incrementally routes You have spare I/O pins and you
internal signals to I/O pins while would like to check the
preserving results from your last operation of a small set of
place-and-routed design. control pins using either an
external logic analyzer or an
oscilloscope.
Logic Analyzer Interface (LAI) This tool multiplexes a larger set of You have limited on-chip
signals to a smaller number of spare memory, and have a large set of
I/O pins. LAI allows you to select internal data buses that you
which signals are switched onto the would like to verify using an
I/O pins over a JTAG connection. external logic analyzer. Logic
analyzer vendors, such as
Tektronics and Agilent, provide
integration with the tool to
improve the usability of the tool.
In-System Sources and Probes This tool provides an easy way to You want to prototype a front
drive and sample logic values to and panel with virtual buttons for
from internal nodes using the JTAG your FPGA design.
interface.
In-System Memory Content This tool displays and allows you to You would like to view and edit
Editor edit on-chip memory. the contents of on-chip memory
that is not connected to a Nios II
processor. You can also use the
tool when you do not want to
have a Nios II debug core in your
system.
Virtual JTAG Interface This megafunction allows you to You have custom signals in your
communicate with the JTAG design that you want to be able
interface so that you can develop to communicate with.
your own custom applications.
Send Feedback
QPS5V3
9-4 Debugging Ecosystem 2015.11.02
sld_hub:sld_hub_inst. The SLD logic allows you to instantiate multiple debugging blocks into your
design and run them simultaneously. For System Console, you must explicitly insert debug IP cores into
your design to enable debugging.
Debugging Ecosystem
To maximize debugging closure, the Quartus Prime software allows you to use a combination of the
debugging tools in tandem to fully exercise and analyze the logic under test. All of the tools have basic
analysis features built in; that is, all of the tools enable you to read back information collected from the
design nodes that are connected to the debugging logic. Out of the set of debugging tools, the SignalTap II
Logic Analyzer, the LAI, and the SignalProbe feature are general purpose debugging tools optimized for
probing signals in your register transfer level (RTL) netlist. In-System Sources and Probes, the Virtual
JTAG Interface, System Console, Transceiver Toolkit, and In-System Memory Content Editor, allow you
to read back data from the debugging breakpoints, and to input values into your design during runtime.
Taken together, the set of on-chip debugging tools form a debugging ecosystem. The set of tools can
generate a stimulus to and solicit a response from the logic under test, providing a complete debugging
solution.
Figure 9-1: Debugging Ecosystem
FPGA
JTAG
Design
Under Test
Send Feedback
QPS5V3
2015.11.02 Resource Usage 9-5
SignalTap II Logic Analyzer is useful for providing fast functional verification of your design running on
actual hardware.
Conversely, if logic and memory resources are tight and you require the large sample depths associated
with external logic analyzers, both the LAI and the SignalProbe make it easy to view internal design
signals using external equipment.
Note: The SignalTap II Logic Analyzer is not supported on CPLDs, because there are no memory
resources available on these devices.
Resource Usage
The most important selection criteria for these three tools are the available resources remaining on your
device after implementing your design and the number of spare pins available. You should evaluate your
preferred debugging option early on in the design planning process to ensure that your board, your
Quartus Prime project, and your design are all set up to support the appropriate options. Planning early
can reduce time spent during debugging and eliminate the necessary late changes to accommodate your
preferred debugging methodologies.
Figure 9-2: Resource Usage per Debugging Tool
SignalTap II
Logic Analyzer
Interface
Logic
Signal
Probe
Memory
Overhead Logic
Any debugging tool that requires the use of a JTAG connection requires the SLD infrastructure logic, for
communication with the JTAG interface and arbitration between any instantiated debugging modules.
This overhead logic uses around 200 logic elements (LEs), a small fraction of the resources available in any
of the supported devices. The overhead logic is shared between all available debugging modules in your
design. Both the SignalTap II Logic Analyzer and the LAI use a JTAG connection.
For SignalProbe
SignalProbe requires very few on-chip resources. Because it requires no JTAG connection, SignalProbe
uses no logic or memory resources. SignalProbe uses only routing resources to route an internal signal to
a debugging test point.
Send Feedback
QPS5V3
9-6 For SignalTap II 2015.11.02
For SignalTap II
The SignalTap II Logic Analyzer requires both logic and memory resources. The number of logic
resources used depends on the number of signals tapped and the complexity of the trigger logic. However,
the amount of logic resources that the SignalTap II Logic Analyzer uses is typically a small percentage of
most designs. A baseline configuration consisting of the SLD arbitration logic and a single node with basic
triggering logic contains approximately 300 to 400 Logic Elements (LEs). Each additional node you add to
the baseline configuration adds about 11 LEs. Compared with logic resources, memory resources are a
more important factor to consider for your design. Memory usage can be significant and depends on how
you configure your SignalTap II Logic Analyzer instance to capture data and the sample depth that your
design requires for debugging. For the SignalTap II Logic Analyzer, there is the added benefit of requiring
no external equipment, as all of the triggering logic and storage is on the chip.
Resource Estimation
The resource estimation feature for the SignalTap II Logic Analyzer and the LAI allows you to quickly
judge if enough on-chip resources are available before compiling the tool with your design.
Figure 9-3: Resource Estimator
Pin Usage
For SignalProbe
The ratio of the number of pins used to the number of signals tapped for the SignalProbe feature is one-
to-one. Because this feature can consume free pins quickly, a typical application for this feature is routing
control signals to spare pins for debugging.
For SignalTap II
Other than the JTAG test pins, the SignalTap II Logic Analyzer uses no additional pins. All data is
buffered using on-chip memory and communicated to the SignalTap II Logic Analyzer GUI via the JTAG
test port.
Usability Enhancements
The SignalTap II Logic Analyzer, SignalProbe, and LAI tools can be added to your existing design with
minimal effects. With the node finder, you can find signals to route to a debugging module without
making any changes to your HDL files. SignalProbe inserts signals directly from your post-fit database.
The SignalTap II Logic Analyzer and LAI support inserting signals from both pre-synthesis and post-fit
netlists.
Send Feedback
QPS5V3
2015.11.02 Incremental Compilation 9-7
Incremental Compilation
All three tools allow you to find and configure your debugging setup quickly. In addition, the Quartus
Prime incremental compilation feature and the Quartus Prime incremental routing feature allow for a fast
turnaround time for your programming file, increasing productivity and enabling fast debugging closure.
Both the LAI and SignalTap II Logic Analyzer support incremental compilation. With incremental
compilation, you can add a SignalTap II Logic Analyzer instance or an LAI instance incrementally into
your placed-and-routed design. This has the benefit of both preserving your timing and area optimiza‐
tions from your existing design, and decreasing the overall compilation time when any changes are
necessary during the debugging process. With incremental compilation, you can save up to 70% compile
time of a full compilation.
Incremental Routing
SignalProbe uses the incremental routing feature. The incremental routing feature runs only the Fitter
stage of the compilation. This leaves your compiled design untouched, except for the newly routed node
or nodes. With SignalProbe, you can save as much as 90% compile time of a full compilation.
Remote Debugging
You can perform remote debugging of your system with the Quartus Prime software via the System
Console. This feature allows you to debug equipment deployed in the field through an existing TCP/IP
connection.
There are two Application Notes available to assist you.
• Application Note 624 describes how to set up your NIOS II system to use the System Console to
perform remote debugging.
• Application Note 693 describes how to set up your Altera SoC to use the SLD tools to perform remote
debugging.
Related Information
• Application Note 624: Debugging with System Console over TCP/IP
• Application Note 693: Remote Debugging over TCP/IP for Altera SoC
Send Feedback
QPS5V3
9-8 Suggested On-Chip Debugging Tools for Common Debugging Features 2015.11.02
Ease in X X — External
Debugging equipment, such
Timing Issue as oscilloscopes
and mixed signal
oscilloscopes
(MSOs), can be
used with either
LAI or SignalP‐
robe. When used
with the LAI,
external
equipment
provides you with
access to timing
mode, which
allows you to
debug combined
streams of data.
Send Feedback
QPS5V3
2015.11.02 Suggested On-Chip Debugging Tools for Common Debugging Features 9-9
Send Feedback
QPS5V3
9-10 Suggested On-Chip Debugging Tools for Common Debugging Features 2015.11.02
Send Feedback
QPS5V3
2015.11.02 About Stimulus‑Capable Tools 9-11
Notes to Table:
1. • X indicates the recommended tools for the feature.
• — indicates that while the tool is available for that feature, that tool might not give the best results.
• N/A indicates that the feature is not applicable for the selected tool.
2. When used with incremental compilation.
Send Feedback
QPS5V3
9-12 In-System Sources and Probes 2015.11.02
Console uses a Tcl interpreter to communicate with hardware modules that you have instantiated into
your design.
System Console
System Console is a framework that you can launch from the Quartus Prime software to start services for
performing various debugging tasks. System Console provides you with Tcl scripts and a GUI to access
the Qsys system integration tool to perform low-level hardware debugging of your design, as well as
identify a module by its path, and open and close a connection to a Qsys module. You can access your
Send Feedback
QPS5V3
2015.11.02 Test Signal Integrity 9-13
design at a system level for purposes of loading, unloading, and transferring designs to multiple devices.
Also, System Console supports the Tk toolkit for building graphical interfaces.
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
Analyzing and Debugging Designs with System
Console 10
QPS5V3 Subscribe Send Feedback
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V3
10-2 Introduction to System Console 2015.11.02
In the diagram below, tools are graphical interface, such as Bus Analyzer, that you use in conjunction with
the System Console GUI interface.
Tcl Console is a command-line interface that provides you access to the System Console core. API
supports services and enables communication with hardware, such as, Ethernet, processor, master, and
bytestream services.
Some service have hardware requirements, for example the master service requires a JTAG Master or Nios
II with JTAG Debug, or simular. The Bytestream service requires a JTAG UART.
Note: You use debug links to connect the host to the target that you are debugging.
Related Information
• External Memory Interface Documentation
• Debugging Transceiver Links Documentation on page 11-1
• Application Note 693: Remote Hardware Debugging over TCP/IP for Altera SoC
• Application Note 624: Debugging with System Console over TCP/IP
• White Paper 01208: Hardware in the Loop from the MATLAB/Simulink Environment
• System Console Online Training
Send Feedback
QPS5V3
2015.11.02 Hardware Requirements for System Console 10-3
Related Information
WP-01170 System-Level Debugging and Monitoring of FPGA Designs
Send Feedback
QPS5V3
10-4 System Console Flow 2015.11.02
slave Allows the host to access a single slave • NiosII with debug
without needing to know the location of • JTAG to Avalon Master Bridge
the slave in the host's memory map. Any
• USB Debug Master
slave that is accessible to a System Console
master can provide this service. If an SRAM Object File (.sof) is
loaded, then slaves controlled by a
debug master provide the slave
service.
Related Information
• System Console Examples and Tutorials on page 10-77
• System Console Commands on page 10-8
Related Information
• System Console Commands on page 10-8
• Scripting Reference Manual
Information about Tcl scripting support
• Introduction to Tcl Online Training
Send Feedback
QPS5V3
2015.11.02 Customizing Startup 10-5
Customizing Startup
You can customize your System Console environment, as follows:
• Adding commands to the system_console_rc configuration file located at:
• <$HOME>/system_console/system_console_rc.tcl
The file in this location is the user configuration file, which only affects the owner of the home
directory.
• Specifying your own design startup configuration file with the command-line argument --
rc_script=<path_to_script>, when you launch System Console from the Nios II command shell.
• Using the system_console_rc.tcl file in combination with your custom rc_script.tcl file. In this case, the
system_console_rc.tcl file performs System Console actions, and the rc_script.tcl file performs your
debugging actions.
On startup, System Console automatically runs the Tcl commands in these files. The commands in the
system_console_rc.tcl file run first, followed by the commands in the rc_script.tcl file.
Related Information
Altera Download Center
Send Feedback
QPS5V3
10-6 System Console GUI 2015.11.02
• System Explorer—Displays the hierarchy of the System Console virtual file system in your design,
including board connections, devices, designs, and scripts.
• Toolkits—Displays available toolkits including the ADC Toolkit, Transceiver Toolkit, Toolkits, GDB
Server Control Panel, and Bus Analyzer. Click the Tools menu to launch applications.
• Tcl Console—A window that allows you to interact with your design using Tcl scripts, for example,
sourcing scripts, writing procedures, and using System Console API.
• Messages—Displays status, warning, and error messages related to connections and debug actions.
Figure 10-1: System Console GUI
Send Feedback
QPS5V3
2015.11.02 System Explorer Pane 10-7
Send Feedback
QPS5V3
10-8 System Console Commands 2015.11.02
• The figure above shows the EP4SGX230 folder under the Device folder, which contains a (link) folder.
The (link) folder contains a JTAG folder, which describes the active debug connections to this device,
for example, JTAG, USB, Ethernet, and agents connected to the EP4SGX230 device via a JTAG
connection.
• Folders with a context menu display a context menu icon. Right-click these folders to view the context
menu. For example, the Connections folder above shows a context menu icon.
• Folders that have messages display a message icon. Mouse-over these folders to view the messages. For
example, the Scripts folder above a message icon.
• Debug agents that sense the clock and reset state of the target show an information or error message
with a clock status icon. The icon indicates whether the clock is running (information, green), stopped
(error, red), or running but in reset (error, red). For example, the trace_system_jtag_link.h2t folder
above has a running clock.
Send Feedback
QPS5V3
2015.11.02 System Console Commands 10-9
get_service_paths • <service-type> Allows you to filter the services which are returned.
• <device>—Returns
services in the same
specified device.
The argument can
be a device or
another service in
the device.
• <hpath>—Returns
services whose
hpath starts with
the specified prefix.
• <type>—Returns
services whose
debug type matches
this value. Particu‐
larly useful when
opening slave
services.
• <type>—Returns
services on the
same development
boards as the
argument. Specify a
board service, or
any other service
on the same board.
close_service • <service-type> Closes the specified service type at the specified path.
• <service-path>
get_services_to_add N/A Returns a list of all services that are instantiable with
the add_service command.
Send Feedback
QPS5V3
10-10 System Console Commands 2015.11.02
add_service • <service-type> Adds a service of the specified service type with the
• <instance-name> given instance name. Run get_services_to_add to
• optional-parameters retrieve a list of instantiable services. This command
returns the path where the service was added.
Run help add_service <service-type> to get
specific help about that service type, including any
parameters that might be required for that service.
add_service tcp • <instance name> Allows you to connect to a TCP/IP port that provides
• <ip_addr> a debug link over ethernet. See AN693 (Remote
• <port_number> Hardware Debugging over TCP/IP for Altera SoC) for
more information.
Send Feedback
QPS5V3
2015.11.02 Running System Console in Command-Line Mode 10-11
get_claimed_services • <claim> For the given claim group, returns a list of services
claimed. The returned list consists of pairs of paths
and service types. Each pair is one claimed service.
Related Information
• Starting System Console on page 10-4
• Remote Hardware Debugging over TCP/IP for Altera SoC
Send Feedback
QPS5V3
10-12 Opening and Closing Services 2015.11.02
System Console commands require service paths to identify the service instance you want to access. The
paths for different components can change between runs of System Console and between versions. Use
get_service_paths to obtain service paths rather than hard coding them into your Tcl scripts.
The string values of service paths change with different releases of the tool, so you should not infer
meaning from the actual strings within the service path. Use marker_node_info to get information from
the path.
System Console automatically discovers most services at startup. System Console automatically scans for
all JTAG and USB-based service instances and retrieves their service paths. System Console does not
automatically discover some services, such as TCP/IP. Use add_service to inform System Console about
those services.
You can pass additional arguments to the claim_service command to direct System Console to start
accessing a particular portion of a service instance. For example, if you use the master service to access
Send Feedback
QPS5V3
2015.11.02 System Console Services 10-13
memory, then use claim_service to only access the address space between 0x0 and 0x1000. System
Console then allows other users to access other memory ranges, and denies access to the claimed memory
range. The claim_service command returns a newly created service path that you can use to access your
claimed resources.
You can access a service after you open it. When you finish accessing a service instance, use the
close_service command to direct System Console to make this resource available to other users.
SLD Service
The SLD Service shifts values into the instruction and data registers of SLD nodes and captures the
previous value. When interacting with a SLD node, start by acquiring exclusive access to the node on an
opened service.
This code attempts to lock the selected SLD node. If it is already locked, sld_lock waits for the
specified timeout. Confirm the procedure returns non-zero before proceeding. Set the instruction
register and capture the previous one:
if {$lock_failed} {
return
}
set instr 7
set delay_us 1000
set capture [sld_access_ir $sld_service_path $instr $delay_us]
The 1000 microsecond delay guarantees that the following SLD command executes least 1000
microseconds later. Data register access works the same way.
set data_bit_length 32
set delay_us 1000
set data_bytes [list 0xEF 0xBE 0xAD 0xDE]
set capture [sld_access_dr $sld_service_path $data_bit_length $delay_us \
$data_bytes]
Send Feedback
QPS5V3
10-14 SLD Commands 2015.11.02
Shift count is specified in bits, but the data content is specified as a list of bytes. The capture
return value is also a list of bytes. Always unlock the SLD node once finished with the SLD service.
sld_unlock $sld_service_path
Related Information
• SLD Commands on page 10-14
• Virtual JTAG Megafunction documentation
SLD Commands
Table 10-3: SLD Commands
Send Feedback
QPS5V3
2015.11.02 In-System Sources and Probes Service 10-15
Related Information
SLD Service on page 10-13
set issp_index 0
set issp [lindex [get_service_paths issp] 0]
set claimed_issp [claim_service issp $issp mylib]
The Quartus Prime software reads probe data as a single bitstring of length equal to the probe
width.
As an example, you can define the following procedure to extract an individual probe line's data.
Similarly, the Quartus Prime software writes source data as a single bitstring of length equal to the
source width.
Send Feedback
QPS5V3
10-16 In-System Sources and Probes Commands 2015.11.02
As an example, you can invert the data for a 32-bit wide source by doing the following:
Related Information
In-System Sources and Probes Commands on page 10-16
instance_name
source_width
probe_width
Related Information
In-System Sources and Probes Service on page 10-15
Monitor Service
The monitor service builds on top of the master service to allow reads of Avalon-MM slaves at a regular
interval. The service is fully software-based. The monitor service requires no extra soft-logic. This service
Send Feedback
QPS5V3
2015.11.02 Monitor Service 10-17
streamlines the logic to do interval reads, and it offers better performance than exercising the master
service manually for the reads.
set master_index 0
set master [lindex [get_service_paths master] $master_index]
set address 0x2000
set bytes_to_read 100
set read_interval_ms 100
You can use the first master to read 100 bytes starting at address 0x2000 every 100 milliseconds.
Open the monitor service:
Notice that the master service was not opened. The monitor service opens the master service
automatically. Register the previously-defined address range and time interval with the monitor
service:
You can add more ranges. You must define the result at each interval:
global monitor_data_buffer
set monitor_data_buffer [list]
proc store_data {monitor master address bytes_to_read} {
global monitor_data_buffer
set data [monitor_read_data $claimed_monitor $master $address $bytes_to_read]
lappend monitor_data_buffer $data
}
The code example above, gathers the data and appends it with a global variable. monitor_read_data
returns the range of data polled from the running design as a list. In this example, data will be a 100-
element list. This list is then appended as a single element in the monitor_data_buffer global list. If this
procedure takes longer than the interval period, the monitor service may have to skip the next one or
more calls to the procedure. In this case, monitor_read_data will return the latest data polled. Register
this callback with the opened monitor service:
Use the callback variable to call when the monitor finishes an interval. Start monitoring:
monitor_set_enabled $claimed_monitor 1
Immediately, the monitor reads the specified ranges from the device and invokes the callback at the
specified interval. Check the contents of monitor_data_buffer to verify this. To turn off the monitor, use
0 instead of 1 in the above command.
Send Feedback
QPS5V3
10-18 Monitor Commands 2015.11.02
Related Information
Monitor Commands on page 10-18
Monitor Commands
You can use the Monitor commands to read many Avalon-MM slave memory locations at a regular
interval.
Under normal load, the monitor service reads the data after each interval and then calls the callback. If the
value you read is timing sensitive, you can use the monitor_get_read_interval command to read the
exact time between the intervals at which the data was read.
Under heavy load, or with a callback that takes a long time to execute, the monitor service skips some
callbacks. If the registers you read do not have side effects (for example, they read the total number of
events since reset), skipping callbacks has no effect on your code. The monitor_read_data command and
monitor_get_read_interval command are adequate for this scenario.
If the registers you read have side effects (for example, they return the number of events since the last
read), you must have access to the data that was read, but for which the callback was skipped. The
monitor_read_all_data and monitor_get_all_read_intervals commands provide access to this
data.
Send Feedback
QPS5V3
2015.11.02 Monitor Commands 10-19
Send Feedback
QPS5V3
10-20 Device Service 2015.11.02
Related Information
Monitor Service on page 10-16
Device Service
The device service supports device-level actions.
To program, all you need are the device service path and the file system path to a .sof. Ensure that
no other service (e.g. master service) is open on the target device or else the command fails.
Afterwards, you may do the following to check that the design linked to the device is the same one
programmed:
device_get_design $device
Related Information
Device Commands on page 10-21
Send Feedback
QPS5V3
2015.11.02 Device Commands 10-21
Device Commands
The device commands provide access to programmable logic devices on your board. Before you use these
commands, identify the path to the programmable logic device on your board using the
get_service_paths.
Related Information
Device Service on page 10-20
Design Service
You can use design service commands to work with design information.
System Console is now aware that this particular .sof has been loaded.
Manually linking fails if the target device does not match the design service.
Linking fails even if the .sof programmed to the target is not the same as the design .sof.
Send Feedback
QPS5V3
10-22 Design Service Commands 2015.11.02
Related Information
Design Service Commands on page 10-22
Related Information
Design Service on page 10-21
Send Feedback
QPS5V3
2015.11.02 Bytestream Service 10-23
Bytestream Service
The bytestream service provides access to modules that produce or consume a stream of bytes. You can
use the bytestream service to communicate directly to the IP core that provides bytestream interfaces,
such as the Altera JTAG UART or the Avalon-ST JTAG interface.
set bytestream_index 0
set bytestream [lindex [get_service_paths bytestream] $bytestream_index]
set claimed_bytestream [claim_service bytestream $bytestream mylib]
To specify the outgoing data as a list of bytes and send it through the opened service:
Related Information
Bytestream Commands on page 10-23
Bytestream Commands
Table 10-9: Bytestream Commands
Send Feedback
QPS5V3
10-24 JTAG Debug Service 2015.11.02
Related Information
Bytestream Service on page 10-23
get_service_paths jtag_debug
jtag_debug_reset_system $claim_jtag_path
jtag_debug_loop $claim_jtag_path [list 1 2 3 4 5]
Send Feedback
QPS5V3
2015.11.02 Working with Toolkits 10-25
Related Information
Verifying Clock and Reset Signals on page 10-79
Registering a Toolkit
Use the toolkit_register command to register a System Console toolkit. You must also specify the path
to the .toolkit file when you use the toolkit_register command.
When you open System Console, toolkits that appear with the .toolkit extention in the $HOME/system_
console/toolkits/ directory appear in the Tools > Toolkits menu.
Opening a Toolkit
You can use the Toolkits tab in System Console to launch available toolkits. Each toolkit has a
description, detected hardware list, and a launch button.
Send Feedback
QPS5V3
10-26 Creating a Toolkit Description File 2015.11.02
Related Information
• Toolkit API GUI Example .toolkit File on page 10-32
• Toolkit API GUI Example .tcl File on page 10-32
Send Feedback
QPS5V3
2015.11.02 Toolkit API 10-27
Toolkit API
The Toolkit API service enables you to construct GUIs for visualizing and interacting with debug data.
Toolkit API is a graphical pane for the layout of your graphical widgets, which can include buttons and
text fields. Widgets can pull data from other System Console services. Similarly, widgets can leverage user
input to act on debug logic in your design through services.
Properties
Widget properties can push and pull information to the user interface. Widgets have properties specific to
their type. For example, the button property onClick performs an action when the button is clicked. A
label widget does not have the same property because it does not perform an action when clicked.
However, both the button and label widgets have the text property to display text strings.
Layout
The Toolkit API service creates a widget hierarchy where the toolkit is at the top-level. The service can
implement group-type widgets that contain child widgets. Layout properties dictate layout actions
performed by a parent on its children.
The expandableX property when set as True, expands the widget horizontally to encompass all of the
available space. The visible property when set as True allows a widget to display in the GUI.
User Input
Some widgets allow user interaction. For example, the textField widget is a text box that allows user
entries. You access the contents of the box with the text property. A Tcl script can either get or set the
contents of the textField widget with the text property.
Callbacks
Some widgets can perform user-specified actions, referred to as callbacks. The textField widget has the
onChange property, which is called when text contents change. The button widget has the onClick
property, which is called when a button is clicked. Callbacks may update widgets or interact with services
based on the contents of a text field, or the state of any other widget.
Send Feedback
QPS5V3
10-28 Toolkit API Script Examples 2015.11.02
After:
toolkit_register <toolkit_file>
In this command, $toolkit represents the Toolkit API service. root_widget is the name of the
root toolkit widget. visible is the property that allows the toolkit to be visible in System Console.
Use the following commands to add a label widget "my_label" to the root toolkit. In the GUI, it
appears as "Widget Label."
This command sets the text property to that string. In the GUI, the displayed text changes to the
new value. Add one more label:
Notice the new label appears to the right of the first label. Cause the layout to put the label below
instead:
Send Feedback
QPS5V3
2015.11.02 Toolkit API Script Examples 10-29
The widget appears, but it is very small. Make the widget fill the horizontal space:
Now the text field is fully visible. Text can be typed into it once clicked. Type a sentence. Now,
retrieve the contents of the field:
The onChange property is executed each time the text field changes. The effect is the first field
changes to match what is typed.
Click the button and the second label gets some text appended to it.
Send Feedback
QPS5V3
10-30 Toolkit API GUI Example 2015.11.02
There is now a row with a group of two buttons. You can remove the border with the group name
to make the nested group more seamless.
The title property can be set to any other string to have the border and title text show up.
This adds a set of two tabs, each with a group containing a label. Clicking on the tabs changes the
displayed group/label.
Send Feedback
QPS5V3
2015.11.02 Toolkit API GUI Example 10-31
Send Feedback
QPS5V3
10-32 Toolkit API GUI Example .toolkit File 2015.11.02
Related Information
Creating a Toolkit Description File on page 10-26
variable ledValue 0
variable dashboardActive 0
variable Switch_off 1
Send Feedback
QPS5V3
2015.11.02 Toolkit API GUI Example .tcl File 10-33
::Test::updateDashboard
proc sendText {} {
set sendText [toolkit_get_property sendTextText text]
toolkit_set_property receiveTextText text $sendText
}
proc dashBoard {} {
if { ${::Test::dashboardActive} == 1 } {
return -code ok "dashboard already active"
}
set ::Test::dashboardActive 1
#
# top group widget
#
toolkit_add topGroup group self
toolkit_set_property topGroup expandableX false
toolkit_set_property topGroup expandableY false
toolkit_set_property topGroup itemsPerRow 1
toolkit_set_property topGroup title ""
#
# leds group widget
#
toolkit_add ledsGroup group topGroup
toolkit_set_property ledsGroup expandableX false
toolkit_set_property ledsGroup expandableY false
toolkit_set_property ledsGroup itemsPerRow 2
toolkit_set_property ledsGroup title "LED State"
#
# leds widgets
#
toolkit_add led0Button button ledsGroup
toolkit_set_property led0Button enabled true
toolkit_set_property led0Button expandableY false
toolkit_set_property led0Button expandableY false
toolkit_set_property led0Button text "Toggle"
toolkit_set_property led0Button onClick {::Test::toggle 1}
Send Feedback
QPS5V3
10-34 Toolkit API GUI Example .tcl File 2015.11.02
# sendText widgets
#
toolkit_add sendTextGroup group topGroup
toolkit_set_property sendTextGroup expandableX false
toolkit_set_property sendTextGroup expandableY false
toolkit_set_property sendTextGroup itemsPerRow 1
toolkit_set_property sendTextGroup title "Send Data"
#
# receiveText widgets
#
toolkit_add receiveTextGroup group topGroup
toolkit_set_property receiveTextGroup expandableX false
toolkit_set_property receiveTextGroup expandableY false
toolkit_set_property receiveTextGroup itemsPerRow 1
toolkit_set_property receiveTextGroup title "Receive Data"
return -code ok
}
proc updateDashboard {} {
if { ${::Test::dashboardActive} > 0 } {
}
}
}
Send Feedback
QPS5V3
2015.11.02 Toolkit API Commands 10-35
::Test::dashBoard
Related Information
Creating a Toolkit Description File on page 10-26
Send Feedback
QPS5V3
10-36 toolkit_register 2015.11.02
toolkit_register
Description
Point to the XML file that describes the plugin (.toolkit file) .
Usage
toolkit_register <toolkit_file>
Returns
No return value.
Arguments
<toolkit_file>
Path to the toolkit definition file.
Example
toolkit_register /data/trogdor/toolkits/burninator.xml
Send Feedback
QPS5V3
2015.11.02 toolkit_open 10-37
toolkit_open
Description
Opens an instance of a toolkit in System Console.
Usage
toolkit_open <toolkit_id> [<context>]
Returns
No return value.
Arguments
<toolkit_id>
Name of the toolkit type to open.
<context>
An optional context, such as a service path for a hardware resource that is associated with
the toolkit that opens.
Example
toolkit_open my_toolkit_id
Send Feedback
QPS5V3
10-38 get_quartus_ini 2015.11.02
get_quartus_ini
Description
Returns a value from the software .ini file.
Usage
get_quartus_ini <ini> <type>
Returns
No return value.
Arguments
<ini>
Name of the software .ini setting.
<type>
(Optional) Type of .ini setting. The known types are string and enabled. If the type is
enabled, the value of the .ini setting returns 1, or 0 if not enabled.
Example
set my_ini_enabled [get_quartus_ini my_ini enabled]
Send Feedback
QPS5V3
2015.11.02 toolkit_get_context 10-39
toolkit_get_context
Description
Returns the context that was specified when the toolkit was opened. If no context was specified, returns an
empty string.
Usage
toolkit_get_context
Returns
Returns the context.
Arguments
None
N/A
Example
set context [toolkit_get_context]
Send Feedback
QPS5V3
10-40 toolkit_get_types 2015.11.02
toolkit_get_types
Description
Returns a list of widget types.
Usage
toolkit_get_types
Returns
No return value.
Arguments
None
N/A
Example
set widget_names [toolkit_get_types]
Send Feedback
QPS5V3
2015.11.02 toolkit_get_properties 10-41
toolkit_get_properties
Description
Returns a list of toolkit properties for a type of widget.
Usage
toolkit_get_properties <widgetType>
Returns
No return value.
Arguments
<widgetType>
Name of a type of widget.
Example
Send Feedback
QPS5V3
10-42 toolkit_add 2015.11.02
toolkit_add
Description
Adds a widget to the current toolkit.
Usage
toolkit_add <id> <type><groupid>
Returns
No return value.
Arguments
<id>
A unique ID for the widget being added.
<type>
The type of widget that is being added.
<groupid>
The ID for the parent group that will contain the new widget.
Example
toolkit_add my_button button "parentGroup"
Send Feedback
QPS5V3
2015.11.02 toolkit_get_property 10-43
toolkit_get_property
Description
Returns the value of a property for a specific widget.
Usage
toolkit_get_property <id> <propertyName>
Returns
No return value.
Arguments
<id>
A unique ID for the widget being queried.
<tpropertyName>
The name of the widget property being queried.
Example
set enabled [toolkit_get_property my_button enabled]
Send Feedback
QPS5V3
10-44 toolkit_set_property 2015.11.02
toolkit_set_property
Description
Sets the value of a property for a specific widget.
Usage
toolkit_set_property <id><propertyName> <value>
Returns
No return value.
Arguments
id>
A unique ID for the widget being modified.
<propertyName>
The name of the widget property being set.
<value>
The new value for the widget property.
Example
toolkit_set_property my_button enabled false
Send Feedback
QPS5V3
2015.11.02 toolkit_remove 10-45
toolkit_remove
Description
Removes a widget from the specified toolkit.
Usage
toolkit_remove <id>
Returns
No return value.
Arguments
<id>
A unique ID for the widget being removed.
Example
toolkit_remove my_button
Send Feedback
QPS5V3
10-46 toolkit_get_widget_dimensions 2015.11.02
toolkit_get_widget_dimensions
Description
Returns the width and height of the specified widget.
Usage
toolkit_get_widget_dimensions <id>
Returns
No return value.
Arguments
<id>
A unique ID for the widget being added.
Example
Send Feedback
QPS5V3
2015.11.02 Toolkit API Properties 10-47
Send Feedback
QPS5V3
10-48 Widget Types and Properties 2015.11.02
Name Description
enabled Enables or disables the widget.
expandable Allows the widget to be expanded.
expandableX Allows the widget to be resized horizontally if there is space
available in the cell where it resides.
expandableY Allows the widget to be resized vertically if there is space
available in the cell where it resides.
foregroundColor Sets the foreground color.
maxHeight If the widget's expandableY is set, this is the maximum height
in pixels that the widget can take.
minHeight If the widget's expandableY is set, this is the minimum height
in pixels that the widget can take.
maxWidth If the widget's expandableX is set, this is the maximum width in
pixels that the widget can take.
minWidth If the widget's expandableX is set, this is the minimum width in
pixels that the widget can take.
preferredHeight The height of the widget if expandableY is not set.
preferredWidth The width of the widget if expandableX is not set.
toolTip Implements a mouse-over tooltip.
visible Displays the widget.
Send Feedback
QPS5V3
2015.11.02 barChart Properties 10-49
barChart Properties
Table 10-12: Toolkit API barChart Properties
Name Description
title Chart title.
labelX X-axis label text.
label X-axis label text.
range Y-axis value range. By default, it is auto range. Range is
specified in a Tcl list, for example:
[list lower_numerical_value upper_numerical_value]
Send Feedback
QPS5V3
10-50 button Properties 2015.11.02
button Properties
Table 10-13: Toolkit API button Properties
Name Description
onClick A Tcl command to run, usually a proc, every time the button is
clicked.
text The text on the button.
Send Feedback
QPS5V3
2015.11.02 checkBox Properties 10-51
checkBox Properties
Table 10-14: Toolkit API checkBox Properties
Name Description
checked If true, the checkbox is checked. If false, the checkbox is not
checked.
onClick A Tcl command to run, usually a proc, every time the checkbox
is clicked.
text The text on the checkbox.
Send Feedback
QPS5V3
10-52 comboBox Properties 2015.11.02
comboBox Properties
Table 10-15: Toolkit API comboBox Properties
Name Description
onChange A Tcl callback to run when the value of the combo box changes.
options A list of options to display in the combo box.
selected The index of the selected item in the combo box.
Send Feedback
QPS5V3
2015.11.02 dial Properties 10-53
dial Properties
Table 10-16: Toolkit API dial Properties
Name Description
max The maximum value that the dial can show.
min The minimum value that the dial can show. .
ticksize The space between the different tick marks of the dial.
title The title of the dial.
value The value that the dial's needle should mark. It must be
between min and max.
Send Feedback
QPS5V3
10-54 fileChooserButton Properties 2015.11.02
fileChooserButton Properties
Table 10-17: Toolkit API fileChooserButton Properties
Name Description
text The text on the button.
onChoose A Tcl command to run, usually a proc, every time the button is
clicked.
title The dialog box title.
chooserButtonText chooserButtonText
filter The file filter based on extension. Only one extension is
supported. By default, all file names are allowed. The filter is
specified as [list filter_description file_extension],
for example:
[list "Text Document (.txt)" "txt"]
Send Feedback
QPS5V3
2015.11.02 group Properties 10-55
group Properties
Table 10-18: Toolkit API group Properties
Name Description
itemsPerRow The number of widgets the group can position in one row,
from left to right, before moving to the next row.
title The number of widgets the group can position in one row,
from left to right, before moving to the next row.
Send Feedback
QPS5V3
10-56 label Properties 2015.11.02
label Properties
Table 10-19: Toolkit API label Properties
Name Description
text The text to show in the label.
Send Feedback
QPS5V3
2015.11.02 led Properties 10-57
led Properties
Table 10-20: Toolkit API led Properties
Name Description
color The color of the LED. The options are: red_off, red, yellow_
off, yellow, green_off, green, blue_off, blue, and black.
text The color of the LED. The options are: red_off, red, yellow_
off, yellow, green_off, green, blue_off, blue, and black.
Send Feedback
QPS5V3
10-58 lineChart Properties 2015.11.02
lineChart Properties
Table 10-21: Toolkit API lineChart Properties
Name Description
title Chart title.
labelX X-axis label text.
labelY Y-axis label text.
range Y-axis value range. By default, it is auto range. You specify
range in a Tcl list, for example:
[list lower_numerical_value upper_numerical_value]
Y-axis value range. By default, Y-axis value range. By default, it is auto range. You specify
it is auto range. Range is range in a Tcl list, for example:
specified in a Tcl list, for
[list lower_numerical_value upper_numerical_value]
example [list lower_numerical_
value upper_numerical_value].
Send Feedback
QPS5V3
2015.11.02 list Properties 10-59
list Properties
Table 10-22: Toolkit API list Properties
Name Description
selected Index of the selected item in the combo box.
options List of options to display.
onChange A Tcl callback to run when the selected item in the list changes.
Send Feedback
QPS5V3
10-60 pieChart Properties 2015.11.02
pieChart Properties
Table 10-23: Toolkit API pieChart Properties
Name Description
title Chart title.
itemValue Item value. Value is specified in a Tcl list, for example:
[list bar_category_str numerical_value]
Send Feedback
QPS5V3
2015.11.02 tableProperties 10-61
tableProperties
Table 10-24: Toolkit API tableProperties
Name Description
columnCount The number of columns (Mandatory) (0, by default).
rowCount The number of rows (Mandatory) (0, by default).
headerReorderingAllowed Controls whether you can drag the columns (false, by default)
.
headerResizingAllowed Controls whether you can resize all column widths. (false, by
default).
Note: You can resize each column individually with the
columnWidthResizable property.
rowSorterEnabled Controls whether you can sort the cell values in a column
(false, by default).
showGrid Controls whether to draw both horizontal and vertical lines
(true, by default).
showHorizontalLines Controls whether to draw horizontal line (true, by default).
rowIndex Current row index. Zero-based. This value affects some
properties below (0, by default).
columnIndex Current column index. Zero-based. This value affects all
column specific properties below (0, by default).
cellText Specifies the text to be filled in the cell specified in the current
rowIndex and columnIndex (Empty, by default).
Send Feedback
QPS5V3
10-62 text Properties 2015.11.02
text Properties
Table 10-25: Toolkit API text Properties
Name Description
editable Controls whether the text box is editable.
htmlCapable Controls whether the text box can format HTML.
text The text to show in the text box.
Send Feedback
QPS5V3
2015.11.02 textField Properties 10-63
textField Properties
Table 10-26: Toolkit API textField Properties
Name Description
editable Controls whether the text box is editable.
onChange A Tcl callback to run when the contents of the text box is
changed.
text The text to show in the text box.
Send Feedback
QPS5V3
10-64 timeChart Properties 2015.11.02
timeChart Properties
Table 10-27: Toolkit API timeChart Properties
Name Description
labelX The label for the X-axis.
labelY The label for the Y-axis.
latest The latest value in the series.
maximumItemCount The number of sample points to display in the historic record.
title The title of the chart.
range Sets the range for the chart. The range is of the form {low,
high}. The low/high values are interpreted as doubles.
showLegend Sets whether a legend for the series should be shown in the
graph.
Send Feedback
QPS5V3
2015.11.02 xyChart Properties 10-65
xyChart Properties
Table 10-28: Toolkit API xyChart Properties
Name Properties
title Chart title
labelX X-Axis label text.
labelY Y-Axis label text.
range Sets the range for the chart. The range is of the form {low,
high}. The low/high values are interpreted as doubles.
showLegend Sets whether a legend for the series should be shown in the
graph.
ADC Toolkit
The ADC Toolkit is designed to work with MAX 10 devices and helps you understand the performance of
the analog signal chain as seen by the on-board ADC hardware. The GUI displays the performance of the
ADC using industry standard metrics. You can export the collected data to a .csv file and process this raw
data yourself. The ADC Toolkit is built on the System Console framework and can only be operated using
the GUI. There is no Tcl support for the tool.
Send Feedback
QPS5V3
10-66 ADC Toolkit 2015.11.02
Send Feedback
QPS5V3
2015.11.02 ADC Toolkit 10-67
Send Feedback
QPS5V3
10-68 ADC Toolkit Terms 2015.11.02
Related Information
• Using the ADC Toolkit in MAX 10 Devices online training
• MAX 10 FPGA Device Overview
• MAX 10 FPGA Device Datasheet
• MAX 10 FPGA Design Guidelines
• MAX 10 Analog to Digital Converter User Guide
• Additional information about sampling frequency
Nyquist sampling theorem and how it relates to the nominal sampling interval required to avoid
aliasing.
Term Description
SNR The ratio of the output signal voltage level to the output noise
level.
THD The ratio of the sum of powers of the harmonic frequency
components to the power of the fundamental/original
frequency component.
SFDR Characterizes the ratio between the fundamental signal and the
highest spurious in the spectrum.
Send Feedback
QPS5V3
2015.11.02 Setting the Frequency of the Reference Signal 10-69
Term Description
SINAD The ratio of the RMS value of the signal amplitude to the RMS
value of all other spectral components, including harmonics,
but excluding DC.
ENOB The number of bits with which the ADC behaves.
DNL The maximum and minimum difference in the step width
between actual transfer function and the perfect transfer
function
INL The maximum vertical difference between the actual and the
ideal curve. It indicates the amount of deviation of the actual
curve from the ideal transfer curve.
Send Feedback
QPS5V3
10-70 Tuning the Signal Generator 2015.11.02
• The closest frequency for valid testing near your desired frequency displays under both Signal
Quality Test and Linearity Test.
• The nearest required sine wave frequencies are different for the signal quality test and linearity test.
4. Set your signal generator to the precise frequency given by the tool based on the type of test you want
to run.
Send Feedback
QPS5V3
2015.11.02 Running a Signal Quality Test 10-71
Oscilloscope to see that the top and bottom peaks are evenly balanced to ensure you have selected the
optimum value.
• For MAX 10 devices, you want to get as close to Min Code = 0 and Max Code = 4095 without
actually hitting those values.
• The frequency should be set precisely to the value needed for testing such that coherent sampling is
observed in the test window. Before moving forward, follow the suggested value for signal quality
testing or linearity testing, which is displayed next to the actual frequency that is detected.
• From the Raw Data tab, you can export your data as a .csv file.
Related Information
Additional information about coherent sampling vs window sampling
Send Feedback
QPS5V3
10-72 Running a Linearity Test 2015.11.02
Send Feedback
QPS5V3
2015.11.02 ADC Toolkit Data Views 10-73
• The signal source covers the full code range of the ADC. Results improve if the time spent at code end
is equivalent, by tuning the reference signal in Scope mode.
• You have to make sure if using code ends that you are not clipping the signal. Look at the signal in
Scope mode to see that it does not look flat at the top or bottom. It may be desirable to back away from
code ends and test a smaller range within the desired operating range of the ADC input signal.
• Choosing a frequency that is not an integer multiple of the sample rate and buffer size helps to ensure
all code bins are filled relatively evenly to the probability density function of a sine wave. If an integer
multiple is selected, some bins may be skipped entirely while others are over populated. This makes the
tests results invalid. Use the frequency calculator feature to determine a good signal frequency near
your desired frequency.
To run a linearity test:
1. On ADC Channel, select the ADC channel that you plan to test.
2. Enter the test sample size in Burst Size. Larger samples increase the confidence in the test results.
3. Click Run.
• You can stop the test at anytime, as well as click Run again to continue adding to the aggregate
data. To start fresh, click Reset after you stop a test. Anytime you change the input signal or
channel, you should click Reset so your results are correct for a particular input.
• There are three graphical views of the data: Histogram view, DNL view, and INL view.
• From the Raw Data tab, you can export your data as a .csv file.
Histogram View
The Histogram view shows how often each code appears. The graph updates every few seconds as it
collects data. You can use the Histogram view to quickly check if your test signal is set up appropriately.
Send Feedback
QPS5V3
10-74 ADC Toolkit Data Views 2015.11.02
If your reference signal is not a relatively smooth line, but has jagged edges with some bins having a value
of 0, and adjacent bins with a much higher value, then the test signal frequency is not adequate. Use Scope
mode to help choose a good frequency for linearity testing.
Send Feedback
QPS5V3
2015.11.02 ADC Toolkit Data Views 10-75
Figure 10-10: Examples of (Left) Poor Frequency Choice vs (Right) Good Frequency Choice
Send Feedback
QPS5V3
10-76 ADC Toolkit Data Views 2015.11.02
Send Feedback
QPS5V3
2015.11.02 System Console Examples and Tutorials 10-77
Send Feedback
QPS5V3
10-78 Board Bring-Up with System Console Tutorial 2015.11.02
Related Information
Introduction to System Console on page 10-1
Note: If you do not see the USB-Blaster option, then your device was not detected. Verify that the
USB-Blaster driver is installed, your board is powered on, and the USB cable is intact.
This design example uses a USB-Blaster cable. If you do not have a USB-Blaster cable and you are
using a different cable type, then select your cable from the Currently selected hardware options.
e. Click Auto Detect, and then select your device.
f. Double-click your device under File.
g. Browse to your project folder and click Systemconsole_design_example.sof in the subdirectory
output_files.
Send Feedback
QPS5V3
2015.11.02 Verifying Clock and Reset Signals 10-79
#Select the master service type and check for available service paths.
set service_paths [get_service_paths master]
Avalon-MM Slaves
The Address Map tab shows the address range for every Qsys component. The Avalon-MM master
communicates with slaves using these addresses.
The register maps for all Altera components are in their respective Data Sheets.
Figure 10-13: Address Map
Related Information
Data Sheets Website
Send Feedback
QPS5V3
10-80 Avalon-MM Commands 2015.11.02
Avalon-MM Commands
Using the 8, 16, or 32 versions of the master_read or master_write commands is less efficient than
using the master_write_memory or master_read_memory commands. Master commands can also be
used on slave services. If you are working on a slave service, the address field can be a register (if the slave
defines register names). (6)
master_read_memory -
format 16 <service_
path> <addr> <count>
(6)
Transfers performed in 16- and 32-bit sizes are packed in little-endian format.
Send Feedback
QPS5V3
2015.11.02 Testing the PIO component 10-81
Fields
Offset Register Name R/W
(n-1) ... 2 1 0
read access R Data value currently on PIO inputs.
0 data
write access W New value to drive on PIO outputs.
1 direction R/W Individual direction control for each I/O port. A value of 0 sets the
direction to input; 1 sets the direction to output.
Send Feedback
QPS5V3
10-82 Testing On-chip Memory 2015.11.02
Fields
Offset Register Name R/W
(n-1) ... 2 1 0
2 interruptmask R/W IRQ enable/disable for each input port. Setting a bit to 1 enables
interrupts for the corresponding port.
3 edgecapture R/W Edge detection for each input port.
#Write the driver output values for the Parallel I/O component.
set offset 0x0; #Register address offset.
set value 0x7; #Only set bits 0, 1, and 2.
master_write_8 $claim_path $offset $value
#Observe the LEDs turn on and off as you execute these Tcl commands.
#The LED is on if the register value is zero and off if the register value is one.
#LED 0, LED 1, and LED 2 connect to the PIO.
#LED 3 connects to the interrupt signal of the CheckSum Accelerator.
Send Feedback
QPS5V3
2015.11.02 Testing the Checksum Accelerator 10-83
should only read the result from the controller when both the DONE bit and the interrupt signal are
asserted. The host should assert the interrupt enable control bit in order to check the interrupt signal.
Send Feedback
QPS5V3
10-84 Testing the Checksum Accelerator 2015.11.02
2. If the result is zero and the JTAG chain works properly, the clock and reset signals work properly, and
the memory works properly, then the problem is the Checksum Accelerator component.
3. Check the control enable to see the interrupt signal. LED 3 (MSB) should be off. This indicates the
interrupt signal is asserted.
4. You have narrowed down the problem to the data path. View the RTL to check the data path.
5. Open the Checksum_transform.v file from your project folder.
• <unzip dir>/System_Console/ip/checksum_accelerator/checksum_accelerator.v
6. Notice that the data_out signal is grounded in Figure 10-14 (uncommented line 87 and comment line
88). Fix the problem.
7. Save the file and regenerate the Qsys system.
8. Re-compile the design and reprogram your device.
9. Redo the above steps, starting with Verifying Memory and Other Peripheral Interfaces on page 10-
79 or run the Tcl script included with this design example.
source set_memory_and_run_checksum.tcl
Send Feedback
QPS5V3
2015.11.02 Qsys Modules for Board Bring-up Example 10-85
The Qsys design for this example includes the following modules:
• JTAG to Avalon Master Bridge—Provides System Console host access to the memory-mapped IP in
the design via the JTAG interface.
• On-chip memory—Simplest type of memory for use in an FPGA-based embedded system. The
memory is implemented on the FPGA; consequently, external connections on the circuit board are not
necessary.
• Parallel I/O (PIO) module—Provides a memory-mapped interface for sampling and driving general
I/O ports.
• Checksum Accelerator—Calculates the checksum of a data buffer in memory. The Checksum Acceler‐
ator consists of the following:
• Checksum Calculator (checksum_transform.v)
• Read Master (slave.v)
• Checksum Controller (latency_aware_read_master.v)
Send Feedback
QPS5V3
10-86 Nios II Processor Example 2015.11.02
DONE bit in the status register and also asserts the interrupt signal. You should only read the result from
the Checksum Controller when the DONE bit and interrupt signal are asserted.
nios2-configure-sof niosii_ethernet_standard_<board_version>.sof
6. Using Nios II Software Build Tools for Eclipse, create a new Nios II Application and BSP from
Template using the Count Binary template and targeting the Nios II Ethernet Standard Design
Example.
7. To build the executable and linkable format (ELF) file (.elf) for this application, right-click the Count
Binary project and select Build Project.
8. Download the .elf file to your board by right-clicking Count Binary project and selecting Run As,
Nios II Hardware.
• The LEDs on your board provide a new light show.
9. Type the following:
Send Feedback
QPS5V3
2015.11.02 Processor Commands 10-87
Processor Commands
Table 10-33: Processor Commands
Related Information
Nios II Processor Example on page 10-86
(7)
If your system includes a Nios II/f core with a data cache, it may complicate the debugging process. If you
suspect the Nios II/f core writes to memory from the data cache at nondeterministic intervals; thereby,
overwriting data written by the System Console, you can disable the cache of the Nios II/f core while
debugging.
Send Feedback
QPS5V3
10-88 On-Board USB Blaster II Support 2015.11.02
Send Feedback
QPS5V3
2015.11.02 About Using MATLAB and Simulink in a System Verification Flow 10-89
Send Feedback
QPS5V3
10-90 Deprecated Commands 2015.11.02
High-Level Flow
1. Install the DSP Builder software so you have the necessary libraries to enable this flow
2. Build your design using Simulink and the DSP Builder libraries (DSP Builder helps to convert the
Simulink design to HDL)
3. Include Avalon-MM components in your design (DSP Builder can port non-Avalon-MM
components)
4. Include Signals and Control blocks in your design
5. Use boundary blocks to separate synthesizable and non-synthesizable logic
6. Integrate your DSP system in Qsys
7. Program your Altera FPGA
8. Use the supported MATLAB API commands to interact with your Altera FPGA
Related Information
• Hardware in the Loop from the MATLAB/Simulink Environment white paper
• System in the Loop - Enabling Real-Time FPGA Verification within MATLAB website
• DSP Builder website
Deprecated Commands
The table lists commands that have been deprecated. These commands are currently supported, but are
targeted for removal from System Console.
Note: All dashboard_<name> commands are deprecated and replaced with toolkit_<name> commands
for Quartus Prime software15.1, and later.
Send Feedback
QPS5V3
2015.11.02 Document Revision History 10-91
May 2015 15.0.0 Added information about how to download and start System Console
stand-alone.
December 14.1.0 • Added overview and procedures for using ADC Toolkit on MAX 10
2014 devices.
• Added overview for using MATLABS/Simulink Environment with
System Console for system verification.
June 2014 14.0.0 Updated design examples for the following: board bring-up, dashboard
service, Nios II processor, design service, device service, monitor service,
bytestream service, SLD service, and ISSP service.
June 2013 13.0.0 Updated Tcl command tables. Added board bring-up design example.
Removed SOPC Builder content.
August 2012 12.0.1 Moved Transceiver Toolkit commands to Transceiver Toolkit chapter.
June 2012 12.0.0 Maintenance release. This chapter adds new System Console features.
Send Feedback
QPS5V3
10-92 Document Revision History 2015.11.02
November 11.1.0 Maintenance release. This chapter adds new System Console features.
2011
May 2011 11.0.0 Maintenance release. This chapter adds new System Console features.
December 10.1.0 Maintenance release. This chapter adds new commands and references for
2010 Qsys.
July 2010 10.0.0 Initial release. Previously released as the System Console User Guide,
which is being obsoleted. This new chapter adds new commands.
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
Debugging Transceiver Links
11
QPS5V3 Subscribe Send Feedback
The Transceiver Toolkit helps you to optimize high-speed serial links in your board design. The
Transceiver Toolkit provides real-time control, monitoring, and debugging of the transceiver links
running on your board.
Once you correctly configure a debugging system, you can control the transmitter or receiver channels to
optimize transceiver settings and hardware features. The toolkit tests bit-error rate (BER) while running
multiple links at target data rate. Run auto sweep tests to identify the best physical media attachment
(PMA) settings for each link. EyeQ graphs display the receiver horizontal and vertical eye margin during
testing. The toolkit supports testing of multiple devices across multiple boards simultaneously.
Figure 11-1: Transceiver Toolkit Channel Manager
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V3
11-2 Transceiver Debugging Flow 2015.11.02
Quick Start
The Transceiver Toolkit user interface helps you to visualize and debug transceiver links in your design.
To launch the toolkit, click Tools > System Debugging Tools > Transceiver Toolkit. Alternatively, you
can run Tcl scripts from the command-line:
Get started quickly by downloading Transceiver Toolkit design examples from the On-Chip Debugging
Design Examples website. For an online demonstration of how to use the Transceiver Toolkit to run a
high-speed link test with one of the design examples, refer to the Transceiver Toolkit Online Demo on
the Altera website.
Flow Description
System 1. Use one of the following methods to define a system that includes necessary
Configuration transceiver debugging components:
Steps
• Download Transceiver Toolkit design examples from the On-Chip Debugging
Design Examples website. Modify Altera design examples to fit your design.
• Integrate debugging components into your own design. Click Tools > IP Catalog
to select IP cores and define them in the parameter editor.
2. Click Assignments > Pin Planner to assign device I/O pins to match your device and
board.
3. Click Processing > Start Compilation to compile your design.
4. Connect your target device to Altera programming hardware.
5. Click Tools > Programmer and then program the target device with the debugging
system.
Send Feedback
QPS5V3
2015.11.02 Configuring Systems for Transceiver Debug 11-3
Flow Description
Link 1. Click File > Load Design, and select the SRAM Object File (.sof) generated for your
Debugging transceiver design. If you start the toolkit while a project is open, the project loads in
Steps the toolkit automatically.
2. (Optional) Create additional links between transmitter and receiver channels.
3. Run any of the following tests:
• Run BER with various combinations of PMA settings.
• Run PRBS Signal eye tests.
• Run custom traffic tests.
• Run link optimization tests.
• Directly control PMA analog settings to experiment with settings while the link is
running.
Related Information
Configuring Your Own Debugging System on page 11-6
Send Feedback
QPS5V3
11-4 Modifying Stratix V Design Examples 2015.11.02
You can make changes to the design examples so that you can use a different development board or a
different device. If you have a different board, you must edit the necessary pin assignments and recompile
the design examples.
Related Information
On-Chip Debugging Design Examples
Send Feedback
QPS5V3
2015.11.02 Generating reconfig_clk from an Internal PLL 11-5
From To
clk_100 clk_reset data_pattern_checker csr_clk_reset
low_latency_10g_1ch DUT (
.....
.xcvr_low_latency_phy_0_tx_serial_data_export ({GXB_TXL11,
GXB_TXL12}),
.xcvr_low_latency_phy_0_rx_serial_data_export ({GXB_RXL11,
GXB_TXL12}),
.....
);
17.From the Quartus Prime software, click Assignments > Pin Planner and update pin assignments to
match your board.
18.Edit the design’s Synopsys Design Constraints (.sdc) to reflect the reference clock change. Ignore the
reset warning messages.
19.Click Start > Start Compilation to recompile the design.
Send Feedback
QPS5V3
11-6 Configuring Your Own Debugging System 2015.11.02
You can find the support solution in the Altera Knowledge Base. The solution applies to only Arria V,
Cyclone V, Stratix IV GX/GT, and Stratix V devices.
Related Information
• Arria 10 Debug System Configuration on page 11-6
• Stratix V Debug System Configuration on page 11-12
Transceiver ATX PLL Required for Arria 10 On the Dynamic Reconfiguration tab:
• Turn on Enable dynamic reconfiguration
(required for System Console read/write access).
• Turn on Enable Altera Debug Master Endpoint
(required for System Console read/write access).
Send Feedback
QPS5V3
2015.11.02 Enabling Altera Master Debug Endpoint (Arria 10) 11-7
Altera Debug Master • Supports control of • Enabled from the Arria 10 Transceiver Native PHY
Endpoint (ADME) PMA analog settings, Parameter Editor, Dynamic Reconfiguration tab.
ADCE settings, DFE
settings, and EyeQ.
• discovers PHY and
use toolkit on designs
not using Qsys.
• Optionally, turn off
to save resource
count. (only an
option if you
instantiate the JTAG
to Avalon Master
Bridge. Otherwise,
Transceiver Toolkit
cannot function).
JTAG Debug Link Required for Arria 10. For Qsys projects, the JTAG Debug Link is auto-
instantiated.
Send Feedback
QPS5V3
11-8 Enabling Altera Master Debug Endpoint (Arria 10) 2015.11.02
User
JTAG Avalon-MM
Master 0 User Logic Hard PRBS Generator
Host Link
Send Feedback
QPS5V3
2015.11.02 Link Testing Configuration (Arria 10) 11-9
Send Feedback
QPS5V3
11-10 Link Testing Configuration (Arria 10) 2015.11.02
Note: For more information, refer to the Arria 10 Transceiver Native PHY User Guide, Enabling the PRBS
and Square Wave Data Generator and Enabling the PRBS Data Checker sections in the Reconfigura‐
tion Interface and Dynamic Configuration chapter.
The built-in hard PRBS Data Pattern Generator and Checker requires no separate IP instantiation. The
hard PRBS Data Pattern Generator and Checker does not support error injection. To use error injection
for Arria 10 designs, use the Data Pattern Generator and Checker IP cores in your Arria 10 system design
configuration.
Figure 11-5: BER, PRBS, and Link Optimization Test Configuration (Arria 10)
Table 11-4: System Connections: BER and PRBS Testing (Arria 10)
From To
Send Feedback
QPS5V3
2015.11.02 Custom Traffic Signal Eye Test Configuration (Arria 10) 11-11
Table 11-5: System Connections: Custom Traffic Signal Eye Test (Arria 10)
From To
Send Feedback
QPS5V3
11-12 Stratix V Debug System Configuration 2015.11.02
Transceiver Supports all • If Enable 10G PCS is enabled, 10G • Avalon-ST Data
Native PHY debugging PCS protocol mode must be set to Pattern Checker
functions basic on the 10G PCS tab. • Avalon-ST Data
Pattern Generator
• JTAG to Avalon
Master Bridge
• Reconfiguration
controller
Custom PHY Test all possible • Set lanes, group size, serialization • Avalon-ST Data
transceiver factor, data rate, and input clock Pattern Checker
parallel data frequency to match your application. • Avalon-ST Data
widths • Turn on Avalon data interfaces. Pattern Generator
• Disable 8B/10B. • JTAG to Avalon
• Set Word alignment mode to manual. Master Bridge
• Disable rate match FIFO. • Reconfiguration
• Disable byte ordering block. controller
Low Latency Test at more than • Set Phase compensation FIFO mode • Avalon-ST Data
PHY 8.5 Gbps in GT to EMBEDDED above certain data Pattern Checker
devices or use of rates and set to NONE for PMA direct • Avalon-ST Data
PMA direct mode mode (Stratix IV designs only). Pattern Generator
(such as when • Turn on Avalon data interfaces. • JTAG to Avalon
using six channels • Set serial loopback mode to enable Master Bridge
in one quad) serial loopback controls in the toolkit. • Reconfiguration
controller
Send Feedback
QPS5V3
2015.11.02 Stratix V Debug System Configuration 11-13
Altera-Avalon Validates • Specify a value for ST_DATA_W that • PHY output port
Data Pattern incoming data matches the FPGA-fabric interface • JTAG to Avalon
Checker stream against width. Master Bridge
test patterns
accepted on
Avalon streaming
sink ports
Reconfigura‐ Supports PMA • Connect the reconfiguration controller • PHY input port
tion Controller control and other to • JTAG to Avalon
transceiver • Connect reconfig_from_xcvr to Master Bridge
settings reconfig_to_xcvr.
• Enable Analog controls.
• Turn on Enable EyeQ block to enable
signal eye analysis
• Turn on Enable Bit Error Rate Block
for BER testing
• Turn on Enable decision feedback
equalizer (DFE) block for link
optimization
• Enable DFE block
Send Feedback
QPS5V3
11-14 Bit Error Rate Test Configuration (Stratix V) 2015.11.02
Avalon-ST Data
Pattern Checker
XCVR Reconfig
Controller
From To
Related Information
Running BER Tests on page 11-27
Send Feedback
QPS5V3
2015.11.02 PRBS Signal Eye Test Configuration (Stratix V) 11-15
Avalon-ST Data
Pattern Checker
From To
Related Information
Running PRBS Signal Eye Tests on page 11-28
Send Feedback
QPS5V3
11-16 Enabling Serial Bit Comparator Mode (Stratix V) 2015.11.02
Transceiver Reconfiguration Turn on Enable EyeQ block and Enable Bit Error Rate Block
Controller
Serial bit comparator mode is less accurate than Data pattern checker mode for single bit error
checking. Do not use Serial bit comparator mode if you require an exact error rate. Use the Serial bit
comparator mode for checking a large window of error. The toolkit does not read the bit error counter in
real-time because it reads through the memory-mapped interface. Serial bit comparator mode has the
following hardware limitations for Stratix V devices:
• Toolkit uses serial bit checker only on a single channel per reconfiguration controller at a time.
• When the serial bit checker is running on channel n, you can change only the VOD, pre-emphasis, DC
gain, and EyeQ settings on that channel. Changing or enabling DFE or CTLE can cause corruption of
the serial bit checker results.
• When the serial bit checker is running on a channel, you cannot change settings on any other channel
on the same reconfiguration controller.
• When the serial bit checker is running on a channel, you cannot open any other channel in the
Transceiver Toolkit.
• When the serial bit checker is running on a channel, you cannot copy PMA settings from any channel
on the same reconfiguration controller.
(8)
Settings in Table 11-9 are supported in Stratix V devices only.
(9)
Limited support for Data Pattern Generator or data pattern in Serial Bit Mode.
Send Feedback
QPS5V3
2015.11.02 Custom Traffic Signal Eye Test Configuration (Stratix V) 11-17
Table 11-10: System Connections: Custom Traffic Signal Eye Tests (Stratix V)
From To
Related Information
Running Custom Traffic Tests on page 11-29
Send Feedback
QPS5V3
11-18 Link Optimization Test Configuration (Stratix V) 2015.11.02
Avalon-ST Data
Pattern Checker
From To
Related Information
Running Link Optimization Tests on page 11-30
Send Feedback
QPS5V3
2015.11.02 PMA Analog Setting Control Configuration (Stratix V) 11-19
From To
Related Information
Controlling PMA Analog Settings on page 11-30
Send Feedback
QPS5V3
11-20 Channel Display Modes 2015.11.02
Send Feedback
QPS5V3
2015.11.02 Creating Links 11-21
Note: The Transmitter Channels tab only shows the Current display mode. Auto sweep cannot be
performed on only a transmitter channel; a receiver channel is required to perform an auto sweep
test.
Creating Links
The toolkit automatically creates links when a receiver and transmitter share a transceiver channel. You
can also manually create and delete links between transmitter and receiver channels. You create links in
the Setup dialog.
Setup Dialog
Click Setup from the Channel Manager to open the Setup dialog box.
Send Feedback
QPS5V3
11-22 Step 1: Load Your Design 2015.11.02
The Transceiver Toolkit supports various transceiver link testing configurations. You can identify and test
the transceiver link between two Altera devices, or you can transmit a test pattern with a third-party
device and monitor the data on an Altera device receiver channel. If a third-party chip includes self-test
capability, then you can send the test pattern from the Altera device and monitor the signal integrity at the
third-party device receiver channel. If the third-party device supports reverse serial loopback, you can run
the test entirely within the Transceiver Toolkit.
Before you can monitor transceiver channels, you must configure a system with debugging components,
and program the design into an FPGA. Once those steps are complete, use the following flow to test the
channels:
1. Load the design in Transceiver Toolkit
2. Link hardware resources
3. Verify hardware connections
4. Identify transceiver channels
5. Run link tests or control PMA analog settings
6. View results
Send Feedback
QPS5V3
2015.11.02 Step 2: Link Hardware Resources 11-23
Custom PHY
XCVR
Transceiver Toolkit JTAG-to-Avalon IP Core
Reconfiguration
host computer Master Bridge or
Controller Loopback
Low-Latency
on board
PHY IP Core
Avalon-ST Data
Pattern Generator
Avalon-ST Data
Pattern Checker
Send Feedback
QPS5V3
11-24 Step 2: Link Hardware Resources 2015.11.02
XCVR
Transceiver Toolkit JTAG-to-Avalon
Reconfiguration
host computer Master Bridge
Controller
Avalon-ST Data
Pattern Generator
Loopback
on board
Avalon-ST Data
Pattern Checker
Avalon-ST Data
Pattern Generator
Loopback
on board
Avalon-ST Data
Pattern Checker
Avalon-ST Data
Pattern Generator
Loopback
on board
Avalon-ST Data
Pattern Checker
Send Feedback
QPS5V3
2015.11.02 Linking One Design to One Device 11-25
Figure 11-17: Four Channel Loopback Mode for Arria 10 / Generation 10 / 20nm
Send Feedback
QPS5V3
11-26 Linking One Design on Two Devices 2015.11.02
1. Load the design for all the Quartus Prime project files you might need.
2. Link each device to an appropriate design if the design has not auto-linked.
3. Create the link between channels on the device to test.
4. Link the device you connected to the second USB-Blaster download cable to the second design.
5. Create a link between the channels on the devices you want to test.
Red Channel is closed or generator clock is not Channel is closed or checker clock is not
running running
Neutral Channel is open, generator clock is Channel is open, checker clock is running,
running, and generator is not sending a and checker is not checking
pattern
Send Feedback
QPS5V3
2015.11.02 Step 5: Run Link Tests 11-27
Related Information
• Bit Error Rate Test Configuration (Stratix V) on page 11-14
• Link Testing Configuration (Arria 10) on page 11-9
Send Feedback
QPS5V3
11-28 Running PRBS Signal Eye Tests 2015.11.02
Figure 11-18: EyeQ Settings and Status Showing Results of Two Test Runs
Figure 11-19: Heat Map Display and Bathtub Curve Through Eye
Send Feedback
QPS5V3
2015.11.02 Running Custom Traffic Tests 11-29
Related Information
• PRBS Signal Eye Test Configuration (Stratix V) on page 11-15
• Link Testing Configuration (Arria 10) on page 11-9
Send Feedback
QPS5V3
11-30 Auto Sweep Testing 2015.11.02
Related Information
• Custom Traffic Signal Eye Test Configuration (Stratix V) on page 11-17
• Custom Traffic Signal Eye Test Configuration (Arria 10) on page 11-11
Related Information
• Link Optimization Test Configuration (Stratix V) on page 11-18
• Link Testing Configuration (Arria 10) on page 11-9
Send Feedback
QPS5V3
2015.11.02 Controlling PMA Analog Settings 11-31
a. Click the Transmitter Channels tab, define a transmitter without a generator, and click Create
Transmitter Channel.
b. Click the Receiver Channels tab, define a receiver without a generator, and click Create Receiver
Channel.
c. Click the Transceiver Links tab, select the transmitter and receivers you want to control, and click
Create Transceiver Link.
d. Click Close.
2. Click Control Receiver Channel, Control Transmitter Channel, or Control Transceiver Link to
directly control the PMA settings while running.
Figure 11-20: Controlling Transmitter Channel
Send Feedback
QPS5V3
11-32 Controlling PMA Analog Settings 2015.11.02
Send Feedback
QPS5V3
2015.11.02 Controlling PMA Analog Settings 11-33
Related Information
• PMA Analog Setting Control Configuration (Stratix V) on page 11-19
• PMA Analog Setting Control Configuration (Arria 10) on page 11-11
Send Feedback
QPS5V3
11-34 Troubleshooting Common Errors 2015.11.02
1-D EyeQ mode Use when DFE is on and the EyeQ mode is set to Receiver
Bathtub curve. Ignores the vertical step settings for
Transceiver Link
EyeQ (Stratix V only).
Auto sweep status Reports the current and best tested bits, errors, bit Receiver
error rate, and case count for the current auto sweep
Transceiver Link
test.
Bit error rate (BER) Specifies errors divided by bits tested since the last Receiver
reset of the checker.
Transceiver Link
Send Feedback
QPS5V3
2015.11.02 User Interface Settings Reference 11-35
Data rate Data rate of the channel as read from the project file Transmitter
or data rate as measured by the frequency detector.
Receiver
To use the frequency detector, turn on Enable
Transceiver Link
Frequency Counter in the Data Pattern Checker IP
core and/or Data Pattern Generator IP core,
regenerate the IP cores, and recompile the design.
The measured data rate depends on the Avalon
management clock frequency as read from the project
file.
Click the refresh button next to the measured Data
rate if you make changes to your settings and want to
sample the data rate again.
Send Feedback
QPS5V3
11-36 User Interface Settings Reference 2015.11.02
Enable word Forces the transceiver channel to align to the word Receiver
aligner you specify (Stratix V only feature).
Transceiver Link
Error rate limit Turns on or off error rate limits. Start checking after Receiver
waits until the set number of bits are satisfied until it
Transceiver Link
starts looking at the bit error rate (BER) for the next
two checks.
Bit error rate achieves below sets upper bit error rate
limits. If the error rate is better than the set error rate,
the test ends.
Bit error rate exceeds Sets lower bit error rate limits.
If the error rate is worse than the set error rate, the
test ends.
EyeQ mode Allows you to specify Eye contour or Bathtub curve as Transmitter
the type of EyeQ graph generated by the test.
Receiver
Transceiver Link
Send Feedback
QPS5V3
2015.11.02 User Interface Settings Reference 11-37
EyeQ phase step Sets the phase step for sampling the data from an Receiver
offset of the CDR (clock data recovery) data path; set
Transceiver Link
to Off to use the regular clock data recovery (CDR)
data path.
EyeQ vertical step Sets the voltage threshold of the sampler to report the Receiver
height of the eye. Negative numbers are allowed for
Transceiver Link
vertical steps to capture asymmetric eye.
Increase test range Right-click in the Advanced panel to use the span Receiver
capabilities of Auto Sweep to automatically increase
Transceiver Link
the span of tests by one unit down for the minimum
and one unit up for the maximum, for the selected set
of controls. You can span either PMA Analog controls
(non-DFE controls), or the DFE controls. You can
quickly set up a test to check if any PMA setting
combinations near your current best could yield better
results.
Inject Error Flips one bit to the output of the data pattern Transmitter
generator to introduce an artificial error (Stratix V
Transceiver Link
only feature).
Maximum tested Sets the maximum number of tested bits for each test Receiver
bits iteration.
Transceiver Link
Number of bits Specifies the number of bits tested since the last reset Receiver
tested of the checker.
Transceiver Link
Number of error Specifies the number of error bits encountered since Receiver
bits the last reset of the checker.
Transceiver Link
Send Feedback
QPS5V3
11-38 User Interface Settings Reference 2015.11.02
PLL refclk freq Channel reference clock frequency as read from the Transmitter
project file or measured reference clock frequency as
Receiver
calculated from the measured data rate.
Transceiver Link
Preamble word Word to send out if you use the preamble mode (only Transmitter
if you use soft PRBS Data Pattern Generator and
Transceiver Link
Checker).
Receiver channel Specifies the name of the selected receiver channel. Receiver
Transceiver Link
Refresh Button After loading the .pof, loads fresh settings from the Transmitter
registers after running dynamic reconfiguration.
Receiver
Transceiver Link
Send Feedback
QPS5V3
2015.11.02 User Interface Settings Reference 11-39
Run results table Lists the statistics of each EyeQ test run. The run Transmitter
results table is sortable. You can right-click any of the
Receiver
tests in the table and then click Apply Settings to
Device to quickly apply the chosen PMA settings to Transceiver Link
your device. You can click Import to load reports
from previously generated EyeQ runs into the run
results table. You can click Export to export single or
multiple runs from the run results table to a report.
RX CDR data status Shows the receiver in lock-to-data (LTD) mode. Receiver
When in auto-mode, if data cannot be locked, the
Transceiver Link
signal stays high when locked to data and never
toggles.
Serial loopback Inserts a serial loopback before the buffers, allowing Transmitter
enabled you to form a link on a transmitter and receiver pair
Receiver
on the same physical channel of the device.
Transceiver Link
(10)
For Stratix V devices, the Phase Frequency Detector (PFD) is inactive in LTD mode. The rx_is_
lockedtoref status signal toggles randomly and is not significant in LTD mode.
Send Feedback
QPS5V3
11-40 User Interface Settings Reference 2015.11.02
Target bit error rate Finds the contour edge of the bit error rate that you Transmitter
select. This option only applies to eye contour mode.
Receiver
Transceiver Link
Test mode Allows you to specify the Auto sweep, EyeQ, or Auto Receiver
sweep and EyeQ test mode.
Transceiver Link
Test pattern Test pattern sent by the transmitter channel. Arria 10 Transmitter
devices support PRBS9, PRBS15, PRBS23, and
Receiver
PRBS31).
Transceiver Link
Stratix V devices support PRBS7, PRBS15,
PRBS23, PRBS31, LowFrequency, HighFrequency,
and Bypass mode. The Data Pattern Checker self-
aligns both high and low frequency patterns. Use
Bypass mode to send user-design data.
Time limit Specifies the time limit unit and value to have a Receiver
maximum bounds time limit for each test iteration
Transceiver Link
Use preamble upon If turned on, sends the preamble word before the test Transmitter
start pattern. If turned off, starts sending the test pattern
Transceiver Link
immediately.
Vertical phase step Specify the number of vertical steps to increment Transmitter
interval when performing a sweep. Increasing the value
Receiver
increases the speed of the test but at a lower
resolution. This option only applies to the eye Transceiver Link
contour.
Send Feedback
QPS5V3
2015.11.02 Scripting API Reference 11-41
transceiver_channel_rx_ <service-path> <tap position> Gets the current tap value of the specified
get_dfe_tap_value channel at the specified tap position.
Send Feedback
QPS5V3
11-42 Transceiver Toolkit Commands 2015.11.02
transceiver_channel_rx_ <service-path> Resets the bit and error counters inside the
reset_counters checker.
transceiver_channel_rx_ <service-path> <tap position> Sets the current tap value of the specified
set_dfe_tap_value <tap value> channel at the specified tap position to the
specified value.
Send Feedback
QPS5V3
2015.11.02 Transceiver Toolkit Commands 11-43
transceiver_channel_rx_ <service-path><phase step> Sets the phase step of the specified channel.
set_eyeq_phase_step
Send Feedback
QPS5V3
11-44 Transceiver Toolkit Commands 2015.11.02
Send Feedback
QPS5V3
2015.11.02 Transceiver Toolkit Commands 11-45
transceiver_debug_link_set_ <service-path> <data pattern> Sets the pattern the link uses to
pattern run the test.
Send Feedback
QPS5V3
11-46 Transceiver Toolkit Commands 2015.11.02
Send Feedback
QPS5V3
2015.11.02 Transceiver Toolkit Commands 11-47
alt_xcvr_reconfig_dfe_set_ <service-path> <tap position> <tap Sets the tap value at the
tap_value value> previously specified channel at
specified tap position and value.
Send Feedback
QPS5V3
11-48 Transceiver Toolkit Commands 2015.11.02
Send Feedback
QPS5V3
2015.11.02 Transceiver Toolkit Commands 11-49
Send Feedback
QPS5V3
11-50 Transceiver Toolkit Commands 2015.11.02
Send Feedback
QPS5V3
2015.11.02 Data Pattern Generator Commands 11-51
Send Feedback
QPS5V3
11-52 Data Pattern Generator Commands 2015.11.02
Send Feedback
QPS5V3
2015.11.02 Data Pattern Generator Commands 11-53
Send Feedback
QPS5V3
11-54 Data Pattern Checker Commands 2015.11.02
Send Feedback
QPS5V3
2015.11.02 Data Pattern Checker Commands 11-55
Send Feedback
QPS5V3
11-56 Document Revision History 2015.11.02
Send Feedback
QPS5V3
2015.11.02 Document Revision History 11-57
May 2015 15.0.0 • Added section about Implementation Differences Between Stratix V and
Arria 10.
• Added section about Recommended Flow for Arria 10 Transceiver Toolkit
Design with the Quartus Prime Software.
• Added section about Transceiver Toolkit Troubleshooting
• Updated the following sections with information about using the
Transceiver Toolkit with Arria 10 devices:
• Serial Bit Comparator Mode
• Arria 10 Support and Limitations
• Configuring BER Tests
• Configuring PRBS Signal Eye Tests
• Adapting Altera Design Examples
• Modifying Design Examples
• Configuring Custom Traffic Signal Eye Tests
• Configuring Link Optimization Tests
• Configuring PMA Analog Setting Control
• Running BER Tests
• Toolkit GUI Setting Reference
• Reworked Table: Transceiver Toolkit IP Core Configuration
• Replaced Figure: EyeQ Settings and Status Showing Results of Two Test
Runs with Figure: EyeQ Settings and Status Showing Results of Three Test
Runs.
• Added Figure: Arria 10 Altera Debug Master Endpoint Block Diagram.
• Added Figure: BER Test Configuration (Arria10/ Gen 10/ 20nm) Block
Diagram.
• Added Figure: PRBS Signal Test Configuration (Arria 10/ 20nm) Block
Diagram.
• Added Figure: Custom Traffic Signal Eye Test Configuration (Arria 10/ Gen
10/ 20nm) Block Diagram.
• Added Figure: PMA Analog Setting Control Configuration (Arria 10/ Gen
10/ 20nm) Block Diagram.
• Added Figure: One Channel Loopback Mode (Arria 10/ 20nm) Block
Diagram.
• Added Figure: Four Channel Loopback Mode (Arria 10/ Gen 10/ 20nm)
Block Diagram.
Software Version 15.0 Limitations
• Transceiver Toolkit supports EyeQ for Arria 10 designs.
• Supports optional hard acceleration for EyeQ. This allows for much faster
EyeQ data collection. Enable this in the Arria 10 Transceiver Native PHY IP
core under the Dynamic Configuration tab. Turn on Enable ODI accelera‐
tion logic.
Send Feedback
QPS5V3
11-58 Document Revision History 2015.11.02
November, 12.1.0 • Minor editorial updates. Added Tcl help information and removed Tcl
2012 command tables. Added 28-Gbps Transceiver support section.
August, 2012 12.0.1 • General reorganization and revised steps in modifying Altera example
designs.
June, 2012 12.0.0 • Maintenance release for update of Transceiver Toolkit features.
December, 10.1.0 • Changed to new document template. Added new 10.1 release features.
2010
August, 2010 10.0.1 • Corrected links.
Related Information
Altera Documentation Archive
For previous versions of the Quartus Prime Handbook, search the Altera documentation archives.
Send Feedback
2015.11.02
Quick Design Debugging Using SignalProbe
12
QPS5V3 Subscribe Send Feedback
families.
Related Information
System Debugging Tools Overview documentation on page 9-1
Overview and comparison of all the tools available in the Quartus Prime software
© 2016 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance ISO
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any 9001:2008
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, Registered
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
QPS5V3
12-2 Perform a Full Compilation 2015.11.02
Related Information
• SignalProbe Pins Dialog Box online help
• Add SignalProbe Pins Dialog Box online help
• Engineering Change Management with the Chip Planner documentation
Note: When you add a register to a SignalProbe pin, the SignalProbe compilation attempts to place the
register to best meet timing requirements. You can place SignalProbe registers either near the
SignalProbe source to meet fMAX requirements, or near the I/O to meet tCO requirements.
Send Feedback
QPS5V3
2015.11.02 Perform a SignalProbe Compilation 12-3
Reg_a_1 Reg_a_2
DFF DFF
Logic D Q D Q Logic
Reg_b_1 Reg_b_2
DFF DFF
Logic D Q D Q Logic
SignalProbe_Output_1
D Q SignalProbe_Output_2
SignalProbe
Pipeline
Register
In addition to clock input for pipeline registers, you can also specify a reset signal pin for pipeline
registers. To specify a reset pin for pipeline registers, use the Tcl command make_sp.
Related Information
Add SignalProbe Pins Dialog Box online help
Information about how to pipeline an existing SignalProbe connection
Send Feedback
QPS5V3
12-4 What a SignalProbe Compilation Does 2015.11.02
To view the timing results of each successfully routed SignalProbe pin, on the Processing menu, point to
Start and click Start Timing Analysis.
Related Information
Engineering Change Management with the Chip Planner documentation
Status Description
Routed Connected and routed successfully
Not Routed Not enabled
Send Feedback
QPS5V3
2015.11.02 Understanding the Results of a SignalProbe Compilation 12-5
Status Description
Failed to Route Failed routing during last SignalProbe compilation
Need to Compile Assignment changed since last SignalProbe
compilation
Figure 12-3: SignalProbe Fitting Results Page in the Compilation Report Window
The SignalProbe source to output delays screen in the Timing Analysis section of the Compilation
Report displays the timing results of each successfully routed SignalProbe pin.
Figure 12-4: SignalProbe Source to Output Delays Page in the Compilation Report Window
Send Feedback
QPS5V3
12-6 Analyzing SignalProbe Routing Failures 2015.11.02
Note: After a SignalProbe compilation, the processing screen of the Messages window also provides the
results for each SignalProbe