Qts Qii5v1
Qts Qii5v1
Qts Qii5v1
Subscribe
Send Feedback
QII5V1
2014.12.15
2014.12.15
QII5V1
Subscribe
Send Feedback
The Quartus II 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 quickly create a new project 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 II 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.
Figure 1-1: New Project Wizard
2014 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
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information,
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
ISO
9001:2008
Registered
1-2
QII5V1
2014.12.15
Contains
To Edit
Format
Project file
Project
settings
Project
database
Compilation results
Timing
constraints
Clock properties,
exceptions, setup/hold
Program
ming files
Device programming
image and information
Project
library
.qsf(project)
EDA tool
files
quartus2.ini (global)
Archive files Complete project as single Project > Archive Project Quartus II Archive File (.qar)
compressed file
Altera Corporation
QII5V1
2014.12.15
1-3
View and modify the design hierarchy (right-click > Set as Top-Level Entity)
Set the project revision (right-click > Set Current Revision)
View and update logic design files and constraint files (right-click > Open)
Update IP component version information (right-click > Upgrade IP Component)
Analyze the detailed project information in these reports to determine correct implementation. Rightclick report data to locate and edit the source in project files.
Altera Corporation
1-4
QII5V1
2014.12.15
Related Information
You can suppress display of unimportant messages so they do not obscure valid messages.
Altera Corporation
QII5V1
2014.12.15
Suppressing Messages
1-5
Suppressing Messages
Altera Corporation
1-6
QII5V1
2014.12.15
The Quartus II Default Settings File (<revision name>_assignment_defaults.qdf) stores initial settings
and constraints for each new project revision.
Figure 1-6: Settings Dialog Box for Global Project Settings
The Assignment Editor (Tools > Assignment Editor) provides a spreadsheet-like interface for assigning
all instance-specific settings and constraints.
Figure 1-7: Assignment Editor Spreadsheet
Altera Corporation
QII5V1
2014.12.15
1-7
Use Design Space Explorer II (Tools > Launch Design Space Explorer) to find optimal project settings
for resource, performance, or power optimization goals. Design Space Explorer II (DSE) processes your
design using various setting and constraint combinations, and reports the best settings for your design.
DSE II attempts multiple seeds to identify one meeting your requirements. DSE II can run different
compilations on multiple computers in parallel to streamline timing closure.
You can save multiple, named project revisions within your Quartus II project (Project > Revisions).
Altera Corporation
1-8
QII5V1
2014.12.15
Each revision captures a unique set of project settings and constraints, but does not capture any logic
design file changes. Use revisions to experiment with different settings while preserving the original.You
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 II 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 II software creates a new .qsf using the revision name.
To compare each revisions 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-9: Comparing Project Revisions
Click Project > Copy Project to create a separate copy of your project, rather than just a revision within
the same project.
The project copy includes all design files, .qsf(s), and project revisions. Use this technique to optimize
project copies for different applications. For example, optimize one project to interface with a 32-bit data
bus, and optimize a project copy to interface with a 64-bit data bus.
Altera Corporation
QII5V1
2014.12.15
1-9
The Quartus II software includes full-featured schematic and text editors, as well as HDL templates to
accelerate your design work. The Quartus II software supports VHDL Design Files (.vhd), Verilog HDL
Design Files (.v), SystemVerilog (. sv) and schematic Block Design Files (. bdf). The Quartus II 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 projects logic design files in the Project Navigator.
Figure 1-10: Design and IP Files in Project Navigator
Altera Corporation
1-10
QII5V1
2014.12.15
Related Information
Altera Corporation
QII5V1
2014.12.15
1-11
The OpenCore and OpenCore Plus IP evaluation features enable fast acquisition, evaluation, and
hardware testing of Altera IP cores.
You can integrate optimized and verified IP cores into your design to shorten design cycles and maximize
performance. The Quartus II software also supports IP cores from other sources. Use the IP Catalog to
efficiently parameterize and generate a custom IP variation for instantiation in your design.
The Altera IP library includes the following IP core types:
Basic functions
DSP functions
Interface protocols
Memory interfaces and controllers
Processors and peripherals
Note: The IP Catalog (Tools > IP Catalog) and parameter editor replace the MegaWizard Plug-In
Manager for IP selection and parameterization, beginning in Quartus II software version 14.0. Use
the IP Catalog and parameter editor to locate and paramaterize Altera and other supported IP
cores.
Related Information
Altera Corporation
1-12
QII5V1
2014.12.15
Altera's free OpenCore Plus feature allows you to evaluate licensed MegaCore IP cores in simulation and
hardware before purchase. You need only purchase a license for MegaCore IP cores if you decide to take
your design to production. OpenCore Plus supports the following evaluations:
The IP Catalog lists IP cores available for your design. Double-click any IP core to launch the parameter
editor and generate files representing your IP variation. The parameter editor prompts you to specify an
IP variation name, optional ports, and output file generation options. The parameter editor generates a
top-level Qsys system file (.qsys) or Quartus II IP file (.qip) representing the IP core in your project. You
can also parameterize an IP variation without an open project.
Use the following features to help you quickly locate and select an IP core:
Filter IP Catalog to Show IP for active device family or Show IP for all device families.
Search to locate any full or partial IP core name in IP Catalog. Click Search for Partner IP, to access
partner IP information on the Altera website.
Right-click an IP core name in IP Catalog to display details about supported devices, open the IP core's
installation folder, andor view links to documentation.
Altera Corporation
QII5V1
2014.12.15
1-13
Note: 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 II IP Catalog. For more information about using the Qsys IP Catalog, refer
to Creating a System with Qsys in the Quartus II Handbook.
Related Information
The parameter editor helps you to configure IP core ports, parameters, and output file generation options.
Use preset settings in the parameter editor (where provided) to instantly apply preset parameter values
for specific applications.
View port and parameter descriptions, and links to documentation.
Generate testbench systems or example designs (where provided).
Altera Corporation
1-14
QII5V1
2014.12.15
Legacy parameter
editors
The IP Catalog automatically displays Altera IP cores found in the project directory, in the Altera
installation directory, and in the defined IP search path. The IP Catalog can include Altera-provided IP
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. The Quartus
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, or a reference to other
directories to search. In general, .ipx files facilitate faster searches.
The Quartus 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 an _hw.tcl or .ipx file.
In the following list of search locations, a recursive descent is annotated by **. A single * signifies any file.
Table 1-2: IP Search Locations
Location
Description
PROJECT_DIR/*
PROJECT_DIR/ip/**/*
Altera Corporation
QII5V1
2014.12.15
1-15
If the Quartus 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 in the
Quartus Settings File ( .qsf) 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 refresh your system by clicking File > Refresh
to update the IP Catalog.
You can use the following settings to control how the Quartus software manages IP cores in your project.
Altera Corporation
1-16
QII5V1
2014.12.15
Description
Altera Corporation
QII5V1
2014.12.15
1-17
5. Specify output file generation options, and then click Generate. The IP variation files generate
according to your specifications.
6. To generate a simulation testbench, click Generate > Generate Testbench System.
7. To generate an HDL instantiation template that you can copy and paste into your text editor, click
Generate > HDL Example.
8. Click Finish. The parameter editor adds the top-level .qsys file to the current project automatically. If
you are prompted to manually add the .qsys file to the project, click Project > Add/Remove Files in
Project to add the file.
9. After generating and instantiating your IP variation, make appropriate pin assignments to connect
ports.
Figure 1-16: IP Parameter Editor
View IP port
and parameter
details
The Quartus software generates the following IP core output file structure.
Altera Corporation
1-18
QII5V1
2014.12.15
<project directory>
<your_ip>
<your_ip> n
<testbench>_tb
IP variation files
IP variation files
testbench system
<your_ip>_tb.qsys
Testbench system file
<testbench>_tb
testbench files
<your_testbench>_tb.csv
<your_testbench>_tb.spd
sim
simulation files
synth
Simulation files
IP synthesis files
<your_ip>.v or .vhd
Top-level simulation file
<ip subcores> n
Subcore libraries
<your_ip>.v or .vhd
Top-level IP synthesis file
synth
Subcore
synthesis files
sim
Subcore
Simulation files
<HDL files>
<HDL files>
Description
<my_ip>.qsys
<system>.sopcinfo
Altera Corporation
QII5V1
2014.12.15
File Name
1-19
Description
<my_ip>.cmp
<my_ip>.html
<my_ip>_generation.rpt
<my_ip>.debuginfo
<my_ip>.qip
<my_ip>.csv
<my_ip>.bsf
<my_ip>.spd
<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 black-box (_bb.v) file as an empty module
declaration for use as a black box.
<my_ip>.sip
<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.
<my_ip>.regmap
Altera Corporation
1-20
QII5V1
2014.12.15
File Name
<my_ip>.svd
Description
<my_ip>.v
or
<my_ip>.vhd
mentor/
aldec/
/synopsys/vcs
/synopsys/vcsmx
/cadence
/submodules
<child IP cores>/
For each generated child IP core directory, Qsys generates /synth and /
sim sub-directories.
Altera Corporation
QII5V1
2014.12.15
1-21
Legacy parameter
editors
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.
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: 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.
The Quartus software generates one of the following output file structures for Altera IP cores that use a
legacy parameter editor.
Altera Corporation
1-22
QII5V1
2014.12.15
Notes:
1. If supported and enabled for your IP variation
2. If functional simulation models are generated
3. Ignore this directory
Note: To manually add an IP variation to a Quartus 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.
Altera Corporation
QII5V1
2014.12.15
1-23
Usage
Description
Required
--synthesis=<VERILOG|VHDL>
Optional
--block-symbol-file
Optional
--simulation=<VERILOG|VHDL>
Optional
--testbench=<SIMPLE|STANDARD>
Optional
--testbench-simulation=<VERILOG|VHDL>
Optional
--search-path=<value>
Optional
--jvm-max-heap-size=<value>
Optional
Altera Corporation
1-24
QII5V1
2014.12.15
Modifying an IP Variation
Option
Usage
Description
--family=<value>
Optional
--part=<value>
Optional
--allow-mixed-language-simulation
Optional
Modifying an IP Variation
You can easily modify the parameters of any Altera IP core variation in the parameter editor to match
your design requirements. Use any of the following methods to modify an IP variation in the parameter
editor.
Table 1-6: Modifying an IP Variation
Menu Command
Action
Upgrading IP Cores
IP core variants generated with a previous version of the Quartus II software may require upgrading
before use in the current version of the Quartus II software. Click Project > Upgrade IP Components to
identify and upgrade IP core variants.
The Upgrade IP Components dialog box provides instructions when IP upgrade is required, optional, or
unsupported for specific IP cores in your design. You must upgrade IP cores that require it before you can
compile the IP variation in the current version of the Quartus II software. Many Altera IP cores support
automatic upgrade.
The upgrade process renames and preserves the existing variation file (.v, .sv, or .vhd) as <my_variant>_
BAK.v, .sv, .vhd in the project directory.
Altera Corporation
QII5V1
2014.12.15
Upgrading IP Cores
1-25
Corrective Action
Required Upgrade IP
Components
You must upgrade the IP variation before compiling in the current version of
the Quartus II software.
Optional Upgrade IP
Components
Upgrade is optional for this IP variation in the current version of the Quartus
II 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.
Upgrade Unsupported
Altera Corporation
1-26
QII5V1
2014.12.15
Upgrading IP Cores
Displays upgrade
status for all IP cores
in the Project
Double-click to
individually migrate
Checked IP cores
support Auto Upgrade
Successful
Auto Upgrade
Upgrade
unavailable
To simultaneously upgrade multiple IP cores that support auto-upgrade, type the following
command:
quartus_sh ip_upgrade variation_files <my_ip_filepath/my_ip1>.<hdl>;
<my_ip_filepath/my_ip2>.<hdl> <qii_project>
Example:
quartus_sh -ip_upgrade -variation_files "mega/pll_tx2.v;mega/pll3.v"
hps_testx
Note: IP cores older than Quartus II software version 12.0 do not support upgrade.
Altera verifies that the current version of the Quartus II software compiles the
previous version of each IP core. The Altera IP Release Notes reports any verifica
tion exceptions for Altera IP cores. Altera does not verify compilation for IP cores
older than the previous two releases.
Altera Corporation
QII5V1
2014.12.15
1-27
Related Information
Altera Corporation
1-28
QII5V1
2014.12.15
You can use the functional simulation model and the testbench or example design generated with your IP
core for simulation. The functional simulation model and testbench files are generated in a project
subdirectory. This directory may also include scripts to compile and run the testbench. For a complete list
of models or libraries required to simulate your IP core, refer to the scripts generated with the testbench.
You can use the Quartus II NativeLink feature to automatically generate simulation files and scripts.
NativeLink launches your preferred simulator from within the Quartus II software.
Figure 1-21: Simulation in Quartus II Design Flow
Design Entry
(HDL, Qsys, DSP Builder)
Altera Simulation
Models
Quartus II
Design Flow
Gate-Level Simulation
Fitter
(place-and-route)
RTL Simulation
EDA
Netlist
Writer
Post-synthesis functional
simulation netlist
Post-synthesis
functional
simulation
Post-fit functional
simulation netlist
Post-fit functional
simulation
Post-fit timing
simulation netlist
(Optional)
Post-fit
Post-fit timing
timing
simulation
simulation
(3)
Device Programmer
Note: Post-fit timing simulation is not supported for 28nm and later device archetectures. Altera IP
supports a variety of simulation models, including simulation-specific IP functional simulation
models and encrypted RTL models, and plain text RTL models. These are all cycle-accurate
models. The models support fast functional simulation of your IP core instance using industrystandard VHDL or Verilog HDL simulators. For some cores, only the plain text RTL model is
generated, 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.
Related Information
You can automatically generate simulation scripts to set up supported simulators. These scripts compile
the required device libraries and system design files in the correct order, and then elaborate or load the
top-level design for simulation. You can also use scripts to modify the top-level simulation environment,
Altera Corporation
QII5V1
2014.12.15
1-29
independent of IP simulation files that are replaced during regeneration. You can modify the scripts to set
up supported simulators.
Use the NativeLink feature to generate simulation scripts to automate simulation steps. You can reuse
these generated files and simulation scripts in a custom simulation flow. NativeLink optionally generates
scripts for your simulator in the project subdirectory.
1.
2.
3.
4.
5.
Mentor Graphics
ModelSim
QuestaSim
Simulation File
Use
/simulation/modelsim/<my_ip>.do
Synopsys VCS
/simulation/modelsim/<revision name>
_<rtl or gate>.vcs
Synopsys
VCS MX
/simulation/scsim/<revision name>_
vcsmx_<rtl or gate>_<verilog or vhdl>
.tcl
Cadence Incisive
(NC SIM)
/simulation/ncsim/<revision name>_
ncsim_<rtl or gate>_<verilog or vhdl>
.tcl
Altera Corporation
1-30
QII5V1
2014.12.15
When you specify multiple .spd files, the ip-make-simscript utility generates a single simulation script
containing all required simulation information. The default value of TOP_LEVEL_NAME is the
TOP_LEVEL_NAME defined in the IP core or Qsys .spd file.
Set appropriate variables in the script, or edit the variable assignment directly in the script. If the
simulation script is a Tcl file that is sourced in the simulator, set the variables before sourcing the script. If
the simulation script is a shell script, pass in the variables as command-line arguments to the shell script.
To run ip-make-simscript, type the following at the command prompt:
<Quartus installation path>\quartus\sopc_builder\bin\ip-make-simscript
Description
Status
--output-directory=<directory>
--compile-to-work
--use-relative-paths
Optio
nal
Optio
nal
QII5V1
2014.12.15
1-31
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 II 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 II project.
Related Information
Verilog HDL ALTFP_MULT in Top-Level Module with One Input Connected to Multiplexer.
module MF_top (a, b, sel, datab, clock, result);
input [31:0] a, b, datab;
input clock, sel;
output [31:0] result;
wire [31:0] wire_dataa;
assign wire_dataa = (sel)? a : b;
altfp_mult inst1
(.dataa(wire_dataa), .datab(datab), .clock(clock), .result(result));
defparam
inst1.pipeline = 11,
inst1.width_exp = 8,
inst1.width_man = 23,
inst1.exception_handling = "no";
endmodule
(
pipeline => 11,
Altera Corporation
1-32
QII5V1
2014.12.15
Related Information
Altera Corporation
QII5V1
2014.12.15
1-33
Project Filesproject settings (. qsf), design files, and timing constraints (.sdc).
HardwareCPU architecture, not including hard disk or memory size differences. Windows XP x32
results are not identical to Windows XP x64 results. Linux x86 results is not identical to Linux x86_64.
Quartus II Software Versionincluding build number and installed patches. Click Help > About to
obtain this information.
Operating SystemWindows or Linux operating system, excluding version updates. For example,
Windows XP, Windows Vista, and Windows 7 results are identical. Similarly, Linux RHEL, CentOS 4,
and CentOS 5 results are identical.
Related Information
Quartus II Incremental Compilation for Hierarchical and Team-Based Design on page 3-1
Design Planning for Partial Reconfiguration on page 4-1
The Partial Reconfiguration (PR) feature in the Quartus II software allows you to reconfigure a portion of
the FPGA dynamically, while the remainder of the device continues to operate. The Quartus II software
Altera Corporation
1-34
QII5V1
2014.12.15
To save the compilation results in a version-compatible format for migration to a later version of the
Quartus II software, follow these steps:
1. Open the project for migration in the original version of the Quartus II software.
2. Generate the project database and netlist with one of the following:
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.
4. In a later version of the Quartus II software, click New Project Wizard and create a new project with
the same top-level design entity name as the migrated project.
5. Click Project > Import Database and select the <project directory> /export_db/exported database
directory. The Quartus II software opens the compiled project and displays compilation results.
Note: You can turn on Assignments > Settings > Compilation Process Settings > Export versioncompatible database if you want to always export the database following compilation.
Figure 1-23: Quartus II Version-Compatible Database Structure
To clean the project database and remove all prior compilation results, follow these steps:
Altera Corporation
QII5V1
2014.12.15
Archiving Projects
1-35
Archiving Projects
You can save the elements of a project in a single, compressed Quartus II Archive File (. qar) by clicking
Project > Archive Project.
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 II 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 II software, you must include the original .qdf in the archive to preserve original compilation
results.
1.
2.
3.
4.
5.
Click Project > Archive Project and specify the archive file name.
Click Advanced.
Select the File set for archive or select Custom. Turn on File subsets for archive.
Click Add and select Qsys system or EDA tool files. Click OK.
Click Archive.
You can include compilation results in a project archive to avoid recompilation and preserve original
results in the restored project. To archive compilation results, export the post-synthesis or post-fit version
compatible database and include this file in the archive.
1.
2.
3.
4.
5.
When archiving projects for an Altera service request, include all of the following file types for proper
debugging by Altera Support:
Altera Corporation
1-36
QII5V1
2014.12.15
To quickly identify and include appropriate archive files for an Altera service request:
1. Click Project > Archive Project and specify the archive file name.
2. Click Advanced.
3. In File set, select Service Request to include files for Altera Support.
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-24: Archiving Project for Service Request
Include the following Quartus project file types in external revision control systems:
Altera Corporation
QII5V1
2014.12.15
1-37
You can generate or modify these files manually if you use a scripted design flow. If you use an external
source code control system, you can check-in project files anytime you modify assignments and settings
in the Quartus software.
Consider the following file naming differences when migrating projects across operating systems:
Altera Corporation
1-38
QII5V1
2014.12.15
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.
Altera Corporation
QII5V1
2014.12.15
1-39
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
based_on (optional)
Description
copy_results
set_current (optional)
Altera Corporation
1-40
QII5V1
2014.12.15
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.
Altera Corporation
QII5V1
2014.12.15
1-41
Tcl Scripting
CommandLine Scripting
Quartus Settings File Manual
Altera Corporation
1-42
QII5V1
2014.12.15
Version
Changes
2014.12.15
14.1.0
2014.08.18
14.0a10.0
2014.06.30
14.0.0
November 2013
13.1.0
May 2013
13.0.0
June 2012
12.0.0
November 2011
10.1.1
Template update.
December 2010
10.1.0
Related Information
Altera Corporation
QII5V1
Subscribe
Send Feedback
functions to drive interfaces, you can use a UART interface with a Nios II processor inside the FPGA
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.
2014 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
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information,
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
ISO
9001:2008
Registered
2-2
QII5V1
2014.06.30
Related Information
Intellectual Property
For descriptions of available IP cores.
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.
Altera Corporation
QII5V1
2014.06.30
Device Selection
2-3
Related Information
Device Selection
The device you choose affects board specification and layout. This section provides guidelines in the
device selection process.
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 also has a device handbook, 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 II 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 II 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 II
software, which can significantly affect the resource utilization and timing performance of your design.
Related Information
Altera Corporation
2-4
QII5V1
2014.06.30
move to a larger device if necessary to meet your design requirements. Other designers may prototype
their design in a larger device to reduce optimization time and achieve timing closure more quickly, and
then migrate to a smaller device after prototyping. If you want the flexibility to migrate your design, you
must specify these migration options in the Quartus II software at the beginning of your design cycle.
Selecting a migration device impacts pin placement because some pins may serve different functions in
different device densities or package sizes. If you make pin assignments in the Quartus II software, the Pin
Migration View in the Pin Planner highlights pins that change function between your migration devices.
Related Information
Configuration Handbook
For more details about configuration options.
Estimating Power
You can use the Quartus II 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:
Thermalensure 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 supplyensure that the power supplies provide adequate current to support device operation.
Altera Corporation
QII5V1
2014.06.30
2-5
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 II software to generate device
resource information for your design.
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 II 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 II 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 II software provides an accurate
estimation of power, ensuring that thermal and supply limitations are met.
Related Information
Altera Corporation
2-6
QII5V1
2014.06.30
Early in the design process, before creating the source code, the system architect has information about
the standard I/O interfaces (such as memory and bus interfaces), the IP cores in your design, and any
other I/O-related assignments defined by system requirements. You can use this information with the
Early Pin Planning feature in the Pin Planner to specify details about the design I/O interfaces. You can
then create a top-level design file that includes all I/O information.
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 II software. When you complete initial pin planning, you can create a
revision based on the Quartus II-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 II
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 II
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 II 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 II 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
Altera Corporation
QII5V1
2014.06.30
2-7
Synthesis Tool
The Quartus II 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 II 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 II software to get accurate timing analysis and logic utilization
results.
The synthesis tool you choose may allow you to create a Quartus II 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 II 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.
Altera Corporation
2-8
QII5V1
2014.06.30
Simulation Tool
Related Information
Simulation Tool
Altera provides the Mentor Graphics ModelSim -Altera Starter Edition with the Quartus II 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 II software can generate both functional
and timing netlist files for ModelSim and other third-party simulators.
Use the simulator version that your Quartus II software version supports for best results. You must also
use the model libraries provided with your Quartus II software version. Libraries can change between
versions, which might cause a mismatch with your simulation netlist.
Related Information
Volume 3: Verification
For more information about formal verification flows and the supported tools
Altera Corporation
QII5V1
2014.06.30
2-9
If you intend to use any of these tools, you may have to plan for the tools when developing your system
board, Quartus II project, and design. Consider the following debugging requirements when you plan
your design:
JTAG connectionsrequired to perform in-system debugging with JTAG tools. Plan your system and
board with JTAG ports that are available for debugging.
Additional logic resourcesrequired 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 memoryrequired 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 pinsrequired 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 coderequired if your debugging tool uses an Altera IP core.
Instantiate the SignalTap II Logic Analyzer IP corerequired 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. You can add the 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
ap II
Console
Logic
Analyze
r
InLogic
SignalP
System Analyze
robe
Memory
r
Interfac
Content
e
Editor
(LAI)
InSystem
Sources
Virtual
JTAG IP
Core
and
Probes
JTAG connections
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Related Information
Altera Corporation
2-10
Design Recommendations
QII5V1
2014.06.30
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 II 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.
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
Altera Corporation
QII5V1
2014.06.30
Managing Metastability
2-11
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 frequentlytoggling data signals to reduce the chance of a metastability failure.
You can use the Quartus II 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 II 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
Quartus II Incremental Compilation for Hierarchical and Team-Based Design on page 3-1
For information about using the incremental compilation flow methodology in the Quartus II
software.
Altera Corporation
2-12
QII5V1
2014.06.30
can use debugging tools in an incremental design flow, such as the SignalTap II Logic Analyzer, but you
do not specify any design partitions to preserve design hierarchy during compilation.
The flat compilation flow is easy to use; you do not have to plan any design partitions. However, because
the Quartus II 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.
Quartus II Incremental Compilation for Hierarchical and Team-Based Design on page 3-1
For more information about support for Quartus II incremental compilation.
Altera Corporation
QII5V1
2014.06.30
2-13
partition that can be optimized independently. When you specify the design partitions, you can use the
Incremental Compilation Advisor to ensure that partitions meet Alteras recommendations.
If you have timing-critical partitions that are changing through the design flow, or partitions exported
from another Quartus II project, you can create design floorplan assignments to constrain the placement
of the affected partitions. Good partition and floorplan design helps partitions meet top-level 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
For detailed guidelines about creating design partitions and organizing your source code, as well as
information about when and how to create floorplan assignments .
Analyzing and Optimizing the Design Floorplan
For more information about creating floorplan assignments in the Chip Planner .
Altera Corporation
2-14
QII5V1
2014.06.30
Version
Changes
2014.06.30 14.0.0
Updated format.
November
2013
13.1.0
November, 12.1.0
2012
June 2012
12.0.0
Editorial update.
November
2011
11.0.1
Template update.
May 2011
11.0.0
December
2010
10.1.0
Altera Corporation
QII5V1
2014.06.30
Date
Version
Changes
July 2010
10.0.0
November
2009
9.1.0
March
2009
9.0.0
No change to content
November
2008
8.1.0
2-15
Altera Corporation
2-16
QII5V1
2014.06.30
Date
May 2008
Version
8.0.0
Changes
Organization changes
Added Creating Design Specifications section
Added reference to new details in the In-System Design Debugging
section of volume 3
Added more details to the Design Practices and HDL Coding Styles
section
Added references to the new Best Practices for Incremental Compila
tion and Floorplan Assignments chapter
Added reference to the Quartus II Language Templates
Related Information
Altera Corporation
QII5V1
Subscribe
Send Feedback
2014 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
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information,
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
ISO
9001:2008
Registered
3-2
QII5V1
2014.12.15
Related Information
The Quartus II software has incremental compilation features available even when you do not partition
your design, including Smart Compilation, Rapid Recompile, and incremental debugging. These features
work in either an incremental or flat compilation flow.
During the debugging stage of the design cycle, you can add the SignalTap II Logic Analyzer to your
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.
Related Information
Altera Corporation
QII5V1
2014.12.15
3-3
If you use the incremental compilation feature at any point in your design flow, it is easier to accommo
date the guidelines for partitioning a design and creating a floorplan if you start planning for incremental
compilation at the beginning of your design cycle.
Incremental compilation is recommended for large designs and high resource densities when preserving
results is important to achieve timing closure. The incremental compilation feature also facilitates teambased design flows that allow designers to create and optimize design blocks independently, when
necessary.
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 II 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
(1)
Performance Preservation
Quartus II 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 compilation time if
runtime is dominated by those operations.
Altera Corporation
3-4
QII5V1
2014.12.15
Characteristic
Area Changes
The area (logic resource utilization) might increase because crossboundary optimizations are limited, and placement and register packing
are restricted.
fMAX Changes
Altera Corporation
QII5V1
2014.12.15
3-5
VHDL
(.vhd)
Block
Design File
(.bdf)
AHDL
(.tdf)
EDIF
Netlist
(.edf)
VQM
Netlist
(.vqm)
Partition Top
Design Partition
Assignments
Partition 1
Partition 2
(1)
Analysis & Synthesis
Synthesize Changed Partitions,
Preserve Others
Settings &
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
Partition
Assembler
in parallel
Floorplan
Location
Assignments
Settings &
Assignments
Timing
Analyzer
Requirements
Satisfied?
No
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.
Analysis and Synthesis Stage
The figure above shows a top-level partition and two lower-level partitions. If any part of the design
changes, Analysis and Synthesis processes the changed partitions and keeps the existing netlists for the
Altera Corporation
3-6
QII5V1
2014.12.15
unchanged partitions. After completion of Analysis and Synthesis, there is one post-synthesis netlist for
each partition.
Partition Merge Stage
The Partition Merge step creates a single, complete netlist that consists of post-synthesis netlists, post-fit
netlists, and netlists exported from other Quartus II projects, depending on the netlist type that you
specify 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 II 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.
How to Compare Incremental Compilation Results with Flat Design Results
If you define partitions, but want to check your compilation results without partitions in a what if
scenario, you can direct the Compiler to ignore all partitions assignments in your project and compile the
design as a "flat" netlist. When you turn on the Ignore partitions assignments during compilation
option on the Incremental Compilation page, the Quartus II software disables all design partition
assignments in your project and runs a full compilation ignoring all partition boundaries and netlists.
Turning off the Ignore partitions assignments during compilation option restores all partition
assignments and netlists for subsequent compilations.
Related Information
In a team-based environment, part of your design may be incomplete because it is being developed
elsewhere. The project lead or system architect can create empty placeholders in the top-level design for
partitions that are not yet complete. Designers or IP providers can create and verify HDL code separately,
and then the project lead later integrates the code into the single top-level Quartus II project. In this
scenario, you can add the completed partitions to the design incrementally, however, the design flow
allows all design optimization to occur in the top-level design for easiest design integration. Altera
recommends using a single Quartus II project whenever possible because using multiple projects can add
significant up-front and debugging time to the development cycle.
Alternatively, partition designers can design their partition in a copy of the top-level design or in a
separate Quartus II project. Designers export their completed partition as either a post-synthesis netlist or
Altera Corporation
QII5V1
2014.12.15
3-7
optimized placed and routed netlist, or both, along with assignments such as LogicLock regions, as
appropriate. The project lead then integrates each design block as a design partition into the top-level
design. Altera recommends that designers export and reuse post-synthesis netlists, unless optimized postfit results are required in the top-level design, to simplify design optimization.
Additional Planning Needed
Teams with a bottom-up design approach often want to optimize placement and routing of design
partitions independently and may want to create separate Quartus II projects for each partition. However,
optimizing design partitions in separate Quartus II projects, and then later integrating the results into a
top-level design, can have the following potential drawbacks that require careful planning:
Achieving timing closure for the full design may be more difficult if you compile partitions independ
ently without information about other partitions in the design. This problem may be avoided by
careful timing budgeting and special design rules, such as always registering the ports at the module
boundaries.
Resource budgeting and allocation may be required to avoid resource conflicts and overuse. Creating a
floorplan with LogicLock regions is recommended when design partitions are developed independ
ently in separate Quartus II projects.
Maintaining consistency of assignments and timing constraints can be more difficult if there are
separate Quartus II projects. The project lead must ensure that the top-level design and the separate
projects are consistent in their assignments.
A unique challenge of team-based design and IP delivery for FPGAs is the fact that the partitions being
developed independently must share a common set of resources. To minimize issues that might arise from
sharing a common set of resources, you can design partitions within a single Quartus II project or a copy
of the top-level design. A common project ensures that designers have a consistent view of the top-level
project framework.
For timing-critical partitions being developed and optimized by another designer, it is important that
each designer has complete information about the top-level design in order to maintain timing closure
during integration, and to obtain the best results. When you want to integrate partitions from separate
Quartus II projects, the project lead can perform most of the design planning, and then pass the top-level
design constraints to the partition designers. Preferably, partition designers can obtain a copy of the toplevel design by checking out the required files from a source control system. Alternatively, the project lead
can provide a copy of the top-level project framework, or pass design information using Quartus IIgenerated design partition scripts. In the case that a third-party designer has no information about the
top-level design, developers can export their partition from an independent project if required.
Related Information
Altera Corporation
3-8
QII5V1
2014.12.15
Repeat as Needed
During Design, Verification,
& Debugging Stages
The first compilation after making partition assignments is a full compilation, and prepares the design for
subsequent incremental compilations. In subsequent compilations of your design, you can preserve
satisfactory compilation results and performance of unchanged partitions with the Netlist Type setting in
the Design Partitions window. The Netlist Type setting determines which type of netlist or source file the
Partition Merge stage uses in the next incremental compilation. You can choose the Source File, PostSynthesis netlist, or Post-Fit netlist.
Altera Corporation
QII5V1
2014.12.15
3-9
Related Information
Specifying the Level of Results Preservation for Subsequent Compilations on page 3-25
You can right-click an instance in the list under the Hierarchy tab in the Project Navigator and use the
sub-menu to create and delete design partitions.
Related Information
The Design Partitions window, available from the Assignments menu, allows you to create, delete, and
merge partitions, and is the main window for setting the netlist type to specify the level of results
preservation for each partition on subsequent compilations.
The Design Partitions window also lists recommendations at the bottom of the window with links to the
Incremental Compilation Advisor, where you can view additional recommendations about partitions. The
Color column indicates the color of each partition as it appears in the Design Partition Planner and Chip
Planner.
You can right-click a partition in the window to perform various common tasks, such as viewing property
information about a partition, including the time and date of the compilation netlists and the partition
statistics.
When you create a partition, the Quartus II software automatically generates a name based on the
instance name and hierarchy path. You can edit the partition name in the Design Partitions Window so
that you avoid referring to them by their hierarchy path, which can sometimes be long. This is especially
useful when using command-line commands or assignments, or when you merge partitions to give the
partition a meaningful name. Partition names can be from 1 to 1024 characters in length and must be
unique. The name can consist of alphanumeric characters and the pipe ( | ), colon ( : ), and underscore
( _ ) characters.
Related Information
The Design Partition Planner allows you to view design connectivity and hierarchy, and can assist you in
creating effective design partitions that follow Alteras guidelines.
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.
Altera Corporation
3-10
QII5V1
2014.12.15
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
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.
Perform the following steps to update a single source file:
1. Apply and save the fix to the HDL source file.
2. On the Assignments menu, open the Design Partitions window.
3. Change the netlist type of each partition, including the top-level entity, to Post-Fit to preserve as much
as possible for the next compilation.
Altera Corporation
QII5V1
2014.12.15
3-11
The Quartus II software recompiles partitions by default when changes are detected in a source file.
You can refer to the Partition Dependent Files table in the Analysis and Synthesis report to
determine which partitions were recompiled. If you change an assignment but do not change the
logic in a source file, you can set the netlist type to Source File for that partition to instruct the
software to recompile the partition's source design files and its assignments.
4. Click Start Compilation to incrementally compile the fixed HDL code. This compilation should take
much less time than the initial full compilation.
5. Simulate the design to ensure that the error is fixed, and use the TimeQuest Timing Analyzer report to
ensure that timing results have not degraded.
Related Information
Altera Corporation
3-12
QII5V1
2014.12.15
Use this flow to compile a timing-critical partition or partitions in isolation, optionally with extra
optimizations turned on. After timing closure is achieved for the critical logic, you can preserve its
content and placement and compile the remaining partitions with normal or reduced optimization levels.
For example, you may want to compile an IP block that comes with instructions to perform optimization
before you incorporate the rest of your custom logic.
To implement this design flow, perform the following steps:
1. Partition the design and create floorplan location assignments. For best results, ensure that the toplevel design includes the entire project framework, even if some parts of the design are incomplete and
are represented by an empty wrapper file.
2. For the partitions to be compiled first, in the Design Partitions window, set the netlist type to Source
File.
3. For the remaining partitions, set the netlist type to Empty.
4. To compile with the desired optimizations turned on, click Start Compilation.
5. Check the Timing Analyzer reports to ensure that timing requirements are met. If so, proceed to step
6. Otherwise, repeat steps 4 and 5 until the requirements are met.
6. In the Design Partitions window, set the netlist type to Post-Fit for the first partitions. You can set the
Fitter Preservation Level on the Advanced tab in the Design Partitions Properties dialog box to
Placement to allow more flexibility during routing if exact placement and routing preservation is not
required.
7. Change the netlist type from Empty to Source File for the remaining partitions, and ensure that the
completed source files are added to the project.
8. Set the appropriate level of optimizations and compile the design. Changing the optimizations at this
point does not affect any fitted partitions, because each partition has its netlist type set to Post-Fit.
9. Check the Timing Analyzer reports to ensure that timing requirements are met. If not, make design or
option changes and repeat step 8 and step 9 until the requirements are met.
The flow in this example is similar to design flows in which a module is implemented separately and is
later merged into the top-level. Generally, optimization in this flow works only if each critical path is
contained within a single partition. Ensure that if there are any partitions representing a design file that is
missing from the project, you create a placeholder wrapper file to define the port interface.
Related Information
Altera Corporation
QII5V1
2014.12.15
3-13
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 partitions 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
The Quartus II software can partition your design into safety partitions and standard partitions, but the
Quartus II software does not perform any online safety-related functionality. The Quartus II software
generates a bitstream that performs the safety functions. For the purpose of compliance with a functional
safety standard, the Quartus II software should be considered as an offline support tool.
The functional safety separation flow consists of two separate work flows. The design creation flow and
the design modification flow both use incremental compilation, but the two flows have different use-case
scenarios.
Altera Corporation
3-14
QII5V1
2014.12.15
Design activity
entry point
no
no
New Design?
yes
yes
Safety IP Change?
Design
Modification
Flow
Design
Creation
Flow
Design
Creation
Flow
Altera Corporation
QII5V1
2014.12.15
3-15
Create Safety IP
LogicLock Region
Altera Corporation
3-16
QII5V1
2014.12.15
Related Information
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
Altera Corporation
QII5V1
2014.12.15
3-17
Every safety-related IP component in your design should be implemented in a partition(s) so the safety
IPs are protected from recompilation. The global assignment PARTITION_ENABLE_STRICT_PRESERVATION
is used to identify safety IP in your design.
set_global_assignment -name PARTITION_ENABLE_STRICT_PRESERVATION <ON/OFF> section_id <partition_name>
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.
Quartus II Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
Altera Corporation
3-18
QII5V1
2014.12.15
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
The preservation of the partitions netlist atoms and the atoms placement and routing, in the design
modification flow, is done by setting the netlist type to Post-fit with the Fitter preservation level set to
Placement and Routing Preserved.
In order to fix the safety IP logic into specific areas of the device, you should define LogicLock regions. By
using preserved LogicLock regions, device placement is reserved for the safety IP to prevent standard logic
from being placed into the unused resources of the safety IP region. You establish a fixed size and origin
to ensure location preservation. You need to use LogicLock to ensure a valid safety IP POF mask is
generated when you turn on the functional safety separation flow. The POF comparison tool for
functional safety can check that the safety region is unchanged between compiles. A LogicLock region
assigned to a safety IP can only contain safety IP logic.
You can use a global assignment to specify that a pin is assigned to a safety IP.
set_instance_assignment -name ENABLE_STRICT_PRESERVATION ON/OFF -to <hpath> section_id <region_name>
Altera Corporation
QII5V1
2014.12.15
3-19
When you have the functional safety separation flow turned on, the Quartus II software displays safety IP
and standard IP information in the Fitter report.
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:
The Programmer generates a bitstream file containing only the bits for a safety IP. This partial preserved
bitstream (.ppb) file is for the safety IP region mask. The command lines to generate the partial bitstream
file are the following:
Altera Corporation
3-20
QII5V1
2014.12.15
turned on when you generate the .qxp file for each safety IP. The .qxp files should be archived along with
the partial bitstream files for use in later design modification flow compiles.
Safety IP Partition Import
You can import a previously exported safety IP partition into your Quartus II project. There are two usecases for this.
(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 II software version, you can import
the .qxp into a future Quartus II software release.
To import a previously exported design partition, use the Design Partitions window and import the .qxp.
Related Information
There is a separate safe/standard partitioning verification tool that is licensed to safety users. Along with
the .ppb file, a .md5.sign file is generated. The MD5 hash signature can be used for verification. For more
detailed verification, the POF comparison tool should be used. This POF comparison tool is available in
the Altera Functional Safety Data Package.
Altera Corporation
QII5V1
2014.12.15
3-21
illustrated with different colored shading. The top-level partition, called Top, automatically contains the
top-level entity in the design, and contains any logic not defined as part of another partition. The design
file for the top level may be just a wrapper for the hierarchical instances below it, or it may contain its own
logic. In this example, partition B contains the logic in instances B, D, and E. Entities F and G were first
identified as separate partitions, and then merged together to create a partition F-G. The partition for the
top-level entity A, called Top, includes the logic in one of its lower-level instances, C, because C was not
defined as part of any other partition.
Figure 3-6: Partitions in a Hierarchical Design
Representation i
Partition Top
A
Partition B
Representation ii
A
C
B
D
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.
Quartus II Incremental Compilation for Hierarchical and Team-Based Design
Send Feedback
Altera Corporation
3-22
QII5V1
2014.12.15
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 lowerlevel 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.
You can improve the optimizations performed between design partitions by turning on supported crossboundary optimizations. These optimizations are turned on a per partition basis and you can select the
optimizations as individual assignments. This allows the cross-boundary optimization feature to give you
more control over the optimizations that work best for your design. You can turn on the cross-boundary
optimizations for your design partitions on the Advanced tab of the Design Partition Properties dialog
box. Once you change the optimization settings, the Quartus II 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.
Altera Corporation
QII5V1
2014.12.15
3-23
Cross-boundary optimizations are implemented top-down from the parent partition into the child
partition, but not vice-versa. Also, cross-boundary optimizations cannot be enabled for partitions that
allow multiple personas (partial reconfiguration partitions).
Related Information
Best Practices for Incremental Compilation Partitions and Floorplan Assignments documentation on
page 14-1
The Synplify Pro and Synplify Premier software include the MultiPoint synthesis feature to perform
incremental synthesis for each design block assigned as a Compile Point in the user interface or a script.
The Precision RTL Plus software includes an incremental synthesis feature that performs block-based
synthesis based on Partition assignments in the source HDL code. These features provide automated
block-based incremental synthesis flows and create different output netlist files for each block when set up
for an Altera device.
Altera Corporation
3-24
QII5V1
2014.12.15
Using incremental synthesis within your synthesis tool ensures that only those sections of a design that
have been updated are resynthesized when the design 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 of the design.
Related Information
You can also partition your design and create different netlist files manually with the basic Synplify
software (non-Pro/Premier), the basic Precision RTL software (non-Plus), or any other supported
synthesis tool by creating a separate project or implementation for each partition, including the top level.
Set up each higher-level project to instantiate the lower-level VQM/EDIF netlists as black boxes. Synplify,
Precision, and most synthesis tools automatically treat a design block as a black box if the logic definition
is missing from the project. Each tool also includes options or attributes to specify that the design block
should be treated as a black box, which you can use to avoid warnings about the missing logic.
After compilation, you can view statistics about design partitions in the Partition Merge Partition
Statistics report, and on the Statistics tab in the Design Partitions Properties dialog box.
The Partition Merge Partition Statistics report lists statistics about each partition. The statistics for each
partition (each row in the table) include the number of logic cells it contains, as well as the number of
input and output pins it contains, and how many are registered or unconnected.
You can also view post-compilation statistics about the resource usage and port connections for a
particular partition on the Statistics tab in the Design Partition Properties dialog box.
Related Information
Best Practices for Incremental Compilation Partitions and Floorplan Assignments documentation
on page 14-1
You can generate a Partition Timing Overview report and a Partition Timing Details report by clicking
Report Partitions in the Tasks pane in the TimeQuest Timing Analyzer, or using the
report_partitions Tcl command.
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 worstcase 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.
Altera Corporation
QII5V1
2014.12.15
3-25
You can use the Incremental Compilation Advisor to check that your design follows Alteras
recommendations for creating design partitions and floorplan location assignments.
Recommendations are split into General Recommendations, Timing Recommendations, and TeamBased Design Recommendations that apply to design flows in which partitions are compiled independ
ently in separate Quartus II projects before being integrated into the top-level design. Each recommenda
tion provides an explanation, describes the effect of the recommendation, and provides the action
required to make a suggested change. In some cases, there is a link to the appropriate Quartus II settings
page where you can make a suggested change to assignments or settings. For some items, if 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 recommen
dations 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 II 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
3-26
QII5V1
2014.12.15
explains the behavior of the Quartus II software for each setting, and provides guidance on when to use
each setting.
Table 3-2: Partition Netlist Type Settings
Netlist Type
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)
(3)
If you use Rapid Recompile, the Quartus II 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.
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.
Altera Corporation
QII5V1
2014.12.15
Netlist Type
Empty
3-27
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 lowerlevel 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 postfit 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
Altera Corporation
3-28
QII5V1
2014.12.15
Placement
Netlist Only
Related Information
Setting the Netlist Type and Fitter Preservation Level for Design Partitions online help
Altera Corporation
QII5V1
2014.12.15
Deleting Netlists
3-29
If you archive or reproduce the project in another location, you can use a Quartus II Archive File (.qar).
Include the incremental compilation database files to preserve post-synthesis or post-fit compilation
results.
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 II Settings
File (.qxp) for each partition in the design that will be integrated into the top-level design.
Related Information
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
3-30
QII5V1
2014.12.15
The partitions root instance has a different entity binding. In VHDL, an instance may be bound to a
specific entity and architecture. If the target entity or architecture changes, it triggers resynthesis.
The partition has different parameters on its root hierarchy or on an internal AHDL hierarchy (AHDL
automatically inherits parameters from its parent hierarchies). This occurs if you modified the
parameters on the hierarchy directly, or if you modified them indirectly by changing the parameters in
a parent design hierarchy.
You have moved the project and compiled database between a Windows and Linux system. Due to the
differences in the way new line feeds are handled between the operating systems, the internal
checksum algorithm may detect a design file change in this case.
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
The Quartus II software uses an internal checksum algorithm to determine whether the contents of a
source file have changed. Source files are the design description files used to create the design, and include
Memory Initialization Files (.mif) as well as .qxp from exported partitions. When design files in a
partition have dependencies on other files, changing one file may initiate an automatic recompilation of
another file. The Partition Dependent Files table in the Analysis and Synthesis report lists the design files
that contribute to each design partition. You can use this table to determine which partitions are
recompiled when a specific file is changed.
For example, if a design has file A.v that contains entity A, B.v that contains entity B, and C.v that
contains entity C, then the Partition Dependent Files table for the partition containing entity A lists file
A.v, the table for the partition containing entity B lists file B.v, and the table for the partition containing
entity C lists file C.v. Any dependencies are transitive, so if file A.v depends on B.v, and B.v depends on
C.v, the entities in file A.v depend on files B.v and C.v. In this case, files B.v and C.v are listed in the
report table as dependent files for the partition containing entity A.
Note: If you use Rapid Recompile, the Quartus II software might not recompile the entire partition from
the source code as described in this section; it will reuse compatible results if there have been only
small changes to the logic in the partition.
If you define module parameters in a higher-level module, the Quartus II software checks the parameter
values when determining which partitions require resynthesis. If you change a parameter in a higher-level
Altera Corporation
QII5V1
2014.12.15
3-31
module that affects a lower-level module, the lower-level module is resynthesized. Parameter dependen
cies are tracked separately from source file dependencies; therefore, parameter definitions are not listed in
the Partition Dependent Files list.
If a design contains common files, such as an includes.v file that is referenced in each entity by the
command include includes.v, all partitions are dependent on this file. A change to includes.v causes
the entire design to be recompiled. The VHDL statement use work.all also typically results in unneces
sary recompilations, because it makes all entities in the work library visible in the current entity, which
results in the current entity being dependent on all other entities in the design.
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
Forcing the use of a post-compilation netlist when the contents of a source file has changed is
recommended only for advanced users who understand when a partition must be recompiled. You might
use this assignment, for example, if you are making source code changes but do not want to recompile the
partition until you finish debugging a different partition, or if you are adding simple comments to the
source file but you know the design logic itself is not being changed and you want to keep the previous
compilation results.
To force the Fitter to use a previously generated netlist even when there are changes to the source files,
right-click the partition in the Design Partitions window and then click Design Partition Properties. On
the Advanced tab, turn on the Ignore changes in source files and strictly use the specified netlist, if
available option.
Turning on this option can result in the generation of a functionally incorrect netlist when source design
files change, because source file updates will not be recompiled. Use caution when setting this option.
Altera Corporation
3-32
QII5V1
2014.12.15
The exported compilation results of completed partitions are given to the project lead, preferably using a
source control system, who is then responsible for integrating them into the top-level design to obtain a
fully functional design. This type of design flow is required only if partition designers want to optimize
their placement and routing independently, and pass their design to the project lead to reuse placement
and routing results. Otherwise, a project lead can integrate source HDL from several designers in a single
Quartus II project, and use the standard incremental compilation flow described previously.
The figure below illustrates the team-based incremental compilation design flow using a methodology in
which partitions are compiled in separate Quartus II projects before being integrated into the top-level
design. This flow can be used when partitions are developed by other designers or IP providers.
Figure 3-7: Team-Based Incremental Compilation Design Flow
Integrate Partition(s)
into Top-Level Design
Repeat as Needed
During Design, Verification,
& Debugging Stages
Altera Corporation
QII5V1
2014.12.15
3-33
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
3-34
QII5V1
2014.12.15
There are several methods that the project lead can use to distribute the skeleton or top-level project
framework to other partition designers or IP providers.
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 II 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 II 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
Altera Corporation
QII5V1
2014.12.15
3-35
If IP providers or designers on a team want to optimize their design blocks independently and do not have
access to a shared project framework, the project lead must perform some or all of the following tasks to
ensure successful integration of the design blocks:
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 teambased 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 leads 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 II 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 II 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 II
projects.
Related Information
Exporting Partitions
When partition designers achieve the design requirements in their separate Quartus II 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 II 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
Altera Corporation
3-36
QII5V1
2014.12.15
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 II 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
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
Altera Corporation
QII5V1
2014.12.15
3-37
The Quartus II software filters assignments from .qxp files to include appropriate assignments in the toplevel design. The assignments in the .qxp are treated like assignments made in an HDL source file, and are
not listed in the Quartus II Settings File (.qsf) for the top-level design. Most assignments from the .qxp
can be overridden by assignments in the top-level design.
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.
LogicLock Region Assignments
The project lead typically creates LogicLock region assignments in the top-level design for any lower-level
partition designs where designer or IP providers plan to export post-fit information to be used in the toplevel design, to help avoid placement conflicts between partitions. When you use the .qxp as a source file,
LogicLock constraints from the exported partition are applied in the top-level design, but will not appear
in your .qsf file or LogicLock Regions window for you to view or edit. The LogicLock region itself is not
required to constrain the partition placement in the top-level design if the netlist type is set to Post-Fit,
because the netlist contains all the placement information.
Proper license information is required to compile encrypted IP cores. If an IP core is exported as a .qxp
from another Quartus II project, the top-level designer instantiating the .qxp must have the correct
license. The software requires a full license to generate an unrestricted programming file. If you do not
have a license, but the IP in the .qxp was compiled with OpenCore Plus hardware evaluation support, you
can generate an evaluation programming file without a license. If the IP supports OpenCore simulation
only, you can fully compile the design and generate a simulation netlist, but you cannot create
programming files unless you have a full license.
You can use advanced options in the Import Design Partition dialog box to integrate a partition
developed in a separate Quartus II project into the top-level design. The import process adds more
control than using the .qxp as a source file, and is useful only in the following circumstances:
Altera Corporation
3-38
QII5V1
2014.12.15
If you want LogicLock regions in your top-level design (.qsf)If you have regions in your partitions
that are not also in the top-level design, the regions will be added to your .qsf during the import
process.
If you want different settings or placement for different instantiations of the same entityYou can
control the setting import process with the advanced import options, and specify different settings for
different instances of the same .qxp design block.
When you use the Import Design Partition dialog box to integrate a partition into the top-level design,
the import process sets the partitions 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 partitions 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
QII5V1
2014.12.15
3-39
Related Information
Altera Corporation
3-40
QII5V1
2014.12.15
Altera Corporation
QII5V1
2014.12.15
Incorporate IP Core
3-41
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 II 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 II GUI, use the Import Design Partition command.
If you are using command-line executables, run quartus_cdb with the incremental_compilation_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 regions 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
3-42
QII5V1
2014.12.15
2.
3.
4.
5.
and instantiates wrapper files that represent each subdesign by defining only the port interfaces, but
not the implementation.
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.
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.
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.
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 II project framework for each designer. You can use the
Copy Project command on the Project menu or create a project archive.
As the designer of a lower-level design block in this scenario, design and optimize your partition in your
copy of the top-level design, and then follow these steps when you have achieved the desired compilation
results:
Finally, as the project lead in this scenario, perform these steps to integrate the .qxp files received from
designers of each partition:
1. Add the .qxp as a source file in the Quartus II project, to replace any empty wrapper file for the
previously Empty partition.
2. Change the netlist type for the partition from Empty to the required level of results preservation.
Altera Corporation
QII5V1
2014.12.15
3-43
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 II project before sending the design to the project lead. This design flow requires
more planning and careful resource allocation because design blocks are developed independently.
Related Information
Creating Precompiled Design Blocks (or Hard-Wired Macros) for Reuse on page 3-40
Designing in a Team-Based Environment on page 3-41
As the project lead in this scenario, perform the following steps to prepare the top-level design:
1. Create a new Quartus II project to ultimately contain the full implementation of the entire design and
include a skeleton or framework of the design that defines the hierarchy for the subdesigns
implemented by separate designers. The top-level design implements the top-level entity in the design
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 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. 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 specifications.
5. Provide the constraints from the top-level design to partition designers using one of the following
procedures.
Use design partition scripts to pass constraints and generate separate Quartus II projects. On the
Project menu, use the Generate Design Partition Scripts command, or run the script generator
from a Tcl or command prompt. Make changes to the default script options as required for your
project. Altera recommends that you pass all the default constraints, including LogicLock regions,
for all partitions and virtual pin location assignments. If partitions have not already been created by
the other designers, use the partition script to set up the projects so that you can easily take
advantage of makefiles. Provide each partition designer with the Tcl file to create their project with
the appropriate constraints. If you are using makefiles, provide the makefile for each partition.
Use documentation or manually-created scripts to pass all constraints and assignments to each
partition designer.
As the designer of a lower-level design block in this scenario, perform the appropriate set of steps to
successfully export your design, whether the design team is using makefiles or exporting and importing
the design manually.
Altera Corporation
3-44
QII5V1
2014.12.15
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 II 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.
Exporting Without Makefiles
If you are not using makefiles, perform the following steps:
1. If you are using design partition scripts, source the Tcl script provided by the Project Lead to create a
project with the required settings:
To source the Tcl script in the Quartus II software, on the Tools menu, click Utility Windows to
open the Tcl console. Navigate to the scripts 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
2. If you are not using design partition scripts, create a new Quartus II project for the subdesign, and
then apply the following settings and constraints to ensure successful integration:
3.
4.
5.
6.
Make LogicLock region assignments and global assignments (including clock settings) as specified
by the project lead.
Make Virtual Pin assignments for ports which represent connections to core logic instead of
external device pins in the top-level design.
Make floorplan location assignments to the Virtual Pins so they are placed in their corresponding
regions as determined by the top-level design. This provides the Fitter with more information about
the timing constraints between modules. Alternatively, you can apply timing I/O constraints to the
paths that connect to virtual pins.
Proceed to compile and optimize the design as needed.
When you have achieved the desired compilation results, on the Project menu, click Export Design
Partition.
In the Export Design Partition dialog box, choose the netlist(s) to export. You can export a Postsynthesis netlist instead if placement or performance preservation is not required, to provide the most
flexibility for the Fitter in the top-level design. Select Post-fit to preserve the placement and perform
ance of the lower-level design block, and turn on Export routing to include the routing information, if
required. One .qxp can include both post-synthesis and post-fitting netlists.
Provide the .qxp to the project lead.
Finally, as the project lead in this scenario, perform the appropriate set of steps to import the .qxp files
received from designers of each partition.
Altera Corporation
QII5V1
2014.12.15
3-45
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.
Importing Without Makefiles
If you are not using makefiles, perform the following steps:
1. Add the .qxp as a source file in the Quartus II project, to replace any empty wrapper file for the
previously Empty partition.
2. Change the netlist type for the partition from Empty to the required level of results preservation.
When integrating lower-level design blocks, the project lead may notice some assignment conflicts. This
can occur, for example, if the lower-level design block designers changed their LogicLock regions to
account for additional logic or placement constraints, or if the designers applied I/O port timing
constraints that differ from constraints added to the top-level design by the project lead. The project lead
can address these conflicts by explicitly importing the partitions into the top-level design, and using
options in the Advanced Import Settings dialog box. After the project lead obtains the .qxp for each
lower-level design block from the other designers, use the Import Design Partition command on the
Project menu and specify the partition in the top-level design that is represented by the lower-level design
block .qxp. Repeat this import process for each partition in the design. After you have imported each
partition once, you can select all the design partitions and use the Reimport using latest import files at
previous locations option to import all the files from their previous locations at one time. To address
assignment conflicts, the project lead can take one or both of the following actions:
In this variation of the design scenario, one of the lower-level design blocks is instantiated more than once
in the top-level design. The designer of the lower-level design block may want to compile and optimize
the entity once under a partition, and then import the results as multiple partitions in the top-level design.
If you import multiple instances of a lower-level design block into the top-level design, the imported
LogicLock regions are automatically set to Floating status.
Altera Corporation
3-46
QII5V1
2014.12.15
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.
The best way to provide top-level design information to designers of lower-level partitions is to provide
the complete top-level project framework using the following steps:
1. For all partitions other than the one(s) being optimized by a designer(s) in a separate Quartus II
project(s), set the netlist type to Post-Fit.
2. Make the top-level design directory available in a shared source control system, if possible. Otherwise,
copy the entire top-level design project directory (including database files), or create a project archive
including the post-compilation database.
3. Provide each partition designer with a checked-out version or copy of the top-level design.
4. The partition designers recompile their designs within the new project framework that includes the
rest of the design's placement and routing information as well top-level resource allocations and
assignments, and optimize as needed.
5. When the results are satisfactory and the timing requirements are met, export the updated partition as
a .qxp.
If this design flow is not possible, you can generate partition-specific scripts for individual designs to
provide information about the top-level project framework with these steps:
1. In the top-level design, on the Project menu, click Generate Design Partition Scripts, or launch the
script generator from Tcl or the command line.
2. If lower-level projects have already been created for each partition, you can turn off the Create lowerlevel project if one does not exist option.
3. Make additional changes to the default script options, as necessary. Altera recommends that you pass
all the default constraints, including LogicLock regions, for all partitions and virtual pin location
assignments. Altera also recommends that you add a maximum delay timing constraint for the virtual
I/O connections in each partition.
4. The Quartus II software generates Tcl scripts for all partitions, but in this scenario, you would focus on
the partitions that make up the cross-partition critical paths. The following assignments are important
in the script:
Virtual pin assignments for module pins not connected to device I/O ports in the top-level design.
Altera Corporation
QII5V1
2014.12.15
3-47
Location constraints for the virtual pins that reflect the initial top-level placement of the pins
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 II GUI, on the Tools menu, click Utility Windows and
open the Tcl console. Navigate to the scripts 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 toplevel 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
3-48
QII5V1
2014.12.15
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 II software to determine the preliminary
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 II
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 Alteras
guidelines.
Related Information
Altera Corporation
QII5V1
2014.12.15
3-49
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 regions 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 regions 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
Altera Corporation
3-50
QII5V1
2014.12.15
is moved in the top-level design, the relative placement of the nodes is preserved but the routing cannot
be preserved, because the routing connectivity is not perfectly uniform throughout a device.
Altera Corporation
QII5V1
2014.12.15
3-51
Related Information
Altera Corporation
3-52
QII5V1
2014.12.15
The generated scripts include applicable clock information for all clock signals in the top-level design.
Some of those clocks may not exist in the lower-level projects, so you may see warning messages related to
clocks that do not exist in the project. You can ignore these warnings or edit your constraints so the
messages are not generated.
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.
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
When applying constraints with wildcards, note that wildcards are not analyzed across hierarchical
boundaries. For example, an assignment could be made to these nodes: Top|A:inst|B:inst|*, where A
and B are lower-level partitions, and hierarchy B is a child of A, that is B is instantiated in hierarchy A. This
assignment is applied to modules A, B, and all children instances of B. However, the assignment Top|
A:inst|B:inst* is applied to hierarchy A, but is not applied to the B instances because the single level of
hierarchy represented by B:inst* is not expanded into multiple levels of hierarchy. To avoid this issue,
ensure that you apply the wildcard to the hierarchical boundary if it should represent multiple levels of
hierarchy.
When using the wildcard to represent a level of hierarchy, only single wildcards are supported. This
means assignments such as Top|A:inst|*|B:inst|* are not supported. The Quartus II software issues a
warning in these cases.
If a clock in the top level is not directly connected to a pin of a lower-level partition, the lower-level
partition does not receive assignments and constraints from the top-level pin in the design partition
scripts.
This issue is of particular importance for clock pins that require timing constraints and clock group
settings. Problems can occur if your design uses logic or inversion to derive a new clock from a clock
input pin. Make appropriate timing assignments in your lower-level Quartus II project to ensure that
clocks are not unconstrained.
If the lower-level design uses the top-level project framework from the project lead, the design will have
all the required information about the clock and PLL settings. Otherwise, if you use a PLL in your toplevel design and connect it to lower-level partitions, the lower-level partitions do not have information
Altera Corporation
QII5V1
2014.12.15
Pin Assignments for GXB and LVDS Blocks in Design Partition Scripts
3-53
about the multiplication or phase shift factors in the PLL. Make appropriate timing assignments in your
lower-level Quartus II project to ensure that clocks are not unconstrained or constrained with the
incorrect frequency. Alternatively, you can manually duplicate the top-level derived clock logic or PLL in
the lower-level design file to ensure that you have the correct multiplication or phase-shift factors,
compensation delays and other PLL parameters for complete and accurate timing analysis. Create a
design partition for the rest of the lower-level design logic for export to the top level. When the lower-level
design is complete, export only the partition that contains the relevant logic.
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.
Design partition scripts use INPUT_MAX_DELAY and OUTPUT_MAX_DELAY assignments to specify interpartition delays associated with input and output pins, which would not otherwise be visible to the
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 II 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 toplevel 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
3-54
QII5V1
2014.12.15
The Quartus II software does not support creating a partition for any Quartus II internal hierarchy that is
dynamically generated during compilation to implement the contents of an IP core.
Best Practices for Incremental Compilation Partitions and Floorplan Assignments documentation
on page 14-1
Altera Corporation
QII5V1
2014.12.15
Scripting Support
3-55
Scripting Support
You can run procedures and make settings described in this chapter in a Tcl script or at a command-line
prompt.
To create a design partition to a specified hierarchy name, use the following command:
Description
Short help
-long_help
Partition name
To direct the Quartus II Compiler to enable or disable design partition assignments during compilation,
use the following command:
Altera Corporation
3-56
QII5V1
2014.12.15
Description
OFF
ON
To set the Fitter Preservation Level for a post-fit or imported netlist, use the following command:
To preserve high-speed optimization for tiles contained within the selected partition, use the following
command:
Altera Corporation
QII5V1
2014.12.15
Specifying the Software Should Use the Specified Netlist and Ignore Source File
Changes
3-57
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:
Scenario background: You open a project called AB_project, set up two design partitions, entities A and
B, and then perform an initial full compilation.
Scenario background: You have run the initial compilation shown in the example script below. You would
like to apply Fitter optimizations, such as physical synthesis, only to partition A. No changes have been
made to the HDL files. To ensure the previous compilation result for partition B is preserved, and to
ensure that Fitter optimizations are applied to the post-synthesis netlist of partition A, set the netlist type
of B to Post-Fit (which was already done in the initial compilation, but is repeated here for safety), and
the netlist type of A to Post-Synthesis, as shown in the following example:
Altera Corporation
3-58
QII5V1
2014.12.15
Related Information
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:
Altera Corporation
QII5V1
2014.12.15
3-59
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
Version
Changes
2014.12.15
14.1.0
2014.08.18
14.0a10.0
Altera Corporation
3-60
QII5V1
2014.12.15
Date
Version
Changes
June 2014
14.0.0
Dita conversion.
Replaced MegaWizard Plug-In Manager content with IP Catalog
and Parameter Editor content.
Revised functional safety section. Added export and import
sections.
November 2013
13.1.0
November 2012
12.1.0
June 2012
12.0.0
November 2011
11.0.1
Template update.
May 2011
11.0.0
December 2010
10.1.0
July 2010
10.0.0
Altera Corporation
QII5V1
2014.12.15
Date
Version
3-61
Changes
October 2009
9.1.0
March 2009
9.0.0
November 2008
8.1.0
Added new section Importing SDC Constraints from LowerLevel Partitions on page 244
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 210
Related Information
Altera Corporation
QII5V1
Subscribe
Send Feedback
The Partial Reconfiguration (PR) feature in the Quartus II software allows you to reconfigure a portion of
the FPGA dynamically, while the remainder of the device continues to operate. The Quartus II software
Related Information
Terminology
The following terms are commonly used in this chapter.
project: A Quartus II project contains the design files, settings, and constraints files required for the
compilation of your design.
revision: In the Quartus II software, a revision is a set of assignments and settings for one version of your
design. A Quartus II 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.
2014 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
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information,
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
ISO
9001:2008
Registered
4-2
QII5V1
2014.12.15
incremental compilation: This is a feature of the Quartus II 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 II 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 II 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 II Handbook.
PR project: Any Quartus II 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.
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
Altera Corporation
QII5V1
2014.12.15
4-3
Core
Fabric
Transceivers,
PCIe HIP
Transceivers,
PCIe HIP
PLL
CLK
I/O, I/O Registers & Part-Hard Memory PHY
Periphery
Core Fabric
Reconfiguration Mode
Logic Block
Partial Reconfiguration
Partial Reconfiguration
Memory Block
Partial Reconfiguration
Transceivers
PLL
Core Routing
Partial Reconfiguration
Clock Networks
Altera Corporation
4-4
QII5V1
2014.12.15
Reconfiguration Mode
Not supported
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
Chip_top
PR Region A
PR Module A2
PR Module A3
Static
Region
PR Region B
PR Module B1
PR Module B2
Altera Corporation
QII5V1
2014.12.15
SCRUB Mode
4-5
The CRAM bits control individual LABs, MLABs, M20K memory blocks, DSP blocks, and routing
multiplexers in a design. The CRAM bits are organized into a frame structure representing vertical areas
that correspond to specific locations on the FPGA. If you change a design and reconfigure the FPGA in a
non-PR flow, the process reloads all the CRAM bits to a new functionality.
Configuration bitstreams used in a non-PR flow are different than those used in a PR flow. In addition to
standard data and CRC check bits, configuration bitstreams for partial reconfiguration also include
instructions that direct the PR control block to process the data for partial reconfiguration.
The configuration bitstream written into the CRAM is organized into configuration frames. If a LAB
column passes through multiple PR regions, those regions share some programming frames.
SCRUB Mode
In the SCRUB mode, the unchanging CRAM bits from the static region are "scrubbed" back to their
original values. They are neither erased nor reset.
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 PR regions above or below the region being reconfigured. As a
result, it is not currently possible to correctly determine the bits associated with a PR region above or
below the region being reconfigured, because those bits could have already been reconfigured and
changed to an unknown value. This restriction does not apply to static bits above or below the PR region,
since those bits never change and you can rewrite them with the same value as the current state of the
configuration bit. You cannot use the SCRUB mode when two PR regions have a vertically overlapping
column in the device.
The advantage of using the SCRUB mode is that the programming file size is much smaller than the
AND/OR mode.
Figure 4-3: 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
Altera Corporation
4-6
QII5V1
2014.12.15
AND/OR Mode
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.
Figure 4-4: AND/OR Mode
This is the floorplan of a FPGA using AND/OR mode, with two PR regions, with columns that overlap.
Programming Frame(s)
(Vertical Overlap)
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 II 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.
Altera Corporation
QII5V1
2014.12.15
4-7
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 SCRUB mode.
You can control expansion of the routing regions by adding the following two assignments to your
Quartus II 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.
Altera Corporation
4-8
QII5V1
2014.12.15
no
Is Timing Met
for Each Revision?
yes
no
Functionality is
Verified?
yes
Generate
Configuration Files
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. Wellplanned 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.
Altera Corporation
QII5V1
2014.12.15
4-9
Use the following best practice guidelines for designing in the PR flow, which are described in detail in
this section:
Note: PR partitions can contain only core resources, they cannot contain I/O or periphery elements.
Quartus II Incremental Compilation for Hierarchical and Team-Based Design on page 3-1
Altera Corporation
4-10
QII5V1
2014.12.15
This code sample has the component declaration in VHDL, showing the ports of the Stratix V PR control
block and the Stratix V CRC block. In the following example, the PR function is performed from within
the core (code located in Core_Top) and you must add additional ports to Core_Top to connect to both
components.
-- The Stratix V control block interface
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 ;
-- The Stratix V CRC block for diagnosing CRC errors
component stratixv_crcblock is
port(
shiftnld: in STD_LOGIC ;
clk: in STD_LOGIC ;
crcerror: out STD_LOGIC
) ;
end component ;
Altera Corporation
QII5V1
2014.12.15
4-11
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 II 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.
This code example instantiates a PR control block in VHDL, inside your top-level project, Chip_Top:
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
);
//user I/O signal declaration
..
..
//PR interface and configuration signals declaration
input pr_request;
output pr_ready;
output pr_done;
output crc_error;
input dclk;
input [15:0] pr_data;
output init_done
// Following shows the connectivity within the Chip_Top module
Core_Top : Core_Top
port_map (
..
..
);
m_pr : stratixv_prblock
port map(
clk => dclk,
corectl
=> '0', //1 - when using PR from inside
//0 - for PR from pins; You must also enable
// the appropriate option in Quartus II settings
prrequest
=> pr_request,
data
=> pr_data,
error
=> pr_error,
ready
=> pr_ready,
done
=> pr_done
);
m_crc : stratixv_crcblock
port map(
shiftnld=> '1', //If you want to read the EMR register when
Altera Corporation
4-12
QII5V1
2014.12.15
crcerror
);
dummy_clk,
=>
crc_error
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 following example instantiates a PR control block in Verlilog HDL, inside your top-level project,
Chip_Top:
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
);
//user I/O signal declaration
..
..
//PR interface and configuration signals declaration
input pr_request;
output pr_ready;
output pr_done;
output crc_error;
input dclk;
input [15:0] pr_data;
output init_done
// Following shows the connectivity within the Chip_Top module
Core_Top : Core_Top
port_map (
..
..
);
m_pr : stratixv_prblock
//set corectl to '1' when using PR from inside
//set corectl to '0' for PR from pins. You must also enable
// the appropriate option in Quartus II settings.
port map(
clk => dclk,
corectl=> '0',
prrequest=> pr_request,
data=> pr_data,
error=> pr_error,
ready=> pr_ready,
done=> pr_done
);
Altera Corporation
QII5V1
2014.12.15
4-13
m_crc : stratixv_crcblock
//If you want to read the EMR register when an error occurrs, refer to AN539 for
the
//connectivity forthis signal. If you only want to detect CRC errors, but plan
to take no
//further action, you can tie the shiftnld signal to logical high.
port map(
shiftnld=> '1',
clk=> dummy_clk,
crcerror=> crc_error
);
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
Partial 1
Static Region
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:
// Partial Reconfiguration Wrapper in Verilog HDL
module persona_1
(
input reset,
input [2:0] a,
input [2:0] b,
input [2:0] c,
output [3:0] p,
Design Planning for Partial Reconfiguration
Send Feedback
Altera Corporation
4-14
QII5V1
2014.12.15
Altera Corporation
QII5V1
2014.12.15
4-15
User PR_in_freeze
Data2
1
PR Region
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 following example implements a freeze wrapper in Verilog HDL, on a module named pr_module.
module freeze_wrapper
(
input reset,
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;
Design Planning for Partial Reconfiguration
Send Feedback
Altera Corporation
4-16
QII5V1
2014.12.15
The following example implements a freeze wrapper in VHDL, on a module named pr_module.
entity freeze_wrapper is
port( reset:in STD_LOGIC;
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;
architecture behv of freeze_wrapper is
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
signal
signal
signal
signal
signal
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
control_mode_wr <= logic_high when (freeze ='1') else control_mode;
Altera Corporation
QII5V1
2014.12.15
4-17
LAB
Clock, ACLR
RAM
DSP
Clock, ACLR
Note: PR regions are allowed to contain output ports that are used outside of the PR region as global
signals.
Altera Corporation
4-18
QII5V1
2014.12.15
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.
Quartus II Incremental Compilation for Hierarchical and Team-Based Floorplan on page 3-1
Best Practices for Incremental Compilation Partitions and Floorplan on page 14-1
QII5V1
2014.12.15
4-19
Pin Type
Input
Pin Description
PR_READY
Output
PR_DONE
Output
Altera Corporation
4-20
QII5V1
2014.12.15
Pin Name
PR_ERROR
Pin Type
Output
Pin Description
DATA[15:0]
Input
DCLK
Bidirectional
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
Altera Corporation
QII5V1
2014.12.15
4-21
PR Bitstream
file (.rbf) in
external memory
PR
IP Core
PR
Region
External
Host
PR Control
Block (CB)
PR
Region
The PR mode is independent of the full chip programming mode. For example, you can configure the full
chip using a JTAG download cable, or other supported configuration modes. When configuring PR
regions, you must use the FPPx16 interface to the PR control block whether you choose to partially
reconfigure the chip from an external or internal host.
When using an external host, you must implement the control logic for managing system aspects of
partial reconfiguration on an external device. By using an internal host, you can implement all of your
logic necessary for partial reconfiguration in the FPGA, therefore external devices are not required to
support partial reconfiguration. When using an 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 fit the FPPx16 interface on the PR Control Block.
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 II 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
Altera Corporation
4-22
QII5V1
2014.12.15
Reconfiguring a PR Region
From Pins or
FPGA Core
PR_Data[15:0]
PR_done
PR_ready
CRC_error
PR_error
PR_request
Clk
PR Control Block (CB)
corectl
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 devices 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 a system in which your PR Control logic is implemented inside the FPGA.
However, this section is 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.
Altera Corporation
QII5V1
2014.12.15
Reconfiguring a PR Region
4-23
Static Region
PR1
Region
PR2
Region
PR1_Control
PR Control
Block (CB)
PR_Request
PR_Ready, PR_Error,
PR_Done, CRC_Error
PR2_Control
PR Control Logic
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. Send 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_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. Exactly four clock cycles must occur before
sending the PR data to make sure the PR process progresses correctly. Data and clock signals are sent
to the PR control block to partially reconfigure the PR region interface.
3.
4.
5.
6.
If there are multiple PR personas for the PR region, your PR Control IP must determine the
programming file data for partial reconfiguration.
When there are multiple PR regions in the design, then the same PR control IP 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 de-asserts the
PR_READY signal.
If you want to suspend sending data, you can implement logic to pause the clock at any point.
Your PR control logic must de-assert the PR_REQUEST signal within eight clock cycles after the PR_DONE
signal goes high. If your logic does not de-assert the PR_REQUEST signal within eight clock cycles, a new
PR cycle starts.
If your design includes additional PR regions, repeat steps 2 3 for each region. Otherwise, proceed to
step 5.
Your PR Control logic de-asserts 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.
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.
Design Planning for Partial Reconfiguration
Send Feedback
Altera Corporation
4-24
QII5V1
2014.12.15
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 II Handbook.
Related Information
DONE_to_LAST_CLK
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.
The PR host must continuously monitor the PR_DONE and PR_ERROR signals status. 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 reconfiguration 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
Altera Corporation
QII5V1
2014.12.15
4-25
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.
Table 4-4: Partial Reconfiguration Clock Requirements
Signal timing requirements for partial reconfiguration.
Timing Parameters
4 (exact)
20 (minimum)
20 (minimum)
DONE_to_REQ_low
8 (maximum)
4 (exact)
8 (exact)
12 (exact)
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.
Altera Corporation
4-26
QII5V1
2014.12.15
At any time during user-mode, the external host can initiate partial reconfiguration and monitor the
status using the external PR dedicated pins: PR_REQUEST, PR_READY, PR_DONE, and PR_ERROR. In this
mode, the external host must respond appropriately to the hand-shaking signals for a successful partial
reconfiguration. This includes acquiring the data from the flash memory and loading it into the Stratix V
device on DATA[ 15:0].
Figure 4-12: Connecting to an External Host
The connection setup for partial reconfiguration with an external host in the FPPx16 configuration
scheme.
Memory
V CCPGM
V CCPGM
V CCPGM
ADDR DATA[15:0]
10 K W
10 K W
10 K W
Stratix V Device
External Host
(MAX V Device or
Microprocessor)
CONF_DONE
nSTATUS
nCONFIG
nCE
MSEL[4:0]
DATA[15:0]
DCLK
PR_REQUEST
PR_DONE
PR_READY
PR_ERROR
PR_CONTROL
PR_RESET
CRC_ERROR
Altera Corporation
QII5V1
2014.12.15
4-27
Memory
Address
DATA[7:0]
External
DATA[15:0]
Host
PR_REQUEST1
PR_DONE1
PR_READY1
PR_ERROR1
PR_REQUEST
PR_DONE
PR_READY
PR_ERROR
FPGA1
DATA[15:0]
nCE
PR_REQUEST
PR_DONE
PR_READY
PR_ERROR
PR_REQUEST2
PR_DONE2
PR_READY2
PR_ERROR2
FPGA2
DATA[15:0]
nCE
PR_REQUEST5
PR_DONE5
PR_READY5
PR_ERROR5
PR_REQUEST
PR_DONE
PR_READY
PR_ERROR
FPGA5
Altera Corporation
4-28
QII5V1
2014.12.15
FPPx8, FPPx16, or FPPx32. Alternatively, you can use the JTAG interface to configure the FPGA device.
At any time during user-mode, you can initiate partial reconfiguration through the FPGA core fabric
using the PR internal host.
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-14: Connecting to an Internal Host
An example of the configuration setup when performing partial reconfiguration using the internal host.
VCCPGM
VCCPGM
10 KW
10 KW
VCCPGM
10 KW
Stratix V Device
nSTATUS
CONF_DONE
nCONFIG
nCE
MSEL[4:0]
PR
Controller
EPCS
DATA
DCLK
nCS
ASDI
AS_DATA1
DCLK
nCSO
ASDO
User Logic
QII5V1
2014.12.15
4-29
Altera Corporation
4-30
QII5V1
2014.12.15
4 (exact)
80 (minimum)
80 (minimum)
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-35
Enable Bitstream Decryption Option on page 4-36
Generate PR Programming Files with the Convert Programming Files Dialog Box on page 4-33
Altera Corporation
QII5V1
2014.12.15
4-31
Base
Revision with
Persona a
Partial
Reconfiguration
Design
pr_region.msf
static.msf
base.sof
Revision b
Revision c
b.sof
b.msf
c.sof
c.msf
When these individual revisions are compiled in the Quartus II 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 reconfiguration, 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.
Altera Corporation
4-32
QII5V1
2014.12.15
b_pr_region
.msf
pr_region.msf
a.pmsf
c_pr_region
.msf
b.pmsf
b.sof
base.sof
c.pmsf
c.sof
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-17: 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.
a.rbf
a.pmsf
b.pmsf
b.rbf
c.pmsf
c.rbf
In the Quartus II 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
Altera Corporation
QII5V1
2014.12.15
4-33
Related Information
Generate PR Programming Files with the Convert Programming Files Dialog Box on page 4-33
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 II software, the flow to generate PR programming files is supported in the Convert
Programming Files dialog box. You can specify how the Quartus II software processes file types such
as .msf, .pmsf, and .sof to create .rbf and merged .msf and .pmsf files.
You can create
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 II Programmer chapter in the Quartus II Handbook.
Related Information
Quartus II Programmer
Altera Corporation
4-34
QII5V1
2014.12.15
Altera Corporation
QII5V1
2014.12.15
4-35
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 II software, the Convert Programming Files window provides the option in the .sof file
properties to enable bitstream decompression during partial reconfiguration.
Altera Corporation
4-36
QII5V1
2014.12.15
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.
The Convert Programming Files window provides the option in the .sof file properties to enable
bitstream decryption during partial reconfiguration.
This option is available when converting base .sof to any supported programming file types, such
as .rbf, .pof, and .jic.
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.
Static Region
SignalTap II
Module
PR Region
with Signals to
Be Probed
Brought Out
on the Ports
You can use other on-chip debug features in the Quartus II 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.
Altera Corporation
QII5V1
2014.12.15
4-37
These workarounds allow your design to use M20K blocks with PR.
Stratix V Device
PR
Region
Static
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.
Design Planning for Partial Reconfiguration
Send Feedback
Altera Corporation
4-38
QII5V1
2014.12.15
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.
Figure 4-20: Workaround for Using M20Ks in PR Regions
This figure shows the LogicLock region extended as a rectangle reducing the area available for the static
region. However, you can create non-rectangular LogicLock regions to allocate the resources required for
the partition more optimally. If saving area is a concern, extend the LogicLock region to include M20K
columns entirely.
Stratix V Device
M20K as Uninitialized RAM
PR
Region
Static
Region
Altera Corporation
QII5V1
2014.12.15
4-39
Stratix V Device
M20K as Uninitialized RAM
Static
Region
PR
Region
For more information including a list of the Stratix V production devices, refer to the Errata Sheet for
Stratix V Devices.
Related Information
SCRUB mode
Stratix V Production
OK
OK
Altera Corporation
4-40
QII5V1
2014.12.15
PR Mode
Stratix V Production
AND/OR mode
No
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.
When using AND/OR mode:
LUT-RAMs with initialized content or LUT-ROMs cannot be implemented in a PR region.
LUT-RAMs without initialized content in MLABs inside PR regions are supported with the following
restrictions.
MLAB blocks contain 640 bits of memory. The LUT RAMs in PR regions in your design must occupy
all MLAB bits, you should not use partial MLABs.
You must include control logic in your design with which you can write to all MLAB locations used
inside PR region.
Using this control logic, write '1' at each MLAB RAM bit location in the PR region before starting the
PR process. This is to work around a false EDCRC error during partial reconfiguration.
You must also specify a .mif that sets all MLAB RAM bits to '1' immediately after PR is complete.
ROMs cannot be implemented in MLABs (LUT-ROMs).
There are no restrictions to using MLABs in the static region of your PR design.
For more information, refer to the following documents in the Stratix V Handbook:
Related Information
Altera Corporation
QII5V1
2014.12.15
4-41
Suggested Method
SCRUB
LUT-RAM without
initialization
CRC Error
Suggested Method
LUT-RAM with
initialization
Without Suggested
Method
Suggested Method
Without Suggested
Method
(5)
(4)
Not supported
No special method
required
Incorrect results
No special method
required
No special method
required
Use the circuit shown in the M20K/LUTRAM figure to create clock enable logic to safely exit partial
reconfiguration without spurious writes.
Double partial reconfiguration is described in Initializing M20K Blocks with a Double PR Cycle
Altera Corporation
4-42
QII5V1
2014.12.15
M20K/LUTRAM
D SET Q
Clock Enable
Logic
CE
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.
Related Information
Altera Corporation
QII5V1
2014.12.15
4-43
PR_REQUEST signal after exactly seven clock cycles after the PR_DONE signal is asserted.
PR_REQUEST
PR_CLK
READY_to_NEXT_DATA
PR_DATA[15:0]
PR_READY
DONE_to_NEXT_REQ
PR_DONE
PR_ERROR
CRC_ERROR
If the PR encryption feature (without compression) is enabled , the host logic must issue another
If the PR compression feature is enabled (with or without encryption), the host logic must issue another
PR_REQUEST signal exactly two clock cycles after PR_DONE is asserted. The FPGA responds with PR_READY
signal to the second PR_REQUEST signal assertion.
The PR host must continue sending PR_DATA signal exactly four clock cycles after the PR_READY signal,
just as in the first PR cycle. The data on PR_DATA pins can be don't care between the first PR_DONE signal
and until four clock cycles after the PR_READY signal is asserted for the second PR cycle.
The host must continue sending a PR_DATA signal for the second PR cycle, until it receives the PR_DONE
signal for the second request, similar to the first PR cycle. After the PR_DONE signal is asserted for the
second time, the host should de-assert the PR_REQUEST signal and continue with other operations needed
for region bring up, such as issuing a reset to bring the region to a known state.
You can use bitstream compression along with PR designs that also require memory initialization for
M20K blocks.
For a compressed bitstream requiring a double PR cycle, the PR host must stop sending the PR_DATA
signal in the bitstream as soon as the first PR_DONE is asserted. The PR host must resume sending the
PR_DATA signal immediately after the second PR_READY signal is asserted.
Altera Corporation
4-44
QII5V1
2014.12.15
2015.12.15
Version
14.1.0
Changes
June 2014
14.0.0
November 2013
13.1.0
May 2013
13.0.0
November 2012
12.1.0
Initial release.
Related Information
Altera Corporation
2014.12.15
QII5V1
Subscribe
Send Feedback
Qsys is a system integration tool included as part of the Quartus II software. Qsys captures system-level
hardware designs at a high level of abstraction and simplifies the task of defining and integrating
customized IP components. These components include verification IP cores, and other design modules.
Qsys facilitates design reuse by packaging and integrating your custom IP components with AlteraAltera
and third-party IP components. Qsys automatically creates interconnect logic from the high-level
connectivity that you specify, thereby eliminating the error-prone and time-consuming task of writing
HDL to specify system-level connections.
Qsys is more powerful if you design your custom IP components using standard interfaces. By using
standard interfaces, your custom IP components inter-operate with the Altera IP components in the IP
Catalog. In addition, you can take advantage of bus functional models (BFMs), monitors, and other
verification IP to verify your system.
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.
Qsys provides the following advantages:
Note: For information on how to define and generate single IP cores for use in your Quartus II software
projects, refer to Introduction to Altera IP Cores and Managing Quartus II Projects.
Related Information
2014 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
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information,
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
ISO
9001:2008
Registered
5-2
QII5V1
2014.12.15
Description
Memory-Mapped
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.
Interrupts
Clocks
Connects clock output interfaces with clock input interfaces. Clock outputs can fanout 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
Altera Corporation
QII5V1
2014.12.15
5-3
Altera Corporation
5-4
QII5V1
2014.12.15
Right-click any IP component name in IP Catalog to display details about device support, installation
location, version, and links to documentation. The IP Catalog maintains multiple versions of a
component.
To locate a specific type of component, type some or all of the components name in the IP Catalog search
box. For example, you can type memory to locate memory-mapped IP components, or axi to locate AXI
IP. You can also filter the IP Catalog display with options on the right-click menu.
Figure 5-1: IP Catalog
Altera Corporation
QII5V1
2014.12.15
5-5
The Connections tab (View > Connections) shows a list of current and possible connections for selected
instances or interfaces in the Hierarchy or System Contents tabs. You can add and remove connections
by clicking the check box for each connection. Reporting columns provide information about each
connection. For example, Clock Crossing, Data Width, and Burst columns provide information after
system generation when the Qsys interconnect adds adapters that could possible result in slower fMax, or
larger area.
Figure 5-2: Connections Column in the System Contents Tab
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
The Address Map tab provides the address range that each memory-mapped master must use to connect
to each slave in your system.
Qsys shows the slaves on the left, the masters across the top, and the address span of the connection in
each cell. If there is no connection between a master and a slave, the table cell is empty.
You can design a system where two masters access a slave at different addresses. If you use this feature,
Qsys labels the Base and End address columns in the System Contents tab as "mixed" rather than
providing the address range.
Follow these steps to change or create a connection between master and slave IP components:
1. In Qsys, click or open the Address Map tab.
2. Locate the table cell that represents the connection between the master and slave component pair.
3. Either type in a base address, or update the current base address in the cell.
Note: The base address of a slave component must be a multiple of the address span of the component.
This restriction is a requirement of the Qsys interconnect. The result is an efficient address
decoding logic, which allows Qsys to achieve the best possible fMAX.
Creating a System With Qsys
Send Feedback
Altera Corporation
5-6
QII5V1
2014.12.15
Altera Corporation
QII5V1
2014.12.15
5-7
Qsys Layout controls what tabs are open in your Qsys design window. When you create a Qsys window
configuration that you want to keep, Qsys allows you to save that configuration as a custom layout. By
default, Qsys contains a layout suitable for Qsys system design, as well as a layout that allows you to easily
define and generate single IP cores for use in your Quartus II software projects.
1. To configure your Qsys window with a layout suitable for Qsys system design, click View > Reset to
System Layout.
The System Contents, Address Map, Interconnect Requirements, and Messages tabs open in the
main pane, and the IP Catalog and Hierarchy tabs along the left pane.
2. To configure your Qsys window with a layout suitable for single IP core design, click View > Reset to
IP Layout.
The Parameters and Messages tabs open in the main pane, and the Details, Block Symbol and
Presets tabs along the right pane.
3. To save your current Qsys window configuration as a custom layout, click View > Custom Layouts >
Save.
Altera Corporation
5-8
QII5V1
2014.12.15
Qsys saves your custom layout in your project directory, and adds the layout to the custom layouts list,
and the layouts.ini file. The layouts.ini file controls the order in which the layouts appear in the list.
4. To reset your Qsys window configuration to a previously saved configuration, click View > Custom
Layouts, and then select the custom layout in the list.
The Qsys windows opens with your previously saved Qsys window configuration.
Figure 5-4: Save Your Qsys Window Views and Layouts
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, including the ability to import or export a layout from or to a
different directory.
Altera Corporation
QII5V1
2014.12.15
5-9
You can use the Filters dialog box in the to filter the display of your system by interface type, instance
name, or by using custom tags.
For example, in the System Contents tab, you can show only instances that include memory-mapped
interfaces, instances that are connected to a particular Nios II processor, or temporarily hide clock and
reset interfaces to simplify the display.
Altera Corporation
5-10
QII5V1
2014.12.15
Related Information
The Details tab provides information for a selected component or parameter. Qsys updates the
information in the Details tab as you select different components.
As you click through the parameters for a component in the parameter editor, Qsys displays the descrip
tion of the parameter in the Details tab. To return to the complete description for the component, click
the header in the Parameters tab.
The Schematic tab displays a schematic representation of your Qsys system. Tab controls allow you to
zoom into a component or connection, or to obtain tooltip details for your selection. You can use the
image handles in the right panel to resize the schematic image.
If your selection is a subsystem, use the Hierarchy tool to navigate to the parent subsystem, move up one
level, or to drill into the currently open subsystem.
Altera Corporation
QII5V1
2014.12.15
5-11
Related Information
On the Assignments tab (View > Assignments), you can view assignments for a module or element that
you select in the System Contents tab. The Connections tab displays a lists of connections in your Qsys
system. On the Connections tab (View > Connections), you can choose to connect or un-connect a
module in your system, and then view the results in the System Contents tab.
Altera Corporation
5-12
QII5V1
2014.12.15
Altera Corporation
QII5V1
2014.12.15
5-13
Related Information
Altera Corporation
5-14
QII5V1
2014.12.15
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. When you
select an interface in the Hierarchy tab, the Parameters tab also allows you to review the timing for that
interface. Qsys displays the read and write waveforms at the bottom of the Parameters tab.
The Presets tab allows you to apply a pre-defined set of parameter values to your IP component. The
Presets tab opens the preset editor and allows you to create, modify, and save custom component
parameter values as a preset file. Not all IP components have preset files.
When you add a new component to your system, if there are preset values available for the component,
the preset editor appears in the parameter editor window and lists preset files that you can apply the
component. The name of each preset file describes a particular protocol and contains the required
parameter values for that protocol.
You can search for text to filter the Presets list. For example, if you add the DDR3 SDRAM Controller
with UniPHY component to your system, and type 1g micron 256 in the search box, the Presets list
shows only those parameter values that apply to the 1g micron 256 filter request. Presets whose parameter
values match the current parameter settings appear in bold.
If the available preset files do not meet the requirements of your design, you can create a new preset file.
In the presets editor, click New to open the New Preset dialog box. Specify the new custom preset name,
component version, description of the preset, and which parameters to include in the preset. You can also
specify where you want to save the preset file. If the file location that you specify is not already in the IP
search path, Qsys adds the location of the new preset file to the IP search path.
In the preset editor, click Update to update parameter values for a custom preset. The Update Preset
dialog box displays the default values, which you can edit, and the current value, which are static. Click
Delete to remove a custom preset from the Presets list.
When you access the presets editor by clicking View > Presets, you can apply the available presets to the
currently selected component.
Altera Corporation
QII5V1
2014.12.15
5-15
Create Component
Using Component Editor, or
by Manually Creating the
_hw.tcl File
Simulation at Unit-Level,
Possibly Using BFMs
Does
Simulation Give
Expected Results?
Yes
No
3
Debug Design
Generate Qsys
System
Perform System-Level
Simulation
Yes
No
Debug Design
Does
HW Testing Give
Expected Results?
Does
Simulation Give
Expected Results?
Constrain, Compile
in Quartus II Generating .sof
Yes
No
10
Modify Design or
Constraints
Note: For information on how to define and generate single IP cores for use in your Quartus II software
projects, refer to Introduction to Altera IP Cores.
Altera Corporation
5-16
QII5V1
2014.12.15
Related Information
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 that are found in the IP search path.
Qsys searches the directories listed in the IP search path for the following file types:
*_hw.tclDefines a single IP component.
*.ipxEach IP Index File (.ipx) indexes a collection of available IP components, or a reference to other
directories to search. In general, .ipx files facilitate faster startup for Qsys because Qsys does not
traverse directories below the .ipx file. Additionally, the .ipx file can contain information about the IP
component, which eliminates the need for Qsys to read the _hw.tcl file to understand the basic
attributes of the IP core.
Qsys recursively searches directories specified in the IP search path until it finds a _hw.tcl file. When Qsys
finds a _hw.tcl file in a directory, Qsys does not search subdirectories for additional _hw.tcl files.
When you specify an IP search location in Qsys, a recursive descent is annotated by **. A single * signifies
a match against any file within the specified directory. However, even if a recursive descent is specified, if
Qsys finds a _hw.tcl or .ipx file, it does not search any subdirectories beyond that level.
Note: When you add a component to the search path, you must refresh your system by clicking File >
Refresh to update the IP Catalog.
Altera Corporation
QII5V1
2014.12.15
5-17
Description
PROJECT_DIR/*
PROJECT_DIR/ip/**/*
Altera Corporation
5-18
QII5V1
2014.12.15
<qsys_system>
ip
altera
altera_components.ipx
<ip components>
user_ip_components
2
ip_component1
ip_component1_hw.tcl
ip_component1.v
ip_component2
ip_component2_hw.tcl
ip_component2.v
Qsys performs the IP component search algorithm to locate .ipx and _hw.tcl files, as follows:
1. Qsys recursively searches the <qsys_system>/ip directory by default. The recursive search stops when
Qsys discovers an .ipx file.
Because of this traversal, if changes to the ip_component1_hw.tcl file are made, but the .ipx file is not
rebuilt using ip-make-ipx, those changes are not reflected in Qsys because the .ipx file contains old
information about the ip_component1 directory.
2. If the .ipx file is removed, Qsys discovers both the ip_component1 and ip_component2 directories,
which contain _hw.tcl files.
Note: If you save your _hw.tcl file in the <qsys_system>/ip directory, Qsys finds your _hw.tcl file and will
not search subdirectories adjacent to the _hw.tcl file. For more information about the IP search
path, refer to Introduction to Altera IP Cores.
Altera Corporation
QII5V1
2014.12.15
5-19
Related Information
</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.
Example 5-2: Component Element in an .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>
Note: You can verify that IP components are available with the ip-catalog command.
Altera Corporation
5-20
QII5V1
2014.12.15
The <qsys_file> variable accepts a path to the .qsys file so that you are not constrained to running
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
Altera Corporation
QII5V1
2014.12.15
5-21
Altera Corporation
5-22
QII5V1
2014.12.15
Altera Corporation
QII5V1
2014.12.15
5-23
Note: In the System Contents tab, you can use CTRL+SHIFT+U to navigate up one level, and CTRL
+SHIFT+D to drill into a system.
Figure 5-13: Drill into a Qsys System to Explore its Contents
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).
Creating a System With Qsys
Send Feedback
Altera Corporation
5-24
QII5V1
2014.12.15
Altera Corporation
QII5V1
2014.12.15
5-25
This procedure creates a Qsys system to use as subsystem in a higher-level system as part of a hierarchical
instance parameter example.
Altera Corporation
5-26
QII5V1
2014.12.15
The Instance Parameters tab allows you to define parameters to control the implementation of a
subsystem component. Each column in the Instance Parameters table defines a property of the
parameter. This procedure creates instance parameters in a Qsys system to use as subsystem in a higherlevel system as part of a hierarchical instance parameter example.
Altera Corporation
QII5V1
2014.12.15
5-27
8. In the Instance Script section, type the commands that control how the parameters are passed 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.
Figure 5-16: Instance Script
Altera Corporation
5-28
QII5V1
2014.12.15
This procedure creates a Qsys system to use as a higher-level system as part of a hierarchical instance
parameter example.
1.
2.
3.
4.
5.
Altera Corporation
QII5V1
2014.12.15
Apply Instance Parameters at a Higher-Level Qsys System and Pass the Parameters
to the Instantiated Lower-Level System
5-29
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 instance parameters to control the implementation of an On-Chip
Memory component as part of a hierarchical instance parameter example.
1. In the instantiating_component_system.qsys system, in the Hierarchy tab, click and expand system_0
(components_system.qsys).
2. Click View > Parameters.
The instance paramters that you defined in components_system.qsys display in the Parameter Editor.
Altera Corporation
5-30
Apply Instance Parameters at a Higher-Level Qsys System and Pass the Parameters
to the Instantiated Lower-Level System
QII5V1
2014.12.15
Altera Corporation
QII5V1
2014.12.15
View and Filter Clock and Reset Domains in Your Qsys System
5-31
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
box, which is accesible by clicking the filter icon at the bottom of the System Contents tab. In the Filters
dialog box, you can choose to view a a single interface, or to hide clock, reset, or interrupt interfaces.
Altera Corporation
5-32
QII5V1
2014.12.15
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?
Altera Corporation
QII5V1
2014.12.15
5-33
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-23: 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.
Altera Corporation
5-34
QII5V1
2014.12.15
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:
Altera Corporation
QII5V1
2014.12.15
Filter Qsys Clock and Reset Domains in the System Contents Tab
5-35
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-26: 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.
Altera Corporation
5-36
QII5V1
2014.12.15
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-28: Show All Interfaces
Altera Corporation
QII5V1
2014.12.15
5-37
To use Tcl commands that work with instance parameters in the instance script, you must specify the
commands within a Tcl composition callback. In the instance script, you specify the name for the
composition callback with the following command:
set_module_property COMPOSITION_CALLBACK <name of callback procedure>
Specify the appropriate Tcl commands inside the Tcl procedure with the following syntax:
proc <name of procedure defined in previous command> {}
{#Tcl commands to query and set parameters go here}
Related Information
Altera Corporation
5-38
QII5V1
2014.12.15
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
get_instance_parameter_value pixel_converter input_DPI
Altera Corporation
QII5V1
2014.12.15
get_instance_parameters
5-39
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
Altera Corporation
5-40
QII5V1
2014.12.15
get_parameter_value
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
Altera Corporation
QII5V1
2014.12.15
get_parameters
5-41
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
Altera Corporation
5-42
send_message
QII5V1
2014.12.15
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:
message
The text of the message.
Example
send_message ERROR "The system is down!"
send_message { Info Text } "The system is up!"
Altera Corporation
QII5V1
2014.12.15
set_instance_parameter_value
5-43
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 vaule.
Example
set_instance_parameter_value uart_0 baudRate 9600
Altera Corporation
5-44
QII5V1
2014.12.15
set_module_property
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
set_module_property COMPOSITION_CALLBACK "my_composition_callback"
Altera Corporation
Description
Specifies the maximum number of pipeline stages that Qsys may insert in
each command and response path to increase the fMAX at the expense of
additional latency. You can specify between 04 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.
QII5V1
2014.12.15
Option
5-45
Description
Description
Specifies whether you want Qsys to automatically insert a default slave for
undefined memory region accesses during system generation.
Enable instrumentation
When you set this option to TRUE, Qsys enables debug instrumentation
in the Qsys interconnect, which then monitors interconnect performance
in the system console.
Altera Corporation
5-46
QII5V1
2014.12.15
Option
Description
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.
Security
Value
Non-secure
Secure
Secure ranges
TrustZone-aware
Description
For more information about HPS, refer to the Cyclone V Device Handbook in volume 3 of the Hard
Processor System Technical Reference Manual.
Altera Corporation
QII5V1
2014.12.15
5-47
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 AvalonMM 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
Description
Non-secure
Secure
Master sends only secure transactions, and the slave receives only
secure transactions.
Secure ranges
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
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. Rightclick the System Contents header to select which columns you want to display.
Creating a System With Qsys
Send Feedback
Altera Corporation
5-48
QII5V1
2014.12.15
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.
TrustZone-aware
slave/memory
TrustZone-aware Master
Non-TrustZone-aware
Master
Secure
Non-Secure
OK
OK
Non-TrustZone-aware Per-access
slave (secure)
OK
Not allowed
Non-TrustZone-aware OK
slave (non-secure)
OK
OK
Non-TrustZone-aware Per-access
memory (secure
region)
OK
Not allowed
Non-TrustZone-aware OK
memory (non-secure
region)
OK
OK
Altera Corporation
OK
Non-TrustZone-aware
Master
QII5V1
2014.12.15
5-49
Altera Corporation
5-50
QII5V1
2014.12.15
Integrate a Qsys System and the Quartus II Software With the .qsys File
Integrate a Qsys System and the Quartus II Software With the .qsys File
Use the following steps to integrate your Qsys system and your Quartus II 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 II project during compilation, in the
Quartus II software, select Tools > Options > IP Settings, and turn on Automatically add Quartus II
IP files to all projects.
3. When the Automatically add Quartus II IP files to all projects option is not checked, when you exit
Qsys, the Quartus II software displays a dialog box asking whether you want to add the .qsys file to
your Quartus II project. Click Yes to add the .qsys file to your Quartus II project.
4. In the Quartus II software, select Processing > Start Compilation.
Integrate a Qsys System and the Quartus II Software With the .qip File
Use the following steps to integrate your Qsys system and your Quartus II project using the .qip file:
1.
2.
3.
4.
5.
Altera Corporation
QII5V1
2014.12.15
5-51
Description
Note: You can also access IP Settings by clicking Assignments > Settings > IP Settings. This access is
available only when you have a Quartus II project open. This allows you access to IP Settings when
you want to create IP cores independent of a Quartus II project. Settings that you apply or create in
either location are shared.
If your Qsys system requires more than the 512 megabytes of default memory, you can increase the
amount of memory either in the Quartus II software Options dialog box, or at the command-line.
Altera Corporation
5-52
QII5V1
2014.12.15
When you open Qsys from within the Quartus II software, you can increase memory for your Qsys
system, by clicking Tools > Options > IP Settings, and then selecting the appropriate amount of
memory with the Maximum Qsys memory usage option.
When you open Qsys from the command-line, you can add an option to increase the memory. For
example, the following qsys-edit command allows you to open Qsys with 1 gigabytes of memory.
qsys-edit --jvm-max-heap-size=1g
create_clock command, and then use the derive_pll_clocks command to define the PLL clock output
frequencies and phase shifts for all PLLs in the Quartus II project using the .sdc file.
Altera Corporation
QII5V1
2014.12.15
5-53
Related Information
Altera Corporation
5-54
QII5V1
2014.12.15
Note: If you need to change top-level I/O pin or instance names, create a top-level HDL file that instanti
ates the Qsys system. The Qsys-generated output is then instantiated in your design without
changes to the Qsys-generated output files.
The following options in the Generation dialog box (Generate > Generate HDL) allow you to generate
synthesis and simulation files:
Option
Description
Create timing and resource estimates for thirdparty EDA synthesis tools
Related Information
Qsys generates the following files for your Qsys system that are used during synthesis and simulation.
Altera Corporation
Description
The Qsys system file. <system> is the name that you give your system.
QII5V1
2014.12.15
File Name
<system>.sopcinfo
5-55
Description
<system>.cmp
<system>.html
<system>_generation.rpt
Qsys generation log file. A summary of the messages that Qsys issues
during system generation.
<system>.debuginfo
<system>.qip
<system>.bsf
<system>.spd
<system>.ppf
The Pin Planner File (.ppf) stores the port and node assignments for
IP components created for use with the Pin Planner.
<system>_bb.v
You can use the Verilog black-box (_bb.v) file as an empty module
declaration for use as a black box.
<system>.sip
<system>_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 a Qsys system.
Altera Corporation
5-56
QII5V1
2014.12.15
File Name
Description
<system>.regmap
<system>.svd
<system>.v
or
<system>.vhd
mentor/
aldec/
/synopsys/vcs
/synopsys/vcsmx
/submodules
<child IP cores>/
For each generated child IP core directory, Qsys generates /synth and /
sim subdirectories.
Related Information
Qsys Synthesis Standard and Legacy Device Output Directories on page 5-56
Qsys Simulation Standard and Legacy Device Output Directories on page 5-57
The /synth or /synthesis directories contain the Qsys-generated files that the Quartus II software uses to
synthesize your design.
Altera Corporation
QII5V1
2014.12.15
5-57
<system>.qsys
<system>.qsys
<system>.sopcinfo
<system>.sopcinfo
<system>
<system>
<system>.cmp
<system>.cmp
<system>.debuginfo
<system>.html
<system>.html
<system>.rpt
<system>.qip
synthesis
<system>.regmap
<system>.qip
<system>_generation.rpt
<system>.debuginfo
synth
<HDL files>
<HDL files>
<Child IP core>
submodules
<HDL files>
synth
<HDL files>
Related Information
The /sim and /simulation directories contain the Qsys-generated output files to simulate your Qsys system.
Altera Corporation
5-58
QII5V1
2014.12.15
<system>.qsys
<system>.qsys
<system>.sopcinfo
<system>.sopcinfo
<system>
<system>
<system>.cmp
<system>.cmp
<system>.csv
<system>.csv
<system>.html
<system>.html
<system>.regmap
<system>.spd
<system>.sip
<system>_generation.rpt
<system>.spd
simulation
<system>_generation.rpt
<system>.sip
sim
<HDL files>
<HDL files>
aldec
submodules
<HDL files>
cadence
aldec
mentor
cadence
synopsys
mentor
<Child IP core>
synopsys
sim
<HDL files>
Related Information
QII5V1
2014.12.15
5-59
You can generate a standard or simple testbench system with BFM or Mentor Verification IP (for AXI3/
AXI4) IP components that drive the external interfaces of your system. Qsys generates a Verilog HDL or
VHDL simulation model for the testbench system to use in your simulation tool. You should first
generate a testbench system, and then modify the testbench system in Qsys before generating its
simulation model. In most cases, you should select only one of the simulation model options.
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
Description
Altera Corporation
5-60
QII5V1
2014.12.15
or
Description
<system>_tb.vhd
<system>_tb.spd
<system>.html
and
<system>_tb.html
<system>_generation.rpt
Qsys generation log file. A summary of the messages that Qsys issues
during testbench system generation.
<system>.ipx
<system>.svd
mentor/
aldec/
/synopsys/vcs
/synopsys/vcsmx
/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>/
Altera Corporation
QII5V1
2014.12.15
5-61
The /sim and /simulation directories contain the Qsys-generated output files to simulate your Qsys
testbench system.
<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>
sim
mentor
synopsys
<HDL files>
You can use the following steps to create a Qsys testbench system of your Qsys system.
Altera Corporation
5-62
QII5V1
2014.12.15
Simulation Scripts
Simulation Scripts
Qsys generates simulation scripts to set up the simulation environment for Mentor Graphics Modelsim
and Questasim, Synopsys VCS and VCS MX, Cadence Incisive Enterprise Simulator (NCSIM), and the
Aldec Riviera-PRO Simulator.
You can use the scripts to compile the required device libraries and system design files in the correct order
and elaborate or load the top-level system for simulation.
Table 5-11: Simulation Script Variables
The simulation scripts provide variables that allow flexibility in your simulation environment.
Variable
TOP_LEVEL_NAME
QSYS_SIMDIR
QUARTUS_INSTALL_DIR
Description
Note: The VHDL version of the Altera Tristate Conduit BFM is not supported in Synopsys VCS, NCSim,
and Riviera-PRO in the Quartus II 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.
Altera Corporation
QII5V1
2014.12.15
5-63
Related Information
To simulate the software in a system driven by a Nios II processor, generate the simulation model for the
Qsys testbench system with the following steps:
1. In the Generation dialog box (Generate > Generate Testbench System), select Simple, BFMs for
clocks and resets.
2. For the Create testbench simulation model option select Verilog or VHDL.
3. Click Generate.
4. Open the Nios II Software Build Tools for Eclipse.
5. Set up an application project and board support package (BSP) for the <system> .sopcinfo file.
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
Altera Corporation
5-64
QII5V1
2014.12.15
Figure 5-33: Inserting an Avalon-MM Monitor Between an Avalon-MM Master and Slave Interface
This example demonstrates the use of a monitor with an Avalon-MM monitor between the
Similarly, you can insert an Avalon-ST monitor between Avalon-ST source and sink interfaces.
Related Information
Altera Corporation
QII5V1
2014.12.15
5-65
The System with Qsys Interconnect window has the following tabs:
System ContentsDisplays the original instances in your system, as well as the inserted interconnect
instances. Connections between interfaces are replaced by connections to interconnect where
applicable.
HierarchyDisplays a system hierarchical navigator, expanding the system contents to show modules,
interfaces, signals, contents of subsystems, and connections.
ParametersDisplays the parameters for the selected element in the Hierarchy tab.
Memory-Mapped InterconnectAllows 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 MemoryMapped 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.
0.000
0.204
0.242
0.100
0.339
cpu_instruction_master|out_shifter[63]|q
mm_domain_0|addr_router_001|Equal5~0|datac
mm_domain_0|addr_router_001|Equal5~0|combout
mm_domain_0|addr_router_001|Equal5~1|dataa
mm_domain_0|addr_router_001|Equal5~1|combout
Altera Corporation
5-66
QII5V1
2014.12.15
Altera Corporation
QII5V1
2014.12.15
5-67
Altera Corporation
5-68
QII5V1
2014.12.15
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
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 unities from any directory location.
Related Information
Altera Corporation
QII5V1
2014.12.15
5-69
You can use the following options with the qsys-edit utility:
Table 5-12: qsys-edit Command-Line Options
Option
Usage
Description
Optional
--search-path[=<value>]
Optional
--project-directory=<directory>
Optional
--new-component-type=<value>
Optional
--debug
Optional
--host-controller
Optional
--jvm-max-heap-size=<value>
Optional
--help
Optional
Usage
Required
Description
Altera Corporation
5-70
QII5V1
2014.12.15
Option
Usage
Description
--synthesis=<VERILOG|VHDL>
Optional
--block-symbol-file
Optional
--simulation=<VERILOG|VHDL>
Optional
--testbench=<SIMPLE|STANDARD>
Optional
--testbench-simulation=<VERILOG|VHDL>
Optional
--search-path=<value>
Optional
--jvm-max-heap-size=<value>
Optional
--family=<value>
Optional
--part=<value>
Optional
Altera Corporation
QII5V1
2014.12.15
Option
Usage
--allow-mixed-language-simulation
Optional
5-71
Description
Usage
Description
--project-dir= <directory>
Optional
--name=<value>
Optional
--verbose
Optional
--xml
Optional
--help
Optional
Altera Corporation
5-72
QII5V1
2014.12.15
Usage
Description
--source-directory=<directory>
Optional
--output=<file>
Optional
--relative-vars=<value>
Optional
--thorough-descent
Optional
--message-before=<value>
Optional
--message-after=<value>
Optional
--help
Optional
Altera Corporation
QII5V1
2014.12.15
5-73
Usage
Description
--system-file=<file>
Optional
--script=<file>
Optional
--cmd=<value>
Optional
--package-version=<value>
Optional
--search-path=<value>
Optional
--jvm-max-heap-size=<value>
Optional
--help
Optional
Altera Corporation
5-74
QII5V1
2014.12.15
QII5V1
2014.12.15
5-75
Altera Corporation
5-76
QII5V1
2014.12.15
Altera Corporation
QII5V1
2014.12.15
add_connection
5-77
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
add_connection dma.read_master sdram.s1
Related Information
Altera Corporation
5-78
QII5V1
2014.12.15
add_instance
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
add_instance uart_0 altera_avalon_uart
Related Information
Altera Corporation
QII5V1
2014.12.15
add_interface
5-79
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
add_interface my_export conduit end
set_interface_property my_export EXPORT_OF uart_0.external_connection
Related Information
Altera Corporation
5-80
apply_preset
QII5V1
2014.12.15
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
apply_preset cpu_0 "Custom Debug Settings"
Altera Corporation
QII5V1
2014.12.15
auto_assign_base_addresses
5-81
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
Altera Corporation
5-82
auto_assign_system_base_addresses
QII5V1
2014.12.15
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 autoassignment.
Usage
auto_assign_system_base_addresses
Returns
No return value.
Arguments
No arguments.
Example
auto_assign_system_base_addresses
Related Information
Altera Corporation
QII5V1
2014.12.15
auto_assign_irqs
5-83
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
Altera Corporation
5-84
auto_connect
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
create_system
5-85
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
Altera Corporation
5-86
export_hw_tcl
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
get_composed_connection_parameter_value
5-87
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
get_composed_connection_parameter_value subsystem_0 cpu.data_master/memory.s0
baseAddress
Related Information
Altera Corporation
5-88
QII5V1
2014.12.15
get_composed_connection_parameters
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
get_composed_connection_parameters subsystem_0 cpu.data_master/memory.s0
Related Information
Altera Corporation
QII5V1
2014.12.15
get_composed_connections
5-89
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
Altera Corporation
5-90
QII5V1
2014.12.15
get_composed_instance_assignment
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
get_composed_instance_assignment subsystem_0 video_0 "embeddedsw.CMacro.colorSpace"
Related Information
Altera Corporation
QII5V1
2014.12.15
get_composed_instance_assignments
5-91
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
get_composed_instance_assignments subsystem_0 cpu
Related Information
Altera Corporation
5-92
QII5V1
2014.12.15
get_composed_instance_parameter_value
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
get_composed_instance_parameter_value subsystem_0 cpu DATA_WIDTH
Related Information
Altera Corporation
QII5V1
2014.12.15
get_composed_instance_parameters
5-93
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
get_composed_instance_parameters subsystem_0 cpu
Related Information
Altera Corporation
5-94
get_composed_instances
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
get_connection_parameter_property
5-95
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
get_connection_parameter_property cpu.data_master/dma0.csr baseAddress UNITS
Related Information
Altera Corporation
5-96
QII5V1
2014.12.15
get_connection_parameter_value
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
get_connection_parameter_value cpu.data_master/dma0.csr baseAddress
Related Information
Altera Corporation
QII5V1
2014.12.15
get_connection_parameters
5-97
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
Altera Corporation
5-98
get_connection_properties
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
get_connection_property
5-99
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
get_connection_property cpu.data_master/dma0.csr TYPE
Related Information
Altera Corporation
5-100
QII5V1
2014.12.15
get_connections
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
Altera Corporation
QII5V1
2014.12.15
get_instance_assignment
5-101
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
get_instance_assignment video_0 embeddedsw.CMacro.colorSpace
Related Information
Altera Corporation
5-102
get_instance_assignments
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
get_instance_documentation_links
5-103
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:
{Data Sheet} {http://url/to/data/sheet}
Altera Corporation
5-104
QII5V1
2014.12.15
get_instance_interface_assignment
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
get_instance_interface_assignment sdram s1 embeddedsw.configuration.isFlash
Related Information
Altera Corporation
QII5V1
2014.12.15
get_instance_interface_assignments
5-105
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
Altera Corporation
5-106
QII5V1
2014.12.15
get_instance_interface_parameter_property
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
get_instance_interface_parameter_property uart_0 s0 setupTime ENABLED
Related Information
Altera Corporation
QII5V1
2014.12.15
get_instance_interface_parameter_value
5-107
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
get_instance_interface_parameter_value uart_0 s0 setupTime
Related Information
Altera Corporation
5-108
get_instance_interface_parameters
QII5V1
2014.12.15
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
get_instance_interface_parameters instance interface
Related Information
Altera Corporation
QII5V1
2014.12.15
get_instance_interface_port_property
5-109
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
get_instance_interface_port_property uart_0 exports tx WIDTH
Related Information
Altera Corporation
5-110
get_instance_interface_ports
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
get_instance_interface_properties
5-111
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
Altera Corporation
5-112
QII5V1
2014.12.15
get_instance_interface_property
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
get_instance_interface_property uart_0 s0 DESCRIPTION
Related Information
Altera Corporation
QII5V1
2014.12.15
get_instance_interfaces
5-113
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
Altera Corporation
5-114
QII5V1
2014.12.15
get_instance_parameter_property
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
get_instance_parameter_property uart_0 baudRate ENABLED
Related Information
Altera Corporation
QII5V1
2014.12.15
get_instance_parameter_value
5-115
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
get_instance_parameter_value uart_0 baudRate
Related Information
Altera Corporation
5-116
get_instance_parameters
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
get_instance_port_property
5-117
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
get_instance_port_property uart_0 tx WIDTH
Related Information
Altera Corporation
5-118
get_instance_properties
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
get_instance_property
5-119
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
get_instance_property uart_0 ENABLED
Related Information
Altera Corporation
5-120
get_instances
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
get_interconnect_requirement
5-121
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
get_interconnect_requirement {$system} qsys_mm.maxAdditionalLatency
Altera Corporation
5-122
get_interconnect_requirements
QII5V1
2014.12.15
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:
foreach { element_id name value } $requirement_list { loop_body
}
Arguments
No arguments.
Example
get_interconnect_requirements
Altera Corporation
QII5V1
2014.12.15
get_interface_port_property
5-123
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
get_interface_port_property uart_exports tx DIRECTION
Related Information
Altera Corporation
5-124
get_interface_ports
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
get_interface_properties
5-125
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
Altera Corporation
5-126
get_interface_property
QII5V1
2014.12.15
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
get_interface_property export_clk_out EXPORT_OF
Related Information
Altera Corporation
QII5V1
2014.12.15
get_interfaces
5-127
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
Altera Corporation
5-128
QII5V1
2014.12.15
get_module_properties
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
Altera Corporation
QII5V1
2014.12.15
get_module_property
5-129
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
Altera Corporation
5-130
get_parameter_properties
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
get_port_properties
5-131
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
Altera Corporation
5-132
QII5V1
2014.12.15
get_project_properties
get_project_properties
Description
Returns a list of properties that you can query for properties pertaining to the Quartus II project.
Usage
get_project_properties
Returns
A list of project properties.
Arguments
No arguments
Example
get_project_properties
Related Information
Altera Corporation
QII5V1
2014.12.15
get_project_property
5-133
get_project_property
Description
Returns the value of a Quartus II project property. Not all Quartus II 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
Altera Corporation
5-134
QII5V1
2014.12.15
load_system
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
Altera Corporation
QII5V1
2014.12.15
lock_avalon_base_address
5-135
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
Altera Corporation
5-136
remove_connection
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
remove_dangling_connections
5-137
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
Altera Corporation
5-138
remove_instance
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
remove_interface
5-139
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
Altera Corporation
5-140
save_system
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
send_message
5-141
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:
Properties.
message
The text of the message.
Example
send_message ERROR "The system is down!"
Related Information
Altera Corporation
5-142
QII5V1
2014.12.15
set_connection_parameter_value
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
set_connection_parameter_value cpu.data_master/dma0.csr baseAddress "0x000a0000"
Related Information
Altera Corporation
QII5V1
2014.12.15
set_instance_parameter_value
5-143
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
set_instance_parameter_value uart_0 baudRate 9600
Related Information
Altera Corporation
5-144
set_instance_property
QII5V1
2014.12.15
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
set_instance_property cpu ENABLED false
Related Information
Altera Corporation
QII5V1
2014.12.15
set_interconnect_requirement
5-145
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
set_interconnect_requirement {$system} qsys_mm.clockCrossingAdapter HANDSHAKE
Altera Corporation
5-146
QII5V1
2014.12.15
set_interface_property
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
set_interface_property clk_out EXPORT_OF clk.clk_out
Related Information
Altera Corporation
QII5V1
2014.12.15
set_module_property
5-147
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
set_module_property NAME "new_system_name"
Related Information
Altera Corporation
5-148
set_project_property
QII5V1
2014.12.15
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
set_project_property DEVICE_FAMILY "Cyclone IV GX"
Related Information
Altera Corporation
QII5V1
2014.12.15
set_use_testbench_naming_pattern
5-149
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.
Altera Corporation
5-150
QII5V1
2014.12.15
set_validation_property
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
set_validation_property AUTOMATIC_VALIDATION false
Related Information
Altera Corporation
QII5V1
2014.12.15
unlock_avalon_base_address
5-151
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
Altera Corporation
5-152
validate_connection
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
validate_instance
5-153
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
Altera Corporation
5-154
validate_instance_interface
QII5V1
2014.12.15
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
validate_instance_interface cpu data_master
Related Information
Altera Corporation
QII5V1
2014.12.15
validate_system
5-155
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
Altera Corporation
5-156
QII5V1
2014.12.15
Interface properties work differently for _hw.tcl scripting than with qsys scripting. In _hw.tcl, interfaces
do not distinguish between properties and parameters. In qsys scripting, properties and parameters are
unique.
Connection Properties on page 5-157
Design Environment Type Properties on page 5-158
Altera Corporation
QII5V1
2014.12.15
Connection Properties
5-157
Connection Properties
Type
Name
Description
string
END
string
NAME
string
START
String
TYPE
Altera Corporation
5-158
QII5V1
2014.12.15
Description
NATIVE
QSYS
Altera Corporation
QII5V1
2014.12.15
Direction Properties
5-159
Direction Properties
Name
Description
BIDIR
INOUT
OUTPUT
Altera Corporation
5-160
QII5V1
2014.12.15
Element Properties
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.
Type
String
Name
AUTHOR
Description
Boolean AUTO_EXPORT
String
CLASS_NAME
String
DESCRIPTION
String
DISPLAY_NAME
The display name for referencing the type of instance, interface or connection.
Boolean EDITABLE
Indicates whether you can edit the component in the Qsys Component Editor.
Boolean ENABLED
String
GROUP
Boolean INTERNAL
String
NAME
String
VERSION
Altera Corporation
14.0.
QII5V1
2014.12.15
Instance Properties
5-161
Instance Properties
Type
String
Name
AUTO_EXPORT
Description
Boolean ENABLED
String
The name of the system, which is used as the name of the top-level module in
the generated HDL.
NAME
Altera Corporation
5-162
QII5V1
2014.12.15
Interface Properties
Interface Properties
Type
Name
Description
String EXPORT_OF Indicates which interface of a child instance to export through the top-level
interface. Before using this command, you must create the top-level interface using
the add_interface command. You must use the format:
<instanceName.interfaceName>. For example:
set_interface_property CSC_input EXPORT_OF my_colorSpaceConverter.input_port
Altera Corporation
QII5V1
2014.12.15
5-163
Description
COMPONENT_INFO
DEBUG
ERROR
INFO
PROGRESS
TODOERROR
WARNING
Altera Corporation
5-164
QII5V1
2014.12.15
Module Properties
Module Properties
Type
Name
Description
String
GENERATION_ID
String
NAME
Altera Corporation
QII5V1
2014.12.15
Parameter Properties
5-165
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 and
AFFECTS_ELABORATION is false, the elaboration phase does not repeat
and improves performance. When AFFECTS_ELABORATION is set to
true, the default value, Qsys re-analyzes the HDL file to determine the
port widths and configuration each time a parameter changes.
Boolean AFFECTS_GENERATION
Boolean AFFECTS_VALIDATION
String[]
ALLOWED_RANGES
String
DEFAULT_VALUE
Boolean DERIVED
String
DESCRIPTION
String[]
DISPLAY_HINT
Altera Corporation
5-166
QII5V1
2014.12.15
Parameter Properties
Type
Name
Description
DISPLAY_NAME
String
DISPLAY_UNITS
Boolean ENABLED
String
GROUP
Boolean HDL_PARAMETER
String
LONG_DESCRIPTION
String
NEW_INSTANCE_VALUE
String[]
SYSTEM_INFO
String
SYSTEM_INFO_ARG
(various) SYSTEM_INFO_TYPE
Specifies the types of system information that you can query. Refer to
System Info Type Properties.
(various) TYPE
(various) UNITS
Boolean VISIBLE
Altera Corporation
QII5V1
2014.12.15
Parameter Properties
Type
String
Name
WIDTH
5-167
Description
Related Information
Altera Corporation
5-168
QII5V1
2014.12.15
Name
Description
Boolean ACTIVE
Boolean DEPRECATED
Indicates that this parameter exists only for backwards compatibility, and may
not have any effect.
Boolean EXPERIMENTAL Indicates that this parameter is experimental and not exposed in the design
flow.
Altera Corporation
QII5V1
2014.12.15
5-169
Description
BOOLEAN
FLOAT
A signed 32-bit floating point parameter. (Not supported for HDL parameters.)
INTEGER
INTEGER_LIST
A parameter that contains a list of 32-bit integers. (Not supported for HDL
parameters.)
LONG
NATURAL
POSITIVE
STD_LOGIC
STD_LOGIC_VECTOR
STRING
A string parameter.
STRING_LIST
A parameter that contains a list of strings. (Not supported for HDL parameters.)
Altera Corporation
5-170
QII5V1
2014.12.15
Port Properties
Port Properties
Type
Name
Description
ROLE
Integer
WIDTH
Altera Corporation
The type of the signal. Each interface type defines a set of interface types for its
ports.
The width of the signal in bits.
QII5V1
2014.12.15
Project Properties
5-171
Project Properties
Type
Name
String DEVICE
Description
The device part number in the Quartus II project that contains the Qsys system.
String DEVICE_FAMILY The device family name in the Quartus II project that contains the Qsys system.
Altera Corporation
5-172
QII5V1
2014.12.15
Name
String
ADDRESS_MAP
Integer
ADDRESS_WIDTH
String
AVALON_SPEC
Integer
CLOCK_DOMAIN
Description
String
CLOCK_RESET_INFO
String
CUSTOM_INSTRUCTION_SLAVES
String
DESIGN_ENVIRONMENT
String
DEVICE
String
DEVICE_FAMILY
String
DEVICE_FEATURES
String
DEVICE_SPEEDGRADE
Integer
GENERATION_ID
Altera Corporation
QII5V1
2014.12.15
Type
BigInteger,
Long
Integer
String,
Boolean,
Integer
Name
INTERRUPTS_USED
MAX_SLAVE_DATA_WIDTH
QUARTUS_INI
Integer
RESET_DOMAIN
String
TRISTATECONDUIT_INFO
String
TRISTATECONDUIT_MASTERS
String
UNIQUE_ID
5-173
Description
Related Information
Altera Corporation
5-174
QII5V1
2014.12.15
Units Properties
Units Properties
Name
Description
ADDRESS
A memory-mapped address.
BITS
BITSPERSECOND
BYTES
CYCLES
GIGABITSPERSECOND
GIGABYTES
GIGAHERTZ
Frequency in GHz.
HERTZ
Frequency in Hz.
KILOBITSPERSECOND
KILOBYTES
KILOHERTZ
Frequency in kHz.
MEGABITSPERSECOND
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.
Altera Corporation
QII5V1
2014.12.15
Validation Properties
5-175
Validation Properties
Type
Name
Description
Boolean AUTOMATIC_VALIDATION When true, Qsys runs system validation and elaboration after each
scripting command. When false, Qsys runs system validation with
validation scripting commands. Some queries affected by system
elaboration may be incorrect if automatic validation is turned off.
You can disable validation to make a system script run faster.
Altera Corporation
5-176
QII5V1
2014.12.15
Version
Changes
December 2014
14.1.0
August 2014
14.0a10.0
June 2014
14.0.0
November 2013
13.1.0
May 2013
13.0.0
November 2012
12.1.0
Altera Corporation
QII5V1
2014.12.15
Date
Version
5-177
Changes
June 2012
12.0.0
November 2011
11.1.0
May 2011
11.0.0
December 2010
10.1.0
Initial release.
Related Information
Altera Corporation
2014.06.30
QII5V1
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
Qsys Components
A Qsys component includes the following elements:
Information about the component type, such as name, version, and author.
HDL description of the components hardware, including SystemVerilog, Verilog HDL, or VHDL files
Constraint files (Synopsys Design Constraints File (.sdc) and/or Quartus II IP File (.qip)) that define
the component for synthesis and simulation.
A components interfaces, including I/O signals.
The parameters that configure the operation of the component.
2014 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
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information,
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
ISO
9001:2008
Registered
6-2
QII5V1
2014.06.30
Component Structure
Description
Memory-Mapped
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.
Interrupts
Clocks
Connects clock output interfaces with clock input interfaces. Clock outputs can fanout 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
Component Structure
Altera provides components automatically installed with the Quartus II 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.
Altera Corporation
QII5V1
2014.06.30
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.
GeneratedA generated component's fileset callback allows an instance of the component to create
unique HDL design files based on the instance's parameter values.
ComposedComposed 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
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.
Altera Corporation
6-4
QII5V1
2014.06.30
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>.
When you open a Qsys design, if Qsys detects IP components that require regeneration, the Upgrade IP
Cores dialog box appears and allows you to upgrade outdated components.
Components that you must upgrade in order to successfully compile your design appear in red. Status
icons indicate whether a component is currently being regenerated, the component is encrypted, or that
there is not enough information to determine the status of component. To upgrade a component, in the
Upgrade IP Cores dialog box, select the component that you want to upgrade, and then click Upgrade.
The Quartus II software maintains a list of all IP components associated with your design on the
Components tab in the Project Navigator.
Related Information
Altera Corporation
QII5V1
2014.06.30
6-5
ElaborationDuring 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.
CompositionDuring 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.
GenerationDuring 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.
Altera Corporation
6-6
QII5V1
2014.06.30
the file to complete the component definition. Subsequent topics document the _hw.tcl commands that
are generated by the Component Editor, as well as some of the advanced features that you can add with
your own _hw.tcl commands.
Note: By default, custom component do not have registered outputs, even if they are exported out of the
Qsys system. For a custom component, if you want to export the signals, you must add the
registered outputs.
Related Information
Altera Corporation
QII5V1
2014.06.30
6-7
NameSpecifies the name used in the _hw.tcl filename, as well as in the top-level module name when
you create a synthesis wrapper file for a non HDL-based component.
Display nameIdentifies the component in the parameter editor, which you use to configure and
instance of the component, and also appears in the IP Catalog under Project and on the System
Contents tab.
VersionSpecifies the version number of the component.
GroupRepresents the category of the component in the list of available components in the IP
Catalog. You can select an existing group from the list, or define a new group by typing a name in the
Group box. Separating entries in the Group box with a slash defines a subcategory. For example, if you
type Memories and Memory Controllers/On-Chip, the component appears in the IP Catalog under
the On-Chip group, which is a subcategory of the Memories and Memory Controllers group. If you
save the component in the project directory, the component appears in the IP Catalog in the group you
specified under Project. Alternatively, if you save the component in the Quartus II installation
directory, the component appears in the specified group under IP Catalog.
DescriptionAllows you to describe the component. This description appears when the user views
the component details.
Created ByAllows you to specify the author of the component.
IconAllows you to enter the relative path to an icon file (.gif, .jpg, or .png format) that represents
the component and appears as the header in the parameter editor for the component. The default
image is the Altera MegaCore function icon.
DocumentationAllows you to add links to documentation for the component, and appears when
you right-click the component in the IP Catalog, and then select Details.
To specify an Internet file, begin your path with http://, for example: http://mydomain.com/
datasheets/my_memory_controller.html.
To specify a file in the file system, begin your path with file:/// for Linux, and file://// for Windows;
for example (Windows): file:////company_server/datasheets my_memory_controller.pdf.
Altera Corporation
6-8
QII5V1
2014.06.30
When you use the Component Editor to create a component, it writes this basic component information
in the _hw.tcl file. The example below shows the component hardware Tcl code related to the entries for
the Component Type tab in figure above. The package require command specifies the Quartus II
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.
Example 6-1: _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 II software.
# request TCL package from ACDS 14.0
package require -exact qsys 14.0
# demo_axi_memory
set_module_property DESCRIPTION \
"Demo AXI-3 memory with optional Avalon-ST port"
set_module_property
set_module_property
set_module_property
set_module_property
set_module_property
Altera Corporation
NAME demo_axi_memory
VERSION 1.0
GROUP "My Components"
AUTHOR Altera
DISPLAY_NAME "Demo AXI Memory"
QII5V1
2014.06.30
6-9
Related Information
Altera Corporation
6-10
QII5V1
2014.06.30
Altera Corporation
QII5V1
2014.06.30
6-11
fileset property. Each synthesis file is individually added to the fileset. If the source files are saved in a
different directory from the working directory where the Component Editor is launched and the _hw.tcl
is located, you can use standard fixed or relative path notation to identify the file location for the PATH
variable.
Example 6-2: _hw.tcl Created from Entries in the Files tab in the Synthesis Files Section
# file sets
add_fileset QUARTUS_SYNTH QUARTUS_SYNTH "" ""
set_fileset_property QUARTUS_SYNTH TOP_LEVEL demo_axi_memory
add_fileset_file demo_axi_memory.sv
SYSTEM_VERILOG PATH demo_axi_memory.sv
add_fileset_file single_clk_ram.v VERILOG PATH single_clk_ram.v
Related Information
Interface Type
asi
aso
avm
Avalon-MM master
avs
Avalon-MM slave
Altera Corporation
6-12
QII5V1
2014.06.30
Interface Prefix
Interface Type
axm
AXI master
axs
AXI slave
apm
APB master
aps
APB slave
coe
Conduit
csi
cso
inr
Interrupt receiver
ins
Interrupt sender
ncm
ncs
rsi
rso
tcm
Avalon-TC master
tcs
Avalon-TC slave
Refer to the Avalon Interface Specifications or the AMBA Protocol Specification for the signal types
available for each interface type.
Related Information
QII5V1
2014.06.30
6-13
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.
Note: The order that you add files to the fileset determines the order of compilation. For VHDL filesets
with VHDL files, you must add the files bottom-up, adding the top-level file last.
Figure 6-3: Specifying the Simulation Output Files on the Files Tab
Example 6-3: _hw.tcl Created from Entries in the Files tab in the Simulation Files Section
add_fileset SIM_VERILOG SIM_VERILOG "" ""
set_fileset_property SIM_VERILOG TOP_LEVEL demo_axi_memory
add_fileset_file single_clk_ram.v VERILOG PATH single_clk_ram.v
add_fileset_file verbosity_pkg.sv SYSTEM_VERILOG PATH \
verification_lib/verbosity_pkg.sv
add_fileset_file demo_axi_memory.sv SYSTEM_VERILOG PATH \
demo_axi_memory.sv
add_fileset SIM_VHDL SIM_VHDL "" ""
set_fileset_property SIM_VHDL TOP_LEVEL demo_axi_memory
set_fileset_property SIM_VHDL ENABLE_RELATIVE_INCLUDE_PATHS false
add_fileset_file demo_axi_memory.sv SYSTEM_VERILOG PATH \
demo_axi_memory.sv
add_fileset_file single_clk_ram.v VERILOG PATH single_clk_ram.v
Altera Corporation
6-14
QII5V1
2014.06.30
Including Internal Register Map Description in the .svd for Slave Interfaces
Connected to an HPS Component
add_fileset_file verbosity_pkg.sv SYSTEM_VERILOG PATH \
verification_lib/verbosity_pkg.sv
Related Information
Including 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.
Example 6-4: Setting the CMSIS_SVD_VARIBLES Interface Property
For example, if you set the CMSIS_SVD_VARIABLES in the _hw tcl file, then in the .svd file if there
is a variable {width} that describes the element <size>${width}</size>, it is replaced by
<size>23</size> during generation of the .svd file. Note that substitution works only within
character data (the data enclosed by <element>...</element>) and not on element attributes.
set_interface_property <interface name> \
CMSIS_SVD_VARIABLES "{width} {23}"
Related Information
Altera Corporation
QII5V1
2014.06.30
6-15
When the component includes HDL files, the parameters match those defined in the top-level module,
and you cannot be add or remove them on the Parameters tab. To add or remove the parameters, edit
your HDL source, and then re-analyze the file.
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:
NameSpecifies the name of the parameter.
Default ValueSets the default value used in new instances of the component.
EditableSpecifies whether or not the user can edit the parameter value.
TypeDefines the parameter type as string, integer, boolean, std_logic, logic vector, natural, or
positive.
GroupAllows you to group parameters in parameter editor.
TooltipAllows you to add a description of the parameter that appears when the user of the
component points to the parameter in the parameter editor.
Altera Corporation
6-16
QII5V1
2014.06.30
parameter is specified in the HDL instance wrapper when creating instances of the component.
The Group column in the Parameters tab maps to the display items section with the
add_display_item commands.
Altera Corporation
QII5V1
2014.06.30
6-17
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
add_parameter AXI_DATA_W INTEGER 32
...
#
# display items
#
add_display_item "AXI Port Widths" AXI_ID_W PARAMETER ""
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
Related Information
Altera Corporation
6-18
QII5V1
2014.06.30
Types of Parameters
Meaning
{a b c}
a, b, or c
{1 2 4 8 16}
1, 2, 4, 8, or 16
{1:3}
1 through 3, inclusive
{1 2 3 7:10}
1, 2, 3, or 7 through 10 inclusive
Related Information
Types of Parameters
Qsys uses the following parameter types: user parameters, system information parameters, and derived
parameters.
User Parameters on page 6-18
System Information Parameters on page 6-18
Derived Parameters on page 6-19
Related Information
User Parameters
User parameters are parameters that users of a component can control, and appear in the parameter
editor for instances of the component. User parameters map directly to parameters in the component
HDL. For user parameter code examples, such as AXI_DATA_W and ENABLE_STREAM_OUTPUT, refer to
Declaring Parameters with Custom hw.tcl Commands.
You then set the name of the clock interface as the SYSTEM_INFO argument:
set_parameter_property <param> SYSTEM_INFO_ARG <clkname>
Altera Corporation
QII5V1
2014.06.30
Derived Parameters
6-19
Derived Parameters
Derived parameter values are calculated from other parameters during the Elaboration phase, and are
specified in the hw.tcl file with the DERIVED property. Derived parameter values are calculated from other
parameters during the Elaboration phase, and are specified in the hw.tcl file with the DERIVED property.
For example, you can derive a clock period parameter from a data rate parameter. Derived parameters are
sometimes used to perform operations that are difficult to perform in HDL, such as using logarithmic
functions to determine the number of address bits that a component requires.
Related Information
Altera Corporation
6-20
QII5V1
2014.06.30
Related Information
Altera Corporation
QII5V1
2014.06.30
6-21
Related Information
Altera Corporation
6-22
QII5V1
2014.06.30
The Interface column allows you assign a signal to an interface. Each signal must belong to an interface
and be assigned a legal signal type for that interface. To create a new interface of a specific type, select new
<interface type> from the list; this new interface then become available in the list for subsequent signal
assignments. You can highlight all of the signals in an interface and then select an Interface from the list
to apply the Interface name to each signal in the interface.
You edit the interface name on the Interface tab; you cannot edit the interface name on the Signals tab.
Figure 6-6: Signals Tab in the Qsys Components Editor
Related Information
QII5V1
2014.06.30
6-23
You add additional interfaces by clicking Add Interface, and then you must specify the signals for the
added interface on the Signals tab. You can remove interfaces that have no assigned signals by clicking
Remove Interfaces With No Signals.
Figure 6-7: Avalon Streaming Source Interface on the Interfaces Tab
Altera Corporation
6-24
QII5V1
2014.06.30
associatedClock clock
associatedReset reset
readAcceptanceCapability 1
writeAcceptanceCapability 1
combinedAcceptanceCapability 1
readDataReorderingDepth 1
ENABLED true
readIssuingCapability
readAcceptanceCapability
writeIssuingCapability
writeAcceptanceCapability
combinedIssuingCapability
combinedAcceptanceCapability
Altera Corporation
QII5V1
2014.06.30
6-25
Related Information
Related Information
Altera Corporation
6-26
QII5V1
2014.06.30
Related Information
Altera Corporation
QII5V1
2014.06.30
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.
#Create synthesis fileset with fileset_callback and set top level
add_fileset my_synthesis_fileset QUARTUS_SYNTH fileset_callback
set_fileset_property my_synthesis_fileset TOP_LEVEL \
demo_axi_memory
# Create Verilog simulation fileset with same fileset_callback
# and set top level
add_fileset my_verilog_sim_fileset SIM_VERILOG fileset_callback
set_fileset_property my_verilog_sim_fileset TOP_LEVEL \
demo_axi_memory
# Add extra file needed for simulation only
add_fileset_file verbosity_pkg.sv SYSTEM_VERILOG PATH \
verification_lib/verbosity_pkg.sv
# Create VHDL simulation fileset (with Verilog files
# for mixed-language VHDL simulation)
add_fileset my_vhdl_sim_fileset SIM_VHDL fileset_callback
set_fileset_property my_vhdl_sim_fileset TOP_LEVEL demo_axi_memory
add_fileset_file verbosity_pkg.sv SYSTEM_VERILOG PATH
verification_lib/verbosity_pkg.sv
# Define parameters required for fileset_callback
add_parameter RAM_VERSION INTEGER 1
set_parameter_property RAM_VERSION ALLOWED_RANGES {1 2}
set_parameter_property RAM_VERSION HDL_PARAMETER false
add_parameter CSR_ENABLED BOOLEAN enable
set_parameter_property CSR_ENABLED HDL_PARAMETER false
# Create Tcl callback procedure to add appropriate files to
# filesets based on parameters
proc fileset_callback { entityName } {
send_message INFO "Generating top-level entity $entityName"
set ram [get_parameter_value RAM_VERSION]
set csr_enabled [get_parameter_value CSR_ENABLED]
send_message INFO "Generating memory
implementation based on RAM_VERSION $ram
"
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_message INFO "Generating top-level file for \
CSR_ENABLED $csr_enabled"
Altera Corporation
6-28
QII5V1
2014.06.30
Related Information
Altera Corporation
QII5V1
2014.06.30
6-29
my_component
reset
altera
reset
bridge
altera
clock
bridge
clk
slave
my_regs_microcore
my_phy_microcore
pins
Altera Corporation
6-30
QII5V1
2014.06.30
Creating a Component With Differing Structural Qsys View and Generated Output
Files
add_connection clk.out_clk reset.clk
add_connection clk.out_clk regs.clk
add_connection clk.out_clk phy.clk
add_connection reset.out_reset regs.reset
add_connection reset.out_reset phy.clk_reset
add_connection regs.output phy.input
add_connection phy.output regs.input
}
Related Information
Altera Corporation
QII5V1
2014.06.30
6-31
Related Information
Altera Corporation
6-32
QII5V1
2014.06.30
Static Components
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
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-14: Typical Usage of the add_hdl_instance Command for Static Components
package require -exact qsys 14.0
set_module_property name add_hdl_instance_example
add_fileset synth_fileset QUARTUS_SYNTH synth_callback
set_fileset_property synth_fileset TOP_LEVEL basic_static
set_module_property elaboration_callback elab
proc elab {} {
# Actual API to instantiate an IP Core
add_hdl_instance emif_instance_name altera_mem_if_ddr3_emif
# Make sure the parameters are set appropriately
set_instance_parameter_value emif_instance_name SPEED_GRADE {7}
...
}
proc synth_callback { output_name } {
add_fileset_file "basic_static.v" VERILOG PATH basic_static.v
}
Example 6-15: 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.
//Top Level Component HDL
module basic_static (input_wire, output_wire, inout_wire);
input [31:0] input_wire;
output [31:0] output_wire;
inout [31:0] inout_wire;
//
//
//
//
emif_instance_name fixed_name_instantiation_in_top_level(
.pll_ref_clk (input_wire), // pll_ref_clk.clk
Altera Corporation
QII5V1
2014.06.30
Generated Components
6-33
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 runtime 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.
Altera Corporation
6-34
QII5V1
2014.06.30
Generated Components
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:
get_instance_property instance_name HDLINSTANCE_GET_GENERATED_NAME
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-16: 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.
package require -exact qsys 14.0
set_module_property name generated_toplevel_component
set_module_property ELABORATION_CALLBACK elaborate
add_fileset QUARTUS_SYNTH QUARTUS_SYNTH generate
add_fileset SIM_VERILOG SIM_VERILOG generate
add_fileset SIM_VHDL SIM_VHDL generate
proc elaborate {} {
# Actual API to instantiate an IP Core
add_hdl_instance emif_instance_name altera_mem_if_ddr3_emif
# Make sure the parameters are set appropriately
set_instance_parameter_value emif_instance_name SPEED_GRADE {7}
...
# instruct Qsys to use auto generated fixed name
set_instance_property emif_instance_name \
HDLINSTANCE_USE_GENERATED_NAME 1
}
proc generate { entity_name } {
# get the autogenerated name for emif_instance_name added
# via add_hdl_instance
set autogeneratedfixedname [get_instance_property \
emif_instance_name HDLINSTANCE_GET_GENERATED_NAME]
set fileID [open "generated_toplevel_component.v" r]
set temp ""
# read the contents of the file
while {[eof $fileID] != 1} {
gets $fileID lineInfo
# replace the top level entity name with the name provided
# during generation
regsub -all "substitute_entity_name_here" $lineInfo \
"${entity_name}" lineInfo
# replace the autogenerated name for emif_instance_name added
# via add_hdl_instance
Altera Corporation
QII5V1
2014.06.30
Generated Components
6-35
Example 6-17: Top-Level HDL Instance and Wrapper File Created By Qsys
// Top Level Component HDL
module substitute_entity_name_here (input_wire, output_wire,
inout_wire);
input [31:0] input_wire;
output [31:0] output_wire;
inout [31:0] inout_wire;
//
//
//
//
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 (
.pll_ref_clk (pll_ref_clk), // pll_ref_clk.clk
.global_reset_n (global_reset_n), // global_reset.reset_n
.soft_reset_n (soft_reset_n), // soft_reset.reset_n
...
...);
endmodule
Related Information
Controlling File Generation Dynamically with Parameters and a Fileset Callback on page 6-26
Altera Corporation
6-36
QII5V1
2014.06.30
Version
Changes
December 2014
14.1.0
November 2013
13.1.0
add_hdl_instance
Added Creating a Component
With Differing Structural
Qsys View and Generated
Output Files.
May 2013
13.0.0
Altera Corporation
QII5V1
2014.06.30
Date
Version
6-37
Changes
November 2012
12.1.0
June 2012
12.0.0
November 2011
11.1.0
Template update.
May 2011
11.0.0
December 2010
10.1.0
Initial release.
For previous versions of the Quartus II Handbook, refer to the Quartus II Handbook Archive.
Related Information
Altera Corporation
Qsys Interconnect
2014.12.15
QII5V1
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
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.
2014 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
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information,
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
ISO
9001:2008
Registered
7-2
Memory-Mapped Interfaces
QII5V1
2014.12.15
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
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 II software design, and show how component interfaces
can be exported and connected to external devices.
PCB
Instruction
M
Master
Network
Interface
S
Control
Qsys Design
in Altera FPGA
Processor
DMA Controller
Data
M
Master
Network
Interface
Interconnect
Read
M
Write
M
Master
Network
Interface
Master
Network
Interface
Response Switch
(Avalon-ST)
Command Switch
(Avalon-ST)
Slave
Network
Interface
Slave
Network
Interface
Slave
Network
Interface
Slave
Network
Interface
Data
Memory
DDR3
Controller
Tri-State
Controller
Tri-State
Conduit
TCM
TCM
TCS
TCS
Instruction
Memory
Qsys Interconnect
Send Feedback
Tri-State Conduit
Pin Sharer & Bridge
DDR3 Chip
Ethernet
MAC/PHY
Chip
Flash
Memory
Chip
Altera Corporation
7-4
QII5V1
2014.12.15
Description
Address
Specifies the byte address for the lowest byte in the current cycle. There are no
restrictions on address alignment.
Size
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.
Cache
Transaction
(Exclusive)
Transaction
(Posted)
Data
For command packets, carries the data to be written. For read response packets,
carries the data that has been read.
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Command
Byteenable
Description
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:
Source_ID
Destination_ID
Response
Thread ID
Byte count
The number of bytes remaining in the transaction, including this beat. Number
of bytes requested by the packet.
Qsys Interconnect
Send Feedback
7-5
Altera Corporation
7-6
QII5V1
2014.12.15
Command
Burstwrap
Description
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 wrapVariable 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 1s. 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
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.
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Command
Data sideband
7-7
Description
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.
Name
Definition
PKT_TRANS_READ
PKT_TRANS_COMPRESSED_READ
PKT_TRANS_WRITE
PKT_TRANS_POSTED
PKT_TRANS_LOCK
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.
Qsys Interconnect
Send Feedback
Altera Corporation
7-8
QII5V1
2014.12.15
Interconnect Domains
Figure 7-2: Transformation when Generating a System with Memory-Mapped and Slave Components
Qsys components that implement the blocks appear shaded.
Avalon-MM or AXI
Avalon-ST
Master
Interface
Master
Network
Interface
Master
Interface
Master
Network
Interface
Avalon-ST
Network
(Command)
Avalon-ST
Network
(Response)
Avalon-MM or AXI
Slave
Network
Interface
Slave
Interface
Slave
Network
Interface
Slave
Interface
Related Information
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.
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
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 16bit 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
S
64-Bit
Avalon-MM
Slave
Qsys Interconnect
Send Feedback
64-Bit
Avalon-MM
Master
M
4:1
16-Bit
Avalon-MM
Master
M
16-Bit
Avalon-MM
Slave
16-Bit
Avalon-MM
Slave
S
64-Bit
Avalon-MM
Slave
Altera Corporation
7-10
QII5V1
2014.12.15
Component 1
Component 2
64-bit
Avalon-MM
Master
64-bit
Avalon-MM
Master
16-bit
Avalon-MM
Master
Domain 1
Domain 2
64-bit
Avalon-MM
Slave
64-bit
Avalon-MM
Slave
16-bit
Avalon-MM
Slave
16-bit
Avalon-MM
Slave
Command Network
Altera Corporation
Response Network
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
7-11
Router
Master
Interface
Translator
Agent
response [1:0 ]
Limiter
Avalon-ST
Network
(Response)
Master
Interface
AXI
Translator
AXI
Master
Agent
Write Command
Router
Router
Limiter
Avalon-ST
Network
(Command)
Write Response
Read Response
Limiter
Avalon-ST
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
Qsys Interconnect
Send Feedback
Altera Corporation
7-12
QII5V1
2014.12.15
The Avalon-MM Master Agent translates Avalon-MM master transactions into Qsys command packets
and translates the Qsys Avalon-MM slave response packets into Avalon-MM responses.
The Avalon-MM Master Translator interfaces with an Avalon-MM master component and converts the
Avalon-MM master interface to a simpler representation for use in Qsys.
The Avalon-MM Master translator performs the following functions:
An AXI Master Agent accepts AXI commands and produces Qsys command packets. It also accepts Qsys
response packets and converts those into AXI responses. This component has separate packet channels
for read commands, write commands, read responses, and write responses. Avalon master agent drives
the QoS and BUSER, WUSER, and RUSER packet fields with default values AXQO and b0000, respectively.
Note: For signal descriptions, refer to Qsys Packet Format.
Related Information
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:
An APB master agent accepts APB commands and produces or generates Qsys command packets. It also
converts Qsys response packets to APB responses.
An APB slave agent issues resulting transaction to the APB interface. It also accepts creates Qsys response
packets.
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
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
SoCs 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.
The Memory-Mapped Traffic Limiter ensures the responses arrive in order. It prevents any command
from being sent if the response could conflict with the response for a command that has already been
issued. By guaranteeing in-order responses, the Traffic Limiter simplifies the response network.
Avalon-ST
Network
(Command)
Overflow Error
Command
Waitrequest
Agent
Avalon-ST
Network
(Response)
Qsys Interconnect
Send Feedback
Translator
Slave
Interface
Response
Altera Corporation
7-14
QII5V1
2014.12.15
Network Interface
Avalon-ST
Network
(Command)
Write Command
Read Command
AXI
Agent
Avalon-ST
Network
(Response)
AXI
Translator
Slave
Interface
Write Response
Read Response
The Avalon-MM Slave Translator interfaces to an Avalon-MM slave component as the Avalon-MM Slave
Network Interface figure illustrates. It converts the Avalon-MM slave interface to a simplified
representation that the Qsys network can use.
An Avalon-MM Merlin Slave Translator performs the following functions:
Drives the beginbursttransfer and byteenable signals.
Supports Avalon-MM slaves that operate using fixed timing and or slaves that use the readdatavalid
signal to identify valid data.
Translates the read, write, and chipselect signals into the representation that the Avalon-ST slave
response network uses.
Converts active low signals to active high signals.
Translates word and symbol addresses and burstcounts.
Handles burstcount timing and sequencing.
Removes unnecessary address bits.
Related Information
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:
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
7-15
Wait states extend the duration of a transfer by one or more cycles. Wait state insertion logic
accommodates the timing needs of each slave, and causes the master to wait until the slave can proceed.
Qsys interconnect inserts wait states into a transfer when the target slave cannot respond in a single clock
cycle, as well as in cases when slave read and write signals have setup or hold time requirements.
Figure 7-9: Wait State Insertion Logic for One Master and One Slave
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.
read/write
Master
Port
wait request
address
Wait-State
Insertion
Logic
read/write
Slave
Port
data
The Avalon-MM Slave Agent accepts command packets and issues the resulting transactions to the
Avalon interface. For pipelined slaves, an Avalon-ST FIFO stores information about pending transactions.
The size of this FIFO is the maximum number of pending responses that you specify when creating the
slave component. The Avalon-MM Slave Agent also backpressures the Avalon-MM master command
interface when the FIFO is full if the slave component includes the waitrequest signal.
An AXI Slave Agent works similar to a master agent in reverse. The AXI slave Agent accepts Qsys
command packets to create AXI commands, and accepts AXI responses to create Qsys response packets.
This component has separate packet channels for read commands, write commands, read responses, and
write responses.
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
Qsys Interconnect
Send Feedback
Altera Corporation
7-16
Fairness-Based Shares
QII5V1
2014.12.15
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.
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Round-Robin Scheduling
7-17
Master 1
Master 2
Master 1
Master 2
Master 1
Master 1
Master 2
Master 1
Master 2
Master 1
Master 2
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.
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.
Qsys Interconnect
Send Feedback
Altera Corporation
7-18
QII5V1
2014.12.15
Memory-Mapped Arbiter
Command
packet for
master 0
Command
packet for
master 1
Master 0
Arbiter
for
slave 0
Master 1
Selected request
Arbiter
Arbiter
for
for
slave
slave 11
Selected request
Master 2
Arbiter
for
slave 2
Command
packet for
master 2
Master 3
Command
packet for
master 3
Selected request
Arbiter
for
slave 3
Selected request
= Pipeline stage, masters 0-3
= Pipeline stage, 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.
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
7-19
readdata1
address
Data
Path
Multiplexer
readdata
Slave
Port 1
writedata
Master
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.
The Memory-Mapped Width Adapter is used in the Avalon-ST domain and operates with information
contained in the packet format.
The memory-mapped width adapter accepts packets on its sink interface with one data width and
produces output packets on its source interface with a different data width. The ratio of the narrow data
width must be a power of two, such as 1:4, 1:8, and 1:16. The ratio of the wider data width to the narrower
width must also be a power of two, such as 4:1, 8:1, and 16:1 These output packets may have a different
size if the input size exceeds the output data bus width, or if data packing is enabled.
When the width adapter converts from narrow data to wide data, each input beat's data and byte enables
are copied to the appropriate segment of the wider output data and byte enables signals.
Qsys Interconnect
Send Feedback
Altera Corporation
7-20
QII5V1
2014.12.15
clock
addr_in[7:0]
Adapter
Input
byteenable_in[3:0]
wide_data[31:0]
addr_out[7:0]
Adapter
Output
08
C
AABBCCDD
08
09
0A
0B
byteenable_out[3:0]
narrow_data[7:0]
DD
CC
BB
AA
write
AXI Wide-to-Narrow Adaptation
For all cases of AXI wide-to-narrow adaptation, read data is re-packed to match the original size.
Responses are merged, with the following error precedence: DECERR, SLVERR, OKAY, and EXOKAY.
Table 7-3: AXI Wide-to-Narrow Adaptation (Downsizing)
Burst Type
Behavior
IncrementingInc If the transaction size is less than or equal to the output width, the burst is unmodified.
rementing
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.
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Burst Type
Wrapping
7-21
Behavior
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.
Behavior
Incrementing
The burst (and its response) passes through unmodified. Data and write strobes are
placed in the correct output segment.
Wrapping
Fixed
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
slaves 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.
Qsys Interconnect
Send Feedback
Altera Corporation
7-22
QII5V1
2014.12.15
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.
Qsys automatically inserts burst adapters into your system depending on your master and slave
connections, and properties. You can select burst adapter implementation options on the Interconnect
Requirements tab.
To access the implementation options, you must select the Burst adapter implementation setting for the
$system identifier.
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
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
7-23
Incrementing
Behavior
Sequential Slave
Bursts that exceed slave_max_burst_length are converted to multiple
sequential bursts of a length less than or equal to the slave_max_burst_length.
Otherwise, the burst is unconverted. For example, for an Avalon slave with a
maximum burst length of 4, an INCR7 burst is converted to INCR4 + INCR3.
Wrapping Slave
Bursts that exceed the slave_max_burst_length are converted to multiple
sequential bursts of length less than or equal to the slave_max_burst_length.
Bursts that exceed the wrapping boundary are converted to multiple sequential
bursts that respect the slave's wrapping boundary.
Wrapping
Sequential Slave
A WRAP burst is converted to multiple sequential bursts. The sequential bursts
are less than or equal to the max_burst_length and respect the transaction's
wrapping boundary
Wrapping Slave
If the WRAP transaction's boundary matches the slave's boundary, then the
burst passes through. Otherwise, the burst is converted to sequential bursts that
respect both the transaction and slave wrap boundaries.
Fixed
Fixed bursts are converted to sequential bursts of length 1 that repeatedly access
the same address.
Narrow
Sequential
Qsys Interconnect
Send Feedback
Definition
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.
Altera Corporation
7-24
QII5V1
2014.12.15
Responses
Burst Type
Definition
Wrapping
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.
Responses
Qsys merges write responses if a write is converted (burst adapted) into multiple bursts. Qsys requires
read response merging for a downsized (wide-to-narrow width adapted) read.
Qsys merges responses based on the following precedence rule:
DECERR > SLVERR > OKAY > EXOKAY
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: For Avalon-MM slaves without the response signal, there is no way to notify a connected master
that a transaction has not completed successfully. As a result, the Qsys interconnect generates an
OKAY response on behalf of an Avalon-MM slave that does not have the response signal.
Related Information
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
7-25
Address
Decoding
Logic
read/write
address [S..0]
read/write
address [T..2]
Qsys Interconnect
Send Feedback
Slave
Port 1
(8-bit)
Slave
Port 2
(32-bit)
Altera Corporation
7-26
QII5V1
2014.12.15
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
7-27
RAM
Processor
Control
Slave
Data Source
Data Plane
Qsys Interconnect
Send Feedback
Timer
Control
Slave
Control
Slave
Data Sink
FIFO
( Rx Interface)
Data
Data
Source
Source
UART
ready
valid
channel
data
Data
Sink
( Tx Interface)
Data
Source
ready
valid
channel
data
Data
Sink
Avalon-Streaming Interface
Altera Corporation
7-28
QII5V1
2014.12.15
Avalon-ST Adapters
Data Source
data
Data Sink
Figure 7-21: 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.
Data Source
ready
valid
channel
startof packet
endofpacket
empty
error
data
Data Sink
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
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
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Avalon-ST Adapter
7-29
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.
Description
Symbol Width
Use Packet
Description
Sets the bit width of the source interface channel port. If set to 0, there
is no channel port on the sink interface.
Sets the bit width of the source interface error port. If set to 0, there is
no error port on the sink interface.
A list of strings that describe the error conditions for each bit of the
source interface error signal.
Qsys Interconnect
Send Feedback
Altera Corporation
7-30
QII5V1
2014.12.15
Parameter Name
Description
Indicates whether the source interface includes the empty port, and
whether the sink interface should also include the empty port.
Indicates the bit width of the source interface empty port, and sets the
bit width of the sink interface empty port.
Indicates whether the sink interface uses the ready port, and if set,
configures the source interface to use the ready port.
Description
Indicates the bit width of the data port on the sink interface connected
to the source interface.
Indicates the bit width of the channel port on the sink interface
connected the source interface.
Indicates the bit width of the error port on the sink interface
connected to the adapter's source interface. If set to zero, there is no
error port on the source interface.
A list of strings that describe the error conditions for each bit of the
error port on the sink interface connected to the source interface.
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.
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Channel Adapter
Parameter Name
7-31
Description
Channel Adapter
The channel adapter provides adaptations between interfaces that have different channel signal widths.
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 sources channel is connected to the sinks
source's maximum channel number is greater than channel unchanged. If the sources 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.
Avalon-ST Channel Adapter Input Interface Parameters
Table 7-11: Avalon-ST Channel Adapter Input Interface Parameters
Parameter Name
Description
Max Channel
Qsys Interconnect
Send Feedback
Altera Corporation
7-32
QII5V1
2014.12.15
Description
Max Channel
Description
Ready Latency
The data format adapter allows you to connect interfaces that have different values for the parameters
defining the data signal, or interfaces where the source does not use the empty signal, but the sink does
use the empty signal. One of the most common uses of this adapter is to convert data streams of different
widths.
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
7-33
Qsys Interconnect
Send Feedback
Altera Corporation
7-34
QII5V1
2014.12.15
128 Bits
128-Bit RX
Interface
128 Bits
32 Bits
32-Bit TX
Interface
32-Bit TX
Interface
128 Bits
Data
Format
Adapter
32 Bits
128 Bits
Data
Format
Adapter
32 Bits
32-Bit TX
Interface
Description
Description
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Avalon-ST Data Format Adapter Common to Input and Output Interface Parameters
7-35
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
Parameter Name
Description
Max Channel
Read Latency
Error Adapter
The error adapter ensures that per-bit-error information provided by the source interface is correctly
connected to the sink interfaces 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.
Avalon-ST Error Adapter Input Interface Parameters
Table 7-18: Avalon-ST Error Adapter Input Interface Parameters
Parameter Name
Description
The width of the error signal. Valid values are 0256 bits. Type 0 if the
error signal is not used.
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.
Qsys Interconnect
Send Feedback
Altera Corporation
7-36
QII5V1
2014.12.15
Description
The width of the error signal. Valid values are 0256 bits.
Type 0 if you do not need to send error values.
Description
Ready Latency
Max Channel
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Timing Adapter
7-37
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.
Adaptation
In this case, the source can respond to backpressure, 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 source and sink both support backpressure, but The source responds to ready assertion or deasser
the sinks 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 sinks 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 sources
inability to respond in time.
Avalon-ST Timing Adapter Input Interface Parameters
Table 7-22: Avalon-ST Timing Adapter Input Interface Parameters
Parameter Name
Description
Read Latency
Qsys Interconnect
Send Feedback
Altera Corporation
7-38
QII5V1
2014.12.15
Parameter Name
Description
Description
Read Latency
Description
Max Channel
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Interrupt Interfaces
7-39
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
Qsys Interconnect
Send Feedback
Altera Corporation
7-40
QII5V1
2014.12.15
IRQs simultaneously, the receiver logic determines which IRQ has highest priority, and then responds
appropriately.
Figure 7-23: 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
1
irq
Interrupt
Controller
Sender
2
Sender
3
irq
irq
irq0
irq1
irq2
irq3
irq4
irq5
irq6
Receiver
irq31
Sender
4
irq
IRQ Bridge
The IRQ Bridge allows you to route interrupt wires between Qsys subsystems.
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
IRQ Mapper
7-41
export
IR
export
export
IRQ
export
IS
IS
IS
Interrupt
Sender 1
Interrupt
Sender 2
Interrupt
Sender 3
Bridge
IS
Interrupt
Sender 4
IS
Peripheral Subsystem
4-bit bus
IR
CPU Subsystem
IS
Interrupt Sender
IR
Nios II
Processor
Interrupt Receiver
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.
Qsys Interconnect
Send Feedback
Altera Corporation
7-42
QII5V1
2014.12.15
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-25: IRQ Column in Qsys
Circled in the IRQ column are the default interrupt priorities allocated for the CPU subsystem.
Related Information
The IRQ Clock Crosser synchronizes interrupt senders and receivers that are in different clock domains.
To use this component, connect the clocks for both the interrupt sender and receiver, and for both the
interrupt sender and receiver interfaces. Qsys automatically inserts this component when it is required.
Clock Interfaces
Clock interfaces define the clocks used by a component. Components can have clock inputs, clock
outputs, or both. You can use the Clock Settings tab to define external clock sources, for example an
oscillator on your board.
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
7-43
The Clock Source parameters allows you to set the following options:
Clock frequencyThe 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
NoneThe 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.
BothThe reset is asserted and deasserted synchronously.
DeassertThe reset is deasserted synchronously and asserted asynchronously.
For more information about synchronous design practices, refer to Recommended Design Practices
Related Information
You can connect the HSSI Serial Clock interface with only similar type of interfaces, for example, you can
connect a HSSI Serial Clock Source interface to a HSSI Serial Clock Sink interface.
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.
Table 7-25: HSSI Serial Clock Source Port Roles
Name
clk
Qsys Interconnect
Send Feedback
Direction
Output
Width
1 bit
Description
Altera Corporation
7-44
QII5V1
2014.12.15
clockRate
Type
long
Default
Derived
No
Description
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.
Table 7-27: HSSI Serial Clock Sink Port Roles
Name
clk
Direction
Output
Width
Description
clockRate
Type
long
Default
Derived
No
Description
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
7-45
hssi_serial_clock_port_out \
hssi_serial_clock_port_in clk \
}
proc generate { output_name } {
add_fileset_file hssi_serial_component.v VERILOG PATH \
"hssi_serial_component.v"
}
Qsys Interconnect
Send Feedback
Altera Corporation
7-46
QII5V1
2014.12.15
You can connect the HSSI Bonded Clock interface with only similar type of Interfaces, for example, you
can connect a HSSI Bonded Clock Source interface to a HSSI Bonded Clock Sink interface.
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.
Table 7-29: HSSI Bonded Clock Source Port Roles
Name
clk
Direction
Output
Width
Description
1 to 24 bits
Type
Default
Derived
Description
clockRate
long
No
serialization
long
No
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
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
7-47
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.
Table 7-31: HSSI Bonded Clock Source Port Roles
Name
clk
Direction
Output
Width
Description
1 to 24 bits
Type
Default
Derived
Description
clockRate
long
No
serialization
long
No
Qsys Interconnect
Send Feedback
Altera Corporation
7-48
QII5V1
2014.12.15
hssi_bonded_clock_port_out \
hssi_bonded_clock_port_in \
}
proc generate { output_name } {
add_fileset_file hssi_bonded_component.v VERILOG PATH \
"hssi_bonded_component.v"}
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.
Example 7-4: HSII Bonded Clock Instantiated in a Composed Component
add_instance myinst1 hssi_bonded_component
add_instance myinst2 hssi_bonded_component
# add connection from source of myinst1 to sink of myinst2
add_connection myinst1.my_clock_start myinst2.my_clock_end \
hssi_bonded_clock
# adding connection from source of myinst2 to sink of myinst1
add_connection myinst2.my_clock_start myinst2.my_clock_end \
hssi_bonded_clock
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Reset Interfaces
7-49
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 edgesSpecifies the level of synchronization. You can select one the
following options:
NoneThe 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.
BothThe reset is asserted and deasserted synchronously.
DeassertThe reset is deasserted synchronously and asserted asynchronously.
Synchronization depthSpecifies the number of register stages the synchronizer uses to eliminate the
propagation of metastable events.
Reset requestEnables 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.
Qsys Interconnect
Send Feedback
Altera Corporation
7-50
QII5V1
2014.12.15
Reset Bridge
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 resetWhen turned on, reset is asserted low.
Synchronous edgesSpecifies the level of synchronization and includes the following options:
NoneThe reset is asserted and deasserted asynchronously. Use this setting if you have internal
synchronization circuitry.
BothThe reset is asserted and deasserted synchronously.
DeassertThe reset is deasserted synchronously, and asserted asynchronously.
Number of reset outputsThe 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.
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
7-51
CSR
CSR_MASK/PVR
CSR_CONTROL(csr_*)
reset_logging
Parameter:
ASRT_DELAY(0:N)
Sync
Sync
Sync
Sync
reset_in0
reset_in1
reset_in2
reset_in M
Reset
Controller
reset_dsrt_qual0
reset_dsrt_qual1
reset_dsrt_qual2
reset_dsrt_qual N
assrt_en
reset_in_sync
Main
FSM
enable
done
enable
done
ASRT SEQ
set_reset[ N :0]
RESET_OUT
DSRT SEQ
reset_out0
reset_out1
reset_out2
reset_out N
dr_reset[ N :0]
Deglitch
Deglitch
Deglitch
Deglitch
Parameter:
DSRT_QUALCNT_(0:N)
Parameter:
MIN_ASRT_TIME
Parameter:
DSRT_DELAY(0:N)
ENABLE_DEASSERTION_INPUT_QUAL(0:N)
Reset Controller Reused reset controller block. It synchronizes the reset inputs into one and feed into the main FSM of the sequencer
block.
Sync Synchronization block (double flip-flop).
Deglitch Deglitch block. This block waits for a signal to be at a level for
X clocks before propagating the input to the output.
CSR This block contains the CSR Avalon interface and related CSR register and control block in the sequencer.
Main FSM Main sequencer. This block determines when assertion/deassertion and assertion hold timing occurs.
[A/D]SRT SEQ Generic sequencer block that sequences out assertion/deassertion of reset from 0:N. The block has multiple
counters that saturate upon reaching count.
RESET_OUT Controls the end output via:
Set/clear from the ASRT_SEQ/DSRT_SEQ.
Masking/forcing from CSR controls.
Remap of numbering (parameterization).
Description
Qsys Interconnect
Send Feedback
Altera Corporation
7-52
QII5V1
2014.12.15
Parameter
Description
reset_out#
Lists the reset output signals. Set the parameters in the other
columns for each reset signal in the table.
ASRT Seq#
ASRT Cycle#
DSRT Seq#
DSRT Cycle#/Deglitch#
USE_DSRT_QUAL
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
7-53
Qsys Interconnect
Send Feedback
Altera Corporation
7-54
QII5V1
2014.12.15
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.
Reset Sequencer Status Register Offset 0x00
The Status register contains bits that indicate the sources of resets that cause a reset.
You can clear bits by writing 1 to the bit location. The Reset Sequencer ignores writes to bits with a value
of 0. If the sequencer is reset (power-on-reset), all bits are cleared, except the power on reset bit.
Table 7-34: Values for the Status Register at Offset 0x00
Bit
Attrib
ute
Defaul
t
31
RO
30
RW1C 0
Description
29
RW1C 0
28:26
RO
25:16
RW1C 0
15:12
RO
Reserved.
11
RW1C 0
Altera Corporation
Reserved.
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Bit
Attrib
ute
Defaul
t
7-55
Description
10
RW1C 0
RW1C 0
RW1C 0
RW1C 0
RW1C 0
RW1C 0
RW1C 0
RW1C 0
RW1C 0
RW1C 0
RW1C 0
31
Attrib
ute
Defaul
t
RO
Qsys Interconnect
Send Feedback
Description
Reserved.
Altera Corporation
7-56
QII5V1
2014.12.15
Bit
Attrib
ute
Defaul
t
30
RW
Interrupt on Reset Asserted and waiting for SW to proceed enable. When set,
the IRQ is set when the sequencer is waiting for the software to proceed in an
assertion sequence.
29
RW
28:26
RO
Reserved.
25:16
RW
15:12
RO
Reserved.
11
RW
Interrupt on reset_in9 EnableWhen set, the IRQ is set when the reset_in9
trigger status bit is set.
10
RW
Interrupt on reset_in8 EnableWhen set, the IRQ is set when the reset_in8
trigger status bit is set.
RW
Interrupt on reset_in7 EnableWhen set, the IRQ is set when the reset_in7
trigger status bit is set.
RW
Interrupt on reset_in6 EnableWhen set, the IRQ is set when the reset_in6
trigger status bit is set.
RW
Interrupt on reset_in5 EnableWhen set, the IRQ is set when the reset_in5
trigger status bit is set.
RW
Interrupt on reset_in4 EnableWhen set, the IRQ is set when the reset_in4
trigger status bit is set.
RW
Interrupt on reset_in3 EnableWhen set, the IRQ is set when the reset_in3
trigger status bit is set.
RW
Interrupt on reset_in2 EnableWhen set, the IRQ is set when the reset_in2
trigger status bit is set.
RW
Interrupt on reset_in1 EnableWhen set, the IRQ is set when the reset_in1
trigger status bit is set.
RW
Interrupt on reset_in0 EnableWhen set, the IRQ is set when the reset_in0
trigger status bit is set.
Altera Corporation
Description
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Bit
7-57
Attrib
ute
Defaul
t
Description
RW
Interrupt on Software triggered reset EnableWhen set, the IRQ is set when
the software triggered reset status bit is set.
RW
Attrib
ute
Defaul
t
Description
31:3
RO
Reserved.
RW
RW
WO
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
Bit
31:10
Attrib
ute
Defaul
t
RO
Qsys Interconnect
Send Feedback
Description
Reserved.
Altera Corporation
7-58
QII5V1
2014.12.15
Reset Sequencer Software Sequenced Reset Bring Up Control Register Offset 0x10
Bit
9:0
Attrib
ute
Defaul
t
RW
3FF
Description
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
Bit
Attrib
ute
Defaul
t
Description
31:10
RO
Reserved.
9:0
RW
3FF
Attrib
ute
Defaul
t
Description
31:26
RO
Reserved.
25:16
WO
15:10
RO
Reserved.
9:0
WO
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
7-59
Attrib
ute
Defaul
t
31:10
RO
Reserved.
9:0
RW
Qsys Interconnect
Send Feedback
Description
Altera Corporation
7-60
QII5V1
2014.12.15
IRQ
Asserted?
yes
no
Software checks bit 1 of the Status
egister. When set, it indicates that Reset
Sequencer has completed initiating a
rest throught he sequencer.
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
7-61
Qsys Interconnect
Send Feedback
Altera Corporation
7-62
QII5V1
2014.12.15
Software sets the Enable softwaresequenced reset entry bit (bit 2 of the
Control Register).
Setup is complete.
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Conduits
7-63
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
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.
Qsys Interconnect
Send Feedback
Altera Corporation
7-64
QII5V1
2014.12.15
Interconnect Pipelining
Command
packet for
master 0
Command
packet for
master 1
Master 0
Arbiter
for
slave 0
Master 1
Selected request
Arbiter
Arbiter
for
for
slave
slave 11
Selected request
Master 2
Arbiter
for
slave 2
Command
packet for
master 2
Master 3
Command
packet for
master 3
Selected request
Arbiter
for
slave 3
Selected request
= Pipeline stage, masters 0-3
= Pipeline stage, 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
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
7-65
0.000
0.204
0.242
0.100
0.339
0.468
0.220
cpu_instruction_master|out_shifter[63]|q
mm_domain_0|addr_router_001|Equal5~0|datac
mm_domain_0|addr_router_001|Equal5~0|combout
mm_domain_0|addr_router_001|Equal5~1|dataa
mm_domain_0|addr_router_001|Equal5~1|combout
mm_domain_0|addr_router_001|src_channel[5]~0|datad
mm_domain_0|addr_router_001|src_channel[5]~0|combout
Qsys Interconnect
Send Feedback
Altera Corporation
7-66
QII5V1
2014.12.15
Channels
Qsys 14.0 has the following support and restrictions for AXI3 channels.
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.
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Cacheable (Modifiable)
7-67
Cacheable (Modifiable)
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 noncacheable, with the allocate bits tied low. Qsys provides compile-time options to control the cache
behavior of Avalon transactions on a per-master basis.
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
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.
According to the AMBA Protocol Specifications, there is no ordering requirement between reads and
writes. However, Avalon has an implicit ordering model that requires transactions from a master to the
same slave to be in order. As a result, there is a potential read-after-write risk when Avalon masters
Qsys Interconnect
Send Feedback
Altera Corporation
7-68
QII5V1
2014.12.15
Data Buses
transact to AXI slaves. In response to this potential risk, Avalon interfaces provide a compile-time option
to enforce strict order. When turned on, the Avalon interface waits for outstanding write responses before
issuing reads.
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.
When an Avalon master issues a transaction to an AXI slave, the transaction cannot cross 4KB
boundaries. Non-bursting Avalon masters already follow this boundary restriction.
Read side effects can occur when more bytes than necessary are read from the slave, and the unwanted
data that are read are later inaccessible on subsequent reads. For write commands, the correct byteenable
paths are asserted based on the size of the transactions. For read commands, narrow-sized bursts are
broken up into multiple non-bursting commands, and each command with the correct byteenable paths
asserted.
Note: Qsys always assumes that the byteenable is asserted based on the size of the command, not the
address of the command. The following scenarios are examples:
For a 32-bit AXI master that issues a read command with an unaligned address starting at
address 0x01, and a burstcount of 2 to a 32-bit Avalon slave, the starting address is: 0x00.
For a 32-bit AXI master that issues a read command with an unaligned address starting at
address 0x01, with 4-bytes to an 8-bit AXI slave, the starting address is: 0x00.
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Bridges
7-69
do not require the high performance of a pipelined bus interface. Signal transitions are sampled at the
rising edge of the clock to enable the integration of APB peripherals easily into any design flow.
Qsys allows connections between APB components, and AXI3, AXI4, and Avalon memory-mapped
interfaces. The following sections describe unique or exceptional APB support in the Qsys software.
Refer to the AMBA APB Protocol Specifications for AXI4 on the ARM website for more information.
Related Information
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
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 nonbursting 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.
Qsys Interconnect
Send Feedback
Altera Corporation
7-70
QII5V1
2014.12.15
Burst Support
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 nonbursting 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.
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.
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Ordering Model
7-71
Ordering Model
Out of order support is not implemented in Qsys, version 14.0. Qsys processes AXI slaves as device nonbufferable memory types.
The following describes the required behavior for the device non-bufferable memory type:
(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.
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
Qsys Interconnect
Send Feedback
Altera Corporation
7-72
QII5V1
2014.12.15
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.
Type
Description
associatedClock
string
associatedReset
string
Width
Master
Direction
Slave Direction
Required
tvalid
Output
Input
Yes
tready
Input
Output
No
tdata(6)
8:4096
Output
Input
No
tstrb
1:512
Output
Input
No
tkeep
1:512
Output
Input
No
tid(7)
1:8
Output
Input
No
tdest(8)
1:4
Output
Input
No
tuser(9)
1:4096
Output
Input
No
tlast
Output
Input
No
Adaptation
AXI4 stream adaptation support is not available. AXI4 stream master and slave interface signals and
widths must match.
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
AXI4-Lite Signals
7-73
AXI4-Lite Signals
Qsys supports all AXI4-Lite interface signals. All signals are required.
Table 7-43: AXI4-Lite Signals
Global
Write Address
Channel
Write Data
Channel
Write
Response
Channel
Read Address
Channel
ACLK
AWVALID
WVALID
BVALID
ARVALID
RVALID
ARESETn
AWREADY
WREADY
BREADY
ARREADY
RREADY
AWADDR
WDATA
BRESP
ARADDR
RDATA
AWPROT
WSTRB
ARPROT
RRESP
AXI4-Lite IDs
AXI4-Lite does not support IDs. Qsys performs ID reflection inside the slave agent.
Qsys Interconnect
Send Feedback
Altera Corporation
7-74
QII5V1
2014.12.15
Burst adapterAvalon and AXI3 and AXI4 bursting masters require a burst adapter to shorten the
burst length to 1 before sending a transaction to an AXI4-Lite slave.
Qsys interconnect uses a width adapter for mismatched data widths.
Qsys interconnect performs ID reflection inside the slave agent.
An AXI4-Lite slave must have an address width of at least 12-bits.
AXI4-Lite does not have the AXSIZE parameter. Narrow master to a wide AXI4-Lite slave is not
supported. For masters that support narrow-sized bursts, for example, AXI3 and AXI4, a burst to an
AXI4-Lite slave must have a burst size equal to or greater than the slave's burst size.
Direction
Width
araddr
output
1 - 64
arburst
output
arcache
output
arid
output
1 - 18
arlen
output
arlock
output
arprot
output
arready
input
arsize
output
aruser
output
1 - 64
arvalid
output
awaddr
output
1 - 64
awburst
output
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Name
Direction
7-75
Width
awcache
output
awid
output
1 - 18
awlen
output
awlock
output
awprot
output
awready
input
awsize
output
awuser
output
1 - 64
awvalid
output
bid
input
1 - 18
bready
output
bresp
input
bvalid
input
rdata
input
rid
input
1 - 18
rlast
input
rready
output
rresp
input
rvalid
input
wdata
output
wid
output
1 - 18
wlast
output
wready
input
wstrb
output
wvalid
output
Direction
Width
araddr
input
1 - 64
arburst
input
Qsys Interconnect
Send Feedback
Altera Corporation
7-76
QII5V1
2014.12.15
Name
Direction
Width
arcache
input
arid
input
1 - 18
arlen
input
arlock
input
arprot
input
arready
output
arsize
input
aruser
input
1 - 64
arvalid
input
awaddr
input
1 - 64
awburst
input
awcache
input
awid
input
1 - 18
awlen
input
awlock
input
awprot
input
awready
output
awsize
input
awuser
input
1 - 64
awvalid
input
bid
output
1 - 18
bready
input
bresp
output
bvalid
output
rdata
output
rid
output
1 - 18
rlast
output
rready
input
rresp
output
rvalid
output
wdata
input
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Name
Direction
7-77
Width
wid
input
1 - 18
wlast
input
wready
output
wstrb
input
wvalid
input
Direction
Width
araddr
output
1 - 64
arburst
output
arcache
output
arid
output
1 - 18
arlen
output
arlock
output
arprot
output
arready
input
arregion
output
1-4
arsize
output
aruser
output
1 - 64
arvalid
output
awaddr
output
1 - 64
awburst
output
awcache
output
awid
output
1 - 18
awlen
output
awlock
output
awprot
output
awqos
output
1-4
awready
input
awregion
output
1-4
Qsys Interconnect
Send Feedback
Altera Corporation
7-78
QII5V1
2014.12.15
Name
Direction
Width
awsize
output
awuser
output
1 - 64
awvalid
output
bid
input
1 - 18
bready
output
bresp
input
buser
input
1 - 64
bvalid
input
rdata
input
rid
input
1 - 18
rlast
input
rready
output
rresp
input
ruser
input
1 - 64
rvalid
input
wdata
output
wid
output
1 - 18
wlast
output
wready
input
wstrb
output
wuser
output
1 - 64
wvalid
output
Direction
Width
araddr
input
1 - 64
arburst
input
arcache
input
arid
input
1 - 18
arlen
input
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Name
Direction
Width
arlock
input
arprot
input
arqos
input
1-4
arready
output
arregion
input
1-4
arsize
input
aruser
input
1 - 64
arvalid
input
awaddr
input
1 - 64
awburst
input
awcache
input
awid
input
1 - 18
awlen
input
awlock
input
awprot
input
awqos
input
1-4
awready
output
awregion
inout
1-4
awsize
input
awuser
input
1 - 64
awvalid
input
bid
output
1 - 18
bready
input
bresp
output
bvalid
output
rdata
output
rid
output
1 - 18
rlast
output
rready
input
rresp
output
ruser
output
1 - 64
Qsys Interconnect
Send Feedback
7-79
Altera Corporation
7-80
QII5V1
2014.12.15
Name
Direction
Width
rvalid
output
wdata
input
wlast
input
wready
output
wstrb
input
wuser
input
1 - 64
wvalid
input
Width
Master Direction
Slave Direction
Required
tvalid
Output
Input
Yes
tready
Input
Output
No
tdata
8:4096
Output
Input
No
tstrb
1:512
Output
Input
No
tkeep
1:512
Output
Input
No
tid
1:8
Output
Input
No
tdest
1:4
Output
Input
No
tuser
Output
Input
No
tlast
1:4096
Output
Input
No
Width
Direction
Direction
APB Master
APB Slave
Required
paddr
[1:32]
output
input
yes
psel
[1:16]
output
input
yes
penable
output
input
yes
pwrite
output
input
yes
pwdata
[1:32]
output
input
yes
prdata
[1:32]
input
output
yes
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Name
Width
Direction
Direction
APB Master
APB Slave
7-81
Required
pslverr
input
output
no
pready
input
output
yes
paddr31
output
input
no
Width
Direction
Description
Fundamental Signals
address
1 - 64
Master
Slave
Qsys Interconnect
Send Feedback
Altera Corporation
7-82
QII5V1
2014.12.15
Signal Role
byteenable
byteenable_n
Width
Direction
2, 4, 8, 16,
32, 64, 128
Master
Slave
Description
debugaccess
Master
Slave
read
Master
Slave
8,16, 32,
64,
128, 256,
512, 1024
Slave
Master
read_n
readdata
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Signal Role
response
Width
Direction
Slave
Master
(optional)
7-83
Description
write
Master
Slave
8,16, 32,
64,
128, 256,
512, 1024
Master
Slave
write_n
writedata
Wait-State Signals
Qsys Interconnect
Send Feedback
Altera Corporation
7-84
QII5V1
2014.12.15
Signal Role
lock
Width
Direction
Master
Slave
Description
lock ensures that once a master wins arbitra
tion, it maintains access to the slave for
multiple transactions. It is asserted coincident
with the first read or write of a locked
sequence of transactions. It is deasserted on the
final transaction of a locked sequence of
transactions. lock assertion does not guarantee
that arbitration will be won. After the lockasserting master has been granted, it retains
grant until it is deasserted.
lock
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Signal Role
waitrequest
Width
Direction
Slave
Master
waitrequest_n
7-85
Description
Pipeline Signals
readdatavalid
readdatavalid_n
Slave
Master
Burst Signals
Qsys Interconnect
Send Feedback
Altera Corporation
7-86
QII5V1
2014.12.15
Signal Role
burstcount
Width
Direction
1 11
Master
Slave
Description
beginbursttransfer
Width
Direction
Description
Fundamental Signals
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Signal Role
channel
Width
Direction
1 128
7-87
Description
1 4,096 Source The data signal from the source to the sink, typically
Sink
carries the bulk of the information being transferred.
The contents and format of the data signal is further
defined by parameters.
error
1 256
ready
Source A bit mask used to mark errors affecting the data being
Sink
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 errorDescriptor property.
Sink
Source
empty
18
endofpacket
startofpacket
Qsys Interconnect
Send Feedback
Altera Corporation
7-88
QII5V1
2014.12.15
Width
Direction
Require
d
Output
Yes
Description
Width
Direction
Require
d
Input
Yes
Description
Width
Direction
<any>
<n>
In, out, or
bidirectional
Description
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
7-89
Width
Direction
Require
d
request
Master
Slave
Yes
Description
grant
Slave
Master
Yes
<name>_in
<name>_
out
<name>_
outen
Qsys Interconnect
Send Feedback
1 1024
Slave
Master
No
1 1024
Master
Slave
No
Master
Slave
No
Altera Corporation
7-90
QII5V1
2014.12.15
read
Width
Direction
Required
1 - 32
input
No
input
No
read_n
Description
input
No
write_n
chipselect
input
No
input
Yes
bidir
No
chipselect_n
outputenable
outputenable_n
data
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Name
byteenable
Width
Direction
Required
2, 4, 8,16, 32,
64, 128
input
No
byteenable_n
7-91
Description
writebyteenable
writes lower
writes upper
writes byte 0
writes byte 1
writes byte 2
writes byte 3
2,4,8,16, 32,
64,128
input
No
input
No
writebyteenable_n
begintransfer1
writes full
Note: All Avalon signals are active high. Avalon signals that can also be asserted low list both
versions in the Signal Role column.
Qsys Interconnect
Send Feedback
Altera Corporation
7-92
QII5V1
2014.12.15
Width
Direction
Require
d
Output
Yes
irq
irq_n
Description
Width
Direction
Require
d
132
Input
Yes
Description
irq is an <n>-bit vector, where each bit corresponds
Version
Changes
December 2014
14.1.0
August 2014
14.0a10.0
Altera Corporation
Qsys Interconnect
Send Feedback
QII5V1
2014.12.15
Date
Version
7-93
Changes
June 2014
14.0.0
AXI4-Lite support.
AXI4-Stream support.
Avalon-ST adapter parameters.
IRQ Bridge.
Handling Read Side Effects note added.
November 2013
13.1.0
May 2013
13.0.0
November 2012
12.1.0
June 2012
12.0.0
November 2011
11.0.1
Template update.
May 2011
11.0.0
December 2010
10.1.0
Initial release.
Related Information
Qsys Interconnect
Send Feedback
Altera Corporation
QII5V1
Subscribe
Send Feedback
You can optimize system interconnect performance for Altera designs that you create with the Qsys
system integration tool.
The foundation of any system is the interconnect logic that connects hardware blocks or components.
Creating interconnect logic is prone to errors, is time consuming to write, and is difficult to modify when
design requirements change. The Qsys system integration tool addresses these issues and provides an
automatically generated and optimized interconnect designed to satisfy your system requirements.
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: Recommended Altera practices may improve clock frequency, throughput, logic utilization, or
power consumption of your Qsys design. When you design a Qsys system, use your knowledge of
your design intent and goals to further optimize system performance beyond the automated
optimization available in Qsys.
Related Information
www.altera.com
101 Innovation Drive, San Jose, CA 95134
ISO
9001:2008
Registered
8-2
QII5V1
2014.06.30
Altera Corporation
QII5V1
2014.06.30
8-3
Read Multiplexer
readdata[31:0]
EN
read
address[1:0]
Register File
D
Decode
2:4
User
Logic
EN
0
D
EN
1
D
address[1:0]
EN
2
D
write
EN
EN
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.
Altera Corporation
8-4
QII5V1
2014.06.30
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 resourcesDetermine 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 higherlevel system for easy access.
Plan shared address space between subsystemsPlanning the address space ensures you can set
appropriate sizes for bridges between subsystems.
Plan how much latency you may need to add to your systemWhen you add a pipeline bridge
between subsystems, you may add latency to the overall system. You can reduce the added latency by
parameterizing the pipeline bridge with zero cycles of latency.
Figure 8-2: Passing Messages Between Subsystems
Top-Level System
Subsystem
Subsystem
Nios II
Processor
Nios II
Processor
M
Pipeline Bridges
Arbiter
Arbiter
Arbiter
Arbiter
On-Chip
Memory
PIO
UART
Mutex
Shared
Memory
On-Chip
Memory
PIO
UART
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).
Altera Corporation
QII5V1
2014.06.30
8-5
Channel 1 System
Channel 2 System
Channel N System
Nios II
Processor
M
Arbiter
S
On-Chip
Memory
Input Data
Stream
Input Data
Stream
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 because you can calculate the required resources as a multiple of the
subsystem requirements.
Altera Corporation
8-6
QII5V1
2014.06.30
Altera Corporation
QII5V1
2014.06.30
8-7
N ios II
P rocessor
M
AXI DMA
Engine
M
Dual-Port On-Chip
Memory
PCI Express
Interface
M
Arbiter
Arbiter
External Memory
Controller
External Memory
Controller
Altera Corporation
8-8
QII5V1
2014.06.30
Nios II
Processor
M
DMA
Engine
M
Read
Dual-Port On-Chip
Memory
PCI Express
Interface
S
Write
Arbiter
Arbiter
External Memory
Controller
External Memory
Controller
Altera Corporation
QII5V1
2014.06.30
8-9
Compute
Engine 1
Data Channel 1
Host 2
Compute
Engine 2
Data Channel 2
Arbiter
Host 3
Compute
Engine 3
Data Channel 3
Host 4
Compute
Engine 4
Data Channel 4
Compute
Engine 1
Data Channel 1
Host 2
Compute
Engine 2
Data Channel 2
Host 3
Compute
Engine 3
Data Channel 3
Host 4
Compute
Engine 4
Data Channel 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.
Altera Corporation
8-10
QII5V1
2014.06.30
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-7: Single or Dual DMA Channels
DMA
Engine
M
Read
Buffer 1
Read
Buffer 2
Write
Buffer 1
Write
Buffer 2
DMA
Engine 2
DMA
Engine 1
M
Read
Buffer 1
Write
Buffer 1
Read
Buffer 2
Write
Buffer 2
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.
Altera Corporation
QII5V1
2014.06.30
8-11
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.
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
Altera Corporation
8-12
QII5V1
2014.06.30
You can insert an Avalon-MM pipeline bridge to insert registers in the path between the bridges and its
master and slaves. If a critical register-to-register delay occurs in the interconnect, a pipeline bridge can
help reduce this delay and improve system fMAX.
The Avalon-MM pipeline bridge component integrates into any Qsys system. The pipeline bridge options
can increase logic utilization and read latency. The change in topology may also reduce concurrency if
multiple masters arbitrate for the bridge. You can use the Avalon-MM pipeline bridge to control topology
without adding a pipeline stage. A pipeline bridge that does not add a pipeline stage is optimal in some
latency-sensitive applications. For example, a CPU may benefit from minimal latency when accessing
memory.
Master-to-Slave
Signals
Master-to-Slave
Pipeline
D
Master-to-Slave
Signals
ENA
waitrequest
Pipeline
waitrequest
Connects to an
Avalon-MM
Slave Interface
Wait Request
Logic
waitrequest
Master
I/F
Slave
I/F
Slave-to-Master
Signals
Connects to an
Avalon-MM
Master Interface
Slave-to-Master
Signals
Slave-to-Master
Pipeline
Altera Corporation
QII5V1
2014.06.30
8-13
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-9: Tree of Bridges
Master 1
Master 2
Master 3
Master 4
arb
arb
Pipeline Bridge
Pipeline Bridge
arb
S
Shared
Slave
Read Data
Write Data &
Control Signals
Altera Corporation
8-14
QII5V1
2014.06.30
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.
Altera Corporation
QII5V1
2014.06.30
Limiting Concurrency
8-15
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.
Altera Corporation
8-16
QII5V1
2014.06.30
Figure 8-10: Differences Between Systems With and Without a Pipeline Bridge
Concurrency
No Concurrency
Arbiter
S
Bridge
Arbiter
Arbiter
Arbiter
Altera Corporation
QII5V1
2014.06.30
8-17
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.
Acceptable Latency Increase
For a pipeline bridge, Qsys adds a cycle of latency for each pipeline option that is enabled. The buffering
in the clock crossing bridge also adds latency. If you use a pipelined or burst master that posts many read
transfers, the increase in latency does not impact performance significantly because the latency increase is
very small compared to the length of the data transfer.
Optimizing Qsys System Performance
Send Feedback
Altera Corporation
8-18
QII5V1
2014.06.30
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-11: Low-Efficiency Read Transfer
Read Latency
Read Latency
Overhead
Overhead
A0
A1
clk
address
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-12: High Efficiency Read Transfer
Read Latency
Overhead
clk
address
A0
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
A11
A12
D0
D1
D2
D3
D4
D5
D6
D7
D8
read
waitrequest
readdatavalid
readdata
Altera Corporation
QII5V1
2014.06.30
Limited Concurrency
8-19
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-13: Performance of a Nios II Processor and Memory Operating at 100 MHz
110 ns
40 ns
clk
A0
address
A1
A2
A3
A4
A5
A6
A7
D0
D1
D2
D3
read
waitrequest
readdatavalid
readdata
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-14: 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
Optimizing Qsys System Performance
Send Feedback
Altera Corporation
8-20
QII5V1
2014.06.30
Limited Concurrency
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.
Altera Corporation
QII5V1
2014.06.30
Limited Concurrency
8-21
Nios II
Processor
M
DMA
M
Arbiter
Qsys Subsystem
Bottleneck
S
Bridge
M
DDR
SDRAM
DDR
SDRAM
DDR
SDRAM
DDR
SDRAM
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.
Optimizing Qsys System Performance
Send Feedback
Altera Corporation
8-22
QII5V1
2014.06.30
Subsystem
Nios II
Processor
M
Subsystem
DMA
M
Arbiter
Arbiter
Arbiter
Arbiter
Bridge
Bridge
Bridge
Bridge
DDR
SDRAM
DDR
SDRAM
DDR
SDRAM
DDR
SDRAM
Altera Corporation
QII5V1
2014.06.30
8-23
Address Coherency
Nios II Processor
Bridge
0x102C
Peripheral
0x2C
0x2C
Base = 0x1000
Address
Decoder
0xC
Base = 0x20
Address Translation
Address Translation
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-18: Slaves at Different Addresses and Complicating the System
Nios II Processor
M
Peripheral
0x20
Arbiter
0x0
Address
Decoder
Base = 0x20
Masters Drive
Different Addresses
DMA
Bridge
M
0x1020
0x20
0x20
Base = 0x1000
Address Translation
Altera Corporation
8-24
QII5V1
2014.06.30
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-19: Address Translation Corrected With Bridge
Address Translation
Nios II Processor
Bridge
M
0x1020
0x20
Arbiter
Base = 0x1000
DMA
Peripheral
0x20
S
0x0
Address
Decoder
Base = 0x20
Bridge
M
0x1020
0x20
0x20
Base = 0x1000
Address Translation
Altera Corporation
QII5V1
2014.06.30
8-25
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
Altera Corporation
8-26
QII5V1
2014.06.30
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.
Altera Corporation
QII5V1
2014.06.30
8-27
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
Altera Corporation
8-28
QII5V1
2014.06.30
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.
Table 8-1: Pipeline Latency in a Master-Slave Pair
Master
Slave
No pipeline
No Pipeline
No pipeline
Pipelined with Qsys interconnect forces the master to wait through any slavefixed or
side latency cycles. This master-slave pair gains no benefits from
variable latency pipelining, because the master waits for each transfer to complete
before beginning a new transfer. However, while the master is
waiting, the slave can accept transfers from a different master.
Pipelined
No pipeline
Pipelined
Pipelined with
fixed latency
Pipelined
Pipelined with The slave asserts a signal when its readdata is valid, and the
variable latency master captures the data. The master-slave pair can achieve
maximum throughput if the slave has variable latency. Examples
of variable latency slaves include SDRAM and FIFO memories.
Altera Corporation
QII5V1
2014.06.30
8-29
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.
d
load
Up
Counter
master_address[31:0]
1
0 s
D
VCC
count enable
byteenable[3:0]
EN
burst_begin
done
transfer_length[31:0]
go
increment_address
d
load
length[31:0]
master_burstcount[2:0]
Down
Counter
count enable
Tracking Logic/
State Machine
fifo_used[]
burst_begin
burst_count[2:0]
write
increment_address
waitrequest
user_data[31:0]
user_data_full
full
user_data_write
write
used[]
Look-Ahead FIFO
d
read acknowledge
writedata[31:0]
increment_address
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
Optimizing Qsys System Performance
Send Feedback
Altera Corporation
8-30
QII5V1
2014.06.30
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 FIFOs 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
Altera Corporation
QII5V1
2014.06.30
8-31
Related Information
Consolidating Interfaces
The Nios II/e core maintains communication between the Nios II /f core and external processors. 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.
Altera Corporation
8-32
QII5V1
2014.06.30
Consolidating Interfaces
M
8
64
B
1
M
8
Host Processor
Interface
B
1
8
B
64
B
B
1
8
B
B
2
Arbiter
Arbiter
Arbiter
Arbiter
Arbiter
2
PIO
System ID
Timer
Mutex
DDR
SDRAM
Burst Adapter
64
2
In this example a system with a mix of components with different burst capabilities with 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.
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.
Altera Corporation
QII5V1
2014.06.30
8-33
Host Processor
Interface
M
8
64
8
64
64
B
1
B
1
Bridge
Bridge
M
8
B
2
Arbiter
Arbiter
Arbiter
Arbiter
Arbiter
2
PIO
System ID
Timer
Mutex
DDR
SDRAM
Burst Adapter
Altera Corporation
8-34
QII5V1
2014.06.30
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-23: Clock Crossing Adapter
Receiver Clock Domain
CDC Logic
control
waitrequest
Receiver
Port
Receiver
Handshake
FSM
transfer
request
Synchronizer
acknowledge
Synchronizer
control
Sender
Handshake
FSM
waitrequest
Sender
Port
address
readdata
readdata
writedata & byte enable
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.
Altera Corporation
QII5V1
2014.06.30
8-35
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
Altera Corporation
8-36
QII5V1
2014.06.30
PIOs
UARTs (JTAG or RS-232)
System identification (SysID)
Timers
PLL (instantiated within Qsys)
Serial peripheral interface (SPI)
EPCS controller
Tristate bridge and the components connected to the bridge
By reducing the clock frequency of the components connected to the bridge, you reduce the dynamic
power consumption of the design. Dynamic power is a function of toggle rates and decreasing the clock
frequency decreases the toggle rate.
Altera Corporation
QII5V1
2014.06.30
8-37
Figure 8-24: Reducing Power Utilization Using a Bridge to Separate Clock Domains
Nios II
Processor
M
Arbiter
Arbiter
DDR
SDRAM
On-Chip
Memory
Arbiter
200 MHz
S
Clock
Crossing
Bridge
M
5 MHz
PIO
UART
System ID
Timer
PLL
SPI
EPCS
Controller
S
Tristate
Conduit
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
Altera Corporation
8-38
QII5V1
2014.06.30
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:
HandshakeUses 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.
FIFOUses 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.
AutoQsys 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 onchip 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
Altera Corporation
QII5V1
2014.06.30
8-39
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-25: Variable Latency
Avalon-MM
Slave Port
writedata
write
Remaining
Component
Logic
readdata
read
waitrequest
ready
(synchronous)
begintransfer
Altera Corporation
8-40
QII5V1
2014.06.30
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
Altera Corporation
QII5V1
2014.06.30
8-41
Timeout Value
read
write
countq
= 0?
reset
Down
Counter
wake
load
count enable
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
Altera Corporation
8-42
QII5V1
2014.06.30
The data path logic includes the readdata and readdatavalid signals. If your master can accept data on
every clock cycle, you can register the data with the readdatavalid as an enable bit. If your master
cannot process a continuous stream of read data, it must buffer the data in a FIFO. The control logic must
stop issuing reads when the FIFO reaches a predetermined fill level to prevent FIFO overflow.
d
load
Up
Counter
master_address[31:0]
q
VCC
count enable
byteenable[3:0]
done
transfer_length[31:0]
go
increment_address
d
load
length[31:0]
read
Down
Counter
count enable
readdatavalid
Tracking Logic/
State Machine
increment_address
fifo_used[]
waitrequest
Altera Corporation
user_data[31:0]
user_data_empty
empty
user_data_read
read acknowledge
used[]
Look-Ahead FIFO
d
write
writedata[31:0]
readdatavalid
QII5V1
2014.06.30
Multiplexer Examples
8-43
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
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.
Figure 8-28: Data Path that Doubles the Clock Frequency
Data Source
Input
src
Data Source
Input
src
src
sink
src
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.
Altera Corporation
8-44
QII5V1
2014.06.30
Figure 8-29: Data Path to Double Data Width and Maintain Original Frequency
Data Source
Input
src
sink
Data Format
Adapter
src
sink
src
Data Source
Input
src
sink
Data Format
Adapter
src
16 Bits
at 100 MHz
sink
The diagram below llustrates a data path that uses the data format adapter and Avalon-ST channel
multiplexer to convert two 8-bit inputs running at 100 MHz to a single 16-bit output at 100 MHz.
Figure 8-30: Data Path to Boost the Clock Frequency
Data Source
Input
src
Data Source
Input
src
sink
src
200 MHz
sink
src
sink
src
200 MHz
Output
200 MHz
sink
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 do not 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.
Altera Corporation
QII5V1
2014.06.30
8-45
Version
Changes
May 2013
13.0.0
November 2012
12.1.0
June 2012
12.0.0
November 2011
11.1.0
Related Information
Altera Corporation
2014.12.15
QII5V1
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 II 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
2014 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
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information,
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
ISO
9001:2008
Registered
9-2
QII5V1
2014.12.15
Altera Corporation
QII5V1
2014.12.15
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
add_interface mm_slave avalon slave
add_interface my_export conduit end
set_interface_property my_export EXPORT_OF uart_0.external_connection
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.
The following direction rules apply to Qsys-supported interfaces.
Component Interface Tcl Reference
Send Feedback
Altera Corporation
9-4
QII5V1
2014.12.15
add_interface
Interface Type
Direction
avalon
master, slave
axi
master, slave
tristate_conduit
master, slave
avalon_streaming
source, sink
interrupt
sender, receiver
conduit
end
clock
source, sink
reset
source, sink
nios_custom_instruction
slave
Related Information
Altera Corporation
QII5V1
2014.12.15
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
Altera Corporation
9-6
add_interface_port
QII5V1
2014.12.15
Altera Corporation
QII5V1
2014.12.15
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
Altera Corporation
9-8
get_interface_assignment
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
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
Altera Corporation
9-10
get_interface_ports
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
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
Altera Corporation
9-12
QII5V1
2014.12.15
get_interface_property
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
get_interface_property mm_slave linewrapBursts
Notes
The properties for each interface type are different. Refer to the Avalon Interface Specifications for more
information about interface properties.
Related Information
Altera Corporation
QII5V1
2014.12.15
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
Altera Corporation
9-14
get_port_property
QII5V1
2014.12.15
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
get_port_property rdata WIDTH_VALUE
Related Information
Altera Corporation
QII5V1
2014.12.15
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:
qsys.ui.connect:
ui.blockdiagram.direction:
Altera Corporation
9-16
set_interface_assignment
QII5V1
2014.12.15
Related Information
Altera Corporation
QII5V1
2014.12.15
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
set_interface_property clk_out EXPORT_OF clk.clk_out
set_interface_property mm_slave linewrapBursts false
Notes
The properties for each interface type are different. Refer to the Avalon Interface Specifications for more
information about interface properties.
Related Information
Altera Corporation
9-18
set_port_property
QII5V1
2014.12.15
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
set_port_property rdata WIDTH 32
Related Information
Altera Corporation
QII5V1
2014.12.15
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 for 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
set_interface_upgrade_map { <old_interface_name> <new_interface_name>
<old_interface_name_2> <new_interface_name_2> }
Returns
No return value.
Arguments
{ <old_interface_name> <new_interface_name>}
List of mappings between between names of older and newer interfaces.
Example
set_interface_upgrade_map { avalon_master_interface new_avalon_master_interface }
Altera Corporation
9-20
Parameters
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
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
add_parameter seed INTEGER 17 "The seed to use for data generation."
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
Altera Corporation
9-22
get_parameters
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
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
set property_summary [ get_parameter_properties ]
Related Information
Altera Corporation
9-24
QII5V1
2014.12.15
get_parameter_property
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
set enabled [ get_parameter_property parameter1 ENABLED ]
Related Information
Altera Corporation
QII5V1
2014.12.15
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
set width [ get_parameter_value fifo_width ]
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
Altera Corporation
9-26
QII5V1
2014.12.15
get_string
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:
set_module_property DISPLAY_NAME [get_string DISPLAY_NAME]
If you are externalizing a parameter property, qualify the parameter property with the parameter name,
with uppercase format, if needed:
set_parameter_property my_param DISPLAY_NAME [get_string MY_PARAM_DISPLAY_NAME]
Altera Corporation
QII5V1
2014.12.15
get_string
9-27
If you use a string to describe a string format, end the identifier with _FORMAT.
set formatted_string [ format
"arg2" ]
Related Information
Altera Corporation
9-28
QII5V1
2014.12.15
load_strings
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:
TROGDOR = A dragon with a big beefy arm
Related Information
Altera Corporation
QII5V1
2014.12.15
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
set_parameter_property BAUD_RATE ALLOWED_RANGES {9600 19200 38400}
Related Information
Altera Corporation
9-30
set_parameter_value
QII5V1
2014.12.15
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
set_parameter_value half_clock_rate [ expr { [ get_parameter_value clock_rate ] /
2 } ]
Altera Corporation
QII5V1
2014.12.15
decode_address_map
9-31
decode_address_map
Description
Converts an XMLformatted 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 masters 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.
set address_map_xml [get_parameter_value my_map_param]
set address_map_dec [decode_address_map $address_map_xml]
foreach i $address_map_dec {
array set info $i
send_message info "Connected to slave $info(name)"
}
Altera Corporation
9-32
Display Items
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
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
add_display_item "Timing" read_latency PARAMETER
add_display_item "Sounds" speaker_image_id ICON speaker.jpg
Altera Corporation
9-34
QII5V1
2014.12.15
add_display_item
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>.
The tab is an optional parameter. If present, the group appears in separate tab in the GUI for the
instance.
Altera Corporation
QII5V1
2014.12.15
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
Altera Corporation
9-36
QII5V1
2014.12.15
get_display_item_properties
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
Altera Corporation
QII5V1
2014.12.15
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
set my_label [get_display_item_property my_action DISPLAY_NAME]
Related Information
Altera Corporation
9-38
QII5V1
2014.12.15
set_display_item_property
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
set_display_item_property my_action DISPLAY_NAME "Click Me"
set_display_item_property my_action DESCRIPTION "clicking this button runs the
click_me_callback proc in the hw.tcl file"
Related Information
Altera Corporation
QII5V1
2014.12.15
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
Altera Corporation
9-40
QII5V1
2014.12.15
add_documentation_link
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
add_documentation_link "Avalon Verification IP Suite User Guide" http://
www.altera.com/literature/ug/ug_avalon_verification_ip.pdf
Altera Corporation
QII5V1
2014.12.15
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
Altera Corporation
9-42
get_module_assignments
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
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
Altera Corporation
9-44
get_module_properties
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
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
set my_name [ get_module_property NAME ]
Related Information
Altera Corporation
9-46
QII5V1
2014.12.15
send_message
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_message ERROR "The system is down!"
send_message { Info Text } "The system is up!"
Altera Corporation
QII5V1
2014.12.15
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
set_module_assignment embeddedsw.CMacro.colorSpace CMYK
Related Information
Altera Corporation
9-48
set_module_property
QII5V1
2014.12.15
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
set_module_property VERSION 10.0
Related Information
Altera Corporation
QII5V1
2014.12.15
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
add_hdl_instance my_uart altera_avalon_uart
Related Information
Altera Corporation
9-50
QII5V1
2014.12.15
package
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
package require -exact qsys 14.1
Altera Corporation
QII5V1
2014.12.15
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
Altera Corporation
9-52
QII5V1
2014.12.15
add_instance
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
add_instance my_uart altera_avalon_uart
add_instance my_uart altera_avalon_uart 14.1
Related Information
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
Altera Corporation
QII5V1
2014.12.15
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
add_connection dma.read_master sdram.s1 avalon
Related Information
Altera Corporation
9-54
get_connections
QII5V1
2014.12.15
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
set all_connections [ get_connections ]
Related Information
Altera Corporation
QII5V1
2014.12.15
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
Altera Corporation
9-56
QII5V1
2014.12.15
get_connection_parameter_value
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
get_connection_parameter_value cpu.data_master/dma0.csr baseAddress
Related Information
Altera Corporation
QII5V1
2014.12.15
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
Altera Corporation
9-58
QII5V1
2014.12.15
get_instance_interfaces
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
Altera Corporation
QII5V1
2014.12.15
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
set port_names [ get_instance_interface_ports cpu data_master ]
Related Information
Altera Corporation
9-60
QII5V1
2014.12.15
get_instance_interface_properties
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
set properties [ get_instance_interface_properties cpu data_master ]
Related Information
Altera Corporation
QII5V1
2014.12.15
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
set my_name [ get_instance_property myinstance NAME ]
Related Information
Altera Corporation
9-62
set_instance_property
QII5V1
2014.12.15
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
set_instance_property myinstance SUPRESS_ALL_WARNINGS true
Related Information
Altera Corporation
QII5V1
2014.12.15
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
Altera Corporation
9-64
QII5V1
2014.12.15
get_instance_interface_property
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
set value [ get_instance_interface_property cpu data_master setupTime ]
Related Information
Altera Corporation
QII5V1
2014.12.15
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
set parameters [ get_instance_parameters instance ]
Notes
You can use this command with instances created by either add_instance or add_hdl_instance.
Related Information
Altera Corporation
9-66
QII5V1
2014.12.15
get_instance_parameter_property
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
get_instance_parameter_property instance parameter property
Related Information
Altera Corporation
QII5V1
2014.12.15
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
set dpi [ get_instance_parameter_value pixel_converter input_DPI ]
Notes
You can use this command with instances created by either add_instance or add_hdl_instance.
Related Information
Altera Corporation
9-68
QII5V1
2014.12.15
get_instance_port_property
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
get_instance_port_property instance port property
Related Information
Altera Corporation
QII5V1
2014.12.15
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
Related Information
Altera Corporation
9-70
QII5V1
2014.12.15
set_instance_parameter_value
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
set_instance_parameter_value uart_0 baudRate 9600
Notes
You can use this command with instances created by either add_instance or add_hdl_instance.
Related Information
Altera Corporation
QII5V1
2014.12.15
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
Altera Corporation
9-72
add_fileset
QII5V1
2014.12.15
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
add_fileset my_synthesis_fileset QUARTUS_SYNTH mySynthCallbackProc "My Synthesis"
proc mySynthCallbackProc { topLevelName } { ... }
Notes
If using the TOP_LEVEL fileset property, all parameterizations of the component must use identical HDL.
Related Information
Altera Corporation
QII5V1
2014.12.15
add_fileset_file
9-73
add_fileset_file
Description
Adds a file to the generation directory. You can specify source file locations using either an absolute path,
or a path that is relative to the IP component's _hw.tcl file.
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
add_fileset_file "./implementation/rx_pma.sv" SYSTEM_VERILOG PATH synth_rx_pma.sv
add_fileset_file gui.sv SYSTEM_VERILOG TEXT "Customize your IP core"
Related Information
Altera Corporation
9-74
QII5V1
2014.12.15
set_fileset_property
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
set_fileset_property mySynthFileset TOP_LEVEL simple_uart
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
Altera Corporation
QII5V1
2014.12.15
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
get_fileset_file_attribute my_file.sv ALDEC_SPECIFIC
Related Information
Altera Corporation
9-76
QII5V1
2014.12.15
set_fileset_file_attribute
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
set_fileset_file_attribute my_file_pkg.sv COMMON_SYSTEMVERILOG_PACKAGE
my_file_package
Altera Corporation
QII5V1
2014.12.15
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
Altera Corporation
9-78
get_fileset_property
QII5V1
2014.12.15
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
get_fileset_property fileset property
Related Information
Altera Corporation
QII5V1
2014.12.15
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
get_fileset_sim_properties my_fileset LINUX64 OPT_CADENCE_64BIT
Related Information
Altera Corporation
9-80
QII5V1
2014.12.15
set_fileset_sim_properties
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
set_fileset_sim_properties my_fileset LINUX64 OPT_MENTOR_PLI "{libA} {libB}"
Related Information
Altera Corporation
QII5V1
2014.12.15
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
set filelocation [create_temp_file "./hdl/compute_frequency.v" ]
add_fileset_file compute_frequency.v VERILOG PATH ${filelocation}
Related Information
Altera Corporation
9-82
Miscellaneous
QII5V1
2014.12.15
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
Altera Corporation
QII5V1
2014.12.15
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
check_device_family_equivalence "CYLCONE III LS" { "stratixv" "Cyclone IV"
"cycloneiiils" }
Related Information
Altera Corporation
9-84
QII5V1
2014.12.15
get_device_family_displayname
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
get_device_family_displayname cycloneiiils ( returns: "Cyclone IV LS" )
Related Information
Altera Corporation
QII5V1
2014.12.15
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
set strings [ get_qip_strings ]
Related Information
Altera Corporation
9-86
QII5V1
2014.12.15
set_qip_strings
set_qip_strings
Description
Places strings in the Quartus II IP File (.qip) file, which Qsys passes to the command as a Tcl list. You add
the .qip file to your Quartus II 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
set_qip_strings {"QIP Entry 1" "QIP Entry 2"}
Notes
You can use the following macros in your QIP strings entry:
%entityName%
%libraryName%
%instanceName%
The generated name of the entity replaces this macro when the string is written to
the .qip file.
The compilation library this IP component was compiled into is inserted in place of
this macro inside the .qip file.
The name of the instance is inserted in place of this macro inside the .qip file.
Related Information
Altera Corporation
QII5V1
2014.12.15
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
set_interconnect_requirement {$system} qsys_mm.maxAdditionalLatency 2
Altera Corporation
9-88
QII5V1
2014.12.15
Altera Corporation
QII5V1
2014.12.15
9-89
Description
Altera Corporation
9-90
QII5V1
2014.12.15
Interface Properties
Interface Properties
Name
Description
CMSIS_SVD_FILE
CMSIS_SVD_VARIABLES
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_colorSpaceConverter.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
SVD_ADDRESS_OFFSET
Altera Corporation
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
Generates a CMSIS SVD file. Slaves connected to this master will have their
base address offset by this amount in the SVD file.
QII5V1
2014.12.15
Instance Properties
9-91
Instance Properties
Name
HDLINSTANCE_GET_GENERATED_NAME
HDLINSTANCE_USE_GENERATED_NAME
SUPPRESS_ALL_INFO_MESSAGES
SUPPRESS_ALL_WARNINGS
Description
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.
If true, instances added with the add_hdl_instance command are
instructed to use unique auto-generated fixed names based on the
parameterization.
If true, allows you to suppress all Info messages that originate
from a child instance.
If true, allows you to suppress alL warnings that originate from a
child instance
Altera Corporation
9-92
QII5V1
2014.12.15
Parameter Properties
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
Boolean AFFECTS_VALIDATION
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"}.
String
DEFAULT_VALUE
Boolean DERIVED
When true, indicates that the parameter value can only be set by the
IP component, and cannot be set by the user. Derived parameters are
not saved as part of an instance's parameter values. The default value
is false.
String
DESCRIPTION
String[]
DISPLAY_HINT
Altera Corporation
QII5V1
2014.12.15
Parameter Properties
Type
Name
9-93
Description
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
String
GROUP
Boolean HDL_PARAMETER
String
LONG_DESCRIPTION
String
NEW_INSTANCE_VALUE
String[]
SYSTEM_INFO
String
SYSTEM_INFO_ARG
(various) SYSTEM_INFO_TYPE
(various) TYPE
(various) UNITS
Boolean VISIBLE
String
WIDTH
Altera Corporation
9-94
Parameter Properties
QII5V1
2014.12.15
Related Information
Altera Corporation
QII5V1
2014.12.15
9-95
Description
BOOLEAN
FLOAT
A signed 32-bit floating point parameter. Not supported for HDL parameters.
INTEGER
INTEGER_LIST
A parameter that contains a list of 32-bit integers. Not supported for HDL
parameters.
LONG
NATURAL
POSITIVE
STD_LOGIC
STD_LOGIC_VECTOR
STRING
A string parameter.
STRING_LIST
A parameter that contains a list of strings. Not supported for HDL parameters.
Altera Corporation
9-96
QII5V1
2014.12.15
Name
Description
Boolean ACTIVE
Boolean DEPRECATED
Indicates the parameter exists only for backwards compatibility, and may not
have any effect.
Boolean EXPERIMENTAL Indicates the parameter is experimental, and not exposed in the design flow.
Altera Corporation
QII5V1
2014.12.15
Port Properties
9-97
Port Properties
Type
Name
(various)
DIRECTION
String
DRIVEN_BY
String[]
FRAGMENT_LIST
Description
String
ROLE
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.
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
String
WIDTH_EXPR
Integer
WIDTH_VALUE
The width of the port in bits. Cannot be set directly. Any changes must
be set through the WIDTH_EXPR property.
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.
The width of the port in bits. Cannot be set directly. Any changes must
be set through the WIDTH_EXPR property.
Related Information
Altera Corporation
9-98
Port Properties
QII5V1
2014.12.15
Altera Corporation
QII5V1
2014.12.15
Direction Properties
9-99
Direction Properties
Name
Description
Bidir
Input
Output
Altera Corporation
9-100
QII5V1
2014.12.15
String
Name
DESCRIPTION
Description
String[] DISPLAY_HINT A hint that affects how the display item displays in the parameter editor.
String
DISPLAY_NAME
Boolean ENABLED
String
PATH
String
TEXT
Text associated with a display item. Only applies to display items of type TEXT.
Boolean VISIBLE
Altera Corporation
QII5V1
2014.12.15
9-101
GROUP
Description
An action displays as a button in the GUI. When the button is clicked, it calls the callback
procedure. The button label is the display item id.
A group that is a child of the parent_group group. If the parent_group is an empty string,
this is a top-level group.
ICON
PARAMETER
TEXT
A block of text.
Altera Corporation
9-102
QII5V1
2014.12.15
Description
BIT_WIDTH
BOOLEAN
COLLAPSED
COLUMNS
EDITABLE
Indicates whether a list of strings allows free-form text entry (editable combo box).
FILE
Indicates that the string is an optional file path, for example, "file:jpg,png,gif".
FIXED_SIZE
GROW
HEXADECIMAL
RADIO
ROWS
Number of rows in text field, or visible rows in a table, for example, "rows:N".
SLIDER
TAB
TABLE
if present for a group, the group must contain all list-type parameters, which display
collectively in a single table.
TEXT
String is a text field with a limited character set, for example, "text:A-Za-z0-9_".
WIDTH
Altera Corporation
QII5V1
2014.12.15
Module Properties
9-103
Module Properties
Name
ANALYZE_HDL
AUTHOR
COMPOSITION_CALLBACK
DATASHEET_URL
DESCRIPTION
DISPLAY_NAME
EDITABLE
ELABORATION_CALLBACK
Description
GENERATION_CALLBACK
GROUP
ICON_PATH
INSTANTIATE_IN_SYSTEM_MODULE
INTERNAL
MODULE_DIRECTORY
MODULE_TCL_FILE
NAME
OPAQUE_ADDRESS_MAP
9-104
QII5V1
2014.12.15
Module Properties
Name
Description
software tools. When true, the children's address are not visible.
When false, the children's addresses are visible.
PREFERRED_SIMULATION_LANGUAGE
REPORT_HIERARCHY
null
STATIC_TOP_LEVEL_MODULE_NAME
Deprecated.
STRUCTURAL_COMPOSITION_CALLBACK
SUPPORTED_DEVICE_FAMILIES
TOP_LEVEL_HDL_FILE
Deprecated.
TOP_LEVEL_HDL_MODULE
Deprecated.
UPGRADEABLE_FROM
null
VALIDATION_CALLBACK
VERSION
Altera Corporation
QII5V1
2014.12.15
Fileset Properties
9-105
Fileset Properties
Name
ENABLE_FILE_OVERWRITE_MODE
ENABLE_RELATIVE_INCLUDE_PATHS
TOP_LEVEL
Description
null
If true, HDL files can include other files using relative paths in the
fileset.
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.
Altera Corporation
9-106
QII5V1
2014.12.15
Description
EXAMPLE_DESIGN
QUARTUS_SYNTH
Contains files that Qsys uses for the Quartus II software synthesis.
SIM_VERILOG
SIM_VHDL
Altera Corporation
QII5V1
2014.12.15
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
ACTION
COMPOSITION
EDITOR
ELABORATION
GENERATE_VERILOG_SIMULATION
GENERATE_VHDL_SIMULATION
GENERATION
PARAMETER_UPGRADE
STRUCTURAL_COMPOSITION
VALIDATION
Description
Altera Corporation
9-108
QII5V1
2014.12.15
Description
ALDEC_SPECIFIC
CADENCE_SPECIFIC
COMMON_SYSTEMVERILOG_PACKAGE
MENTOR_SPECIFIC
SYNOPSYS_SPECIFIC
TOP_LEVEL_FILE
Altera Corporation
Contains the top-level module for the fileset and applies to synthesis
filesets only.
QII5V1
2014.12.15
9-109
Description
DAT
DAT Data
FLI_LIBRARY
FLI Library
HEX
HEX Data
MIF
MIF Data
OTHER
Other
PLI_LIBRARY
PLI Library
QXP
QXP File
SDC
Timing Constraints
SYSTEM_VERILOG
SYSTEM_VERILOG_ENCRYPT
SYSTEM_VERILOG_INCLUDE
VERILOG
Verilog HDL
VERILOG_ENCRYPT
VERILOG_INCLUDE
Verilog Include
VHDL
VHDL
VHDL_ENCRYPT
Encrypted VHDL
VPI_LIBRARY
VPI Library
Altera Corporation
9-110
QII5V1
2014.12.15
Description
PATH
TEXT
Altera Corporation
QII5V1
2014.12.15
Simulator Properties
9-111
Simulator Properties
Name
Description
ENV_ALDEC_LD_LIBRARY_PATH
ENV_CADENCE_LD_LIBRARY_PATH
ENV_MENTOR_LD_LIBRARY_PATH
ENV_SYNOPSYS_LD_LIBRARY_PATH
OPT_ALDEC_PLI
OPT_CADENCE_64BIT
OPT_CADENCE_PLI
OPT_CADENCE_SVLIB
OPT_CADENCE_SVROOT
OPT_MENTOR_64
OPT_MENTOR_CPPPATH
OPT_MENTOR_LDFLAGS
OPT_MENTOR_PLI
OPT_SYNOPSYS_ACC
OPT_SYNOPSYS_CPP
OPT_SYNOPSYS_FULL64
OPT_SYNOPSYS_LDFLAGS
OPT_SYNOPSYS_LLIB
OPT_SYNOPSYS_VPI
Altera Corporation
9-112
QII5V1
2014.12.15
Description
The VHDL type of this signal is automatically determined. Single-bit signals are
STD_LOGIC_VECTOR
Altera Corporation
QII5V1
2014.12.15
9-113
Name
String
ADDRESS_MAP
Integer
ADDRESS_WIDTH
String
AVALON_SPEC
Integer
CLOCK_DOMAIN
Description
String
CLOCK_RESET_INFO
String
CUSTOM_INSTRUCTION_SLAVES
(various)
DESIGN_ENVIRONMENT
String
DEVICE
String
DEVICE_FAMILY
String
DEVICE_FEATURES
String
DEVICE_SPEEDGRADE
Integer
GENERATION_ID
Altera Corporation
9-114
QII5V1
2014.12.15
Type
BigInteger,
Long
Integer
String,
Boolean,
Integer
Name
INTERRUPTS_USED
MAX_SLAVE_DATA_WIDTH
QUARTUS_INI
Integer
RESET_DOMAIN
String
TRISTATECONDUIT_INFO
String
TRISTATECONDUIT_MASTERS
String
UNIQUE_ID
Description
Related Information
Altera Corporation
QII5V1
2014.12.15
9-115
Description
NATIVE
QSYS
Altera Corporation
9-116
QII5V1
2014.12.15
Units Properties
Units Properties
Name
Description
Address
A memory-mapped address.
Bits
BitsPerSecond
Bytes
Cycles
GigabitsPerSecond
Gigabytes
Gigahertz
Frequency, in GHz.
Hertz
Frequency, in Hz.
KilobitsPerSecond
Kilobytes
Kilohertz
Frequency, in kHz.
MegabitsPerSecond
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.
Altera Corporation
QII5V1
2014.12.15
9-117
Description
ALL
LINUX32
Linux 32-bit
LINUX64
Linux 64-bit
WINDOWS32
Windows 32-bit
WINDOWS64
Windows 64-bit
Altera Corporation
9-118
QII5V1
2014.12.15
Description
ENABLED
STRING
Altera Corporation
QII5V1
2014.12.15
9-119
Version
Changes
December 2014
14.1.0
set_interface_upgrade_map
Moved Port Roles (Interface Signal Types) section to Qsys
Interconnect.
November 2013
13.1.0
add_hdl_instance
May 2013
13.0.0
November 2012
12.1.0
June 2012
12.0.0
November 2011
11.1.0
Template update.
Added: set_qip_strings, get_qip_strings, get_device_
family_displayname, check_device_family_equivalence.
May 2011
11.0.0
December 2010
10.1.0
Initial release.
Related Information
Altera Corporation
10
2014.12.15
QII5V1
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
Bridges
Bridges affect the way Qsys transports data between components. You can insert bridges between masters
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.
2014 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
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information,
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
ISO
9001:2008
Registered
10-2
QII5V1
2014.12.15
Bridges
M1
M2
M3
Altera Corporation
S1
S2
S3
Master
Slave
QII5V1
2014.12.15
Clock Bridge
10-3
Clock Bridge
The Clock Bridge allows you to connect 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. You create the connection through
an exported interface, and then connect to multiple clock input interfaces.
Clock outputs have the ability to fan-out 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
PIO
CIn
DMA
Qsys System
Avalon-MM Clock Crossing Bridge
The Avalon-MM Clock Crossing Bridge transfers Avalon-MM commands and responses between
different clock domains. You can also use the Avalon-MM Clock Crossing Bridge between AXI masters
and slaves of different clock domains.
The Avalon-MM Clock Crossing Bridge uses asynchronous FIFOs to implement clock crossing logic. The
bridge parameters control the depth of the command and response FIFOs in both the master and slave
clock domains. If the number of active reads exceeds the depth of the response FIFO, the Clock Crossing
Bridge stops sending reads.
To maintain throughput for high-performance applications, increase the response FIFO depth from the
default minimum depth, which is twice the maximum burst size.
Note: When you use the FIFO-based clock crossing a Qsys system, the DC FIFO is automatically inserted
in the Qsys system. The reset inputs for the DC FIFO are connected to the reset sources for the
connected master and slave components on either side of the DC FIFO. With this configuration,
both the master side and slave side resets must be asserted at the same time to ensure that the DC
FIFO is reset properly.
Qsys System Design Components
Send Feedback
Altera Corporation
10-4
QII5V1
2014.12.15
Alternatively, you can drive both resets from the same reset source to guarantee that the DC FIFO
is reset properly.
Note: The clock crossing bridge includes appropriate SDC constraints for its internal asynchronous
FIFOs. For these SDC constraints to work correctly, you should not set false paths on the pointer
crossings in the FIFOs. You should also not split the bridges clocks into separate clock groups
when you declare SDC constraints; this has the same effect as setting false paths.
Related Information
Altera Corporation
QII5V1
2014.12.15
10-5
CPU
M
Avalon-MM
Clock-Crossing
Bridge
Avalon-MM
Clock-Crossing
Bridge
Avalon
Tristate
Bridge
JTAG Debug
Module
UART
System ID
Seven Segment
PIO
LCD
Display
S
Flash
Memory
S
DDR
SDRAM
S
Avalon
Tristate
Bridge
M
S
External
SRAM
Altera Corporation
10-6
QII5V1
2014.12.15
Values
Description
Data width
Symbol width
1, 2, 4, 8, 16,
32, 64 (bits)
Address width
1-32 bits
1, 2, 4, 8, 16,
32, 64, 128,
256, 512, 1024
bits
2, 3, 4, 5 bits
Altera Corporation
QII5V1
2014.12.15
Parameters
Values
2, 3, 4, 5 bits
10-7
Description
Altera Corporation
10-8
QII5V1
2014.12.15
XAUI PHY
Xcvr
S
Avalon-MM
Pipeline
Bridge (Qsys)
Interleave
M
Interconnect
Transceiver
Reconfiguration
Controller
Low Latency
Controller
PMA
Ch
Cntl
PCS
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.
Altera Corporation
QII5V1
2014.12.15
10-9
64 bit Avalon-MM
Slave
Slave
Master
32 bit Avalon-MM
Master
Slave
Master
Unaligned Burst
Expansion Bridge
Slave
64 bit Avalon-MM
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 un-aligned 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: For Qsys 14.0, the Avalon-MM Unaligned Burst Expansion Bridge does not support VHDL
simulation.
Related Information
When a master sends a read burst transaction to a slave, the Avalon-MM Unaligned Burst Expansion
Bridge initially determines whether the start address of the read burst transaction is aligned to the slave's
memory address space. If the base address is aligned, the bridge does not change the base address. If the
base address is not aligned, the bridge aligns the base address to the nearest aligned address that is less
than the requested base address.
The Avalon-MM Unaligned Burst Expansion Bridge then determines whether the final word requested by
the master is the last word at the slave read burst address. If a single slave address contains multiple
words, all of those words must be requested in order for a single read burst transaction to occur.
If the final word requested by the master is the last word at the slave read burst address, the bridge does
not modify the burst length of the read burst command to the slave.
If the final word requested by the master is not the last word at the slave read burst address, the bridge
increases the burst length of the read burst command to the slave. The final word requested by the
modified read burst command is then the last word at the slave read burst address.
Qsys System Design Components
Send Feedback
Altera Corporation
10-10
QII5V1
2014.12.15
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.
Description
Data width
Burstcount width
Altera Corporation
QII5V1
2014.12.15
Parameter
10-11
Description
0, 1
2, 3
4, 5
6, 7
8, 9
X
X
X
X
Transaction 1
Transaction 2
Transaction 3
Transaction 4
Transaction 5
0
1
2
3
4
X
X
X
X
X
X
X
X
5
6
7
8
9
A
B
1
2
3
4
X
X
X
X
5
6
7
8
9
A
X
X
X
X
Transaction 1
A, B
C, D
E, F
X
X
X
X
Bridge
Alignment
Transaction 1
0, 1
2, 3
4, 5
6, 7
8, 9
X*
X
X
X
X
X
X
X
X
X*
Transaction 1
A, B
C, D
E, F
Note: the bridge suppresses
X* response words
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.
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.
Altera Corporation
10-12
QII5V1
2014.12.15
AXI
AXI
Network
Avalon-MM
AXI
Avalon-MM
AXI
AXI
AXI
Network
AXI
Avalon-MM
Avalon-MM
Network
Avalon-MM
Avalon-MM
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, demuxes, and muxes. Two of the slaves have a narrower data
width than the master; 16-bit slaves versus a 32-bit master. In this system, Qsys interconnect creates four
width adapters and four burst adapters to access the two slaves. In this case, you could improve resource
usage by adding an AXI bridge. This would result in Qsys having to add only two width adapters and two
burst adapters, one pair for the read channels, and another pair for the write channel.
Altera Corporation
QII5V1
2014.12.15
AXI Bridge
10-13
Figure 10-9: AXI Example Without a Bridge: Adding a Bridge Can Reduce the Number of Adapters
Four width adapters (0 - 3) and four burst adapters (0 - 3) are
inserted between the master and slaves for transaction
adaptation for the example system.
Router_0
AXI Master
Command
Demux_0
Command
Mux_0
Width
Adapter_0
Burst
Adapter_0
AXI Slave
Agent_0
AXI
Slave_0
Command
Mux_2
Width
Adapter_1
Burst
Adapter_1
AXI Slave
Agent_1
AXI
Slave_1
Command
Mux_4
Width
Adapter_2
Burst
Adapter_2
AXI Slave
Agent_2
AXI
Slave_2
Command
Mux_1
AXI Master
Agent
Router_1
Command
Demux_1
Command
Mux_5
Command
Mux_3
Width
Adapter_3
Burst
Adapter_3
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.
Altera Corporation
10-14
QII5V1
2014.12.15
AXI Bridge
Figure 10-10: Width and Burst Adapters Added to a System With a Bridge
Command
Mux_0
Router_0
Burst
Adapter_0
AXI Slave
Agent_1
AXI
Slave_2
Command
Mux_2
AXI Master
Agent
Command
Mux_1
Router_1
Command
Demux_1
Command
Mux_3
Width
Adapter_3
Command
Mux_0
Router_0
Limiter_0
AXI Slave
Agent_0
Command
Mux_2
AXI Master
Agent
AXI
Slave_0
Command
Mux_1
Router_1
Limiter_1
Command
Demux_1
Command
Mux_3
Altera Corporation
Burst
Adapter_3
Command
Demux_0
Interconnect_1
AXI
Bridge
AXI
Bridge
AXI Slave
Agent_0
Command
Demux_0
Interconnect_0
AXI Master
Width
Adapter_0
AXI Slave
Agent_1
AXI
Slave_1
QII5V1
2014.12.15
10-15
AXI3
AXI4
awid / arid
yes
yes
awaddr /araddr
yes
yes
yes (4-bit)
yes (8-bit)
awsize/ arsize
yes
yes
awburst /arburst
yes
yes
awlock /arlock
yes
yes (2-bit)
yes (optional)
awprot / arprot
yes
yes
awuser /aruser
yes
yes
awvalid / arvalid
yes
yes
awready /arready
yes
yes
awqos /arqos
no
yes
awregion /arregion
no
yes
wid
yes
no (optional)
wdata / rdata
yes
yes
wstrb
yes
yes
wlast /rvalid
yes
yes
wvalid /rlast
yes
yes
wready /rready
yes
yes
wuser / ruser
no
yes
bid / rid
yes
yes
bresp / rresp
yes
yes (optional)
bvalid
yes
yes
bready
yes
yes
awlen / arlen
awcache / arcache
Altera Corporation
10-16
QII5V1
2014.12.15
Type
Range
AXI Version
string
AXI3/
AXI4
Data Width
int
8:1024
Address Width
int
Altera Corporation
Description
QII5V1
2014.12.15
Parameter
Type
Range
int
1-16
10-17
Description
AWUSER Width
int
ARUSER Width
int
WUSER Width
int
RUSER Width
int
BUSER Width
int
Description
ID Width
Altera Corporation
10-18
QII5V1
2014.12.15
Parameter
Description
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.
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.
Altera Corporation
QII5V1
2014.12.15
10-19
S0
M0
Interconnect
S1
M1
Near Slave
or at Slaves Side
Near Master
or at Masters Side
Possible bridge placement when used with Interconnect
Simplest Form
Master
Bridge
Slave
A timeout occurs when the internal timer in the bridge exceeds the specified number of cycles within
which a burst must complete from start to end.
Altera Corporation
10-20
QII5V1
2014.12.15
No more
outstanding
commands
A read/write
times out
Altera Corporation
QII5V1
2014.12.15
10-21
When a timeout occurs, the AXI Timeout Bridge asserts an interrupt and reports the burst that caused the
timeout to the 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 then 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
Channel
Write
Start
End
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 to utilize the bridges 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.
Altera Corporation
10-22
QII5V1
2014.12.15
Table 10-7: CSR Interrupt Status Information for the AXI Timeout Bridge
Address
Attribute
Name
Description
0x0
0x4
read-only
Timed out operation The operation of the burst that caused the
timeout. 1 for a write; 0 for a read.
read-only
Description
ID width
Address width
Data width
User width
Maximum number of
outstanding writes
Maximum number of
outstanding reads
Altera Corporation
QII5V1
2014.12.15
10-23
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.
Altera Corporation
10-24
QII5V1
2014.12.15
28-bit Slave
Word Address
[25:0]
[27:26]
Mapping Table (Sub-Windows)
addr[27:6]
Extended addr_regs[63:0]
Control
Port
0x00000000_04000000
0x00000000_08000000
0x00000000_0C000000
0x00000000_00000000
00
[1:0]
38-bit Master
Byte Address
Using the Address Span Extender
When you implement the address span extender in Qsys, you must know the amount of address space the
master uses (the size of the window), the total size of the addressable space (the number of windows), and
how much address space (the size of the window) you want a particular slave to occupy in a masters
address map.
This component supports 1 to 64 address windows. Qsys requires an assigned number of registers to hold
the upper address bits for each window. In the parameter editor, you must select the number of bits in the
expanded address map you want to access (Expanded Master Byte Address Width), the number of bits
you want the master to see (Slave Word Address Width), and the number of sub-windows.
Each sub-window has a 64-bit register set that defines the sub window's upper address, and use only the
bits greater than the slave byte address.
Altera Corporation
QII5V1
2014.12.15
10-25
You can set parameters for the address span extender with an initial fixed address value. Enter an address
for the Reset Default for Master Window option, and select True for the Disable Slave Control Port
option. This allows the address span extender to function as a fixed, non-programmable component.
Altera Corporation
10-26
QII5V1
2014.12.15
NIOS II Support
Each sub-window is equal in size and stacks sequentially in the windowed slave interface's address space.
To control the fixed address bits of a particular sub-window, you can write to the sub-windows register in
the register control slave interface. Qsys structures the logic so that Qsys can optimize and remove bits
that are not needed.
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:
0x110000 - 0x100000 + 0x40000 = 0x050000
0x140000
0x120000
Nios II
0x80000
Address Span
Extender
Avalon-MM
Slave
0x40000
0x110000
Effective Slave Base Address =
0x110000 - 0x100000 + 0x040000
= 0x050000
0x100000
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.
Altera Corporation
QII5V1
2014.12.15
10-27
Altera Corporation
10-28
QII5V1
2014.12.15
Value
Description
1-8 bits
8-64 bits
32, 64,
or128 bits
On or Off
Altera Corporation
QII5V1
2014.12.15
CSR Registers
Parameter
Value
10-29
Description
1-16 bits
On or Off
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.
Bit
Attribute
Default
Descripton
31:4
R0
Reserved.
RW1C
RW1C
Altera Corporation
10-30
QII5V1
2014.12.15
Offset
Bit
Attribute
RW1C
Default
Descripton
RW1C
The CSR read access violation log settings are valid only when an associated read interrupt register is set.
This set of registers should be read until the valid bit is cleared.
Bit
Attribute
Default
Description
31:13
R0
Reserved.
12:11
R0
10:7
R0
6:4
R0
3:1
R0
R0
0x104
31:0
R0
0x108
31:0
R0
Read cycle target address for the cycle that causes the
access violation (lower 32-bit).
0x100
Altera Corporation
QII5V1
2014.12.15
Offset
0x10C
Bit
31:0
Attribute
R0
Default
10-31
Description
Read cycle 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.
Note: When this register is read, the current read
access violation log is recovered from FIFO.
The CSR write access violation log settings are valid only when an associated read interrupt register is set.
This set of registers should be read until the valid bit is cleared.
Bit
Attribute
Default
Description
31:13
R0
Reserved.
12:11
R0
10:7
R0
6:4
R0
3:1
R0
R0
0x194
31:0
R0
0x198
31:0
R0
Write target address for the cycle that causes the access
violation (lower 32-bit).
0x19C
31:0
R0
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.
0x190
Altera Corporation
10-32
QII5V1
2014.12.15
Offset
0x1A0
Bit
31:0
Attribute
R0
Default
Description
First 32 bits of the write data for the write cycle that
causes the access violation.
Note: When this register is read, the current write
access violation log is recovered from FIFO,
when the data width is 32 bits.
0x1A4
31:0
R0
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
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
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.
Altera Corporation
QII5V1
2014.12.15
10-33
Tri-State Components
Figure 10-19: 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.
Printed Circuit Board
Altera FPGA
TCS
Generic Tri-state
Controller
Parameterized
for 8 MByte
x16 Flash
Avalon-MM Master
TCM
Avalon-TC Master
Avalon-MM Slave
TCS
Avalon-TC Slave
Cn
Conduit
Cn
SSRAM
Cn
Flash
TCM
Nios II
Processor
Send Feedback
Generic Tri-state
Controller
Parameterized
for 2 MByte
x32 SSRAM
TCS
TCM
Tri-state
Conduit
Pin
Sharer
TCM
TCS
Tri-state
Conduit
Bridge
Cn
Altera Corporation
10-34
QII5V1
2014.12.15
Tri-State Components
PCB
Qsys
Address Map
2 MByte SSRAM
(32-bit word)
PCB_Addr [19:1]
Unused
Addr [18:0]
10 MBytes
Tristate Conduit
Bridge
Addr [23]
Addr [22:1]
Addr [0]
16 MBytes
2 MByte SSRAM
(32-bit word)
8 MBytes
PCB_Addr [21:0]
PCB_Addr [21:0]
8 MByte Flash
(16-bit word)
8 MByte Flash
(16-bit word)
Addr [21: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.
Altera Corporation
QII5V1
2014.12.15
10-35
Related Information
Note: In calculating delays, the Generic Tri-State Controller chooses the larger of the bus-turnaround
time and read latency. Turnaround time is measured from the time that a command is accepted,
not from the time that the previous read returned data.
Qsys System Design Components
Send Feedback
Altera Corporation
10-36
QII5V1
2014.12.15
Note: All tri-state conduit components are connected to a pin sharer must be in the same clock domain.
Altera Corporation
QII5V1
2014.12.15
10-37
Related Information
TEST PATTERN
GENERATOR
Avalon-ST
Source
command
Avalon-MM
Slave Port
Avalon-MM
Slave Port
data_out
Altera Corporation
10-38
QII5V1
2014.12.15
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.
The command interface for the Test Pattern Generator is a 32-bit Avalon-MM write slave that accepts
data generation commands. It is connected to a 16-element deep FIFO, thus allowing a master peripheral
to drive a number of commands into the test pattern generator.
The command interface maps to the following registers: cmd_lo and cmd_hi. The command is pushed
into the FIFO when the register cmd_lo (address 0) is addressed. When the FIFO is full, the command
interface asserts the waitrequest signal. You can create errors by writing to the register cmd_hi (address
1). The errors are cleared when 0 is written to this register, or its respective fields.
The output interface of the Test Pattern Generator is an Avalon-ST interface that optionally supports data
packets. You can configure the output interface to align with your system requirements. Depending on
the incoming stream of commands, the output data may contain interleaved packet fragments for
different channels. To keep track of the current symbols position within each packet, the test pattern
generator maintains an internal state for each channel.
You can configure the output interface of the test pattern generator with the following parameters:
Number of ChannelsNumber of channels that the test pattern generator supports. Valid values are 1
to 256.
Data Bits Per SymbolBits per symbol is related to the width of readdata and writedata signals,
which must be a multiple of the bits per symbol.
Data Symbols Per BeatNumber of symbols (words) that are transferred per beat. Valid values are 1
to 256.
Include Packet SupportIndicates whether or not packet transfers are supported. Packet support
includes the startofpacket, endofpacket, and empty signals.
Error Signal Width (bits)Width of the error signal on the output interface. Valid values are 0 to 31.
A value of 0 indicates that the error signal is not in use.
Note: If you change only bits per symbol, and do not change the data width, errors are generated.
Altera Corporation
QII5V1
2014.12.15
10-39
data_in
Avalon-ST
Sink
Avalon-MM
Slave Port
TEST PATTERN
CHECKER
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-ofpacket (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.
The Test Pattern Checker input interface is an Avalon-ST interface that optionally supports data packets.
You can configure the input interface to align with your system requirements. Incoming data may contain
interleaved packet fragments. To keep track of the current symbols position, the test pattern checker
maintains an internal state for each channel.
The Test Pattern Checker control and status interface is a 32-bit Avalon-MM slave that allows you to
enable or disable data acceptance, as well as set the throttle. This interface provides generation-time
information, such as the number of channels and whether the test pattern checker supports data packets.
The control and status interface also provides information on the exceptions detected by the test pattern
checker. The interface obtains this information by reading from the exception FIFO.
Altera Corporation
10-40
QII5V1
2014.12.15
The Test Pattern Checker functional parameter allows you to configure the test pattern checker as a whole
system.
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.
For Nios II processor users, Altera provides HAL system library drivers that allow you to initialize and
access the test pattern generator and checker cores. Altera recommends you to use the provided drivers to
access the cores instead of accessing the registers directly.
For Nios II IDE users, copy the provided drivers from the following installation folders to your software
application directory:
The following files define the low-level access to the hardware, and provide the routines for the HAL
device drivers.
Note: Do not modify the test pattern generator or test pattern checker core files.
Altera Corporation
QII5V1
2014.12.15
Register Maps for the Test Pattern Generator and Test Pattern Checker Cores
10-41
Register Maps for the Test Pattern Generator and Test Pattern Checker Cores
Test Pattern Generator Control and Status Registers
Table 10-13: 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
Name
Access
Description
[15:0]
ID
RO
[23:16]
NUMCHANNELS
RO
[30:24]
NUMSYMBOLS
RO
[31]
SUPPORTPACKETS
RO
Name
[0]
ENABLE
[7:1]
Reserved
Access
RW
Description
Altera Corporation
10-42
QII5V1
2014.12.15
Bit(s)
Name
[16:8]
THROTTLE
Access
RW
Description
[17]
SOFT RESET
[31:18]
Reserved
RW
When this bit is set to 1, all internal counters and statistics are
reset. Write 0 to this bit to exit reset.
Name
[0]
BUSY
[6:1]
Reserved
[15:7]
FILL
[31:16]
Reserved
Access
Description
RO
RO
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.
Altera Corporation
QII5V1
2014.12.15
10-43
Name
Access
Description
[15:0]
SIZE
RW
[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.
Name
Access
Description
[15:0]
SIGNALED
ERROR
RW
[23:16]
DATA ERROR
RW
[24]
SUPPRESS
SOP
RW
[25]
SUPRESS
EOP
RW
Register Name
base + 0
status
base + 1
control
Altera Corporation
10-44
QII5V1
2014.12.15
Offset
Register Name
base + 2
base + 3
Reserved
base + 4
base + 5
exception_descriptor
base + 6
indirect_select
base + 7
indirect_count
Name
Access
Description
[15:0]
ID
RO
[23:16]
NUMCHANNELS
RO
[30:24]
NUMSYMBOLS
RO
[31]
SUPPORTPACKETS
RO
Name
[0]
ENABLE
[7:1]
Reserved
[16:8]
THROTTLE
Access
Description
RW
RW
[17]
SOFT RESET
[31:18]
Reserved
Altera Corporation
RW
When this bit is set to 1, all internal counters and statistics are
reset. Write 0 to this bit to exit reset.
QII5V1
2014.12.15
10-45
Name
Access
Description
[0]
DATA ERROR
RO
[1]
MISSINGSOP
RO
[2]
MISSINGEOP
RO
[7:3]
Reserved
[15:8]
SIGNALLED
ERROR
RO
[23:16]
Reserved
[31:24]
CHANNEL
RO
Bits Name
[7:0]
INDIRECT
CHANNEL
[15:8]
Reserved
[31:16]
INDIRECT
ERROR
Access
Description
RW
RO
Bits Name
Access
[15:0]
INDIRECT
PACKET
COUNT
RO
[31:16]
INDIRECT
SYMBOL
COUNT
RO
Description
INDIRECT CHANNEL.
.
Qsys System Design Components
Send Feedback
Altera Corporation
10-46
QII5V1
2014.12.15
data_source_reset()
Table 10-26: data_source_reset()
Information Type
Description
Prototype
Thread-safe
No
Include
<data_source_util.h >
Parameters
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.
Altera Corporation
QII5V1
2014.12.15
data_source_init()
10-47
data_source_init()
Table 10-27: data_source_init()
Information Type
Description
Prototype
Thread-safe
No
Include
<data_source_util.h >
Parameters
Returns
1Initialization is successful.
0Initialization is unsuccessful.
Description
data_source_get_id()
Table 10-28: data_source_get_id()
Information Type
Description
Prototype
Thread-safe
Yes
Include
<data_source_util.h >
Parameters
Returns
Description
Altera Corporation
10-48
QII5V1
2014.12.15
data_source_get_supports_packets()
data_source_get_supports_packets()
Table 10-29: data_source_get_supports_packets()
Information Type
Description
Prototype
Thread-safe
Yes
Include
<data_source_util.h >
Parameters
Returns
Description
data_source_get_num_channels()
Table 10-30: data_source_get_num_channels()
Description
Description
Prototype
Thread-safe
Yes
Include
<data_source_util.h >
Parameters
Returns
Description
data_source_get_symbols_per_cycle()
Table 10-31: data_source_get_symbols_per_cycle()
Description
Description
Prototype
Thread-safe
Yes
Altera Corporation
QII5V1
2014.12.15
data_source_get_enable()
Description
10-49
Description
Include
<data_source_util.h >
Parameters
Returns
Description
data_source_get_enable()
Table 10-32: data_source_get_enable()
Information Type
Description
Prototype
Thread-safe
Yes
Include
<data_source_util.h >
Parameters
Returns
Description
data_source_set_enable()
Table 10-33: data_source_set_enable()
Information Type
Description
Prototype
Thread-safe
No
Include
<data_source_util.h >
Parameters
Returns
void
Altera Corporation
10-50
QII5V1
2014.12.15
data_source_get_throttle()
Information Type
Description
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-34: data_source_get_throttle()
Information Type
Description
Prototype
Thread-safe
Yes
Include
<data_source_util.h >
Parameters
Returns
Throttle value.
Description
data_source_set_throttle()
Table 10-35: data_source_set_throttle()
Information Type
Description
Prototype
Thread-safe
No
Include
<data_source_util.h >
Parameters
Returns
void
Description
Sets the throttle value, which can be between 0256 inclusively. The
throttle value, when divided by 256 yields the rate at which the test
pattern generator sends data.
Altera Corporation
QII5V1
2014.12.15
data_source_is_busy()
10-51
data_source_is_busy()
Table 10-36: data_source_is_busy()
Information Type
Description
Prototype
Thread-safe
Yes
Include
<data_source_util.h >
Parameters
Returns
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-37: data_source_fill_level()
Information Type
Description
Prototype
Thread-safe
Yes
Include
<data_source_util.h >
Parameters
Returns
Description
data_source_send_data()
Table 10-38: data_source_send_data()
Information Type
Prototype
Description
int data_source_send_data(alt_u32 cmd_base, alt_u16
channel, alt_u16 size, alt_u32 flags, alt_u16 error, alt_
u8 data_error_mask);
Altera Corporation
10-52
QII5V1
2014.12.15
Information Type
Description
Thread-safe
No
Include
<data_source_util.h >
Parameters
Returns
Returns 1.
Description
QII5V1
2014.12.15
data_sink_reset()
10-53
data_sink_reset()
Table 10-39: data_sink_reset()
Information Type
Description
Prototype
Thread-safe
No
Include
<data_sink_util.h >
Parameters
Returns
void
Description
Resets the test pattern checker core including all internal counters.
data_sink_init()
Table 10-40: data_sink_init()
Information Type
Description
Prototype
Thread-safe
No
Include
<data_sink_util.h >
Parameters
Altera Corporation
10-54
QII5V1
2014.12.15
data_sink_get_id()
Information Type
Returns
Description
1Initialization is successful.
0Initialization is unsuccessful.
Description
data_sink_get_id()
Table 10-41: data_sink_get_id()
Information Type
Description
Prototype
Thread-safe
Yes
Include
<data_sink_util.h >
Parameters
Returns
Description
data_sink_get_supports_packets()
Table 10-42: data_sink_get_supports_packets()
Information Type
Description
Prototype
Thread-safe
Yes
Include
<data_sink_util.h >
Parameters
Returns
Description
Altera Corporation
QII5V1
2014.12.15
data_sink_get_num_channels()
10-55
data_sink_get_num_channels()
Table 10-43: data_sink_get_num_channels()
Information Type
Description
Prototype
Thread-safe
Yes
Include
<data_sink_util.h >
Parameters
Returns
Description
data_sink_get_symbols_per_cycle()
Table 10-44: data_sink_get_symbols_per_cycle()
Information Type
Description
Prototype
Thread-safe
Yes
Include
<data_sink_util.h >
Parameters
Returns
Description
data_sink_get_enable()
Table 10-45: data_sink_get_enable()
Information Type
Description
Prototype
Thread-safe
Yes
Altera Corporation
10-56
QII5V1
2014.12.15
data_sink_set enable()
Information Type
Description
Include
<data_sink_util.h >
Parameters
Returns
Description
data_sink_set enable()
Table 10-46: data_sink_set enable()
Information Type
Description
Prototype
Thread-safe
No
Include
<data_sink_util.h >
Parameters
Returns
void
Description
data_sink_get_throttle()
Table 10-47: data_sink_get_throttle()
Information Type
Description
Prototype
Thread-safe
Yes
Include
<data_sink_util.h >
Parameters
Returns
Throttle value.
Description
Altera Corporation
QII5V1
2014.12.15
data_sink_set_throttle()
10-57
data_sink_set_throttle()
Table 10-48: data_sink_set_throttle()
Information Type
Description
Prototype
Thread-safe
No
Include:
<data_sink_util.h >
Parameters
Returns
void
Description
Sets the throttle value, which can be between 0256 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-49: data_sink_get_packet_count()
Information Type
Description
Prototype
Thread-safe
No
Include
<data_sink_util.h >
Parameters
Returns
Description
Altera Corporation
10-58
QII5V1
2014.12.15
data_sink_get_error_count()
data_sink_get_error_count()
Table 10-50: data_sink_get_error_count()
Information Type
Description
Prototype
Thread-safe
No
Include
<data_sink_util.h >
Parameters
Returns
Description
data_sink_get_symbol_count()
Table 10-51: data_sink_get_symbol_count()
Information Type
Description
Prototype
Thread-safe
No
Include
<data_sink_util.h >
Parameters
Returns
Description
data_sink_get_exception()
Table 10-52: data_sink_get_exception()
Information Type
Prototype
Altera Corporation
Description
int data_sink_get_exception(alt_u32 base);
QII5V1
2014.12.15
data_sink_exception_is_exception()
Information Type
10-59
Description
Thread-safe
Yes
Include
<data_sink_util.h >
Parameters
Returns
Description
Retrieves the first exception descriptor in the exception FIFO and pops
it off the FIFO.
data_sink_exception_is_exception()
Table 10-53: data_sink_exception_is_exception()
Information Type
Description
Prototype
Thread-safe
Yes
Include
<data_sink_util.h >
Parameters
exceptionException descriptor
Returns
1Indicates an exception.
0No exception.
Description
data_sink_exception_has_data_error()
Table 10-54: data_sink_exception_has_data_error()
Information Type
Description
Prototype
Thread-safe
Yes
Include
<data_sink_util.h >
Parameters
exceptionException descriptor.
Altera Corporation
10-60
QII5V1
2014.12.15
data_sink_exception_has_missing_sop()
Information Type
Returns
Description
1Data has errors.
0No errors.
Description
data_sink_exception_has_missing_sop()
Table 10-55: data_sink_exception_has_missing_sop()
Information Type
Description
Prototype
Thread-safe
Yes
Include
<data_sink_util.h >
Parameters
exceptionException descriptor.
Returns
1Missing SOP.
0Other exception types.
Description
data_sink_exception_has_missing_eop()
Table 10-56: data_sink_exception_has_missing_eop()
Information Type
Description
Prototype
Thread-safe
Yes
Include
<data_sink_util.h >
Parameters
exceptionException descriptor.
Returns
1Missing EOP.
0Other exception types.
Description
Altera Corporation
QII5V1
2014.12.15
data_sink_exception_signalled_error()
10-61
data_sink_exception_signalled_error()
Table 10-57: data_sink_exception_signalled_error()
Information Type
Description
Prototype
Thread-safe
Yes
Include
<data_sink_util.h >
Parameters
exceptionException descriptor.
Returns
Description
data_sink_exception_channel()
Table 10-58: data_sink_exception_channel()
Information Type
Description
Prototype
Thread-safe
Yes
Include
<data_sink_util.h >
Parameters
exceptionException descriptor.
Returns
Description
Altera Corporation
10-62
QII5V1
2014.12.15
Avalon-ST
Source 0
In_Data
Avalon-ST
Sink
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.
Avalon-ST
Splitter Core
Out_Data
Avalon-ST
Source N
Clock
Output 0
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.
Altera Corporation
QII5V1
2014.12.15
10-63
Support
Backpressure
Ready latency = 0.
Data Width
Configurable.
Channel
Supported (optional).
Error
Supported (optional).
Packet
Supported (optional).
Legal Values
Default Value
Description
Number Of Outputs
1 to 16
0 or 1
Data Width
1512
1512
Use Packets
0 or 1
Use Channel
0 or 1
Channel Width
0-8
Altera Corporation
10-64
QII5V1
2014.12.15
Parameter
Legal Values
Default Value
Description
Max Channels
0-255
Use Error
0 or 1
Error Width
031
Avalon-ST
Delay Core
Avalon-ST
Source
In_Data
Avalon-ST
Sink
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.
Out_Data
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.
Altera Corporation
QII5V1
2014.12.15
10-65
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.
Support
Backpressure
Not supported.
Data Width
Configurable.
Channel
Supported (optional).
Error
Supported (optional).
Packet
Supported (optional).
Legal Values
Default Value
Description
0 to 16
Data Width
1512
1512
Use Packets
0 or 1
Use Channel
0 or 1
Altera Corporation
10-66
QII5V1
2014.12.15
Parameter
Legal Values
Default Value
Description
Channel Width
0-8
Max Channels
0-255
Use Error
0 or 1
Error Width
031
Avalon-ST
Round-Robin
Scheduler
Avalon-ST Sink
Request
(Channel_select)
Avalon-MM
Write Master
The Avalon-ST Round Robin Scheduler core controls the read operations from a multi-channel AvalonST 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.
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.
Altera Corporation
QII5V1
2014.12.15
10-67
Property
Backpressure
Not supported
Data Width
Channel
Error
Not supported
Packet
Not supported
Direction
Description
In
Clock reference.
reset_n
In
Altera Corporation
10-68
QII5V1
2014.12.15
Signal
Direction
Description
Out
request_write
Out
request_writedata
Out
In
request_waitrequest
In
almost_full_channel (Channel_
Width1:0)
In
In
Values
Description
Number of channels
232
01
Altera Corporation
QII5V1
2014.12.15
10-69
Avalon-MM Master
data_in
Avalon-ST
Sink
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.
data_out
Avalon-MM
Slave
Component
Avalon-ST
Source
Avalon
Packets to
Transactions
Converter
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
Property
Backpressure
Ready latency = 0.
Data Width
Channel
Not supported.
Altera Corporation
10-70
QII5V1
2014.12.15
Feature
Property
Error
Not used.
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.
A response packet is returned for every write transaction. The core also returns a response packet if a no
transaction (0x7f) is received. An invalid transaction code is regarded as a no transaction. For read
transactions, the core returns the data read.
The Packets to Transactions Converter core expects incoming data streams to be in the formats shown the
table below.
Field
Description
Transaction code
Type of transaction.
Reserved
[3:2]
Size
[7:4]
Address
[n:8]
Data
Transaction code
Reserved
Altera Corporation
QII5V1
2014.12.15
Byte
[4:2]
Field
10-71
Description
Size
Related Information
Avalon-MM Transaction
Description
0x00
0x04
0x10
0x14
0x7f
No transaction.
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.
Qsys System Design Components
Send Feedback
Altera Corporation
10-72
QII5V1
2014.12.15
data_in
Altera Corporation
Sink
Register 0
Source
data_out
QII5V1
2014.12.15
10-73
Full?
Register 1
data_in
Sink
Source
data_out
Register 0
Full?
Altera Corporation
10-74
QII5V1
2014.12.15
Avalon-ST Multiplexer
Avalon-ST Multiplexer
Figure 10-31: 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.
sink
data_in_ n
sink
...
...
data_in 0
src
data_out
sink
sink
channel
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.
Each input interface is an Avalon-ST data interface that optionally supports packets. The input interfaces
are identical; they have the same symbol and data widths, error widths, and channel widths.
Altera Corporation
QII5V1
2014.12.15
10-75
The output interface carries the multiplexed data stream with data from the inputs. The symbol, data, and
error widths are the same as the input interfaces.
The width of the channel signal is the same as the input interfaces, with the addition of the bits needed to
indicate the origin of the data.
You can configure the following parameters for the output interface:
Data Bits Per SymbolThe bits per symbol is related to the width of readdata and writedata
signals, which must be a multiple of the bits per symbol.
Data Symbols Per BeatThe number of symbols (words) that are transferred per beat (transfer).
Valid values are 1 to 32.
Include Packet SupportIndicates whether or not packet transfers are supported. Packet support
includes the startofpacket, endofpacket, and empty signals.
Channel Signal Width (bits) The number of bits Qsys uses for the channel signal for output
interfaces. For example, set this parameter to 1 if you have two input interfaces with no channel, or set
this parameter to 2 if you have two input interfaces with a channel width of 1 bit. The input channel
can have a width between 0-31 bits.
Error Signal Width (bits)The width of the error signal for input and output interfaces. A value of 0
means the error signal is not in use.
Note: If you change only bits per symbol, and do not change the data width, errors are generated.
Multiplexer Parameters
You can configure the following parameters for the multiplexer:
Number of Input PortsThe 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 SchedulingWhen 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 portWhen 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.
Altera Corporation
10-76
QII5V1
2014.12.15
Avalon-ST Demultiplexer
Avalon-ST Demultiplexer
Figure 10-32: 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.
sink
sink
src
data_out 0
...
data_in
...
src
sink
data_out _n
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.
Each input interface is an Avalon-ST data interface that optionally supports packets. You can configure
the following parameters for the input interface:
Data Bits Per SymbolThe bits per symbol is related to the width of readdata and writedata
signals, which must be a multiple of the bits per symbol.
Data Symbols Per BeatThe number of symbols (words) that are transferred per beat (transfer).
Valid values are 1 to 32.
Include Packet SupportIndicates whether or not data packet transfers are supported. Packet
support includes the startofpacket, endofpacket, and empty signals.
Channel Signal Width (bits)The number of bits for the channel signal for output interfaces. A
value of 0 means that output interfaces do not use the optional channel signal.
Error Signal Width (bits)The width of the error signal for input and output interfaces. A value of 0
means the error signal is in use.
Note: If you change only bits per symbol, and do not change the data width, errors are generated.
Each output interface carries data from a subset of channels from the input interface. Each output
interface is identical; all have the same symbol and data widths, error widths, and channel widths. The
Altera Corporation
QII5V1
2014.12.15
Demultiplexer Parameters
10-77
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 PortsThe number of output interfaces that the multiplexer supports Valid
values are 2 to 16.
High channel bits select outputWhen 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-33: Select Bits for the Demultiplexer
sink
data_ in
channel <4 .. 0 > sink
data_ out 0
src channel <3 .. 0 >
src
sink
data_out_n
channel <3 .. 0 >
Altera Corporation
10-78
QII5V1
2014.12.15
csr
Avalon-MM
Slave
in
Avalon-ST
Data
Sink
Avalon-ST
Single-Clock
FIFO
Avalon-ST
Status
Source
almost_full
Altera Corporation
Avalon-ST
Data
Source
out
Avalon-ST
Status
Source
almost_empty
QII5V1
2014.12.15
10-79
Avalon-ST
Dual-Clock
FIFO
in_csr
out_csr
Avalon-MM
Slave
Avalon-MM
Slave
Avalon-ST
Data
Sink
in
Avalon-ST
Data
Source
Clock A
out
Clock B
Property
Backpressure
Ready latency = 0.
Data Width
Configurable.
Altera Corporation
10-80
QII5V1
2014.12.15
Feature
Property
Channel
Error
Configurable.
Packet
Configurable.
QII5V1
2014.12.15
10-81
the input clock domain represents the amount of space available in the FIFO (available space = FIFO
depth input fill level).
Legal
Values
Description
132
132
Error width
032
FIFO depth
2n
Use packets
Channel width
132
Altera Corporation
10-82
QII5V1
2014.12.15
Parameter
Legal
Values
Description
28
28
Max Channel
1255
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
Altera Corporation
QII5V1
2014.12.15
10-83
Name
Access
Reset
Description
fill_
level
Reserved
almost_
full_
threshold
RW
FIFO
depth1
almost_
empty_
threshold
RW
cut_
through_
threshold
RW
RW
drop_on_
error
Name
fill_level
Access
Reset Value
Description
10-84
QII5V1
2014.12.15
Related Information
December 2014
Version
14.1.0
Changes
June 2014
14.0.0
November 2013
13.1.0
May 2013
13.0.0
November 2012
12.1.0
Related Information
Altera Corporation
11
2014.12.15
QII5V1
Subscribe
Send Feedback
This chapter provides design recommendations for Altera devices and describes the Quartus II Design
Assistant, which helps you check your design for violations of Alteras 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
www.altera.com
101 Innovation Drive, San Jose, CA 95134
ISO
9001:2008
Registered
11-2
QII5V1
2014.12.15
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 II
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.
Related Information
Altera Corporation
QII5V1
2014.12.15
11-3
The timing of asynchronous design structures is often difficult or impossible to model with timing
assignments and constraints. If you do not have complete or accurate timing constraints, the timingdriven algorithms used by your synthesis and place-and-route tools may not be able to perform the best
optimizations, and the reported results may not be complete.
Some asynchronous design structures can generate harmful glitches, which are pulses that are very short
compared with clock periods. Most glitches are generated by combinational logic. When the inputs of
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.
Combinational loops are among the most common causes of instability and unreliability in digital
designs. Combinational loops generally violate synchronous design principles by establishing a direct
feedback loop that contains no registers.
You should avoid combinational loops whenever possible. In a synchronous design, feedback loops
should include registers. For example, a combinational loop occurs when the left-hand side of an
arithmetic expression also appears on the right-hand side in HDL code. A combinational loop also occurs
when you feed back the output of a register to an asynchronous pin of the same register through combina
tional logic.
Figure 11-1: Combinational Loop Through Asynchronous Control Pin
Logic
Altera Corporation
11-4
QII5V1
2014.12.15
Tip: Use recovery and removal analysis to perform timing analysis on asynchronous ports, such as clear
or reset in the Quartus II software.
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.
Related Information
A latch is a small circuit with combinational feedback that holds a value until a new value is assigned. You
can implement latches with the Quartus II Text Editor or Block Editor.
It is common for mistakes in HDL code to cause unintended latch inference; Quartus II Synthesis issues a
warning message if this occurs. Unlike other technologies, a latch in FPGA architecture is not significantly
smaller than a register. The architecture is not optimized for latch implementation and latches generally
have slower timing performance compared to equivalent registered circuitry.
Latches have a transparent mode in which data flows continuously from input to output. A positive latch
is in transparent mode when the enable signal is high (low for negative latch). In transparent mode,
glitches on the input can pass through to the output because of the direct path created. This presents
significant complexity for timing analysis. Typical latch schemes use multiple enable phases to prevent
long transparent paths from occurring. However, timing analysis cannot identify these safe applications.
The TimeQuest analyzer analyzes latches as synchronous elements clocked on the falling edge of the
positive latch signal by default, and allows you to treat latches as having nontransparent start and end
points. Be aware that even an instantaneous transition through transparent mode can lead to glitch
propagation. The TimeQuest analyzer cannot perform cycle-borrowing analysis.
Due to various timing complexities, latches have limited support in formal verification tools. Therefore,
you should not rely on formal verification for a design that includes latches.
Tip: Avoid using latches to ensure that you can completely analyze the timing performance and reliability
of your design.
You require delay chains when you use two or more consecutive nodes with a single fan-in and a single
fan-out to cause delay. Inverters are often chained together to add delay. Delay chains are sometimes used
to resolve race conditions created by other asynchronous design practices.
Delays in PLD designs can change with each placement and routing cycle. Effects such as rise and fall time
differences and on-chip variation mean that delay chains, especially those placed on clock paths, can cause
significant problems in your design. Avoid using delay chains to prevent these kinds of problems.
In some ASIC designs, delays are used for buffering signals as they are routed around the device. This
functionality is not required in FPGA devices because the routing structure provides buffers throughout
the device.
Altera Corporation
QII5V1
2014.12.15
11-5
You can use delay chains to generate either one pulse (pulse generators) or a series of pulses
(multivibrators). There are two common methods for pulse generation. These techniques are purely
asynchronous and must be avoided.
AND Gate
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 registers output drives the same registers 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
Altera Corporation
11-6
QII5V1
2014.12.15
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.
If you use the output from combinational logic as a clock signal or as an asynchronous reset signal, you
can expect to see glitches in your design. In a synchronous design, glitches on data inputs of registers are
normal events that have no consequences. However, a glitch or a spike on the clock input (or an
asynchronous input) to a register can have significant consequences.
Narrow glitches can violate the registers minimum pulse width requirements. Setup and hold require
ments might also be violated if the data input of the register changes when a glitch reaches the clock input.
Even if the design does not violate timing requirements, the register output can change value unexpect
edly and cause functional hazards elsewhere in the design.
To avoid these problems, you should always register the output of combinational logic before you use it as
a clock signal.
Clock
Generation
Logic
Altera Corporation
QII5V1
2014.12.15
11-7
Registering the output of combinational logic ensures that glitches generated by the combinational logic
are blocked at the data input of the register.
Designs often require clocks that you create by dividing a master clock. Most Altera FPGAs provide
dedicated phase-locked loop (PLL) circuitry for clock division. Using dedicated PLL circuitry can help
you to avoid many of the problems that can be introduced by asynchronous clock division logic.
When you must use logic to divide a master clock, always use synchronous counters or state machines.
Additionally, create your design so that registers always directly generate divided clock signals, and route
the clock on global clock resources. To avoid glitches, do not decode the outputs of a counter or a state
machine to generate clock signals.
To simplify verification, avoid ripple counters in your design. In the past, FPGA designers implemented
ripple counters to divide clocks by a power of two because the counters are easy to design and may use
fewer gates than their synchronous counterparts.
Ripple counters use cascaded registers, in which the output pin of one register feeds the clock pin of the
register in the next stage. This cascading can cause problems because the counter creates a ripple clock at
each stage. These ripple clocks must be handled properly during timing analysis, which can be difficult
and may require you to make complicated timing assignments in your synthesis and placement and
routing tools.
You can often use ripple clock structures to make ripple counters out of the smallest amount of logic
possible. However, in all Altera devices supported by the Quartus II software, using a ripple clock
structure to reduce the amount of logic used for a counter is unnecessary because the device allows you to
construct a counter using one logic element per counter bit. You should avoid using ripple counters
completely.
Use clock multiplexing to operate the same logic function with different clock sources. In these designs,
multiplexing selects a clock source.
For example, telecommunications applications that deal with multiple frequency standards often use
multiplexed clocks.
Figure 11-5: Multiplexing Logic and Clock Sources
Multiplexed Clock Routed
on Global Clock Resource
Clock 1
Clock 2
Select Signal
Altera Corporation
11-8
QII5V1
2014.12.15
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 II 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 II 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.
Gated clocks turn a clock signal on and off using an enable signal that controls gating circuitry. When a
clock is turned off, the corresponding clock domain is shut down and becomes functionally inactive.
Clock
Gating Signal
Gated 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
Altera Corporation
QII5V1
2014.12.15
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.
To turn off a clock domain in a synchronous manner, use a synchronous clock enable signal. FPGAs
efficiently support clock enable signals because there is a dedicated clock enable signal available on all
device registers.
This scheme does not reduce power consumption as much as gating the clock at the source because the
clock network keeps toggling, and performs the same function as a gated clock by disabling a set of
registers. Insert a multiplexer in front of the data input of every register to either load new data, or copy
the output of the register.
Figure 11-7: Synchronous Clock Enable
Data
Enable
Use gated clocks only when your target application requires power reduction and when gated clocks are
able to provide the required reduction in your device architecture.
If you must use clocks gated by logic, implement these clocks using the robust clock-gating technique and
ensure that the gated clock signal uses dedicated global clock routing.
You can gate a clock signal at the source of the clock network, at each register, or somewhere in between.
Because the clock network contributes to switching power consumption, gate the clock at the source
whenever possible, so that you can shut down the entire clock network instead of gating it further along
the clock network at the registers.
Figure 11-8: Recommended Clock-Gating Technique
Clock
Gating Signal
Enable
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.
Recommended Design Practices
Send Feedback
Altera Corporation
11-10
QII5V1
2014.12.15
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 II software to automatically
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.
Your design requirements impact the use of FPGA resources. Plan functional blocks with appropriate
global, regional, and dual-regional network signals in mind.
In general, after allocating the clocks in a design, use global networks for the highest fan-out control
signals. When a global network signal distributes a high fan-out control signal, the global signal can drive
logic anywhere in the device. Similarly, when using a regional network signal, the driven must be in one
quadrant of the device, or half the device for a dual-regional network signal. Depending on data flow and
physical locations of the data entry and exit between the I/Os and the device, restricting a functional block
to a quadrant or half the device may not be practical for performance or resource requirements.
Altera Corporation
QII5V1
2014.12.15
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.
You can make changes to your design and constraints that help you achieve timing closure.
Whenever you change the project settings, you must balance any performance improvement of the setting
against any potential increase in compilation time associated with the setting. You can view the perform
ance gain versus runtime cost by reviewing the Fitter messages after design processing.
You can use physical synthesis optimizations for combinational logic, register retiming, and register
duplication techniques to optimize your design for timing closure.
Click Assignments > Settings > Compiler Settings > Advanced Settings (Fitter) to turn on physical
synthesis options.
Physical synthesis for combinational logicWhen the Perform physical synthesis for combinational
logic is turned on, the report panel identifies logic that physical synthesis can modify. You can use this
information to modify the design so that the associated optimization can be turned off to save compile
time.
Register duplicationThis technique is most useful where registers have high fan-out, or where the
fan-out is in physically distant areas of the device. Review the netlist optimizations report and consider
manually duplicating registers automatically added by physical synthesis. You can also locate the
original and duplicate registers in the Chip Planner. Compare their locations, and if the fan-out is
improved, modify the code and turn off register duplication to save compile time.
Register retimingThis technique is particularly useful where some combinatorial paths between
registers exceed the timing goal while other paths fall short. If a design is already heavily pipelined,
register retiming is less likely to provide significant performance gains since there should not be
significantly unbalanced levels of logic across pipeline stages.
The application of appropriate timing constraints is essential to timing closure. Use the following
general guidelines in applying timing constraints:
Apply multicycle constraints in your design wherever single-cycle timing analysis is not required.
Apply False Path constraints to all asynchronous clock domain crossings or resets in the design. This
technique prevents overconstraining and the Fitter focuses only on critical paths to reduce compile
time. However, over constraining timing critical clock domains can sometimes provide better timing
results and lower compile times than physical synthesis.
Overconstrain rather than using physical synthesis when the slack improvement from physical
synthesis is near zero. Overconstrain the frequency requirement on timing critical clock domains by
using setup uncertainty.
When evaluating the effect of constraint changes on performance and runtime, compile the design
with at least three different seeds to determine the average performance and runtime effects. Different
constraint combinations produce various results. Three samples or more establishes a performance
trend. Modify your constraints based on performance improvement or decline.
Leave settings at the default value whenever possible. Increasing performance constraints can increase
the compile time significantly. While those increases may be necessary to close timing on a design,
using the default settings whenever possible minimizes compile time.
Altera Corporation
11-12
QII5V1
2014.12.15
To close timing in high speed designs, review paths with the largest timing failures. Correcting a single,
large timing failure can result in a very significant timing improvement.
Review the register placement and routing paths by clicking Tools > Chip Planner. Large timing failures
on high fan-out control signals can be caused by any of the following conditions:
Sub-optimal use of global networks
Signals that traverse the chip on local routing without pipelining
Failure to correct high fan-out by register duplication
For high-speed and high-bandwidth designs, optimize speed by reducing bus width and wire usage. To
reduce wire use, move the data as little as possible. For example, if a block of logic functions on a few
bits of a word, store inactive bits in a fifo or memory. Memory is cheaper and denser than registers and
reduces wire usage.
Altera Corporation
QII5V1
2014.12.15
11-13
This section provides an introduction to the Quartus II design flow with the Design Assistant, message
severity levels, and an explanation about how to set up the Design Assistant. The last parts of the section
describe the design rules and the reports generated by the Design Assistant. The Design Assistant
supports all Altera devices supported by the Quartus II software.
Design Files
Pre-Synthesis
Netlist
Design Assistant
Golden Rules (1)
Post-Synthesis
Netlist
Synthesis
(Logic Synthesis &
Technology Mapping)
Design Assistant
Fitter
T iming Analysis
Post-Fitting
Netlist
Custom
Rules (2)
Altera Corporation
11-14
QII5V1
2014.12.15
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
The following examples of custom rules show how to check node relationships and clock relationships in
a design.
This example shows the XML codes for checking SR latch structures in a design.
Example 11-1: Detecting SR Latches in a Design
Altera Corporation
QII5V1
2014.12.15
11-15
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.
Example 11-2: Detecting SR Latches in a Design
<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_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>
Altera Corporation
11-16
QII5V1
2014.12.15
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.
Example 11-3: Detecting Incorrect Synchronizer Configuration
Altera Corporation
QII5V1
2014.12.15
11-17
</MESSAGE>
</REPORTING_ROOT>
</DA_RULE>
The codes differentiate the clock domains. ASYN means asynchronous, and !ASYN means nonasynchronous. 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.
<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" />
The next line of code states that NODE_2 and NODE_3 have a clock relationship of either sequential
edge or asynchronous.
<CLOCK_RELATIONSHIP NAME="SEQ_EDGE|ASYN" NODE_LIST="NODE_2, NODE_3" />
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:
Example 11-4: Undesired Condition 3
Altera Corporation
11-18
QII5V1
2014.12.15
NODE_2
NODE_3
Q
Logic
D
CLOCK_1
CLOCK_2
NODE_2
NODE_3
CLOCK_1
CLOCK_2
Altera Corporation
QII5V1
2014.12.15
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 II 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.
The synchronous reset ensures that the circuit is fully synchronous. You can easily time the circuit with
the Quartus II TimeQuest analyzer.
Because clocks that are synchronous to each other launch and latch the reset signal, the data arrival and
data required times are easily determined for proper slack analysis. The synchronous reset is easier to use
with cycle-based simulators.
There are two methods by which a reset signal can reach a register; either by being gated in with the data
input, or by using an LAB-wide control signal (synclr). If you use the first method, you risk adding an
additional gate delay to the circuit to accommodate the reset signal, which causes increased data arrival
times and negatively impacts setup slack. The second method relies on dedicated routing in the LAB to
each register, but this is slower than an asynchronous reset to the same register.
Altera Corporation
11-20
QII5V1
2014.12.15
Local Interconnect
Local Interconnect
Local Interconnect
Local Interconnect
Local Interconnect
Local Interconnect
labclk0
labclk2
labclk1
labclkena0
labclkena1
labclr1
syncload
labclkena2
labclr0
synclr
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.
Altera Corporation
QII5V1
2014.12.15
11-21
por_n
clock
reset_n
INPU T
VCC
data_a
INPU T
VCC
clock
INPU T
VCC
AND2
lc 1
FPG A
OUTPU T
out_a
AND2
data_b
INPU T
VCC
lc 2
OUTPU T
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.
Example 11-6: Verilog Code for Externally 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
<= 1b0;
reg2
<= 1b0;
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.
Altera Corporation
11-22
QII5V1
2014.12.15
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
lc 1
OUTPU T
INPU T
VCC
AND2
INPU T
VCC
lc 2
OUTPU T
The following example shows the Verilog equivalent of the schematic. Only the clock edge is in
the sensitivity list for a synchronous reset.
Example 11-8: Verilog Code for 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;
Altera Corporation
QII5V1
2014.12.15
11-23
assign
out_b = reg2;
always @ (posedge clock)
begin
if (!reset_n)
begin
reg1
<= 1b0;
reg2
<= 1b0;
end
else
begin
reg1
<= data_a;
reg2
<= data_b;
end
end
endmodule
// sync_reset_ext
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.
Example 11-9: SDC Constraints for Internally Synchronized Reset
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.
Altera Corporation
11-24
QII5V1
2014.12.15
INPU T
VCC
lc 3
AND2
INPU T
VCC
lc 1
OUTPU T
INPU T
VCC
AND2
INPU T
VCC
lc 2
OUTPU T
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.
Asynchronous resets are the most common form of reset in circuit designs, as well as the easiest to
implement. Typically, you can insert the asynchronous reset into the device, turn on the global buffer, and
connect to the asynchronous reset pin of every register in the device.
This method is only advantageous under certain circumstancesyou do not need to always reset the
register. Unlike the synchronous reset, the asynchronous reset is not inserted in the data path, and does
not negatively impact the data arrival times between registers. Reset takes effect immediately, and as soon
as the registers receive the reset pulse, the registers are reset. The asynchronous reset is not dependent on
the clock.
However, when the reset is deasserted and does not pass the recovery (tSU) or removal (tH) time check
(the TimeQuest analyzer recovery and removal analysis checks both times), the edge is said to have fallen
into the metastability zone. Additional time is required to determine the correct state, and the delay can
cause the setup time to fail to register downstream, leading to system failure. To avoid this, add a few
follower registers after the register with the asynchronous reset and use the output of these registers in the
design. Use the follower registers to synchronize the data to the clock to remove the metastability issues.
You should place these registers close to each other in the device to keep the routing delays to a minimum,
which decreases data arrival times and increases MTBF. Ensure that these follower registers themselves
are not reset, but are initialized over a period of several clock cycles by flushing out their current or
initial state.
Altera Corporation
QII5V1
2014.12.15
11-25
DFF
INPU T
VCC
DFF
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.
Example 11-10: Verilog Code of Asynchronous Reset with Follower Registers
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
<= 1b0;
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 nondeterministic 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.
Example 11-11: SDC Constraints for Asynchronous Reset
Altera Corporation
11-26
QII5V1
2014.12.15
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.
To avoid potential problems associated with purely synchronous resets and purely asynchronous resets,
you can use synchronized asynchronous resets. Synchronized asynchronous resets combine the
advantages of synchronous and asynchronous resets.
These resets are asynchronously asserted and synchronously deasserted. This takes effect almost instanta
neously, and ensures that no data path for speed is involved, and that the circuit is synchronous for timing
analysis and is resistant to noise.
The following example shows a method for implementing the synchronized asynchronous reset. You
should use synchronizer registers in a similar manner as synchronous resets. However, the asynchronous
reset input is gated directly to the CLRN pin of the synchronizer registers and immediately asserts the
resulting reset. When the reset is deasserted, logic 1 is clocked through the synchronizers to synchro
nously deassert the resulting reset.
Altera Corporation
QII5V1
2014.12.15
11-27
DFF
DFF
reg3
reg4
DFF
data_a
INPU T
VCC
clock
INPU T
VCC
reset_n
INPU T
VCC
OUTPU T
out_a
OUTPU T
out_b
reg1
DFF
data_b
INPU T
VCC
reg2
The following example shows the equivalent Verilog HDL code. Use the active edge of the reset in the
sensitivity list for the blocks.
Example 11-12: Verilog Code for Synchronized Asynchronous Reset
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
<= 1b0;
reg4
<= 1b0;
end
else
begin
reg3
<= 1b1;
reg4
<= reg3;
end
end
always @ (posedge clock, negedge rst_n)
begin
if (!rst_n)
Recommended Design Practices
Send Feedback
Altera Corporation
11-28
QII5V1
2014.12.15
<= 1b0;
<= 1;b0;
<= data_a;
<= data_b;
// 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.
QII5V1
2014.12.15
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 II 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.
Version
Changes
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
November 13.1.0
2013
May 2013
13.0.0
June 2012
12.0.0
November 11.0.1
2011
Template update.
May 2011
11.0.0
December 10.1.0
2010
Title changed from Design Recommendations for Altera Devices and the
Quartus II Design Assistant.
Updated to new template.
Added references to Quartus II Help for Metastability on page 913 and
Incremental Compilation on page 913.
Removed duplicated content and added references to Quartus II Help for
Custom Rules on page 915.
Altera Corporation
11-30
QII5V1
2014.12.15
Date
July 2010
Version
10.0.0
Changes
November 9.1.0
2009
March
2009
No change to content.
9.0.0
November 8.1.0
2008
May 2008
8.0.0
Updated Figure 59 on page 513; added custom rules file to the flow
Added notes to Figure 59 on page 513
Added new section: Custom Rules Report on page 534
Added new section: Custom Rules on page 534
Added new section: Targeting Embedded RAM Architectural Features on
page 538
Minor editorial updates throughout the chapter
Added hyperlinks to referenced documents throughout the chapter
Related Information
http://www.altera.com/literature/lit-qts_archive.jsp
Altera Corporation
12
2014.12.15
QII5V1
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 II integrated synthesis and other EDA tools), refer to the tool vendors documentation.
Related Information
2014 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
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information,
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
ISO
9001:2008
Registered
12-2
QII5V1
2014.12.15
Note: You can use any of the standard features of the Quartus II Text Editor to modify the HDL design
or save the template as an HDL file to edit in your preferred text editor.
Related Information
Altera Corporation
QII5V1
2014.12.15
12-3
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 II synthesis recognizes certain
HDL code structures and automatically infers the appropriate IP core or map directly to device atoms.
Related Information
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 II 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.
Example 12-1: Verilog HDL Unsigned Multiplier
Altera Corporation
12-4
QII5V1
2014.12.15
Inferring Multipliers
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;
ARCHITECTURE rtl OF unsigned_mult IS
SIGNAL a_reg, b_reg: UNSIGNED (7 DOWNTO 0);
BEGIN
PROCESS (clk, aclr)
BEGIN
IF (aclr ='1') THEN
a_reg <= (OTHERS => '0');
b_reg <= (OTHERS => '0');
result <= (OTHERS => '0');
ELSIF (clk'event AND clk = '1') THEN
a_reg <= a;
b_reg <= b;
result <= a_reg * b_reg;
END IF;
END PROCESS;
END rtl;
Altera Corporation
QII5V1
2014.12.15
12-5
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;
ARCHITECTURE rtl OF signed_mult IS
BEGIN
result <= a * b;
END rtl;
Altera Corporation
12-6
QII5V1
2014.12.15
LIBRARY ieee;
Altera Corporation
QII5V1
2014.12.15
12-7
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;
ARCHITECTURE rtl OF sig_altmult_accum IS
SIGNAL a_reg, b_reg: SIGNED (7 DOWNTO 0);
SIGNAL pdt_reg: SIGNED (15 DOWNTO 0);
SIGNAL adder_out: SIGNED (15 DOWNTO 0);
BEGIN
PROCESS (clk, aclr)
BEGIN
IF (aclr = '1') then
a_reg <= (others => '0');
b_reg <= (others => '0');
pdt_reg <= (others => '0');
adder_out <= (others => '0');
ELSIF (clk'event and clk = '1') THEN
a_reg <= (a);
b_reg <= (b);
pdt_reg <= a_reg * b_reg;
adder_out <= adder_out + pdt_reg;
END IF;
END process;
accum_out <= adder_out;
END rtl;
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.numeric_std.all;
ENTITY unsignedmult_add IS
PORT (
a: IN UNSIGNED (7 DOWNTO
b: IN UNSIGNED (7 DOWNTO
c: IN UNSIGNED (7 DOWNTO
d: IN UNSIGNED (7 DOWNTO
clk: IN STD_LOGIC;
aclr: IN STD_LOGIC;
result: OUT UNSIGNED (15
);
END unsignedmult_add;
0);
0);
0);
0);
DOWNTO 0)
Altera Corporation
12-8
QII5V1
2014.12.15
Related Information
Altera Corporation
QII5V1
2014.12.15
12-9
VHDL
Single-Port RAM
Single-Port RAM with Initial Contents
Simple Dual-Port RAM (single clock)Simple Dual-Port RAM (dual clock)
True Dual-Port RAM (single clock)
True Dual-Port RAM (dual clock)
Mixed-Width RAM
Mixed-Width True Dual-Port RAM
Byte-Enabled Simple Dual-Port RAM
Byte-Enabled True Dual-Port RAM
Single-Port ROMDual-Port ROM
Verilog HDL
Single-Port RAM
Single-Port RAM with Initial Contents
Simple Dual-Port RAM (single clock)
Simple Dual-Port RAM (dual clock)
True Dual-Port RAM (single clock)
True Dual-Port RAM (dual clock)
Single-Port ROM
Dual-Port ROM
System Verilog
Related Information
Altera Corporation
12-10
QII5V1
2014.12.15
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 II 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 II 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
When you use a formal verification flow, Altera recommends that you create RAM blocks in separate
entities or modules that contain only the RAM logic. In certain formal verification flows, for example,
when using Quartus II integrated synthesis, the entity or module containing the inferred RAM is put into
a black box automatically because formal verification tools do not support RAM blocks. The Quartus II
software issues a warning message when this situation occurs. If the entity or module contains any
additional logic outside the RAM block, this logic cannot be verified because it also must be treated as a
black box for formal verification.
Because memory blocks in the newest devices from Altera are synchronous, RAM designs that are
targeted towards architectures that contain these dedicated memory blocks must be synchronous to be
mapped directly into the device architecture. For these devices, asynchronous memory logic is
implemented in regular logic cells.
Synchronous memory offers several advantages over asynchronous memory, including higher frequencies
and thus higher memory bandwidth, increased reliability, and less standby power. In many designs with
asynchronous memory, the memory interfaces with synchronous logic so that the conversion to synchro
nous memory design is straightforward. To convert asynchronous memory you can move registers from
the data path into the memory block.
Synchronous memories are supported in all Altera device families. A memory block is considered
synchronous if it uses one of the following read behaviors:
Memory read occurs in a Verilog always block with a clock signal or a VHDL clocked process. The
recommended coding style for synchronous memories is to create your design with a registered read
output.
Memory read occurs outside a clocked block, but there is a synchronous read address (that is, the
address used in the read statement is registered). This type of logic is not always inferred as a memory
block, or may require external bypass logic, depending on the target device architecture.
Note: The synchronous memory structures in Altera devices can differ from the structures in other
vendors devices. For best results, match your design to the target device architecture.
Later sections provide coding recommendations for various memory types. All of these examples are
synchronous to ensure that they can be directly mapped into the dedicated memory architecture available
in Altera FPGAs.
Altera Corporation
QII5V1
2014.12.15
12-11
To ensure that your HDL code can be implemented in the target device architecture, avoid unsupported
reset conditions or other control logic that does not exist in the device architecture.
The RAM contents of Altera memory blocks cannot be cleared with a reset signal during device operation.
If your HDL code describes a RAM with a reset signal for the RAM contents, the logic is implemented in
regular logic cells instead of a memory block. Altera recommends against putting RAM read or write
operations in an always block or process block with a reset signal. If you want to specify memory
contents, initialize the memory or write the data to the RAM during device operation.
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
);
reg [7:0] mem [0:31];
integer i;
always @ (posedge clock or posedge reset)
begin
if (reset == 1'b1)
mem[address] <= 0;
else if (we == 1'b1)
mem[address] <= data_in;
data_out <= mem[address];
end
endmodule
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
);
Recommended HDL Coding Styles
Send Feedback
Altera Corporation
12-12
QII5V1
2014.12.15
Related Information
It is important to check the read-during-write behavior of the memory block described in your HDL
design as compared to the behavior in your target device architecture.
Your HDL source code specifies the memory behavior when you read and write from the same memory
address in the same clock cycle. The code specifies that the read returns either the old data at the address,
or the new data being written to the address. This behavior is referred to as the read-during-write
behavior of the memory block. Altera memory blocks have different read-during-write behavior
depending on the target device family, memory mode, and block type.
Synthesis tools map an HDL design into the target device architecture, with the goal of maintaining the
functionality described in your source code. Therefore, if your source code specifies unsupported
read-during-write behavior for the device RAM blocks, the software must implement the logic outside the
RAM hardware in regular logic cells.
One common problem occurs when there is a continuous read in the HDL code, as in the following
examples. You should avoid using these coding styles:
//Verilog HDL concurrent signal assignment
assign q = ram[raddr_reg];
-- VHDL concurrent signal assignment
q <= ram(raddr_reg);
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.
Altera Corporation
QII5V1
2014.12.15
12-13
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 II 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 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 II 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
Synthesis tools usually do not infer small RAM blocks because small RAM blocks typically can be
implemented more efficiently using the registers in regular logic.
If you are using Quartus II integrated synthesis, you can direct the software to infer RAM blocks for all
sizes with the Allow Any RAM Size for Recognition option in the Advanced Analysis & Synthesis
Settings dialog box.
Some synthesis tools provide options to control the implementation of inferred RAM blocks for Altera
devices with synchronous memory blocks. For example, Quartus II integrated synthesis provides the
ramstyle synthesis attribute to specify the type of memory block or to specify the use of regular logic
instead of a dedicated memory block. Quartus II integrated synthesis does not map inferred memory into
MLABs unless the HDL code specifies the appropriate ramstyle attribute, although the Fitter may map
some memories to MLABs.
If you want to control the implementation after the RAM function is inferred during synthesis, you can
set the ram_block_type parameter of the ALTSYNCRAM IP core. In the Assignment Editor, select
Parameters in the Categories list. You can use the Node Finder or drag the appropriate instance from the
Project Navigator window to enter the RAM hierarchical instance name. Type ram_block_type as the
Parameter Name and type one of the following memory types supported by your target device family in
the Value field: "M-RAM", "M512", "M4K", "M9K", "M10K", "M20K", "M144K", or "MLAB".
You can also specify the maximum depth of memory blocks used to infer RAM or ROM in your design.
Apply the max_depth synthesis attribute to the declaration of a variable that represents a RAM or ROM in
your design file. For example:
// Limit the depth of the memory blocks implement "ram" to 512
// This forces the software to use two M512 blocks instead of one M4K block to
implement this RAM
(* max_depth = 512 *) reg [7:0] ram[0:1023];
Altera Corporation
12-14
QII5V1
2014.12.15
Related Information
The code examples in this section show Verilog HDL and VHDL code that infers simple dual-port, singleclock synchronous RAM. Single-port RAM blocks use a similar coding style.
The read-during-write behavior in these examples is to read the old data at the memory address. Altera
recommends that you use the Old Data Read-During-Write coding style for most RAM blocks as long as
your design does not require the RAM locations new value when you perform a simultaneous read and
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];
always @ (posedge clk) begin
if (we)
mem[write_address] <= d;
q <= mem[read_address]; // q doesn't get d in this clock cycle
end
endmodule
Example 12-12: VHDL Single-Clock Simple Dual-Port Synchronous RAM with Old Data
ReadDuringWrite 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;
ARCHITECTURE rtl OF single_clock_ram IS
TYPE MEM IS ARRAY(0 TO 31) OF STD_LOGIC_VECTOR(2 DOWNTO 0);
SIGNAL ram_block: MEM;
Altera Corporation
QII5V1
2014.12.15
12-15
BEGIN
PROCESS (clock)
BEGIN
IF (clock'event AND clock = '1') THEN
IF (we = '1') THEN
ram_block(write_address) <= data;
END IF;
q <= ram_block(read_address);
-- VHDL semantics imply that q doesn't get data
-- in this clock cycle
END IF;
END PROCESS;
END rtl;
Related Information
The examples in this section describe RAM blocks in which a simultaneous read and write to the same
location reads the new value that is currently being written to that RAM location.
To implement this behavior in the target device, synthesis software adds bypass logic around the RAM
block. This bypass logic increases the area utilization of the design and decreases the performance if the
RAM block is part of the designs critical path.
Single-port versions of the Verilog memory block (that is, using the same read address and write address
signals) do not require any logic cells to create bypass logic in the Arria, Stratix, and Cyclone series of
devices, because the device memory supports new data read-during-write behavior when in single-port
mode (same clock, same read address, and same write address).
For Quartus II 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 attribute may
prevent generation of extra bypass logic, but it is not always possible to eliminate the requirement for
bypass logic.
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];
always @ (posedge clk) begin
if (we)
mem[write_address] = d;
q = mem[read_address]; // q does get d in this clock cycle
if
// we is high
end
endmodule
Altera Corporation
12-16
QII5V1
2014.12.15
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.
Example 12-14: Avoid This Coding Style
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 ReadDuring-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;
ARCHITECTURE rtl OF single_clock_rw_ram IS
TYPE MEM IS ARRAY(0 TO 31) OF STD_LOGIC_VECTOR(2 DOWNTO 0);
SIGNAL ram_block: MEM;
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;
Altera Corporation
QII5V1
2014.12.15
12-17
END PROCESS;
q <= ram_block(read_address_reg);
END rtl;
For Quartus II 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 readduring-write behavior of a RAM, rather than using the behavior specified by your HDL code. This
attribute may prevent generation of extra bypass logic but it is not always possible to eliminate the
requirement for bypass logic.
Related Information
In dual clock designs, synthesis tools cannot accurately infer the read-during-write behavior because it
depends on the timing of the two clocks within the target device.
Therefore, the read-during-write behavior of the synthesized design is undefined and may differ from
your original HDL code. When Quartus II integrated synthesis infers this type of RAM, it issues a warning
because of the undefined read-during-write behavior.
module dual_clock_ram(
output reg [7:0] q,
input [7:0] d,
input [6:0] write_address, read_address,
input we, clk1, clk2
);
reg [6:0] read_address_reg;
reg [7:0] mem [127:0];
always @ (posedge clk1)
begin
if (we)
mem[write_address] <= d;
end
always @ (posedge clk2) begin
q <= mem[read_address_reg];
read_address_reg <= read_address;
end
endmodule
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY dual_clock_ram IS
PORT (
clock1, clock2: IN STD_LOGIC;
Recommended HDL Coding Styles
Send Feedback
Altera Corporation
12-18
QII5V1
2014.12.15
Related Information
The code examples in this section show Verilog HDL and VHDL code that infers true dual-port
synchronous RAM. Different synthesis tools may differ in their support for these types of memories.
Altera synchronous memory blocks have two independent address ports, allowing for operations on two
unique addresses simultaneously. A read operation and a write operation can share the same port if they
share the same address. The Quartus II software infers true dual-port RAMs in Verilog HDL and VHDL
with any combination of independent read or write operations in the same clock cycle, with at most two
unique port addresses, performing two reads and one write, two writes and one read, or two writes and
two reads in one clock cycle with one or two unique addresses.
In the synchronous RAM block architecture, there is no priority between the two ports. Therefore, if you
write to the same location on both ports at the same time, the result is indeterminate in the device
architecture. You must ensure your HDL code does not imply priority for writes to the memory block, if
you want the design to be implemented in a dedicated hardware memory block. For example, if both ports
are defined in the same process block, the code is synthesized and simulated sequentially so that there is a
priority between the two ports. If your code does imply a priority, the logic cannot be implemented in the
device RAM blocks and is implemented in regular logic cells. You must also consider the read-duringwrite behavior of the RAM block to ensure that it can be mapped directly to the device RAM architecture.
When a read and write operation occurs on the same port for the same address, the read operation may
behave as follows:
Read new dataThis mode matches the behavior of synchronous memory blocks.
Read old dataThis mode is supported only in device families that support M144K and M9K
memory blocks.
Altera Corporation
QII5V1
2014.12.15
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 dataQuartus II integrated synthesis supports this mode by creating bypass logic around
the synchronous memory block.
Read old dataSynchronous memory blocks support this behavior.
Read dont careThis 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;
// Declare the RAM variable
reg [DATA_WIDTH-1:0] ram[2**ADDR_WIDTH-1:0];
always @ (posedge clk)
begin // Port A
if (we_a)
begin
ram[addr_a] <= data_a;
q_a <= data_a;
end
else
q_a <= ram[addr_a];
end
always @ (posedge clk)
begin // Port b
if (we_b)
begin
ram[addr_b] <= data_b;
q_b <= data_b;
end
else
q_b <= ram[addr_b];
end
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
Recommended HDL Coding Styles
Send Feedback
Altera Corporation
12-20
QII5V1
2014.12.15
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.
Example 12-19: VHDL Read Statement Example
The VHDL single-clock code sample i 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.
Example 12-20: VHDL True Dual-Port RAM with Single Clock (part 1)
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);
q_b
: out std_logic_vector((DATA_WIDTH -1) downto 0)
);
end true_dual_port_ram_single_clock;
architecture rtl of true_dual_port_ram_single_clock is
-- Build a 2-D array type for the RAM
subtype word_t is std_logic_vector((DATA_WIDTH-1) downto 0);
Altera Corporation
QII5V1
2014.12.15
12-21
Example 12-21: VHDL True Dual-Port RAM with Single Clock (part 2)
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;
Related Information
The RAM code examples show SystemVerilog and VHDL code that infers RAM with data ports with
different widths.
This type of logic is not supported in Verilog-1995 or Verilog-2001 because of the requirement for a
multi-dimensional array to model the different read width, write width, or both. Different synthesis tools
may differ in their support for these memories. This section describes the inference rules for Quartus II
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.
Altera Corporation
12-22
QII5V1
2014.12.15
Refer to the Quartus II templates for parameterized examples that you can use for supported combina
tions 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-22: SystemVerilog Mixed-Width RAM with Read Width Smaller than Write Width
module mixed_width_ram
(
input [7:0] waddr,
input [31:0] wdata,
input we, clk,
input [9:0] raddr,
output [7:0] q
);
logic [3:0][7:0] ram[0:255];
always_ff@(posedge clk)
begin
if(we) ram[waddr] <= wdata;
q <= ram[raddr / 4][raddr % 4];
end
endmodule : mixed_width_ram
Example 12-23: SystemVerilog Mixed-Width RAM with Read Width Larger than Write Width
module mixed_width_ram
// 1024x8 write and 256x32 read
(
input [9:0] waddr,
input [31:0] wdata,
input we, clk,
input [7:0] raddr,
output [9:0] q
);
logic [3:0][7:0] ram[0:255];
always_ff@(posedge clk)
begin
if(we) ram[waddr / 4][waddr % 4] <= wdata;
q <= ram[raddr];
end
endmodule : mixed_width_ram
Example 12-24: VHDL Mixed-Width RAM with Read Width Smaller 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;
Altera Corporation
QII5V1
2014.12.15
12-23
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;
architecture rtl of mixed_width_ram is
signal ram : ram_t;
begin -- rtl
process(clk, we)
begin
if(rising_edge(clk)) then
if(we = '1') then
ram(waddr) <= wdata;
end if;
q <= ram(raddr / 4 )(raddr mod 4);
end if;
end process;
end rtl;
Example 12-25: 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;
architecture rtl of mixed_width_ram is
signal ram : ram_t;
begin -- rtl
process(clk, we)
begin
if(rising_edge(clk)) then
if(we = '1') then
ram(waddr / 4)(waddr mod 4) <= wdata;
end if;
q <= ram(raddr);
end if;
end process;
end rtl;
Altera Corporation
12-24
QII5V1
2014.12.15
The RAM code examples show SystemVerilog and VHDL code that infers RAM with controls for writing
single bytes into the memory word, or byte-enable signals.
Byte enables are modeled by creating write expressions with two indices and writing part of a RAM
"word." With these implementations, you can also write more than one byte at once by enabling the
appropriate byte enables.
This type of logic is not supported in Verilog-1995 or Verilog-2001 because of the requirement for a
multidimensional array. Different synthesis tools may differ in their support for these memories. This
section describes the inference rules for Quartus II integrated synthesis.
Refer to the Quartus II templates for parameterized examples that you can use for different address
widths, and true dual port RAM examples with two read ports and two write ports.
Example 12-26: 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-27: 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
port (
we, clk : in std_logic;
waddr, raddr : in integer range 0 to 63
be
: in std_logic_vector (3 downto
wdata
: in std_logic_vector(31 downto
q
: out std_logic_vector(31 downto
end byte_enabled_simple_dual_port_ram;
;
0);
0);
0) );
-----
address width = 6
4 bytes per word
byte width = 8
byte width = 8
Altera Corporation
QII5V1
2014.12.15
12-25
Your synthesis tool may offer various ways to specify the initial contents of an inferred memory.
There are slight power-up and initialization differences between dedicated RAM blocks and the MLAB
memory due to the continuous read of the MLAB. Altera dedicated RAM block outputs always power-up
to zero and are set to the initial value on the first read. For example, if address 0 is pre-initialized to FF,
the RAM block powers up with the output at 0. A subsequent read after power-up from address 0 outputs
the pre-initialized value of FF. Therefore, if a RAM is powered up and an enable (read enable or clock
enable) is held low, the power-up output of 0 is maintained until the first valid read cycle. The MLAB is
implemented using registers that power-up to 0, but are initialized to their initial value immediately at
power-up or reset. Therefore, the initial value is seen, regardless of the enable status. The Quartus II
software maps inferred memory to MLABs when the HDL code specifies an appropriate ramstyle
attribute.
In Verilog HDL, you can use an initial block to initialize the contents of an inferred memory. Quartus II
integrated synthesis automatically converts the initial block into a .mif file for the inferred RAM.
Example 12-28: Verilog HDL RAM with Initialized Contents
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];
Recommended HDL Coding Styles
Send Feedback
Altera Corporation
12-26
QII5V1
2014.12.15
Quartus II 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-29: 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 II integrated synthesis automatically converts the default value
into a .mif file for the inferred RAM.
Example 12-30: VHDL RAM with Initialized Contents
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;
ARCHITECTURE rtl OF ram_with_init IS
TYPE MEM IS ARRAY(31 DOWNTO 0) OF unsigned(7 DOWNTO 0);
FUNCTION initialize_ram
return MEM is
variable result : MEM;
BEGIN
FOR i IN 31 DOWNTO 0 LOOP
result(i) := to_unsigned(natural(i), natural'(8));
END LOOP;
RETURN result;
Altera Corporation
QII5V1
2014.12.15
12-27
END initialize_ram;
SIGNAL ram_block : MEM := initialize_ram;
BEGIN
PROCESS (clock)
BEGIN
IF (clock'event AND clock = '1') THEN
IF (we = '1') THEN
ram_block(write_address) <= data;
END IF;
q <= ram_block(read_address);
END IF;
END PROCESS;
END rtl;
Related Information
Altera Corporation
12-28
QII5V1
2014.12.15
= 6'b101111;
= 6'b110110;
= 6'b000001;
= 6'b101010;
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;
ARCHITECTURE rtl OF sync_rom IS
BEGIN
PROCESS (clock)
BEGIN
IF rising_edge (clock) THEN
CASE address IS
WHEN "00000000" => data_out
WHEN "00000001" => data_out
...
WHEN "11111110" => data_out
WHEN "11111111" => data_out
WHEN OTHERS
=> data_out
END CASE;
END IF;
END PROCESS;
END rtl;
<= "101111";
<= "110110";
<= "000001";
<= "101010";
<= "101111";
module dual_port_rom (
input [(addr_width-1):0] addr_a, addr_b,
Altera Corporation
QII5V1
2014.12.15
12-29
input clk,
output reg [(data_width-1):0] q_a, q_b
);
parameter data_width = 8;
parameter addr_width = 8;
reg [data_width-1:0] rom[2**addr_width-1:0];
initial // Read the memory contents in the file
//dual_port_rom_init.txt.
begin
$readmemb("dual_port_rom_init.txt", rom);
end
always @ (posedge clk)
begin
q_a <= rom[addr_a];
q_b <= rom[addr_b];
end
endmodule
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 addr_b
: in natural range 0 to 2**ADDR_WIDTH q_a
: out std_logic_vector((DATA_WIDTH -1)
q_b
: out std_logic_vector((DATA_WIDTH -1)
);
end entity;
1;
1;
downto 0);
downto 0)
Altera Corporation
12-30
QII5V1
2014.12.15
Related Information
Altera Corporation
QII5V1
2014.12.15
12-31
The code samples show a simple, single-bit wide, 64-bit long shift register.
The synthesis software implements the register (W = 1 and M = 64) in an ALTSHIFT_TAPS IP core for
supported devices and maps it to RAM in supported devices, which may be placed in dedicated RAM
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-35: 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;
ARCHITECTURE arch OF shift_1x64 IS
TYPE sr_length IS ARRAY (63 DOWNTO 0) OF STD_LOGIC;
SIGNAL sr: sr_length;
BEGIN
PROCESS (clk)
BEGIN
IF (clk'EVENT and clk = '1') THEN
IF (shift = '1') THEN
sr(63 DOWNTO 1) <= sr(62 DOWNTO 0);
sr(0) <= sr_in;
END IF;
END IF;
END PROCESS;
sr_out <= sr(63);
END arch;
Altera Corporation
12-32
QII5V1
2014.12.15
The following examples show a Verilog HDL and VHDL 8-bit wide, 64-bit long shift register (W > 1 and
M = 64) with evenly spaced taps at 15, 31, and 47.
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-37: Verilog HDL 8-Bit Wide, 64-Bit Long Shift Register with Evenly Spaced Taps
sr_tap_one = sr[15];
sr_tap_two = sr[31];
sr_tap_three = sr[47];
sr_out = sr[63];
Example 12-38: 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;
ARCHITECTURE arch OF shift_8x64_taps IS
SUBTYPE sr_width IS STD_LOGIC_VECTOR(7 DOWNTO 0);
TYPE sr_length IS ARRAY (63 DOWNTO 0) OF sr_width;
SIGNAL sr: sr_length;
BEGIN
PROCESS (clk)
BEGIN
IF (clk'EVENT and clk = '1') THEN
Altera Corporation
QII5V1
2014.12.15
12-33
Design Recommendations for Altera Devices and the Quartus II Design Assistant on page 11-1
Recommended HDL Coding Styles
Send Feedback
Altera Corporation
12-34
QII5V1
2014.12.15
If you want to force a particular power-up condition for your design, you can use the synthesis options
available in your synthesis tool.
With Quartus II 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 II 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 II integrated synthesis converts default values for registered
signals into Power-Up Level settings. When the Quartus II software reads the default values, the
synthesized behavior matches the power-up state of the HDL code during a functional simulation.
Example 12-39: Verilog Register with High Power-Up Value
There may also be undeclared default power-up conditions based on signal type. If you declare a
VHDL register signal as an integer, Quartus II 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 (100001). 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
Altera Corporation
QII5V1
2014.12.15
12-35
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
a synthesis assignment or initial value, the power-up level is ignored during
synthesis.
Related Information
Altera Corporation
12-36
QII5V1
2014.12.15
The signal order is the same for all Altera device families, although, as noted previously, not all device
families provide every signal. The following priority order is observed:
1.
2.
3.
4.
5.
6.
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 languagethere 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-41: Verilog HDL D-Type Flipflop (Register) with ena, aclr, and aload Control Signals
Example 12-42: 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
Altera Corporation
QII5V1
2014.12.15
Latches
12-37
);
END dff_control;
Example 12-43: VHDL D-Type Flipflop (Register) with ena, aclr, and aload Control Signals (part
2)
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
When you are designing combinational logic, certain coding styles can create an unintentional latch.
For example, when CASE or IF statements do not cover all possible input conditions, latches may be
required to hold the output if a new output value is not assigned. Check your synthesis tool messages for
references to inferred latches. If your code unintentionally creates a latch, make code changes to remove
the latch.
A latch is required if a signal is assigned a value outside of a clock edge (for example, with an asynchro
nous reset), but is not assigned a value in an edge-triggered design block. An unintentional latch may be
generated if your HDL code assigns a value to a signal in an edge-triggered design block, but that logic is
removed during synthesis. For example, when a CASE or IF statement tests the value of a condition with a
parameter or generic that evaluates to FALSE, any logic or signal assignment in that statement is not
required and is optimized away during synthesis. This optimization may result in a latch being generated
for the signal.
Note: Latches have limited support in formal verification tools. Therefore, ensure that you do not infer
latches unintentionally.
Recommended HDL Coding Styles
Send Feedback
Altera Corporation
12-38
QII5V1
2014.12.15
The full_case attribute can be used in Verilog HDL designs to treat unspecified cases as dont care
values (X). However, using the full_case attribute can cause simulation mismatches because this
attribute is a synthesis-only attribute, so simulation tools still treat the unspecified cases as latches.
Omitting the final else or when others clause in an if or case statement can also generate a latch.
Dont care (X) assignments on the default conditions are useful in preventing latch generation. For the
best logic optimization, assign the default case or final else value to dont care (X) instead of a logic
value.
Without the final else clause, the following code creates unintentional latches to cover the remaining
combinations of the sel inputs. When you are targeting a Stratix device with this code, omitting the final
else condition can cause the synthesis software to use up to six LEs, instead of the three it uses with the
else statement. Additionally, assigning the final else clause to 1 instead of X can result in slightly more
LEs, because the synthesis software cannot perform as much optimization when you specify a constant
value compared to a dont care value.
Example 12-44: VHDL Code Preventing Unintentional Latch Creation
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;
ARCHITECTURE rtl OF nolatch IS
BEGIN
PROCESS (a,b,c,sel) BEGIN
if sel = "00000" THEN
oput <= a;
ELSIF sel = "00001" THEN
oput <= b;
ELSIF sel = "00010" THEN
oput <= c;
ELSE
--- Prevents latch inference
oput <= ''X'; --/
END if;
END PROCESS;
END rtl;
Related Information
Synthesis tools can infer a latch that does not exhibit the glitch and timing hazard problems typically
associated with combinational loops. When using Quartus II integrated synthesis, latches that are inferred
by the software are reported in the User-Specified and Inferred Latches section of the Compilation
Report. This report indicates whether the latch is considered safe and free of timing hazards.
Note: Timing analysis does not completely model latch timing in some cases. Do not use latches unless
required by your design, and you fully understand the impact of using the latches.
If a latch or combinational loop in your design is not listed in the User Specified and Inferred Latches
section, it means that it was not inferred as a safe latch by the software and is not considered glitch-free.
Altera Corporation
QII5V1
2014.12.15
12-39
All combinational loops listed in the Analysis & Synthesis Logic Cells Representing Combinational
Loops table in the Compilation Report are at risk of timing hazards. These entries indicate possible
problems with your design that you should investigate. However, it is possible to have a correct design
that includes combinational loops. For example, it is possible that the combinational loop cannot be
sensitized. This can occur in cases where there is an electrical path in the hardware, but either the designer
knows that the circuit never encounters data that causes that path to be activated, or the surrounding logic
is set up in a mutually exclusive manner that prevents that path from ever being sensitized, independent
of the data input.
For macrocell-based devices, all data (D-type) latches and set-reset (S-R) latches listed in the Analysis &
Synthesis User Specified and Inferred Latches table have an implementation free of timing hazards, such
as glitches. The implementation includes both a cover term to ensure there is no glitching and a single
macrocell in the feedback loop.
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 II 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 II 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 II 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 II 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.
Example 12-45: Verilog HDL Set-Reset Latch
module simple_latch (
input SetTerm,
input ResetTerm,
output reg LatchOut
);
always @ (SetTerm or ResetTerm) begin
if (SetTerm)
LatchOut = 1'b1
else if (ResetTerm)
LatchOut = 1'b0
Altera Corporation
12-40
QII5V1
2014.12.15
LIBRARY IEEE;
USE IEEE.std_logic_1164.all;
ENTITY simple_latch IS
PORT (
enable, data
q
);
END simple_latch;
: IN STD_LOGIC;
: OUT STD_LOGIC
The following example shows a Verilog HDL continuous assignment that does not infer a latch in
the Quartus II software:
Example 12-47: VHDL Continuous Assignment Does Not Infer Latch
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 II 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 II software. If a third-party synthesis tool implements a latch
using the Altera latch IP core, the Quartus II integrated synthesis lists the latch in the UserSpecified 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 II 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.
Altera Corporation
QII5V1
2014.12.15
12-41
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.
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 or incremental 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.
Altera Corporation
12-42
QII5V1
2014.12.15
Clock Multiplexing
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.
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
sel1
DQ
DQ
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.
Altera Corporation
QII5V1
2014.12.15
Clock Multiplexing
12-43
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 onehot 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.
Example 12-48: Verilog HDL Clock Multiplexing Design to Avoid Glitches
Altera Corporation
12-44
QII5V1
2014.12.15
Adder Trees
Related Information
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.
Architectures such as Stratix devices and the Cyclone series of devices contain 4-input LUTs as the
standard combinational structure in the LE.
If your design can tolerate pipelining, the fastest way to add three numbers A, B, and C in devices that use
4-input lookup tables is to addA + B, register the output, and then add the registered output to C. Adding
A + B takes one level of logic (one bit is added in one LE), so this runs at full clock speed. This can be
extended to as many numbers as desired.
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).
High-performance Altera device families use a 6-input LUT in their basic logic structure. These devices
benefit from a different coding style from the previous example presented for 4-input LUTs.
Specifically, in these devices, ALMs can simultaneously add three bits. Therefore, the tree must be two
levels deep and contain just two add-by-three inputs instead of four add-by-two inputs.
Although the code in the previous example compiles successfully for 6-input LUT devices, the code is
inefficient and does not take advantage of the 6-input adaptive ALUT. By restructuring the tree as a
ternary tree, the design becomes much more efficient, significantly improving density utilization.
Therefore, when you are targeting with ALUTs and ALMs, large pipelined binary adder trees designed for
4-input LUT architectures should be rewritten to take advantage of the advanced device architecture.
Note: You cannot pack a LAB full when using this type of coding style because of the number of LAB
inputs. However, in a typical design, the Quartus II Fitter can pack other logic into each LAB to
take advantage of the unused ALMs.
These examples show pipelined adders, but partitioning your addition operations can help you achieve
better results in nonpipelined adders as well. If your design is not pipelined, a ternary tree provides much
better performance than a binary tree. For example, depending on your synthesis tool, the HDL code
sum = (A + B + C) + (D + E) is more likely to create the optimal implementation of a 3-input adder
for A + B + C followed by a 3-input adder for sum1 + D + E than the code without the parentheses. If
you do not add the parentheses, the synthesis tool may partition the addition in a way that is not optimal
for the architecture.
Example 12-49: Verilog-2001 State Machine
Altera Corporation
QII5V1
2014.12.15
12-45
in_2;
=
=
=
=
=
3'b000;
3'b001;
3'b010;
3'b011;
3'b100;
An equivalent implementation of this state machine can be achieved by using define instead of
the parameter data type, as follows:
define state_0 3'b000
define state_1 3'b001
define state_2 3'b010
Recommended HDL Coding Styles
Send Feedback
Altera Corporation
12-46
QII5V1
2014.12.15
In this case, the state and next_state assignments are assigned a state_x instead of a state_x,
for example:
next_state <= state_3;
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.
Altera Corporation
QII5V1
2014.12.15
12-47
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
To ensure proper recognition and inference of Verilog HDL state machines, observe the following
additional Verilog HDL guidelines.
Some of these guidelines may be specific to Quartus II integrated synthesis. Refer to your synthesis tool
documentation for specific coding recommendations. If the state machine is not recognized and inferred
by the synthesis software (such as Quartus II integrated synthesis), the state machine is implemented as
regular logic gates and registers, and the state machine is not listed as a state machine in the Analysis &
Synthesis section of the Quartus II Compilation Report. In this case, the software does not perform any of
the optimizations that are specific to state machines.
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 II software.
No state machine is inferred in the Quartus II 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 II software if the state variable is an output.
No state machine is inferred in the Quartus II software for signed variables.
Related Information
Altera Corporation
12-48
QII5V1
2014.12.15
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 in_1 and in_2. Using these temporary variables in the various states of the state machine
ensures proper resource sharing between the mutually exclusive states.
Example 12-50: Verilog-2001 State Machine
Altera Corporation
QII5V1
2014.12.15
12-49
An equivalent implementation of this state machine can be achieved by using define instead of
the parameter data type, as follows:
define
define
define
define
define
state_0
state_1
state_2
state_3
state_4
3'b000
3'b001
3'b010
3'b011
3'b100
In this case, the state and next_state assignments are assigned a state_x instead of a state_x,
for example:
next_state <= state_3;
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.
SystemVerilog State Machine Coding Example
The module enum_fsm is an example of a SystemVerilog state machine implementation that uses
enumerated types. Altera recommends using this coding style to describe state machines in
SystemVerilog.
Note: In Quartus II integrated synthesis, the enumerated type that defines the states for the state machine
must be of an unsigned integer type. If you do not specify the enumerated type as int unsigned, a
signed int type is used by default. In this case, the Quartus II integrated synthesis synthesizes the
design, but does not infer or optimize the logic as a state machine.
Example 12-51: SystemVerilog State Machine Using Enumerated Types
module enum_fsm (input clk, reset, input int data[3:0], output int o);
enum int unsigned { S0 = 0, S1 = 2, S2 = 4, S3 = 8 } state, next_state;
always_comb begin : next_state_logic
next_state = S0;
case(state)
S0: next_state = S1;
S1: next_state = S2;
S2: next_state = S3;
S3: next_state = S3;
endcase
end
always_comb begin
case(state)
S0: o = data[3];
S1: o = data[2];
S2: o = data[1];
S3: o = data[0];
endcase
end
Altera Corporation
12-50
QII5V1
2014.12.15
To ensure proper recognition and inference of VHDL state machines, represent the states in a state
machine with enumerated types and use the corresponding types to make state assignments.
This implementation makes the state machine easier to read and reduces the risk of errors during coding.
If the state is not represented by an enumerated type, synthesis software (such as Quartus II integrated
synthesis) does not recognize the state machine. Instead, the state machine is implemented as regular logic
gates and registers and the state machine is not listed as a state machine in the Analysis & Synthesis
section of the Quartus II Compilation Report. In this case, the software does not perform any of the
optimizations that are specific to state machines.
VHDL State Machine Coding Example
The following state machine has five states. The asynchronous reset sets the variable state to state_0.
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.
Example 12-52: VHDL State Machine
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
Altera Corporation
QII5V1
2014.12.15
12-51
Quartus II integrated synthesis provides the Restructure Multiplexers logic option that extracts and
optimizes buses of multiplexers during synthesis.
The default setting Auto for this option uses the optimization when it is most likely to benefit the
optimization targets for your design. You can turn the option on or off specifically to have more control
over its use.
Even with this Quartus II-specific option turned on, it is beneficial to understand how your coding style
can be interpreted by your synthesis tool, and avoid the situations that can cause problems in your design.
Altera Corporation
12-52
QII5V1
2014.12.15
Multiplexer Types
Related Information
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.
Example 12-53: Verilog HDL Binary-Encoded Multiplexers
case (sel)
2'b00: z
2'b01: z
2'b10: z
2'b11: z
endcase
=
=
=
=
a;
b;
c;
d;
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 II Synthesis will try to combine the selector and decoder into a binary
multiplexer.
Example 12-54: Verilog HDL One-Hot-Encoded Case Statement
case (sel)
4'b0001:
4'b0010:
4'b0100:
4'b1000:
default:
endcase
Altera Corporation
z
z
z
z
z
=
=
=
=
=
a;
b;
c;
d;
1'bx;
QII5V1
2014.12.15
Priority Multiplexers
12-53
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.
Example 12-55: VHDL IF Statement Implying Priority
The multiplexers form a chain, evaluating each condition or select bit sequentially.
Figure 12-4: Priority Multiplexer Implementation of an IF Statement
a
sel[1:0]
01xx
10xx
00xx
11xx
sel[3:2]
Binary MUX
z
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.
The IF statements in Verilog HDL and VHDL can be a convenient way to specify conditions that do not
easily lend themselves to a CASE-type approach.
However, using IF statements can result in complicated multiplexer trees that are not easy for synthesis
tools to optimize. In particular, every IF statement has an implicit ELSE condition, even when it is not
specified. These implicit defaults can cause additional complexity in a multiplexed design.
There are several ways you can simplify multiplexed logic and remove unneeded defaults. The optimal
method may be to recode the design so the logic takes the structure of a 4:1 CASE statement. Alternatively,
if priority is important, you can restructure the code to reduce default cases and flatten the multiplexer.
Examine whether the default "ELSE IF" conditions are dont care cases. You may be able to create a
Recommended HDL Coding Styles
Send Feedback
Altera Corporation
12-54
QII5V1
2014.12.15
default ELSE statement to make the behavior explicit. Avoid unnecessary default conditions in your
multiplexer logic to reduce the complexity and logic utilization required to implement your design.
To fully specify the cases in a CASE statement, include a default (Verilog HDL) or OTHERS (VHDL)
assignment.
This assignment is especially important in one-hot encoding schemes where many combinations of the
select lines are unused. Specifying a case for the unused select line combinations gives the synthesis tool
information about how to synthesize these cases, and is required by the Verilog HDL and VHDL language
specifications.
Some designs do not require that the outcome in the unused cases be considered, often because designers
assume these cases will not occur. For these types of designs, you can specify any value for the default or
OTHERS assignment. However, be aware that the assignment value you choose can have a large effect on
the logic utilization required to implement the design due to the different ways synthesis tools treat
different values for the assignment, and how the synthesis tools use different speed and area optimiza
tions.
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
(dont care) logic value instead of choosing another value. This assignment allows your synthesis tool to
perform the best area optimizations.
Synthesis tools flatten XOR gates to minimize area and depth of levels of logic.
Synthesis tools such as Quartus II integrated synthesis target area optimization by default for these logic
structures. Therefore, for more focus on depth reduction, set the synthesis optimization technique to
speed.
Flattening for depth sometimes causes a significant increase in area.
Altera Corporation
QII5V1
2014.12.15
12-55
Some designers optimize their CRC designs to use cascaded stages (for example, four stages of 8 bits). In
such designs, intermediate calculations are used as required (such as the calculations after 8, 24, or 32 bits)
depending on the data width.
This design is not optimal in FPGA devices. The XOR cancellations that can be performed in CRC designs
mean that the function does not require all the intermediate calculations to determine the final result.
Therefore, forcing the use of intermediate calculations increases the area required to implement the
function, as well as increasing the logic depth because of the cascading. It is typically better to create full
separate CRC blocks for each data width that you require in the design, and then multiplex them together
to choose the appropriate mode at a given time
Synthesis tools often attempt to optimize CRC designs by sharing resources and extracting duplicates in
two different CRC blocks because of the factoring options in the XOR logic.
The CRC logic allows significant reductions, but this works best when each CRC function is optimized
separately. Check for duplicate extraction behavior if you have different CRC functions that are driven by
common data signals or that feed the same destination signals.
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.
Related Information
If your design can use more than one cycle to implement the CRC functionality, adding registers and
retiming the design can help reduce area, improve performance, and reduce power utilization.
If your synthesis tool offers a retiming feature (such as the Quartus II software Perform gate-level
register retiming option), you can insert an extra bank of registers at the input and allow the retiming
feature to move the registers for better results. You can also build the CRC unit half as wide and alternate
between halves of the data in each clock cycle.
CRC designs are heavy consumers of dynamic power because the logic toggles whenever there is a change
in the design.
To save power, use clock enables to disable the CRC function for every clock cycle that the logic is not
required. Some designs dont check the CRC results for a few clock cycles while other logic is performed.
It is valuable to disable the CRC function even for this short amount of time.
The data in many CRC designs must be initialized to 1s before operation. If your target device supports
the use of the sload signal, you should use it to set all the registers in your design to 1s before operation.
To enable use of the sload signal, follow the coding guidelines presented in this chapter. You can check
the register equations in the Chip Planner to ensure that the signal was used as expected.
Altera Corporation
12-56
QII5V1
2014.12.15
If you must force a register implementation using an sload signal, you can use low-level device primitives
as described in Designing with Low-Level Primitives User Guide.
Related Information
Secondary Register Control Signals Such as Clear and Clock Enable on page 12-35
Designing with Low-Level Primitives User Guide
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):
wire [6:0] a,b;
wire [7:0] tmp = a - b;
wire alb = tmp[7]
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 dont 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.
Altera Corporation
QII5V1
2014.12.15
12-57
Figure 12-5: Example Logic Structure for Using Comparators to Check a Bus Value Range
Address[ ]
< 2f00
< 200
< 1a0
< 100
Select[3]
Select[2]
Select[1]
Select[0]
The following coding style requires only one adder along with some other logic:
out <= out + (count_up ? 1 : -1);
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.
Altera Corporation
12-58
QII5V1
2014.12.15
Low-level primitives allow you to use the following types of coding techniques:
Instantiate the logic cell or LCELL primitive to prevent Quartus II integrated synthesis from performing
optimizations across a logic cell
Create carry and cascade chains using CARRY, CARRY_SUM, and CASCADE primitives
Instantiate registers with specific control signals using DFF primitives
Specify the creation of LUT functions by identifying the LUT boundaries
Use I/O buffers to specify I/O standards, current strengths, and other I/O assignments
Use I/O buffers to specify differential pin names in your HDL code, instead of using the automaticallygenerated negative pin name for each pair
For details about and examples of using these types of assignments, refer to the Designing with Low-Level
Primitives User Guide.
Related Information
Version
Changes
2014.12.15
14.1.0
2014.08.18
14.0.a10.0
2014.06.30
14.0.0
November
2013
13.1.0
June 2012
12.0.0
November
2011
11.1.0
December
2010
10.1.0
July 2010
10.0.0
Altera Corporation
QII5V1
2014.12.15
Date
Version
12-59
Changes
November
2009
9.1.0
March 2009
9.0.0
November
2008
8.1.0
May 2008
8.0.0
Related Information
Altera Corporation
13
2014.12.15
QII5V1
Send Feedback
Subscribe
You can use the Quartus II 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 II software provides analysis, optimization, and reporting features to help manage metasta
bility in Altera designs. These metastability features are supported only for designs constrained with the
Quartus II Timing Analyzer. Both typical and worst-case MBTF values are generated for select device
families.
Related Information
www.altera.com
101 Innovation Drive, San Jose, CA 95134
ISO
9001:2008
Registered
13-2
QII5V1
2014.12.15
Reliability Report
For information about Altera device reliability
Clock 1
Altera Corporation
Clock 2 Domain
D
Output
Registers
Clock 2
QII5V1
2014.12.15
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
Clock 1 Domain
Data
Clock 1
Clock 2 Domain
Q
Clock 2
Data
Output
Registers
Clock 2
D
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 133
Altera Corporation
13-4
QII5V1
2014.12.15
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.
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.
Altera Corporation
QII5V1
2014.12.15
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
The MTBF Summary reports an estimate of the overall robustness of cross-clock domain and
asynchronous transfers in the design. This estimate uses the MTBF results of all synchronization chains in
the design to calculate an MTBF for the entire design.
Altera Corporation
13-6
QII5V1
2014.12.15
The Synchronizer Summary lists the synchronization register chains detected in the design depending on
the Synchronizer Identification setting.
The Source Node is the register or input port that is the source of the asynchronous transfer. The
Synchronization Node is the first register of the synchronization chain. The Source Clock is the clock
domain of the source node, and the Synchronization Clock is the clock domain of the synchronizer
chain.
This summary reports the calculated Worst-Case MTBF, if available, and the Typical MTBF, for each
appropriately identified synchronization register chain that meets its timing requirement.
Related Information
The timing analyzer provides an additional report for each synchronizer chain.
The Chain Summary tab matches the Synchronizer Summary information described in Synchronizer
Summary Report, while the Statistics tab adds more details, including whether the Method of Synchron
izer Identification was User Specified (with the Forced if Asynchronous or Forced settings for the
Synchronizer Identification setting), or Automatic (with the Auto setting). The Number of Synchroni
zation Registers in Chain report provides information about the parameters that affect the MTBF
calculation, including the Available Settling Time for the chain and the Data Toggle Rate Used in
MTBF Calculation.
The following information is also included to help you locate the chain in your design:
Source Clock and Asynchronous Source node of the signal.
Synchronization Clock in the destination clock domain.
Node names of the Synchronization Registers in the chain.
Related Information
QII5V1
2014.12.15
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:
set_instance_assignment -name SYNCHRONIZER_TOGGLE_RATE <toggle rate in transitions/
second> -to <register name>
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 II 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:
set_global_assignment -name OPTIMIZE_FOR_METASTABILITY <ON|OFF>
Related Information
Altera Corporation
13-8
QII5V1
2014.12.15
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:
set_global_assignment -name SYNCHRONIZATION_REGISTER_CHAIN_LENGTH <number of
registers>
To apply the assignment to a design instance or the first register in a specific chain with Tcl, use the
following command:
set_instance_assignment -name SYNCHRONIZATION_REGISTER_CHAIN_LENGTH <number of
registers> -to <register or instance name>
Altera Corporation
QII5V1
2014.12.15
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
Altera Corporation
13-10
QII5V1
2014.12.15
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 II 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 II Settings File Reference Manual
For more information about settings and constraints in the Quartus II software
Altera Corporation
QII5V1
2014.12.15
13-11
Command-Line Scripting
For more information about command-line scripting
About Quartus II Scripting
For more information about command-line scripting
To apply the Synchronizer Identification assignment to a specific register or instance, use the following
command:
set_instance_assignment -name SYNCHRONIZER_IDENTIFICATION <AUTO|"FORCED IF ASYNCHRONOUS"|FORCED|OFF> -to <register or instance name>
Related Information
-panel_name
<name>
-stdout
Description
Altera Corporation
13-12
QII5V1
2014.12.15
MTBF Optimization
Related Information
MTBF Optimization
To ensure that metastability optimization described on page MTBF Optimization is turned on (or to turn
it off), use the following command:
set_global_assignment -name OPTIMIZE_FOR_METASTABILITY <ON|OFF>
Related Information
To apply the assignment to a design instance or the first register in a specific chain, use the following
command:
set_instance_assignment -name SYNCHRONIZATION_REGISTER_CHAIN_LENGTH <number of
registers> -to <register or instance name>
Related Information
Managing Metastability
Alteras Quartus II software provides industry-leading analysis and optimization features to help you
manage metastability in your FPGA designs. Set up your Quartus II 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 II software to make your design more robust with respect to
metastability.
Versio
n
Changes
2014.12.15
14.1.0
June 2014
14.0.0
Updated formatting.
Altera Corporation
QII5V1
2014.12.15
Date
Versio
n
Changes
June 2012
12.0.0
November
2011
10.0.2
Template update.
December
2010
10.0.1
July 2010
10.0.0
Technical edit.
November
2009
9.1.0
13-13
Related Information
Altera Corporation
14
2014.12.15
QII5V1
Subscribe
Send Feedback
The Quartus II incremental compilation feature allows you to partition a design, compile partitions
separately, and reuse results for unchanged partitions. Incremental compilation provides the following
benefits:
Related Information
2014 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
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information,
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
ISO
9001:2008
Registered
14-2
QII5V1
2014.12.15
In subsequent compilations, you can select which netlist to preserve for each partition. You can either
reuse the synthesis or fitting netlist, or instruct the Quartus II software to resynthesize the source files.
You can also use compilation results exported from another Quartus II project.
When you make changes to your design, the Quartus II 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
dynamically, while the remainder of the device continues to operate as intended.
Related Information
Altera Corporation
QII5V1
2014.12.15
14-3
The Quartus II software Rapid Recompile feature instructs the Compiler to reuse the compatible compila
tion results if most of the design has not changed since the last compilation. This feature reduces compila
tion time and preserves performance when there are small and isolated design changes within a partition,
and works with all netlist type settings. With this feature, you do not have control over which parts of the
design are recompiled; the Compiler determines which parts of the design must be recompiled.
If required for third-party IP delivery, or in cases where designers cannot access a shared or copied toplevel project framework, you can create and compile a design partition logic in isolation and export a
partition that is included in the top-level project. If this type of design flow is necessary, planning and
rigorous design guidelines might be required to ensure that designers have a consistent view of project
assignments and resource allocations. Therefore, developing partitions in completely separate Quartus II
projects can be more challenging than having all source code within one project or developing design
partitions within the same top-level project framework.
Altera Corporation
14-4
QII5V1
2014.12.15
If any partitions are developed independently, the project lead must ensure that top-level constraints
(such as timing constraints, any relevant floorplan or pin assignments, and optimization settings) are
consistent with those used by all designers.
In a team-based environment where designers have access to the project through source control software,
each designer can use project files as read-only and develop their partition within the source control
system. As designers check in their completed partitions, other team members can see how their
partitions interact.
If designers do not have access to a source control system, the project lead can provide each designer with
a copy of the top-level project framework to use as they develop their partitions. In both cases, each
designer exports their completed design as a partition, and then the project lead integrates the partition
into the top-level design. The project lead can choose to use only the post-synthesis netlist and rerun
placement and routing, or to use the post-fitting results to preserve the placement and routing results
from the other designer's projects. Using post-synthesis partitions gives the Fitter the most flexibility and
is likely to achieve a good result for all partitions, but if one partition has difficultly meeting timing, the
designer can choose to preserve their successful fitting results.
Alternatively, designers can use their own Quartus II project for their independent design block. You
might use this design flow if a designer, such as a third-party IP provider, does not have access to the
entire top-level project framework. In this case, each designer must create their own project with all the
relevant assignments and constraints. This type of design flow requires more planning and rigorous
design guidelines. If the project lead plans to incorporate the post-fitting compilation results for the
partition, this design flow requires especially careful planning to avoid resource conflicts.
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 II projects to follow instructions from the
project lead. The Quartus II design partition scripts feature creates Tcl scripts or .tcl files and makefiles
that an independent designer can run to set up an independent Quartus II project.
Related Information
Using Constraints
If designers create Quartus II 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
Altera Corporation
QII5V1
2014.12.15
14-5
be easily copied or included in the top-level design. If partition designers use a separate Quartus II 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
Altera Corporation
14-6
QII5V1
2014.12.15
Merging Partitions
Hierarchy A
Hierarchy A
Hierarchy B
Hierarchy A
Hierarchy B
Hierarchy B
Compile
with
partition
boundaries
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:
Altera Corporation
QII5V1
2014.12.15
14-7
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
You can improve the optimizations performed between design partitions by turning on the crossboundary optimizations feature. You can select the optimizations as individual assignments for each
partition. This allows the cross-boundary optimization feature to give you more control over the
optimizations that work best for your design.
You can turn on the cross-boundary optimizations for your design partitions on the Advanced tab of the
Design Partition Properties dialog box. Once you change the optimization settings, the Quartus II
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
Altera Corporation
14-8
QII5V1
2014.12.15
You begin the partitioning process by planning the design hierarchy. When you assign a hierarchical
instance as a design partition, the partition includes the assigned instance and entities instantiated below
that are not defined as separate partitions. You can use the Merge command in the Design Partitions
window to combine hierarchical partitions into a single partition, as long as they have the same
immediate parent partition.
When planning your design hierarchy, keep logic in the leaves of the hierarchy instead of having
logic at the top-level of the design so that you can isolate partitions if required.
Create entities that can form partitions of approximately equal size. For example, do not instantiate
small entities at the same hierarchy level, because it is more difficult to group them to form reasonablysized partitions.
Create each entity in an independent file. The Quartus II software uses a file checksum to detect
changes, and automatically recompiles a partition if its source file changes and its netlist type is set to
either post-synthesis or post-fit. If the design entities for two partitions are defined in the same file,
changes to the logic in one partition initiates recompilation for both partitions.
Design dependencies also affect which partitions are compiled when a source file changes. If two
partitions rely on the same lower-level entity definition, changes in that lower-level entity affect both
partitions. Commands such as VHDL use and Verilog HDL include create dependencies between
files, so that changes to one file can trigger recompilations in all dependent files. Avoid these types of
file dependencies if possible. The Partition Dependent Files report for each partition in the Analysis &
Synthesis section of the Compilation report lists which files contribute to each partition.
Incremental compilation works well with third-party synthesis tools in addition to Quartus II Integrated
Synthesis. If you use a third-party synthesis tool, set up your tool to create a separate Verilog Quartus
Mapping File (.vqm) or EDIF Input File (.edf) netlist for each hierarchical partition. In the Quartus II
software, designate the top-level entity from each netlist as a design partition. The .vqm or .edf netlist file is
treated as the source file for the partition in the Quartus II software.
Related Information
Initially, you should partition your design along functional boundaries. In a top-level system block
diagram, each block is often a natural design partition. Typically, each block of a system is relatively
independent and has more signal interaction internally than interaction between blocks, which helps
Altera Corporation
QII5V1
2014.12.15
14-9
reduce optimizations between partition boundaries. Keeping functional blocks together means that
synthesis and fitting can optimize related logic as a whole, which can lead to improved optimization.
Consider how many partitions you want to maintain in your design to determine the size of each
partition. Your compilation time reduction goal is also a factor, because compiling small partitions is
typically faster than compiling large partitions.
There is no minimum size for partitions; however, having too many partitions can reduce the quality
of results by limiting optimization. Ensure that the design partitions are not too small. As a general
guideline, each partition should contain more than approximately 2,000 logic elements (LEs) or
adaptive logic modules (ALMs). If your design is incomplete when you partition the design, use
previous designs to help estimate the size of each block.
Consider which clock in your design feeds the logic in each partition. If possible, keep clock domains
within one partition. When a clock signal is isolated to one partition, it reduces dependence on other
partitions for timing optimization. Isolating a clock domain to one partition also allows better use of
regional clock routing networks if the partition logic is constrained to one region of the design.
Additionally, limiting the number of clocks within each partition simplifies the timing requirements for
each partition during optimization. Use an appropriate subsystem to implement the required logic for any
clock domain transfers (such as a synchronization circuit, dual-port RAM, or FIFO). You can include this
logic inside the partition at one side of the transfer.
Try to isolate timing-critical logic from logic that you expect to easily meet timing requirements. Doing so
allows you to preserve the satisfactory results for non-critical partitions and focus optimization iterations
on only the timing-critical portions of the design to minimize compilation time.
Related Information
Analyzing and Optimizing the Design Floorplan with the Chip Planner documentation
Information about clock domains and their affect on partition design
When assigning partitions, you should consider what is changing in the design. Is there intellectual
property (IP) or reused logic for which the source code will not change during future design iterations? If
so, define the logic in its own partition so that you can compile one time and immediately preserve the
results and not have to compile that part of the design again. Is logic being tuned or optimized, or are
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.
Altera Corporation
14-10
QII5V1
2014.12.15
The design partition guidelines include examples of the types of optimizations that are prevented by
partition boundaries, and describes how you can structure or modify your partitions to avoid these
limitations.
Use registers at partition input and output connections that are potentially timing-critical. Registers
minimize the delays on inter-partition paths and prevent the need for cross-boundary optimizations.
If every partition boundary has a register as shown in the figure, every register-to-register timing path
between partitions includes only routing delay. Therefore, the timing paths between partitions are likely
not timing-critical, and the Fitter can generally place each partition independently from other partitions.
This advantage makes it easier to create floorplan location assignments for each separate partition, and is
especially important for flows in which partitions are placed independently in separate Quartus II
projects. Additionally, the partition boundary does not affect combinational logic optimization because
each register-to-register logic path is contained within a single partition.
Partition A
D
Partition B
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
Minimize the number of I/O paths that cross between partition boundaries to keep logic paths within a
single partition for optimization. Doing so makes partitions more independent for both logic and
placement optimization.
This guideline is most important for timing-critical and high-speed connections between partitions,
especially in cases where the input and output of each partition is not registered. Slow connections that
are not timing-critical are acceptable because they should not impact the overall timing performance of
the design. If there are timing-critical paths between partitions, rework or merge the partitions to avoid
these inter-partition paths.
Altera Corporation
QII5V1
2014.12.15
14-11
When dividing your design into partitions, consider the types of functions at the partition boundaries.
The figure shows an expansive function with more outputs than inputs in the left diagram, which makes a
poor partition boundary, and, on the right side, a better place to assign the partition boundary that
minimizes
cross-partition I/Os. Adding registers to one or both sides of the cross-partition path in this example
would further improve partition quality.
Figure 14-3: Minimizing I/O Between Partitions by Moving the Partition Boundary
Expansive function:
Not ideal partition boundary
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.
Figure 14-4: Minimizing I/O between Partitions by Modifying Glue Logic
Glue
Logic
A
Glue
Logic
Altera Corporation
14-12
QII5V1
2014.12.15
Related Information
Partition boundaries prevent logic optimizations across partitions (except for some limited crossboundary optimizations).
In some cases, especially if part of the design is complete or comes from another designer, the designer
might not have followed these guidelines when the source code was created. These guidelines are not
mandatory to implement an incremental compilation flow, but can improve the quality of results. If
assigning a partition affects resource utilization or timing performance of a design block as compared to
the flat design, it might be due to one of the issues described in the logic optimization across partitions
guidelines below. Many of the examples suggest simple changes to your partition definitions or hierarchy
to move the partition boundary to improve your results.
The following guidelines ensure that your design does not require logic optimization across partition
boundaries:
Keep Logic in the Same Partition for Optimization and Merging
If your design logic requires logic optimization or merging to obtain optimal results, ensure that all the
logic is part of the same partition because only limited cross-boundary optimizations are permitted.
If a combinational logic path is split across two partitions, the logic cannot be optimized or merged into
one logic cell in the device. This effect can result in an extra logic cell in the path, increasing the logic
delay. As a very simple example, consider two inverters on the same signal in two different partitions, A
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 II 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.
Altera Corporation
QII5V1
2014.12.15
ExampleFitter Merging
14-13
Merged Parition
ExampleFitter 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.
Merging PLLs and Transceivers (GXB)
Multiple instances of the ALTPLL IP core can use the same PLL resource on the device. Similarly, GXB
transceiver instances can share high-speed serial interface (HSSI) resources in the same quad as other
instances. The Fitter can merge multiple instantiations of these blocks into the same device resource, even
if it requires optimization across partitions. Therefore, there are no restrictions for PLLs and
high-speed transceiver blocks when setting up partitions.
Because the Quartus II software cannot fully optimize across a partition boundary, constants are not
propagated across partition boundaries, except from parent partition to child partition. A signal that is
constant (1/VCC or 0/GND) in one partition cannot affect another partition.
Altera Corporation
14-14
QII5V1
2014.12.15
Avoid Signals That Drive Multiple Partition I/O or Connect I/O Together
Within the single merged partition, the Quartus II software can use the constants to optimize and remove
much of the logic in block B (shown in gray), as shown in the figure.
Figure 14-6: Keeping Constants in the Same Partition as the Logic They Feed
VCC
Merged Partition
VCC
GND
GND
Related Information
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.
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.
QII5V1
2014.12.15
14-15
global routing lines for the two copies of the clock signal. Partition B can use one global line that fans out
to all destinations. Using just the single port connection prevents overuse of global routing resources.
Figure 14-7: Preventing One Signal from Driving Multiple Partition Inputs
Top
Top
Dualclock
RAM
rd_clk
wr_clk
Clock
rd_clk
wr_clk
Clock
Singleclock
RAM
A
Related Information
For best results, clock inversion should be performed in the destination logic array block (LAB) because
each LAB contains clock inversion circuitry in the device architecture. In a flat compilation, the Quartus
II software can optimize a clock inversion to propagate it to the destination LABs regardless of where the
inversion takes place in the design hierarchy. However, clock inversion cannot propagate through a
partition boundary (except from a parent partition to a child partition) to take advantage of the inversion
architecture in the destination LABs.
Altera Corporation
14-16
QII5V1
2014.12.15
Connect I/O Pin Directly to I/O Register for Packing Across Partition Boundaries
Top
Clock
Top
Clock
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 II 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 fanout 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.
The following examples of I/O register packing illustrate this point using Block Design File (.bdf)
schematics to describe the design logic.
Example 1Output Register in Partition Feeding Multiple Output Pins
In this example, the subdesign contains a single register.
Altera Corporation
QII5V1
2014.12.15
14-17
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 II software can perform crosspartition 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 II 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 II software must
preserve the interface of design partitions.
To allow the Quartus II 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 crosspartition register packing into the simplest case where each register has a single fan-out.
Altera Corporation
14-18
QII5V1
2014.12.15
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 2Input 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.
Figure 14-13: Top-Level Design Instantiating Subdesign as an Input Register with an Inverted Input Pin
Altera Corporation
QII5V1
2014.12.15
14-19
Figure 14-14: Top-Level Design Instantiating the Subdesign as an Output Register Feeding an Inverted
Output Pin
In these cases, the Quartus II 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 II 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 II 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.
Internal tri-state signals are not recommended for FPGAs because the device architecture does not
include internal tri-state logic. If designs use internal tri-states in a flat design, the tri-state logic is usually
converted to OR gates or multiplexing logic. If tri-state logic occurs on a hierarchical partition boundary,
the Quartus II 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 II software to convert the tri-state signals into logic.
Altera Corporation
14-20
QII5V1
2014.12.15
Figure 14-16: Merged Partition Allows Synthesis to Convert Internal Tri-State Logic to Combinational
Logic
Top
Merged Partition
Merged partition allows synthesis to
convert tri-state logic into
combinational logic.
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 II
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 II software to treat the logic as internal tri-state and perform the same type of optimization as
a flat design. If possible, you should avoid using internal
Altera Corporation
QII5V1
2014.12.15
14-21
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.
When multiple output signals use tri-state logic to drive a device output pin, the Quartus II software
merges the logic into one tri-state output pin. The Quartus II software cannot merge tri-state outputs into
one output pin if any of the tri-state logic occurs on a partition boundary. Similarly, 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 enable
logic are defined in the same partition.
The figure shows a design with tri-state output signals that feed a device bidirectional I/O pin (assuming
that the input connection feeds elsewhere in the design and is not shown in the figure). In the left diagram
below, the tri-state output signals appear as the outputs of two separate partitions. In this case, the
Quartus II software cannot implement the specified logic and maintain incremental functionality. In the
right diagram, partitions A and B are merged to group the logic from the two blocks. With this single
partition, the Quartus II software can merge the two tri-state output signals and implement them in the
tri-state logic available in the device I/O element.
Figure 14-17: Including All Tri-State Output Logic in the Same Partition
Merged Partition
A
A
A
Top
Top
B
B
To ensure that your design does not require logic optimization across partitions, follow the guidelines
below:
Altera Corporation
14-22
QII5V1
2014.12.15
Connect I/O directly to I/O register for packing across partition boundaries
Do not use internal tri-states
Include all tri-state and enable logic in the same partition
Remember that these guidelines are not mandatory when implementing an incremental compilation flow,
but can improve the quality of results. When creating source design code, follow these guidelines and
organize your HDL code to support good partition boundaries. For designs that are complete, assess
whether assigning a partition affects the resource utilization or timing performance of a design block as
compared to the flat design. Make the appropriate changes to your design or hierarchy, or merge
partitions as required, to improve your results.
Altera Corporation
QII5V1
2014.12.15
14-23
False Timing
Paths
Top
VCC
D
VCC
D
CLRN
A_Reset
CLRN
Q
VCC
CLRN
Reset
CLRN
CLRN
B_Reset
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
Altera Corporation
14-24
QII5V1
2014.12.15
In an incremental compilation design flow in which designers, such as third-party IP providers, optimize
partitions and then export them to a top-level design, the Quartus II software places and routes each
partition separately. In some cases, partitions can use conflicting resources when combined at the top
level. Allocation of logic resources requires that you decide on a set of logic resources (including I/O, LAB
logic blocks, RAM and DSP blocks) that the IP block will own. This process can be interactive; the
project lead and the IP designer might work together to determine what resources are required for the IP
block and are available in the top-level design.
You can constrain logic utilization for the IP core using design floorplan location assignments. The design
should specify I/O pin locations with pin assignments.
You can also specify limits for Quartus II synthesis to allocate and balance resources. This procedure can
also help if device resources are overused in the individual partitions during synthesis.
In the standard synthesis flow, the Quartus II software can perform automated resource balancing for
DSP blocks or RAM blocks and convert some of the logic into regular logic cells to prevent overuse.
You can use the Quartus II synthesis options to control inference of IP cores that use the DSP, or RAM
blocks. You can also use the IP Catalog and Parameter Editor to customize your RAM or DSP IP cores to
use regular logic instead of the dedicated hardware blocks.
Related Information
In most cases, you do not have to allocate global routing signals because the
Quartus II software finds the best solution for the global signals. However, if your design is complex and
has multiple clocks, especially for a partition developed by a third-party IP designer, you may have to
allocate global routing resources between various partitions.
Global routing signals can cause conflicts when independent partitions are integrated into a top-level
design. The Quartus II software automatically promotes high fan-out signals to use global routing
resources available in the device. Third-party partitions can use the same global routing resources, thus
causing conflicts in the top-level design. Additionally, LAB placement depends on whether the inputs to
the logic cells within the LAB use a global clock signal. Problems can occur if a design does not use a
global signal in a lower-level partition, but does use a global signal in the top-level design.
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 II software is likely to find a routing solution in the toplevel design because there are many regional routing signals available on most Altera devices, and designs
do not typically overuse regional resources.
Altera Corporation
QII5V1
2014.12.15
14-25
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 partitions 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 II software can automati
cally 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.
Related Information
Altera Corporation
14-26
QII5V1
2014.12.15
Virtual pins map lower-level design I/Os to internal cells. If you are developing an IP block in an
independent Quartus II project, use virtual pins when the number of I/Os on a partition exceeds the
device I/O count, and to increase the timing accuracy of cross-partition paths.
You can create a virtual pin assignment in the Assignment Editor for partition I/Os that will become
internal nodes in the top-level design. 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. Leave the clock pins mapped to I/O pins to ensure proper routing.
You can specify locations for the virtual pins that correspond to the placement of other partitions, and
also make timing assignments to the virtual pins to define a timing budget. Virtual pins are created
automatically from the top-level design if you use design partition scripts. The scripts place the virtual
pins to correspond with the placement of the other partitions in the top-level design.
Note: Tri-state outputs cannot be assigned as virtual pins because internal tri-state signals are not
supported in Altera devices. Connect the signal in the design with regular logic, or allow the
software to implement the signal as an external device I/O pin.
Related Information
If you optimize partitions independently and integrate them to the top-level design, or compile with
empty partitions, any unregistered paths that cross between partitions are not optimized as entire paths.
In these cases, the Quartus II software has no information about the placement of the logic that connects
to the I/O ports. If the logic in one partition is placed far away from logic in another partition, the routing
delay between the logic can lead to problems in meeting timing requirements. You can reduce this effect
by ensuring that input and output ports of the partitions are registered whenever possible. Additionally,
using the same top-level project framework helps to avoid this problem by providing the software with
full information about other design partitions in the top-level design.
To ensure that the software correctly optimizes the input and output logic in any independent partitions,
you might be required to perform some manual timing budgeting. For each unregistered timing path that
crosses between partitions, make timing assignments on the corresponding I/O path in each partition to
constrain both ends of the path to the budgeted timing delay. Assigning a timing budget for each part of
the connection ensures that the software optimizes the paths appropriately.
When performing manual timing budgeting in a partition for I/O ports that become internal partition
connections in a top-level design, you can assign location and timing constraints to the virtual pin that
represents each connection to further improve the quality of the timing budget.
Note: If you use design partition scripts, the Quartus II software can write I/O timing budget constraints
automatically for virtual pins.
Related Information
When partitions are exported from another Quartus II project, you should drive partition clock inputs
directly with device clock input pins.
Altera Corporation
QII5V1
2014.12.15
14-27
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
If you connect a PLL in your top-level design to partitions designed in separate Quartus II projects by
third-party IP designers, the IP partitions do not have information about the multiplication, phase shift,
or compensation delays for the PLL in the top-level design. To accommodate the PLL timing, you can
make appropriate timing assignments in the projects created by IP designers to ensure that clocks are not
left unconstrained or constrained with an incorrect frequency. Alternatively, you can duplicate the toplevel PLL (or other derived clock logic) in the design file for the project created by the IP designer to
ensure that you have the correct PLL parameters and clock delays for a complete and accurate timing
analysis.
If the project lead creates a copy of the top-level project framework that includes 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 you use a separate Quartus II project for an independent design block (such as when a designer or
third-party IP provider does not have access to the entire design framework), include a copy of the toplevel PLL in the lower-level partition as shown in figure.
In either case, the IP partition in the separate Quartus II project should contain just the partition logic
that will be exported to the top-level design, while the full project includes more information about the
top-level design. When the partition is complete, you can export just the partition without exporting the
auxiliary PLL components to the top-level design. When you export a partition, the Quartus II software
exports any hierarchy under the specified partition into the Quartus II Exported Partition File (.qxp), but
does not include logic defined outside the partition (the PLL in this example).
Virtual
Input
Pins
PLL From
Top-Level
Design
Lower-Level
Partition
to be
Exported
Virtual
Output
Pins
Outputs to
Device Pins
Altera Corporation
14-28
QII5V1
2014.12.15
Altera Corporation
QII5V1
2014.12.15
14-29
You can switch between connectivity display mode and hierarchical display mode, to examine the viewonly 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
14-30
QII5V1
2014.12.15
Related Information
Altera Corporation
QII5V1
2014.12.15
14-31
Altera Corporation
14-32
QII5V1
2014.12.15
You can use these reports to analyze the location of the critical timing paths in the design in relation to
partitions. If a certain partition contains many failing paths, or failing inter-partition paths, you might be
able to change your partitioning scheme and improve timing performance.
Related Information
2.
3.
4.
5.
6.
After Analysis & Synthesis and Partition Merge, perform a placement and timing analysis estimate
with the Start Early Timing Estimate command. To run a full compilation instead, use the Start
Compilation command.
Record the quality of results from the Compilation report (timing slack or fMAX, area and any other
relevant results).
Create design partitions following the guidelines described in this manual.
Perform another early timing estimate or a full compilation.
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.
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 II 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.
Altera Corporation
QII5V1
2014.12.15
14-33
entire design. If the independent partition designers make any changes or add any constraints, they might
have to transfer new constraints back to the project lead, so that these constraints are included in final
timing sign-off of the entire design. Many assignments from the partition are carried with the partition
into the top-level design; however, SDC format constraints for the TimeQuest analyzer are not copied
into the top-level design automatically.
Passing additional timing constraints from a partition to the top-level design must be managed carefully.
You can design within a single Quartus II project or a copy of the top-level design to simplify constraint
management.
To ensure that there are no conflicts between the project leads top-level constraints and those added by
the third-party IP designer, use two .sdc files for each separate Quartus II project: an .sdc created by the
project lead that includes project-wide constraints, and an .sdc created by the IP designer that includes
partition-specific constraints.
The example design shown in the figure below is used to illustrate recommendations for managing the
timing constraints in a third-party IP delivery flow. The top-level design instantiates a lower-level design
block called module_A that is set as a design partition and developed by an IP designer in a separate
Quartus II project.
Figure 14-22: Example Design to Illustrate SDC Constraints
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:
create_clock -name {clk} -period 3.000 -waveform { 0.000 1.500 } \
[get_ports {TOP_LEVEL_CLK}]
Altera Corporation
14-34
QII5V1
Example Step 1Project Lead Produces .sdc with Project-Wide Constraints for
2014.12.15
Lower-Level Partitions
The .sdc with project-wide constraints is used in the partition, but is not exported back to the top-level
design. The partition designer should not modify this file. If changes are necessary, they should be
communicated to the project lead, who can then update the SDC constraints and distribute new files to all
partition designers as required.
The .sdc should include clock creation and clock constraints for any clock used by more than one
partition. These constraints are particularly important when working with complex clocking structures,
such as the following:
Additionally, the .sdc with project-wide constraints should contain all project-wide timing exception
assignments, such as the following:
The project-wide .sdc can also contain any set_input_delay or set_output_delay constraints that are
used for ports in separate Quartus II projects, because these represent delays external to a given partition.
If the partition designer wants to set these constraints within the separate Quartus II 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 II project.
Related Information
Example Step 1Project 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:
create_clock -name {clk} -period 3.000 -waveform { 0.000 1.500 } [get_ports
{INPUT_CLK}]
The designer of module_A includes this .sdc as part of the separate Quartus II project.
Altera Corporation
QII5V1
2014.12.15
14-35
should be in the partition-specific .sdc. These constraints are required for correct compilation of the
partition, but do not need to be present in any other separate Quartus II projects.
The partition-specific .sdc should be maintained by the partition designer; they must add any constraints
required to properly compile and analyze their partition.
The partition-specific .sdc is used in the separate Quartus II project and must be exported back to the
project lead for the top-level design. The project lead must use the partition-specific constraints to
properly constrain the placement, routing, or both, if the partition logic is fit at the top level, and to
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 II 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.
The partition designer compiles the design with the .sdc with project-wide constraints and might want to
add some additional constraints. In this example, the designer realizes that he or she must specify a false
path between the register called reg_in_1 and all destinations in this design block with the wildcard
character (such as * ). This constraint applies entirely within the partition and must be exported to the
top-level design, so it qualifies for inclusion in the .sdc with partition-specific constraints. The designer
first defines the module_A_hierarchy variable and uses it when writing the constraint as follows:
if {![info exists module_A_hierarchy]} {
set module_A_hierarchy ""
}
set_false_path -from [get_registers ${module_A_hierarchy}reg_in_1] \
-to [get_registers ${module_A_hierarchy}*]
Altera Corporation
14-36
QII5V1
2014.12.15
Example Step 3Project Lead Performs Final Timing Analysis and Sign-off
To set up the top-level .sdc constraint file to accept the .sdc files from the separate Quartus II projects, the
top-level .sdc should define the hierarchy variables specified in the partition .sdc files. List the variable for
each partition and set it to the hierarchy path, up to and including the instantiation of the partition in the
top-level design, including the final hierarchy character |.
To ensure that the .sdc files are used in the correct order, the project lead can use the Tcl Source command
to load each .sdc.
Example Step 3Project 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
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.
Analyzing and Optimizing the Design Floorplan with the Chip Planner documentation
Altera Corporation
QII5V1
2014.12.15
14-37
LogicLock region assignment. Altera recommends creating a design floorplan by assigning design
partitions to LogicLock regions to improve the quality of results and avoid placement conflicts in some
situations for incremental compilation.
Another misconception is that LogicLock assignments are used to preserve placement results for
incremental compilation. Actually, LogicLock regions only constrain logic to a physical region on the
device. Incremental compilation does not use LogicLock assignments or any location assignments to
preserve the placement results; it simply reuses the results stored in the database netlist from a previous
compilation.
Altera Corporation
14-38
QII5V1
2014.12.15
P2
P1
P3
P2
P3
P1
P1
P2
P1
Change in P3
P4
P2
P1
P4
P1
P3
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
P2
P3
Change in P3
P1
P4
P1
P4
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.
Altera Corporation
QII5V1
2014.12.15
Early Floorplan
14-39
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 II project if required, and the design can still be easily integrated in the
top-level design. Even within one Quartus II 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 II projects, you can use the design information and Quartus II
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
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 II 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
14-40
QII5V1
2014.12.15
You might have to perform these steps several times to find the best combination of design partitions and
LogicLock regions that meet the resource and timing goals of the design.
Related Information
Altera Corporation
QII5V1
2014.12.15
14-41
command to perform a fast placement. You can also enable the Fast Synthesis Effort setting to reduce
synthesis time.
After a compilation or early timing estimate, save the Fitter size and origin location of the Fitter with the
Set Size and Origin to Previous Fitter Results command.
Note: It is important that you use the Fitter-chosen locations only as a starting point to give the regions a
good fixed size and location. Ensure that all LogicLock regions in the design have a fixed size and
have their origin locked to a specific location on the device. On average, regions with fixed size and
location yield better timing performance than auto-sized regions.
Related Information
Altera Corporation
14-42
I/O Connections
QII5V1
2014.12.15
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
location assignments for external device I/O pins (instead of including the I/O cells in a LogicLock region
to control placement).
Altera Corporation
QII5V1
2014.12.15
14-43
MRAM
DSP
M4K RAM
M512 RAM
MRAM
DSP
M4K RAM
M512 RAM
Exclude DSP
blocks from
LogicLock region
To view any resource exceptions, right-click in the LogicLock Regions window, and then click LogicLock
Regions Properties. In the LogicLock Regions Properties dialog box, select the design element (module
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.
Altera Corporation
14-44
QII5V1
2014.12.15
<LogicLock region name>The name of the LogicLock region to which the code block is assigned.
<block>A code block in a Quartus II 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:
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.
set_instance_assignment -name LL_MEMBER_RESOURCE_EXCLUDE \
"DSP:SMALL_MEM" -to "alu:alu_unit" -section_id ALU
QII5V1
2014.12.15
14-45
Locate the Quartus II 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
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.
Related Information
Altera Corporation
14-46
QII5V1
2014.12.15
Altera Corporation
QII5V1
2014.12.15
Create a Floorplan Assignment for One Design Block with Difficult Timing
14-47
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
Altera Corporation
14-48
QII5V1
2014.12.15
initial implementation numbers and knowledge of the design specifications. Use the guidelines
described in this chapter to choose a size and location for each LogicLock region.
6. Provide the constraints from the top-level design to partition designers using one of the following
procedures:
a. Create a copy of the top-level Quartus II project framework by checking out the appropriate files
from a source control system, using the Copy Project command, or creating a project archive.
Provide each partition designer with the copy of the project.
b. Provide the constraints with documentation or scripts.
Related Information
Versio
n
Changes
2014.12.15
14.1.0
June 2014
14.0.0
Dita conversion.
Removed obsolete devices content for Arria GX, Cyclone, Cyclone II,
Cyclone III, Stratix, Stratix GX, Stratix II, Stratix II GX,
Replace Megafunction content with IP Catalog and Parameter Editor
content.
November
2013
13.1.0
November
2012
12.1.0
June 2012
12.0.0
November
2011
11.0.1
Template update.
May 2011
11.0.0
Updated links.
Altera Corporation
QII5V1
2014.12.15
Date
Versio
n
Changes
December
2010
10.1.0
July 2010
10.0.0
October
2009
9.1.0
November
2008
8.1.0
14-49
Altera Corporation
14-50
QII5V1
2014.12.15
Date
May 2007
Versio
n
8.0.0
Changes
Initial release.
Related Information
Altera Corporation
15
2014.06.30
QII5V1
Subscribe
Send Feedback
The Quartus II software offers several features to enable the detection and correct ion of single event
upsets (SEUs), or soft errors, as well as to characterize the effects of SEU on your designs.
Understanding SEU
SEU can affect any semiconductor device.
SEUs are rare, unintended changes in the state of internal memory elements, caused by cosmic radiation
effects. The change in state results in a soft error, so the affected device can be reset to its original value
and there is no permanent damage to the device itself. Because of the unintended memory state, the
device may operate erroneously until this upset is fixed.
The Soft Error Rate (SER) is expressed as Failure-in-Time (FIT) units, defined as one soft error
occurrence every billion hours of operation. Often SEU mitigation is not required because of the low
chance of occurrence. However, for highly complex systems, such as with multiple high-density
components, 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, and
use the available techniques for detecting and recovering from these types of errors. If your system is
requiring high reliability and availability, consider the implications of soft errors, and use the techniques
in this document to detect and recover from these types of errors.
FPGAs use memory both in user logic (bulk memory and registers) and in Configuration Random Access
Memory (CRAM). CRAM configures the FPGA; this is the memory loaded with the contents of a .sof file
by the Quartus II Programmer. The CRAM configures all logic and routing in the device. If an SEU strikes
a CRAM bit, the effect can be harmless if the CRAM bit is not in use. However, the affect can be severe if
it affects critical logic internal signal routing (such as a lookup table bit).
Related Information
2014 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
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information,
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
ISO
9001:2008
Registered
15-2
QII5V1
2014.06.30
ECC use a Cyclic Redundancy Check (CRC) code for a given data word. These CRC bits provide
redundancy on the data word which can detect the location of single-bit and double-bit flips in the data
word. Since the location of the bit flips is known, the CRC can locate and correct the error. The CRC code
can also account for bit flips in the CRC code itself. Altera FPGAs support both Single Error Correction
Double Error Detection (SECDED) and Double Error Correction Triple Error Detection (DECTED),
depending on the device family.
Some Altera device memory blocks offer built-in CRC circuitry hardened in silicon. This is available in
the M20K memory in Stratix V, and in the M144K block in Stratix IV, and Arria II devices. (Other device
families can implement CRC functions using Altera IP cores). The CRC circuitry generates an EDCRC
code at the data storage input of the RAM, and checks the CRC code at the output of the RAM. If an SEU
affects any stored bits in the internal memory, the CRC automatically corrects the error when it is read
from the memory. The ECC-enabled memory can report the occurrence of a single-bit flip, or adjacent
double-bit and adjacent triple-bit flips, and will correct single- and double-bit flips. Adjacent triple-bit
corruptions are detected and reported using a status bit, but not corrected.
CRC
Values
Error Detection
and Correction
CRC
Generator
Data
Words
CRC
Memory Storage
QII5V1
2014.06.30
15-3
CRAM
Frame
32-Bit
CRC
CRC Engine Steps
Through Frame by Frame
CRC Error
Detection/Correction
Engine
CRC_ERROR
Related Information
To enable the CRC_ERROR pin as an open drain output, turn on Enable open drain on CRC_ERROR
pin.
Mitigating Single Event Upsets
Send Feedback
Altera Corporation
15-4
Internal Scrubbing
QII5V1
2014.06.30
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 the Divide error check frequency by value.
Internal Scrubbing
Arria V, Cyclone V (including SoC devices), Stratix V, and later device families support automatic CRAM
error correction, without resorting to the original CRAM contents from an external copy of the original
SRAM Object File.
Automatic correction is possible because EDCRC calculates and stores redundancy fields along with the
configuration bits. This automatic correction is known as scrubbing.
To enable internal scrubbing, turn on Enable internal scrubbing option in the Device and Pin Options
dialog box.
If the Quartus II software finds a CRC error in a CRAM frame, the frame is reconstructed from the error
correcting code calculated for that frame, and then the corrected frame is re-written 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 to be scanned, this latency may
be up to 100 milliseconds for large devices. Therefore, the FPGA may operate with errors during
that period.
Related Information
Altera Corporation
QII5V1
2014.06.30
15-5
CRAM CRC
Error?
no
yes
Notify
System
Look Up Sensitivity
of CRAM Bit
Critical Bit?
no
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
Hierarchy Tagging
Hierarchy tagging is the process of classifying the sensitivity of the portions of your design.
The Quartus II software performs hierarchy tagging by creating a design partition, and then assigning the
parameter ASD Region to that partition. The parameter can assume a value from 0 to 255, so there are 256
Mitigating Single Event Upsets
Send Feedback
Altera Corporation
15-6
QII5V1
2014.06.30
different classifications of system responses to the portions of your design. This sensitivity information is
encoded into the .smf the running system uses to look-up the sensitivity of an SEU upset, and to perform
the appropriate action to that CRAM location.
Related Information
Altera Corporation
QII5V1
2014.06.30
Triple-Module Redundancy
15-7
the sensitivity lookup by referring to the Sensitivity Map Header file (.smf) stored in the CPU's memory
space.
External sensitivity processing does not require on-board memory dedicated to the SMH storage
function,. Also, this technique relieves the FPGA of external memory interface requirements, along with
the memory storage requirements for the sensitivity map itself. If a CPU is already present in the system,
external sensitivity processing may be the more hardware-efficient way to implement sensitivity lookup.
Related Information
Triple-Module Redundancy
If your system must suffer no downtime due to SEUs, consider Triple Module Redundancy as an SEU
mitigation strategy.
Triple-Module-Redundancy (TMR) is an established technique for improving hardware fault tolerance. In
TMR, three identical instances of hardware are supplied, along with voting hardware at the output of the
hardware. If an SEU affects one of the instances, the voting logic notes the majority in a vote of the
separate instances of the module to mask out any malfunctioning module.
The advantage of TMR is that there is no downtime in the case of a single SEU; if a module is found to be
in faulty operation, that module can be scrubbed of its error by reprogramming it. The error detection
and correction time is many orders of magnitude less than the MTBF due to SEU events. Therefore, you
can repair a soft interrupt before another SEU affects another instance in the TMR triple.
The disadvantage of TMR is its extreme cost in hardware resources: it requires three times as much
hardware, in addition to voting logic. This hardware cost can be minimized by judiciously implementing
TMR only for the most critical part of the design.
There are several automated ways to generate TMR designs by automatically replicating designated
functions and synthesizing the required voting logic. Synthesis vendors offering automated TMR
synthesis include Synopsys and Mentor Graphics.
Altera Corporation
15-8
QII5V1
2014.06.30
Version
Changes
June 2014
2014.06.30
Updated formatting.
Added "Mitigating SEU
Effects in Embedded User
RAM" section.
Added "Altera Advanced SEU
Detection IP Core" section.
November 2012
2012.11.01
Preliminary release.
Altera Corporation
16
2014.12.15
QII5V1
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 II software
provides a complete, easy-to-use solution.
Related Information
Design Flow
The Quartus II 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 SystemVerilog
language.
In the synthesis stage of the compilation flow, the Quartus II 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:
Table 16-1: Compilation Process
Compilation Process
Description
2014 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
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information,
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
ISO
9001:2008
Registered
16-2
QII5V1
2014.12.15
Design Flow
Compilation Process
Description
Hierarchy Elaboration
Related Information
Altera Corporation
QII5V1
2014.12.15
16-3
Quartus II
Exported
Partition File
System Verilog (.qxp) Verilog HDL VHDL
Functional/RTL
Simulation
Constraints
& Settings
Gate-Level
Functional
Simulation
Internal
Synthesis
Netlist
Constraints
& Settings
Fitter
Timing
Analyzer
Assembler
Gate-Level Timing
Simulation
Post
Placement and Routing
Simulation Files
(.vho/.vo and .sdo)
No
Post
Placement and Routing
Formal Verification File
(.vo)
Formal Verification
Using Source Code as
Golden Netlist, and VO
as Revised Netlist
Configuration/
Programming
Files (.sof/.pof)
Configure/Program Device
The Quartus II Integrated Synthesis design and compilation flow consists of the following steps:
1. Create a project in the Quartus II software and specify the general project information, including the
top-level design entity name.
2. Create design files in the Quartus II 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 II
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.
Quartus II Integrated Synthesis
Send Feedback
Altera Corporation
16-4
QII5V1
2014.12.15
Language Support
Related Information
Language Support
Quartus II Integrated Synthesis supports HDL. You can specify the Verilog HDL or VHDL language
version in your design.
To ensure that the Quartus II software reads all associated project files, add each file to your Quartus II
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 II project.
Related Information
Altera Corporation
QII5V1
2014.12.15
16-5
The Quartus II software support for Verilog HDL is case sensitive in accordance with the Verilog HDL
standard. The Quartus II software supports the compiler directive `define, in accordance with the
Verilog HDL standard.
The Quartus II 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 II
software initially searches relative to the project directory. If the Quartus II 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.
Related Information
Altera Corporation
16-6
QII5V1
2014.12.15
Configuration Syntax
Where:
modules) in the design and the logical library for this module (modules).
config_rule_statementone or more of the following clauses: default, instance, or cell. For
more information, refer to Table 16-2.
endconfigthe keyword that ends a configuration.
Description
Specifies the logical libraries to search to resolve a default cell instance. A default cell
instance is an instance in the design that is not specified in a subsequent instance or
cell clause in the configuration.
You specify these libraries with the liblist keyword. The following is an example of
a default clause: default liblist lib1 lib2;
Also specifies resolving default instances in the logical libraries (lib1 and lib2).
Because libraries are inherited, some simulators (for example, VCS) also search the
default (or current) library as well after the searching the logical libraries (lib1 and
lib2).
instance
Specifies a specific instance. The specified instance clause depends on the use of the
following keywords:
liblistspecifies the logical libraries to search to resolve the instance.
usespecifies 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:
liblistspecifies the logical libraries to search to resolve all instances of the cell.
usethe specified cells definition is in the specified library.
Altera Corporation
QII5V1
2014.12.15
Hierarchical Configurations
16-7
Hierarchical Configurations
A design can have more than one configuration. For example, you can define a configuration that
specifies the source code you use in particular instances in a sub hierarchy, then define a configuration for
a higher level of the design.
Suppose, for example, 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 and 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 II 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
Altera Corporation
16-8
QII5V1
2014.12.15
To avoid such errors, enclose nonsynthesizable constructs (such as those intended only for simulation) in
translate_off and translate_on synthesis directives
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 II Integrated 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
reg [7:0] ram[0:15];
initial
begin
$readmemb("ram.txt", ram);
end
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 in
Example 16-1.
Example 16-2: Text File Format: Initializing RAM with the readmemb Command
@0
00000000
@1
00000001
@2
00000010
@e
00001110
@f
00001111
Related Information
Altera Corporation
QII5V1
2014.12.15
16-9
To specify multiple macros, you can repeat the option more than once.
quartus_map my_design --verilog_macro="a=2" --verilog_macro="b=3"
VHDL Support
The Quartus II Compilers Analysis & Synthesis module supports the following VHDL standards:
VHDL 1987 (IEEE Standard 1076-1987)
VHDL 1993 (IEEE Standard 1076-1993)
VHDL 2008 (IEEE Standard 1076-2008)
The Quartus II Compiler uses the VHDL 1993 standard by default for files that have the extension .vhdl
or .vhd.
Note: The VHDL code samples follow the VHDL 1993 standard.
To specify a default VHDL version for all files, follow these steps:
1. Click Assignments > Settings > Compiler Settings > Verilog HDL Input
2. On the VHDL Input page, under VHDL version, select the appropriate version, and then click OK.
To override the default VHDL version for each VHDL design file, follow these steps:
3. On the Project menu, click Add/Remove Files in Project.
4. On the Files page, select the appropriate file in the list, and then click Properties.
5. In the HDL version list, select VHDL_2008, VHDL_1993, or VHDL_1987, and then click OK.
You can also specify the VHDL version that compiles your design for each design file with the
VHDL_INPUT_VERSION synthesis directive. This directive overrides the default HDL version and any HDL
version specified in the File Properties dialog box.
Table 16-3: Controlling the VHDL Input Version with a Synthesis Directive
HDL
VHDL
Code
--synthesis VHDL_INPUT_VERSION <language version>
Altera Corporation
16-10
QII5V1
2014.12.15
VHDL-2008 Support
HDL
VHDL-2008
Code
/* synthesis VHDL_INPUT_VERSION <language version> */
VHDL-2008 Support
The Quartus II 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
Altera Corporation
QII5V1
2014.12.15
16-11
standard (included in every project by default) and textio. For compatibility with older designs, the
Quartus II software also supports the following vendor-specific packages and libraries:
and maxplus2 (for legacy support of MAX+PLUS II primitives) in the ALTERA library
Altera IP core packages altera_mf_components and stratixgx_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.
Related Information
AHDL Support
The Quartus II Compilers Analysis & Synthesis module fully supports the Altera Hardware Description
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 II software.
Note: The AHDL language does not support the synthesis directives or attributes.
Related Information
About AHDL
For more information about AHDL
Altera Corporation
16-12
QII5V1
2014.12.15
Note: Schematic entry methods do not support the synthesis directives or attributes.
Related Information
Design Libraries
By default, the Quartus II software compiles all design files into the work library. 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 II software searches the work library. This behavior allows the
Quartus II 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:
Specifying a Destination Library Name in the Settings Dialog Box on page 16-13
Specifying a Destination Library Name in the Quartus II Settings File or with Tcl on page 16-13
When the Quartus II Compiler analyzes the file, it stores the analyzed design units in the destination
library of the file.
Note: A design can contain two or more entities with the same name if the Quartus II software compiles
the entities into separate libraries.
When compiling a design instance, the Quartus II 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 II
software could not locate the entity definition, the software searches for a unique entity definition in all
design libraries. If the Quartus II 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 on page 16-14.
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
Altera Corporation
QII5V1
2014.12.15
16-13
Specifying a Destination Library Name in the Quartus II Settings File or with Tcl
You can specify the library name with the -library option to the <language type>_FILE assignment in
the Quartus II Settings File (.qsf) or with Tcl commands.
For example, the following assignments specify that the Quartus II 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.
set_global_assignment name VHDL_FILE my_file.vhd library my_lib
set_global_assignment name VERILOG_FILE my_header_file.h library another_lib
Related Information
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
Quartus II Integrated Synthesis
Send Feedback
Altera Corporation
16-14
QII5V1
2014.12.15
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 II software generates an error if you use the library directive in a design unit.
Related Information
Altera Corporation
QII5V1
2014.12.15
16-15
Example 16-4: VHDL Code: Default Binding to the Directly Visible Entity
use mylib.foo; -- make entity foo in library mylib directly visible
architecture rtl of top
component foo is
generic (...)
port (...);
end component;
begin
-- This instance will be bound to entity foo in library mylib
inst: foo
port map(...);
end architecture rtl;
Using Parameters/Generics
The Quartus II 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 II 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
Quartus II Integrated Synthesis
Send Feedback
Altera Corporation
16-16
QII5V1
2014.12.15
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 II software correctly interprets the parameter value.
Related Information
Setting Default Parameter Values and BDF Instance Parameter Values on page 16-16
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-17
For more information about parameter type rules
S"abc", s"abc"
"abc123", "123abc"
F"12.3", f"12.3"
-5.4
D"123", d"123"
123, -123
X"ff", H"ff"
Hexadecimal value FF
Altera Corporation
QII5V1
2014.12.15
Parameter String
Q"77", O"77"
Octal value 77
B"1010", b"1010"
SB"1010", sb"1010"
E"apple", e"apple"
P"1 unit"
A(...), a(...)
16-17
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
II software interprets the parameter value and defines the parameter type. You must specify parameter
type with the pull-down list to avoid ambiguity.
Note: If you open a .bdf in the Quartus II 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 II software does not recognize the parameter value type, the software sets the
parameter type as untyped.
The Quartus II software supports the following parameter types:
Unsigned Integer
Signed Integer
Unsigned Binary
Signed Binary
Octal
Hexadecimal
Float
Enum
String
Boolean
Char
Untyped/Auto
Altera Corporation
16-18
QII5V1
2014.12.15
ensure that the enumeration literal is in the correct spelling in the language of the higher-level design
block (block that is higher in the hierarchy). The Quartus II software passes the parameter value as a
string literal, and the language of the lower-level design correctly convert the string literal into the correct
enumeration literal.
If the language of the lower-level entity is SystemVerilog, you must ensure that the enum value is in the
correct case. In SystemVerilog, two enumeration literals differ in more than just case. For example, enum
{item, ITEM} is not a good choice of item names because these names can create confusion and is more
difficult to pass parameters from case-insensitive HDLs, such as VHDL.
Arrays have different support in different design languages. For details about the array parameter format,
refer to the Parameter section in the Analysis & Synthesis Report of a design that contains array
parameters or generics.
The following code shows examples of passing parameters from one design entry language to a subdesign
written in another language.
Table 16-5: VHDL Parameterized Subdesign Entity
This table shows a VHDL subdesign that you instantiate in a top-level Verilog HDL design in Table 16-6.
HDL
VHDL
Code
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-6: 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-5.
HDL
Verilog HDL
Altera Corporation
Code
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;
QII5V1
2014.12.15
16-19
Verilog HDL
Code
module veri_sub (...)
parameter name = "default";
parameter width = 8;
parameter number_string = "123";
parameter binary_vector = 4'b0101;
parameter signed_vector = 4'sb1111;
Table 16-8: 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-7.
HDL
VHDL
Code
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-7 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 II
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-7
Altera Corporation
16-20
QII5V1
2014.12.15
Incremental Compilation
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 II 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.
Related Information
Parallel Synthesis
The Parallel Synthesis logic option reduces compilation time for synthesis. The option enables the
Quartus II 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.
Altera Corporation
QII5V1
2014.12.15
16-21
By default, the Quartus II 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:
set_global_assignment -name parallel_synthesis off
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.
Related Information
Altera Corporation
16-22
QII5V1
2014.12.15
Synthesis Attributes
The Quartus II 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 II 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 II logic options via the Quartus II software or scripting. Each attribute description
indicates a corresponding setting or a logic option that you can set in the Quartus II 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 II software, the .qsf, or the Tcl interface take precedence over
assignments or settings made with synthesis attributes in your HDL code. The Quartus II 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 II software might be for a different EDA tool. The Quartus II
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 123 through Synthesis Attributes in VHDL on page 1-24, 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.
Altera Corporation
QII5V1
2014.12.15
16-23
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 II 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 II 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
For example, to set the maxfan attribute to 16 and set the preserve attribute on a register called my_reg,
use the following syntax:
reg my_reg /* synthesis maxfan = 16 preserve */;
Related Information
Altera Corporation
16-24
QII5V1
2014.12.15
For example, to set the maxfan attribute to 16 and set the preserve attribute on a register called my_reg,
use the following syntax:
(* maxfan = 16, preserve *) reg my_reg;
Related Information
altera_syn_attributes
The Quartus II 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;
Altera Corporation
QII5V1
2014.12.15
Synthesis Directives
16-25
Synthesis Directives
The Quartus II 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.
Table 16-9: Specifying Synthesis Directives
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
Verilog
HDL(10)
Syntax Example
// synthesis <directive> [ <value> ]
or
/* synthesis <directive> [ <value> ] */
VHDL
VHDL-2008
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
II software also supports the keyword altera, which allows you to add synthesis directives that only
Quartus II 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 II 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
(10)
Verilog HDL is case sensitive; therefore, all synthesis directives are also case sensitive.
Altera Corporation
16-26
QII5V1
2014.12.15
ena
ena
ena1
ena1
clk
clk
ena
ena
ena1
clk
ena2
ena
ena
ena1
ena2
ena
clk
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
Altera Corporation
QII5V1
2014.12.15
Timing-Driven Synthesis
16-27
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
Timing-Driven Synthesis
The Timing-Driven Synthesis logic option specifies whether Analysis & Synthesis should use the SDC
timing constraints of your design to better optimize the circuit. When you turn on this option, Analysis &
Synthesis runs timing analysis to obtain timing information about the netlist, and then considers the SDC
timing constraints to focus on critical portions of your design when optimizing for performance, while
optimizing noncritical portions for area. When you turn on this option, Analysis & Synthesis also protects
SDC constraints by not merging duplicate registers that have incompatible timing constraints.
When you turn on the Timing-Driven Synthesis logic option, Analysis & Synthesis increases perform
ance by improving logic depth on critical portions of your design, and improving area on noncritical
portions of your design. 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 logic
option. Runtime and peak memory use increases slightly if you turn on the Timing-Driven Synthesis
logic option.
When you turn on the Timing-Driven Synthesis logic option, the Optimization Technique logic option
has the following effect. With Optimization Technique Speed, Timing-Driven Synthesis optimizes
timing-critical portions of your design for performance at the cost of increasing area (logic and register
utilization). With an Optimization Technique of Balanced, Timing-Driven Synthesis also optimizes the
timing-critical portions of your design for performance, but the option allows only limited area increase.
With Optimization Technique Area, Timing-Driven Synthesis 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 TimingDriven 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 II projects, the software cannot properly compute timing of
paths that cross the partition boundaries.
Even with the Optimization Technique logic 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.
When using incremental compilation, Integrated Synthesis allows each partition to use up all the registers
in a device. You can use the Maximum Number of LABs settings to specify the number of LABs that
every partition can use. If your design has only one partition, you can also use the Maximum Number of
LABs settings to limit the number of resources that your design can use. This limitation is useful when
you add more logic to your design.
Quartus II Integrated Synthesis
Send Feedback
Altera Corporation
16-28
QII5V1
2014.12.15
To turn on or turn off the Timing-Driven Synthesis logic option, follow these steps:
1. Click Assignments > Settings > Compiler Settings > Advanced Settings (Synthesis).
2. Turn on or turn off Timing-Driven Synthesis.
Note: Altera recommends that you 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.
Related Information
Altera Corporation
QII5V1
2014.12.15
16-29
the software can place in the device. For RAM blocks, resource balancing converts RAM blocks to
different types of RAM blocks if there are not enough blocks of a certain type available in the device;
however, Quartus II Integrated Synthesis does not convert RAM blocks to logic.
Note: The RAM balancing feature does not support Stratix V devices because Stratix V has only M20K
memory blocks.
By default, Quartus II Integrated Synthesis considers the information in the targeted device to identify the
number of available DSP or RAM blocks. However, in incremental compilation, each partition considers
the information in the device independently and consequently assumes that the partition has all the DSP
and RAM blocks in the device available for use, resulting in over allocation of DSP or RAM blocks in your
design, which means that the total number of DSP or RAM blocks used by all the partitions is greater than
the number of DSP or RAM blocks available in the device, leading to a no-fit error during the fitting
process.
Related Information
Quartus II 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
Altera Corporation
16-30
Restructure Multiplexers
QII5V1
2014.12.15
The partition-specific assignment overrides the global assignment, if any. However, each partition that
does not have a partition-specific assignment uses the value set by the global assignment, or the value
derived from the device size if no global assignment exists. This action can also lead to over allocation.
Therefore, Altera recommends that you always set the assignment on each partition individually.
To select the Maximum Number <block type> Memory Blocks option or the Maximum DSP Block
Usage option globally, click Assignments > Settings > Compiler Settings > Advanced Settings
(Synthesis). You can use the Assignment Editor to set this assignment on a partition by selecting the
assignment, and setting it on the root entity of a partition. You can set any positive integer as the value of
this assignment. If you set this assignment on a name other than a partition root, Analysis & Synthesis
gives an error.
Related Information
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 designs fMAX.
Related Information
Altera Corporation
QII5V1
2014.12.15
Synthesis Effort
16-31
Synthesis Effort
The Synthesis Effort logic option specifies the overall synthesis effort level in the Quartus II software.
Related Information
0
1
2
3
4
0
0
0
0
1
0
0
0
1
0
0
0
1
0
0
0
1
0
0
0
0
1
1
1
1
Altera Corporation
16-32
QII5V1
2014.12.15
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:
parameter S0 = 4'b1010, S1 = 4'b0101, ...
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-32
Recommended HDL Coding Styles on page 12-1
For guidelines on how to correctly infer and encode your state machine
Analyzing Designs with Quartus II Netlist Viewers
For more information about the State Machine Viewer
State Machine Processing logic option
For information about the State Machine Processing logic option, including the settings and supported
devices
Manually Specifying Enumerated Types Using the enum_encoding Attribute on page 16-33
For more information about assigning your own state encoding with the User-Encoded setting of the
State Machine Processing option in a VHDL design
Altera Corporation
QII5V1
2014.12.15
16-33
"sequentia
l"
"gray"
"johnson"
"one-hot"
"compact"
"user"
Enumeration Types
The syn_encoding attribute must follow the enumeration type definition, but precede its use.
Related Information
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,
Altera Corporation
16-34
QII5V1
2014.12.15
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
type fruit is (apple, orange, pear, mango);
attribute enum_encoding : string;
attribute enum_encoding of fruit : type is "11 01 10 00";
=
=
=
=
"11"
"01"
"10"
"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 II
software can implement Enumeration Types with the different encoding styles, as shown in this
table.
Table 16-11: enum_encoding Attribute Values
Attribute Value
"default"
"sequentia
l"
"gray"
"johnson"
"one-hot"
Altera Corporation
Enumeration Types
QII5V1
2014.12.15
16-35
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
type fruit is (apple, orange, pear, mango);
attribute enum_encoding : string;
attribute enum_encoding of fruit : type is "gray";
Verilog HDL
Code
reg [2:0] my_fsm /* synthesis syn_encoding = "safe" */
;
VHDL
Altera Corporation
16-36
QII5V1
2014.12.15
Power-Up Level
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-32
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
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.
Altera Corporation
QII5V1
2014.12.15
16-37
Related Information
-- power-up to VCC
// power-up to VCC
reg q;
initial begin q = 1'b1; end
// power-up to VCC
Related Information
Altera Corporation
16-38
QII5V1
2014.12.15
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 II software, or you can set the preserve
attribute in your HDL code. In these examples, the Quartus II software preserves the my_reg register.
Table 16-13: Setting the syn_preserve attribute in HDL Code
Code(11)
HDL
Verilog HDL
Verilog-2001
VHDL
Code
signal my_reg : stdlogic;
attribute preserve : boolean;
attribute preserve of my_reg : signal is true;
Related Information
(11)
The = 1 after the preserve are optional, because the assignment uses a default value of 1 when you specify
the assignment.
Altera Corporation
QII5V1
2014.12.15
16-39
Verilog HD
Verilog-2001 and SystemVer
ilog
VHDL
Code
reg my_reg /* synthesis dont_merge */;
Related Information
Altera Corporation
16-40
QII5V1
2014.12.15
Verilog HD
Verilog-2001 and
SystemVerilog
VHDL
Code
reg my_reg /* synthesis syn_noprune */;
Related Information
Altera Corporation
QII5V1
2014.12.15
16-41
Code
Verilog HD
Verilog-2001
Code
VHDL
Related Information
Code
Verilog HDL
VHD
Altera Corporation
16-42
QII5V1
2014.12.15
Note: For compatibility with third-party synthesis tools, Quartus II 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.
Verilog HD
Verilog-2001 and
SystemVerilog
VHDL
Code
reg my_reg /* synthesis dont_replicate
*/;
Note: For compatibility with third-party synthesis tools, Quartus II 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
Altera Corporation
QII5V1
2014.12.15
Maximum Fan-Out
16-43
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 II 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 II 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.
Table 16-21: Setting the maxfan attribute in HDL Code
HDL
Code
Verilog HDL
Verilog-2001
VHDL
Code
signal clk_gen : stdlogic;
attribute maxfan : signal ;
attribute maxfan of clk_gen : signal is 50;
Related Information
Altera Corporation
16-44
QII5V1
2014.12.15
Controlling Clock Enable Signals with Auto Clock Enable Replacement and
direct_enable
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 registers 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 registers 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.
Table 16-23: Setting the direct_enable in HDL Code
HDL
Verilog HDL
VHDL
Code
wire my_enable /* synthesis direct_enable = 1 */ ;
Verilog-2001 and
SystemVerilog
Code
(* syn_direct_enable *) wire my_enable;
Related Information
Altera Corporation
QII5V1
2014.12.15
16-45
Additionally, you must use IP cores to access certain architecture-specific features, such as RAM, DSP
blocks, and shift registers that provide improved performance compared with basic logic cells.
The Quartus II software provides options to control the inference of certain types of IP cores.
Related Information
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 II 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 II Integrated Synthesis uses the optimization
technique setting, logic and RAM utilization of your design, and timing information from TimingDriven 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.
Quartus II Integrated Synthesis
Send Feedback
Altera Corporation
16-46
QII5V1
2014.12.15
Related Information
Altera Corporation
QII5V1
2014.12.15
16-47
Synthesis tries to select the memories that are not inferred in a way that aims at the smallest increase in
logic and registers.
Resource aware RAM, ROM and shift register inference is controlled by the Resource Aware Inference
for Block RAM option. To disable this option for the entire project, click Assignments > Settings >
Compiler Settings > Advanced Settings (Synthesis).
When you select the Auto setting, resource aware RAM, ROM, and shift register inference use the
resource counts from the largest device.
For designs with multiple partitions, Quartus II Integrated Synthesis considers one partition at a time.
Therefore, for each partition, it assumes that all RAM blocks are available to that partition. If this causes a
no-fit error, you can limit the number of RAM blocks available per partition with the Maximum Number
of M512 Memory Blocks, Maximum Number of M4K/M9K/M20K/M10K Memory Blocks, Maximum
Number of M-RAM/M144K Memory Blocks and Maximum Number of LABs settings in the
Assignment Editor. The balancer also uses these options.
Altera Corporation
16-48
QII5V1
2014.12.15
The ramstyle and romstyle attributes take a single string value. The M512, M4K, M-RAM, MLAB, M9K, M144K,
M20K, and M10K values (as applicable for the target device family) indicate the type of memory block to
use for the inferred RAM or ROM. If you set the attribute to a block type that does not exist in the target
device family, the software generates a warning and ignores the assignment. The logic value indicates
that the Quartus II software implements the RAM or ROM in regular logic rather than dedicated memory
blocks. You can set the attribute on a module or entity, in which case it specifies the default implementa
tion style for all inferred memory blocks in the immediate hierarchy. You can also set the attribute on a
specific signal (VHDL) or variable (Verilog HDL) declaration, in which case it specifies the preferred
implementation style for that specific memory, overriding the default implementation style.
Note: If you specify a logic value, the memory appears as a RAM or ROM block in the RTL Viewer, but
Integrated Synthesis converts the memory to regular logic during synthesis.
In addition to ramstyle and romstyle, the Quartus II software supports the syn_ramstyle attribute
name for compatibility with other synthesis tools.
These tables specify that you must implement all memory in the module or the my_memory_blocks entity
with a specific type of block.
Table 16-25: Applying a romstyle Attribute to a Module Declaration
HDL
Verilog-1995
Code
module my_memory_blocks (...) /* synthesis romstyle = "M4K" */
;
Verilog-2001 and
SystemVerilog
Code
(* ramstyle = "M512" *) module my_memory_blocks (...);
VHDL
Code
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.
Table 16-28: Applying a syn_ramstyle Attribute to a Variable Declaration
HDL
Verilog-1995
Altera Corporation
Code
reg [0:7] my_ram[0:63] /* synthesis syn_ramstyle = "logic" */
;
QII5V1
2014.12.15
16-49
Verilog-2001 and
SystemVerilog
Code
(* romstyle = "logic" *) reg [0:7] my_rom[0:63];
VHDL
Code
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.
Table 16-31: Applying a max_depth Attribute to a Variable Declaration
HDL
Verilog-1995
Code
reg [7:0] mem [127:0] /* synthesis max_depth = 2048 */
Verilog-2001 and
SystemVerilog
Code
(* max_depth = 2048*) reg [7:0] mem [127:0];
VHDL
Code
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-22.
Related Information
Altera Corporation
16-50
QII5V1
2014.12.15
Verilog
VHDL
Code
(* ramstyle = "mlab" *)reg [N-1:0] sr;
Sometimes, you must map an inferred RAM into regular logic cells because the inferred RAM has a readduring-write behavior that the TriMatrix memory blocks in your target device do not support. In other
cases, the Quartus II software must insert extra logic to mimic read-during-write behavior of the HDL
source to increase the area of your design and potentially reduce its performance. In some of these cases,
you can use the attribute to specify that the software can implement the RAM directly in a TriMatrix
memory block without using logic. You can also use the attribute to prevent a warning message for dualclock RAMs in the case that the inferred behavior in the device does not exactly match the read-duringwrite conditions described in the HDL code.
To set the Add Pass-Through Logic to Inferred RAMs logic option with the Quartus II software, click
Assignments > Settings > Compiler Settings > Advanced Settings (Synthesis).
These examples use two addresses and normally require extra logic after the RAM to ensure that the readduring-write conditions in the device match the HDL code. If your design does not require a defined
read-during-write condition, the extra logic is not necessary. With the no_rw_check attribute, Quartus II
Integrated Synthesis does not generate the extra logic.
Altera Corporation
QII5V1
2014.12.15
16-51
Verilog HDL
VHDL
Code
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
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 II 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 II 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
Quartus II Integrated Synthesis
Send Feedback
Altera Corporation
16-52
QII5V1
2014.12.15
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.
Table 16-36: Inferred RAM Using no_rw_check and MLAB Attributes
HDL
Verilog HDL
VHDL
Altera Corporation
Code
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
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;
QII5V1
2014.12.15
16-53
Related Information
Verilog-1995
Verilog-2001
VHDL(12)
Code
reg [7:0] mem[0:255] /* synthesis ram_init_file
= " my_init_file.mif" */;
Related Information
(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 II Integrated Synthesis automatically converts the default value into a .mif for the inferred RAM.
Altera Corporation
16-54
QII5V1
2014.12.15
Note: Specifying a multstyle of "dsp" does not guarantee that the Quartus II 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 II 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 II software to implement all multiplications inside module
my_module in the dedicated multiplication hardware.
Table 16-38: Applying a multstyle Attribute to a Module Declaration
HDL
Verilog-1995
Verilog-2001
Code
module my_module (...) /* synthesis multstyle = "dsp" */;
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 II software to
implement a * b in logic rather than the dedicated hardware.
Table 16-39: Applying a multstyle Attribute to a Variable Declaration
HDL
Verilog-2001
Verilog-1995
Code
wire [8:0] a, b;
(* multstyle = "logic" *) wire [17:0] result;
assign result = a * b; //Multiplication must be
//directly assigned to result
wire [8:0] a, b;
wire [17:0] result /* synthesis multstyle = "logic" */;
assign result = a * b; //Multiplication must be
//directly assigned to result
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.
Altera Corporation
QII5V1
2014.12.15
16-55
Verilog-2001
Code
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 II software to use dedicated hardware, if
possible, for all multiplications inside architecture rtl of entity my_entity.
Table 16-41: Applying a multstyle Attribute to an Architecture
HDL
VHDL
Code
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 II software to
implement a * b in logic rather than the dedicated hardware.
Table 16-42: Applying a multstyle Attribute to a Signal or Variable
HDL
VHDL
Code
signal a, b : unsigned(8 downto 0);
signal result : unsigned(17 downto 0);
attribute multstyle : string;
attribute multstyle of result : signal is "logic";
result <= a * b;
Altera Corporation
16-56
QII5V1
2014.12.15
Parallel Case
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-22).
Using the full_case attribute might cause a simulation mismatch between the Verilog HDL functional
and the post-Quartus II 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-43 when sel is 2'b11 because a functional HDL simulation output behaves as a latch and the
Quartus II simulation output behaves as a dont care value.
Note: Altera recommends making the case statement full in your regular HDL code, instead of using
the full_case attribute.
Table 16-43: A 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 dont care when the sel input is 2'b11.
HDL
Verilog HDL
Code
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-44 in the case header instead of the
comment form as shown in Table 16-43.
Table 16-44: Syntax for the full_case Attribute
HDL
Verilog-2001
Syntax
(* full_case *) case (sel)
Related Information
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
Altera Corporation
QII5V1
2014.12.15
Parallel Case
16-57
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 II software implements the extra logic necessary to satisfy this priority
relationship.
Attaching a parallel_case attribute to a case statement header allows the Quartus II 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 II 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.
Table 16-45: A parallel_case Attribute
HDL
Verilog HDL
Code
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
Altera Corporation
16-58
QII5V1
2014.12.15
Verilog-2001
Syntax
(* parallel_case *) casez (sel)
Verilog HDL
VHDL
VHDL 2008
Code
// synthesis translate_off
parameter tpd = 2;
// Delay for simulation
#tpd;
// synthesis translate_on
-- synthesis translate_off
use std.textio.all;
-- synthesis translate_on
/* synthesis translate_off */
use std.textio.all;
/* synthesis translate_on */
If you want to ignore only a portion of code in Quartus II Integrated Synthesis, you can use the Alteraspecific attribute keyword altera. For example, use the // altera translate_off
and // altera translate_on directives to direct Quartus II Integrated Synthesis to ignore a portion of
code that you intend only for other synthesis tools.
Altera Corporation
QII5V1
2014.12.15
16-59
Ignore translate_off and synthesis_off Directives logic option, click Assignments > Settings >
Compiler Settings > Advanced Settings (Synthesis).
Related Information
Verilog HDL
VHDL
VHDL 2008
Code
// synthesis read_comments_as_HDL on
// my_rom lpm_rom
(.address (address),
//
.data
(data));
// synthesis read_comments_as_HDL off
-- synthesis read_comments_as_HDL on
-- my_rom : entity lpm_rom
-port map (
-address => address,
-data
=> data,
);
-- synthesis read_comments_as_HDL off
/* synthesis read_comments_as_HDL on */
/* my_rom : entity lpm_rom
port map (
address => address,
data => data, ); */
synthesis read_comments_as_HDL off */
Altera Corporation
16-60
QII5V1
2014.12.15
Verilog HDL
Code
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-50 and Table 16-51 show that the Verilog-2001 syntax also accepts the type of statements
instead of the comment form in Table 16-49.
Table 16-50: Verilog-2001 Code: the useioff Attribute
HDL
Verilog-2001
Altera Corporation
Code
(* useioff = 1 *)
(* useioff = 1 *)
input [1:0] a, b;
output [2:0] o;
QII5V1
2014.12.15
16-61
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;
Verilog-1995
Verilog-2001
Code
input my_pin1 /* synthesis chip_pin = "C1" */;
input my_pin2 /* synthesis altera_chip_pin_lc = "@4" */;
Altera Corporation
16-62
QII5V1
2014.12.15
HDL
VHDL
Code
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.
Table 16-53: Applying Chip Pin to a Bus of Pins
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
Verilog-1995
Code
input [2:0]
Verilog-1995
Code
input [0:2]
VHDL
Code
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-56: VHDL and Verilog-2001 Examples: Assigning Pin Location and I/O Standard
HDL
VHDL
Altera Corporation
Code
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.3V LVCMOS""";
QII5V1
2014.12.15
HDL
Verilog-2001
16-63
Code
(* 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 II option or assignment includes a target, source, and section tag, you must use the syntax
in this example for each .qsf variable assignment:
-name <variable> <value>
-from <source> -to <target> -section_id <section>
This example shows the syntax for the full attribute value, including the optional target, source, and
section tags for two different .qsf assignments:
" -name <variable_1> <value_1> [-from <source_1>] [-to <target_1>] [-section_id \
<section_1>]; -name <variable_2> <value_2> [-from <source_2>] [-to <target_2>] \
[-section_id <section_2>] "
Code
"VARIABLE_NAME \"STRING_VALUE\""
"VARIABLE_NAME ""STRING_VALUE"""
To find the .qsf variable name or value corresponding to a specific Quartus II option or assignment, you
can set the option setting or assignment in the Quartus II software, and then make the changes in the .qsf.
Altera Corporation
16-64
QII5V1
2014.12.15
Verilog-1995
Verilog-2001
VHDL
Code
reg my_reg /* synthesis altera_attribute = "-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 II software automatically
moves the attribute to the inferred instance.
Applying altera_attribute to an Entity
These examples use the altera_attribute to disable the Auto Shift Register Replacement synthesis
option for an entity. To apply the Altera Attribute to a VHDL entity, you must set the attribute on its
architecture rather than on the entity itself.
Table 16-59: Applying altera_attribute to an Entity
HDL
Verilog-1995
Verilog-2001
VHDL
Altera Corporation
Code
module my_entity() /* synthesis altera_attribute = "-name AUTO_
SHIFT_REGISTER_RECOGNITION OFF" */;
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;
QII5V1
2014.12.15
16-65
Verilog-1995
Verilog-2001 and
SystemVerilog
VHDL
Code
reg reg2;
reg reg1 /* synthesis altera_attribute = "-name CUT ON -to reg2"
*/;
reg reg2;
(* altera_attribute = "-name CUT ON -to reg2" *) reg reg1;
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 II 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
Altera Corporation
16-66
QII5V1
2014.12.15
Project Navigator
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
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.
Quartus II Messages
The messages that appear during Analysis & Synthesis describe many of the optimizations during the
synthesis stage, and provide information about how the software interprets your design. Altera
recommends checking the messages to analyze Critical Warnings and Warnings, because these messages
can relate to important design problems. Read the Info messages to get more information about how the
software processes your design.
The software groups the messages by following types: Info, Warning, Critical Warning, and Error.
You can specify the type of Analysis & Synthesis messages that you want to view by selecting the Analysis
& Synthesis Message Level option. To specify the display level, click Assignments > Settings > Compiler
Settings > Advanced Settings (Synthesis)
Related Information
QII5V1
2014.12.15
16-67
When processing the HDL code, the Quartus II 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 II 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.
Altera Corporation
16-68
QII5V1
2014.12.15
In addition, the Quartus II software generates additional HDL info messages to inform you that this small
design does not use neither my_reg nor MY_REG:
Info: (10035) Verilog HDL or VHDL information at namecase.v(3): object "my_reg"
declared but not used
Info: (10035) Verilog HDL or VHDL information at namecase.v(4): object "MY_REG"
declared but not used
The Quartus II 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
Purpose
Description
Level1
High-severity messages
only
If you want to view only the HDL messages that identify likely
problems with your design, select Level1. When you select Level1, the
Quartus II software issues a message only if there is an actual
problem with your design.
Level2
High-severity and
medium-severity
messages
Level3
If you want to view all HDL info and warning messages, select Level3.
This level includes extra LINT messages that suggest changes to
improve the style of your HDL code.
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 II 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.
Altera Corporation
QII5V1
2014.12.15
16-69
Verilog HDL
VHDL
Code
// altera message_level level1
or
/* altera message_level level3 */
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.
Verilog HDL
VHDL
Code
// altera message_off 10000
or
/* altera message_off 10000 */
Altera Corporation
16-70
QII5V1
2014.12.15
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:
<instance_name 0>|<instance_name 1>|...|<instance_name n> |<node_name>
Verilog HDL
Altera Corporation
Code
wire dff_in, my_dff_out, clk;
always @ (posedge clk)
my_dff_out <= dff_in;
QII5V1
2014.12.15
HDL Register
VHDL
16-71
Code
signal dff_in, my_dff_out, clk;
process (clk)
begin
if (rising_edge(clk)) then
my_dff_out <= dff_in;
end if;
end process;
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 II 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 II Integrated Synthesis appends ~reg0 to the register name.
Table 16-65: Verilog HDL Register Feeding Output Pin
For example, the Verilog HDL code example in this table generates a register called q~reg0.
HDL
Verilog HDL
Code
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.
Altera Corporation
16-72
QII5V1
2014.12.15
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]
my_fsm. In this example, the three one-hot state registers are my_fsm.state0, my_fsm.state1, and
my_fsm.state2.
Altera Corporation
QII5V1
2014.12.15
16-73
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.
Altera Corporation
16-74
QII5V1
2014.12.15
For example, consider the Verilog HDL code in this example. Quartus II 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 |
always @ (a or
d = a & b;
always @ (a or
e = a ^ b;
end
always @ (a or
f = ~(a | b);
b;
b)
b) begin : my_label
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 II 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
Altera Corporation
QII5V1
2014.12.15
Scripting Support
16-75
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
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 II
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:
set_global_assignment -name <QSF Variable Name> <Value>
To make an instance assignment, use the Tcl command shown in this example:
set_instance_assignment -name <QSF Variable Name> <Value>\ -to <Instance Name>
To set the Synthesis Effort option at the command line, use the --effort option with the quartus_map
executable shown in this example:
quartus_map <Design name> --effort= "auto | fast"
The early timing estimate feature gives you preliminary timing estimates before running a full compila
tion, which results in a quicker iteration time; therefore, you can save significant compilation time to get a
good estimation of the final timing of your design.
If you want to run fast synthesis with the Fitter Early Timing Estimate option, use the command shown
in this example. This command runs the full flow with timing analysis:
quartus_sh --flow early_timing_estimate_with_synthesis <Design name>
Related Information
Tcl Scripting
For more information about Tcl scripting
Quartus II Settings File Manual
For more information about all settings and constraints in the Quartus II software
Command-Line Scripting
For more information about command-line scripting
Quartus II Integrated Synthesis
Send Feedback
Altera Corporation
16-76
QII5V1
2014.12.15
name
name
name
-name
-name
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_1995
VERILOG_2001
SYSTEMVERILOG_2005
VHDL_1987
VHDL_1993
VHDL_2008
For example, to add a Verilog HDL file called my_file.v written in Verilog-1995, use the command shown
in this example:
set_global_assignment name VERILOG_FILE my_file.v HDL_VERSION \ VERILOG_1995
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".
ARCHITECTURE rtl OF my_fsm IS
TYPE count_state is (zero, one, two, three);
ATTRIBUTE syn_encoding : STRING;
ATTRIBUTE syn_encoding OF count_state : TYPE IS "11 01 10 00";
SIGNAL present_state, next_state : count_state;
BEGIN
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 II 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.
Altera Corporation
QII5V1
2014.12.15
Assigning a Pin
16-77
Example 16-8: Verilog-2001 and SystemVerilog Code: Specifying User-Encoded States with the
syn_encoding Attribute
(* syn_encoding = "user" *) reg [1:0] state;
parameter init = 0, last = 3, next = 1, later = 2;
always @ (state) begin
case (state)
init:
out = 2'b01;
next:
out = 2'b10;
later:
out = 2'b11;
last:
out = 2'b00;
endcase
end
Without the syn_encoding attribute, the Quartus II 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-35),
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
Assigning a Pin
To assign a signal to a pin or device location, use the Tcl command shown in this example:
set_location_assignment -to <signal name> <location>
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.
Altera Corporation
16-78
QII5V1
2014.12.15
The <file name> variable is the name used for internally generated netlist files during incremental
compilation. If you create the partition in the Quartus II software, netlist files are named automatically by
the Quartus II 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 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 toplevel 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
Logic options
For more information about the .qsf variable names and applicable values for the settings
Version
Changes
2014.12.15
14.1.0
2014.06.30
14.0.0
Template update.
November
2013
13.1.0
May 2013
13.0.0
June 2012
12.0.0
Altera Corporation
QII5V1
2014.12.15
Date
Version
Changes
November
2011
11.1.0
May 2011
11.0.0
December
2010
10.1.0
16-79
Altera Corporation
16-80
QII5V1
2014.12.15
Date
July 2010
Version
10.0.0
Changes
December
2009
Altera Corporation
9.1.1
QII5V1
2014.12.15
Date
November
2009
Version
9.1.0
16-81
Changes
Related Information
Altera Corporation
17
2014.12.15
QII5V1
Subscribe
Send Feedback
as key design flows, methodologies, and techniques for achieving optimal results in Altera devices. 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.
Design Flow
The following steps describe a basic Quartus II 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 II project and import the following files generated by the Synplify software into the
Quartus II software. Use the following files for placement and routing, and for performance
evaluation:
2014 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
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information,
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
ISO
9001:2008
Registered
17-2
QII5V1
2014.12.15
Design Flow
System
Verilog
(.v)
VHDL
(.vhd)
Verilog
HDL
(.v)
Functional/RTL
Simulation
Synplify Software
TechnologySpecific Netlist
(.vqm/edf)
Forward-Annotated
Project Constraints
(.tcl/.acf)
Synopsys Constraints
format (.scf) File
Quartus II Software
Gate-Level
Functional
Simulation
Post-Synthesis
Simulation Files
(.vho/.vo)
Gate-Level Timing
Simulation
No
Post-Place-and-Route
Simulation File
(.vho/.vo)
Yes
Configuation/Programming
Files (.sof/.pof)
Program/Configure Device
Related Information
Running the Quartus II Software from within the Synplify Software on page 17-4
Synplify Software Generated Files on page 17-5
Design Constraints Support on page 17-6
Altera Corporation
QII5V1
2014.12.15
17-3
Synopsys Website
Tool Setup
Specifying the Quartus II Software Version
You can specify your version of the Quartus II software in Implementation Options in the Synplify
software. This option ensures that the netlist is compatible with the software version and supports the
newest features. Altera recommends using the latest version of the Quartus II software whenever possible.
If your Quartus II software version is newer than the versions available in the Quartus Version list, check
if there is a newer version of the Synplify software available that supports the current Quartus II software
version. Otherwise, select the latest version in the list for the best compatibility.
Note: The Quartus Version list is available only after selecting an Altera device.
Example 17-1: Specifying Quartus II Software Version at the Command Line
set_option -quartus_version <version number>
Altera Corporation
17-4
QII5V1
2014.12.15
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 II software for place-and-route.
You can run the Quartus II software from within the Synplify software or as a stand-alone application.
After you import the design into the Quartus II 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 II 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 II software with a single GUI
for both synthesis and place-and-route operations. NativeLink integration allows you to run the
Quartus II software from within the Synplify software GUI, or to run the Synplify software from within
the Quartus II software GUI.
To run the Quartus II software from within the Synplify software, you must set the QUARTUS_ROOTDIR
environment variable to the Quartus II software installation directory located in <Quartus II system
directory>\altera\ <version number>\quartus. You must set this environment variable to use the Synplify
and Quartus II software together. Synplify also uses this variable to open the Quartus II 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:
Altera Corporation
QII5V1
2014.12.15
17-5
<project_name>.tcl file contains the command to use the Synplify-generated .scf constraints file with the
TimeQuest Timing Analyzer.
Related Information
You can set up the Quartus II software to run the Synplify software for synthesis with NativeLink
integration. This feature allows you to use the Synplify software to quickly synthesize a design as part of a
standard compilation in the Quartus II software. When you use this feature, the Synplify software does
not use any timing constraints or assignments, such as incremental compilation partitions, that you have
set in the Quartus II software.
Note: For best results, Synopsys recommends that you set constraints in the Synplify software and use a
Tcl script to pass these constraints to the Quartus II software, instead of opening the Synplify
software from within the Quartus II software.
To set up the Quartus II software to run the Synplify software, do the following:
1. On the Tools menu, click Options.
2. In the Options dialog box, click EDA Tool Options and specify the path of the Synplify or Synplify
Pro software under Location of Executable.
Running the Synplify software with NativeLink integration is supported on both floating network and
node-locked fixed PC licenses. Both types of licenses support batch mode compilation.
Related Information
About Using the Synplify Software with the Quartus II Software Online Help
.vqm
File Description
.scf(13)
(13)
If your design uses the Classic Timing Analyzer for timing analysis in the Quartus II software versions 10.0
and earlier, the Synplify software generates timing constraints in the Tcl Constraints File (.tcl). If you are
using the Quartus II software versions 10.1 and later, you must use the TimeQuest Timing Analyzer for
timing analysis.
Altera Corporation
17-6
QII5V1
2014.12.15
File Extensions
.tcl
File Description
.srs
Technology-independent RTL netlist file that can be read only by the Synplify
software.
.srm
.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.
.srr(14)
Related Information
(14)
This report file includes performance estimates that are often based on pre-place-and-route information.
Use the fMAX reported by the Quartus II software after place-and-routeit 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 II
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 II software after place-and-route.
Altera Corporation
QII5V1
2014.12.15
Running the Quartus II Software Manually With the SynplifyGenerated Tcl Script
17-7
Running the Quartus II Software Manually With the SynplifyGenerated Tcl Script
You can run the Quartus II 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 II software, on the View menu, point to Utility Windows and click Tcl Console. The
Quartus II Tcl Console opens.
3. At the Tcl Console command prompt, type the following:
source <path>/<project name>_cons.tcl
define_clock
define_input_delay
define_output_delay
define_multicycle_path
define_false_path
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 II software, refer to the Quartus II
Help.
Related Information
Specify clock frequencies for individual clocks in the Synplify software with the define_clock command.
This command is passed to the Quartus II software with the create_clock command.
Altera Corporation
17-8
QII5V1
2014.12.15
Specify input delay and output delay constraints in the Synplify software with the define_input_delay
and define_output_delay commands, respectively. These commands are passed to the Quartus II
software with the set_input_delay and set_output_delay commands.
Multicycle Path
Specify a multicycle path constraint in the Synplify software with the define_multicycle_path
command. This command is passed to the Quartus II 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 II software with the set_false_path command.
Altera Corporation
QII5V1
2014.12.15
17-9
Synplify Premier software forward-annotates the design netlist to the Quartus II 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 II software.
The physical location annotation file is called <design name>_plc.tcl. If you open the Quartus II software
from the Synplify Premier software user interface, the Quartus II 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.
Passing TimeQuest SDC Timing Constraints to the Quartus II Software on page 17-7
Exporting Designs to the Quartus II Software Using NativeLink Integration on page 17-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.
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,
Synopsys Synplify Support
Send Feedback
Altera Corporation
17-10
QII5V1
2014.12.15
duty cycle, and other settings. Assigning individual clock settings, rather than over-constraining the global
frequency, helps the Quartus II software and the Synplify software achieve the fastest clock frequency for
the overall design. The define_clock attribute assigns clock constraints.
The Synplify software can perform timing analysis on unrelated clock domains. Each clock group is a
different clock domain and is treated as unrelated to the clocks in all other clock groups. All clocks in a
single clock group are assumed to be related, and the Synplify software automatically calculates the
relationship between the clocks. You can assign clocks to a new clock group or put related clocks in the
same clock group with the Clocks tab in the SCOPE window, or with the define_clock attribute.
Specify the input and output delays for the ports of a design in the Input/Output tab of the SCOPE
window, or with the define_input_delay and define_output_delay attributes. The Synplify software
does not allow you to assign the tCO and tSU values directly to inputs and outputs. However, a tCO value
can be inferred by setting an external output delay; a tSU value can be inferred by setting an external input
delay.
Relationship Between tCO and the Output Delay
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 II 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
analysis, optimization of unreachable states, and minimization of transition logic. Implementation is
based on the number of states, regardless of the coding style in the HDL code.
Altera Corporation
QII5V1
2014.12.15
17-11
If the FSM Compiler is turned off, the compiler does not optimize logic as state machines. The state
machines are implemented as HDL code. Thus, if the coding style for a state machine is sequential, the
implementation is also sequential.
Use the syn_state_machine compiler directive to specify or prevent a state machine from being extracted
and optimized. To override the default encoding of the FSM Compiler, use the syn_encoding directive.
Table 17-2: syn_encoding Directive Values
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.
The Synplify Pro and Premier software use the FSM Explorer to explore different encoding styles for a
state machine automatically, and then implement the best encoding based on the overall design
constraints. The FSM Explorer uses the FSM Compiler to identify and extract state machines from a
design. However, unlike the FSM Compiler, which chooses the encoding style based on the number of
states, the FSM Explorer attempts several different encoding styles before choosing a specific one. The
trade-off is that the compilation requires more time to analyze the state machine, but finds an optimal
encoding scheme for the state machine.
Altera Corporation
17-12
QII5V1
2014.12.15
The Synplify Pro and Premier software can retime a design, which can improve the timing performance of
sequential circuits by moving registers (register balancing) across combinational elements. Be aware that
retimed registers incur name changes. You can retime your design from Implementation Options or you
can use the syn_allow_retiming attribute.
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 II 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 II 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 for incremental compilation.
Altera Corporation
QII5V1
2014.12.15
17-13
By default, the Synplify software generates a hierarchical .vqm file. To flatten the file, set the
syn_netlist_hierarchy attribute to 0.
Related Information
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
The syn_direct_enable data type is Boolean. A value of 1 or true enables net assignment to the clockenable pin. The following is the syntax for Verilog HDL:
object /* synthesis syn_direct_enable = 1 */ ;
Altera Corporation
17-14
QII5V1
2014.12.15
I/O Standard
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.
The Synplify SDC syntax for the define_io_standard constraint, in which the delay_type must be
either input_delay or output_delay.
Example 17-4: define_io_standard Constraint
define_io_standard [disable|enable] {<objectName>} -delay_type \
[input_delay|output_delay] <columnTclName>{<value>}
[<columnTclName>{<value>}...]
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 II 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.
Example 17-5: Making Location Assignments in VHDL
ENTITY sample (data_in : IN STD_LOGIC_VECTOR (3 DOWNTO 0);
data_out: OUT STD_LOGIC_VECTOR (3 DOWNTO 0));
ATTRIBUTE altera_chip_pin_lc : STRING;
ATTRIBUTE altera_chip_pin_lc OF data_out : SIGNAL IS "14, 5, 16, 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 Corporation
QII5V1
2014.12.15
altera_io_opendrain
17-15
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.
Altera Corporation
17-16
QII5V1
2014.12.15
Related Information
If you turn on the <output file>_inst.v option on the Parameter Editor, the IP Catalog generates a Verilog
HDL instantiation template file for use in your Synplify design. The instantiation template file, <output
file>_inst.v, helps to instantiate the IP core variation wrapper file, <output file>.v, in your top-level design.
Include the IP core variation wrapper file <output file>.v in your Synplify project. The Synplify software
includes the IP core information in the output .vqm netlist file. You do not need to include the generated
IP core variation wrapper file in your Quartus II project.
If you turn on the <output file>.cmp and <output file>_inst.vhd options on the Parameter Editor, the IP
catalog generates a VHDL component declaration file and a VHDL instantiation template file for use in
your Synplify design. These files can help you instantiate the IP core variation wrapper file, <output
file>.vhd, in your top-level design. Include the <output file>.vhd in your Synplify project. The Synplify
software includes the IP core information in the output .vqm netlist file. You do not need to include the
generated IP core variation wrapper file in your Quartus II project.
By default, the Synplify software automatically opens the Quartus II software in the background to
generate a resource and timing estimation netlist for IP cores.
You might want to change this behavior to reduce run times in the Synplify software, because generating
the netlist files can take several minutes for large designs, or if the Synplify software cannot access your
Quartus II software installation to generate the files. Changing this behavior might speed up the compila
tion time in the Synplify software, but the Quality of Results (QoR) might be reduced.
The Synplify software directs the Quartus II software to generate information in two ways:
Some IP cores provide a clear box modelthe Synplify software fully synthesizes this model and
includes the device architecture-specific primitives in the output .vqm netlist file.
Other IP cores provide a grey box modelthe Synplify software reads the resource information, but
the netlist does not contain all the logic functionality.
Note: You need to turn on Generate netlist when using the grey box model. For more information,
see the Quartus II online help.
For these IP cores, the Synplify software uses the logic information for resource and timing estimation
and optimization, and then instantiates the IP core in the output .vqm netlist file so the Quartus II
software can implement the appropriate device primitives. By default, the Synplify software uses the clear
box model when available, and otherwise uses the grey box model.
Related Information
Including Files for Quartus II Placement and Routing Only on page 17-19
Synplify Synthesis Techniques with the Quartus II 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
Altera Corporation
QII5V1
2014.12.15
17-17
Many Altera IP cores include a resource and timing estimation netlist that the Synplify software uses to
report more accurate resource utilization and timing performance estimates, and leverage timing-driven
optimization rather than a black box function.
To create this netlist file, perform the following steps:
1.
2.
3.
4.
Including Files for Quartus II Placement and Routing Only on page 17-19
Use the syn_black_box compiler directive to declare a module as a black box. The top-level design files
must contain the IP port-mapping and a hollow-body module declaration. Apply the syn_black_box
directive to the module declaration in the top-level file or a separate file included in the project so that the
Synplify software recognizes the module is a black box. The software compiles successfully without this
directive, but reports an additional warning message. Using this directive allows you to add other
directives.
The example shows a top-level file that instantiates my_verilogIP.v, which is a simple customized
variation generated by the IP Catalog.
Example 17-6: Sample Top-Level Verilog HDL Code with Black Box Instantiation of IP
module top (clk, count);
input clk;
output [7:0] count;
my_verilogIP verilogIP_inst (.clock (clk), .q (count));
endmodule
// 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;
output [7:0] q;
endmodule
Use the syn_black_box compiler directive to declare a component as a black box. The top-level design
files must contain the IP core variation component declaration and port-mapping. Apply the
Altera Corporation
17-18
QII5V1
2014.12.15
successfully without this directive, but reports an additional warning message. Using this directive allows
you to add other directives.
The example shows a top-level file that instantiates my_vhdlIP.vhd, which is a simplified customized
variation generated by the IP Catalog.
Example 17-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;
ARCHITECTURE rtl OF top IS
COMPONENT my_vhdlIP
PORT (
clock: IN STD_LOGIC ;
q: OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
);
end COMPONENT;
attribute syn_black_box : boolean;
attribute syn_black_box of my_vhdlIP: component is true;
BEGIN
vhdlIP_inst : my_vhdlIP PORT MAP (
clock => clk,
q => count
);
END rtl;
Instantiating IP as a black box does not provide visibility into the IP for the synthesis tool. Thus, it does
not take full advantage of the synthesis tool's timing-driven optimization. For better timing optimization,
especially if the black box does not have registered inputs and outputs, add timing models to black boxes
by adding the syn_tpd, syn_tsu, and syn_tco attributes.
Altera Corporation
QII5V1
2014.12.15
17-19
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_resourcesSpecifies the resources used in a particular black box.
black_box_pad_pinPrevents mapping to I/O cells.
black_box_tri_pinIndicates a tri-stated signal.
For more information about applying these attributes, refer to the Synopsys FPGA Synthesis
Reference Manual.
-verilog
-verilog
-verilog
-verilog
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.
Altera Corporation
17-20
QII5V1
2014.12.15
Resource Balancing
Figure 17-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.
Controlling the DSP Block Inference
You can implement multipliers in DSP blocks or in logic in Altera devices that contain DSP blocks. You
can control this implementation through attribute settings in the Synplify software.
Signal Level Attribute
You can control the implementation of individual multipliers by using the syn_multstyle attribute as
shown in the following Verilog HDL code (where <signal_name> is the name of the signal ):
<signal_name> /* synthesis syn_multstyle = "logic" */;
Altera Corporation
QII5V1
2014.12.15
17-21
Value
lpm_mult
logic
syn_multstyle
block_mult
Description
Example 17-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" */;
assign temp = a*b;
assign r = en ? temp : c;
endmodule
Example 17-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;
entity onereg is port (
r : out std_logic_vector (15 downto 0);
en : in std_logic;
a : in std_logic_vector (7 downto 0);
b : in std_logic_vector (7 downto 0);
c : in std_logic_vector (15 downto 0);
);
end onereg;
architecture beh of onereg is
signal temp : std_logic_vector (15 downto 0);
attribute syn_multstyle : string;
attribute syn_multstyle of temp : signal is "logic";
begin
temp <= a * b;
r <= temp when en='1' else c;
end beh;
Altera Corporation
17-22
QII5V1
2014.12.15
Inferring RAM
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:
Altera Corporation
QII5V1
2014.12.15
RAM Initialization
17-23
END PROCESS;
END ram_infer;
Example 17-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;
ARCHITECTURE ram_infer OF dualport_ram IS
TYPE Mem_Type IS ARRAY (127 DOWNTO 0) OF STD_LOGIC_VECTOR (7 DOWNTO 0);
SIGNAL mem : Mem_Type;
SIGNAL addr_reg : STD_LOGIC_VECTOR (6 DOWNTO 0);
SIGNAL tmp_out : STD_LOGIC_VECTOR (7 DOWNTO 0); --output register
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 (technologyindependent 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 17-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)
Altera Corporation
17-24
QII5V1
2014.12.15
Inferring ROM
mem[waddr] <= data;
end
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.
The Synplify software infers shift registers for sequential shift components so that they can be placed in
dedicated memory blocks in supported device architectures using the ALTSHIFT_TAPS IP core.
If necessary, set the implementation style with the syn_srlstyle attribute. If you do not want the
components automatically mapped to shift registers, set the value to registers. You can set the value
globally, or on individual modules or registers.
For some designs, turning off shift register inference improves the design performance.
Altera Corporation
QII5V1
2014.12.15
17-25
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 II 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
Altera Corporation
17-26
QII5V1
2014.12.15
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 II projects to place-and-route the design.
Related Information
Best Practices for Incremental Compilation Partitions and Floorplan Assignments Documentation
on page 14-1
The MultiPoint flow lets you segment a design into smaller synthesis units, called Compile Points. The
synthesis software treats each Compile Point as a partition for incremental mapping, which allows you to
isolate and work on each Compile Point module as independent segments of the larger design without
impacting other design modules. A design can have any number of Compile Points, and Compile Points
can be nested. The top-level module is always treated as a Compile Point.
Compile Points are optimized in isolation from their parent, which can be another Compile Point or a
top-level design. Each block created with a Compile Point is unaffected by critical paths or constraints on
its parent or other blocks. A Compile Point is independent, with its own individual constraints. During
synthesis, any Compile Points that have not yet been synthesized are synthesized before the top level.
Nested Compile Points are synthesized before the parent Compile Points in which they are contained.
When you apply the appropriate setting for the Compile Point, a separate netlist is created for that
Compile Point, isolating that logic from any other logic in the design.
The figure shows an example of a design hierarchy that is split into multiple partitions. The top-level
block of each partition can be synthesized as a separate Compile Point.
Altera Corporation
QII5V1
2014.12.15
17-27
Partition B
F
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.
Defining Compile Points With .tcl or .sdc Files
To set Compile Points with a .tcl or .sdc file, use the define_compile_point command.
Example 17-16: The define_compile_point Command
define_compile_point [-disable] {<objname>} -type {locked, partition}
<objname> represents any module in the design. The Compile Point type {locked, partition}
indicates that the Compile Point represents a partition for the Quartus II 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>}
To ensure that changes to a Compile Point do not affect the top-level parent module, turn off the Update
Compile Point Timing Data option in the Implementation Options dialog box. If this option is turned
on, updates to a child module can impact the top-level module.
Altera Corporation
17-28
QII5V1
2014.12.15
Creating a Quartus II Project for Compile Points and Multiple .vqm Files
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 II
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 II
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 II 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 II 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 II project.
Depending on your design methodology, you can create one Quartus II project for all netlists or a separate
Quartus II 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 II 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 II software, create
separate Quartus II 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 II Software Manually With the Synplify-Generated Tcl Script on page 17-7
Creating a Single Quartus II 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 II 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.
Altera Corporation
QII5V1
2014.12.15
17-29
Figure 17-4: Design Flow Using Multiple .vqm Files with One Quartus II Project
Quartus II Project
a.vqm
Use the top-level Tcl file a.tcl
to import Synplify Pro assignments.
b.vqm
f.vqm
a.vqm
Quartus II Project
Quartus II Project
b.vqm
f.vqm
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.
Altera Corporation
17-30
QII5V1
2014.12.15
To create multiple .vqm files manually in the Synplify software, create a separate project for each lowerlevel module and top-level design that you want to maintain as a separate .vqm file for an incremental
compilation partition. Implement black box instantiations of lower-level partitions in your top-level
project.
Partition B
F
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.
Creating Multiple .vqm Files for this Design
To create multiple .vqm files for this design, follow these steps:
1. Generate a .vqm file for module B. Use B.v/.vhd, D.v/.vhd, and E.v/.vhd as the source files.
2. Generate a .vqm file for module F. Use F.v/.vhd as the source files.
3. Generate a top-level .vqm file for module A. Use A.v/.vhd and C.v/.vhd as the source files. Ensure that
you use black box modules B and F, which were optimized separately in the previous steps.
Creating Black Boxes in Verilog HDL
Any design block that is not defined in the project, or included in the list of files to be read for a project, is
treated as a black box by the software. Use the syn_black_box attribute to indicate that you intend to
create a black box for the module. In Verilog HDL, you must provide an empty module declaration for a
module that is treated as a black box.
The example shows the A.v top-level file. Follow the same procedure for lower-level files that also contain
a black box for any module beneath the current level hierarchy.
Example 17-17: Verilog HDL Black Box for Top-Level File A.v
module A (data_in, clk, e, ld, data_out);
input data_in, clk, e, ld;
Altera Corporation
QII5V1
2014.12.15
17-31
Altera Corporation
17-32
QII5V1
2014.12.15
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 II software.
The Synplify software creates a .tcl file for each .vqm file that provides the Quartus II software with the
appropriate constraints and information to set up a project.
Depending on your design methodology, you can create one Quartus II project for all netlists or a separate
Quartus II 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 II 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 where each partition must be optimized separately, such as for third-party IP delivery.
To perform this design flow in the Quartus II software, create separate Quartus II projects, export each
design partition and incorporate it into a top-level design using the incremental compilation features to
maintain the results.
Related Information
Running the Quartus II Software Manually With the Synplify-Generated Tcl Script on page 17-7
QII5V1
2014.12.15
17-33
Figure 17-7: Design Flow Using Multiple .vqm Files with One Quartus II Project
Quartus II Project
a.vqm
Use a.tcl to import top-level
Synplify Pro assignments.
Enter any lower-level
assignments manually.
b.vqm
f.vqm
a.vqm
Quartus II Project
Quartus II Project
b.vqm
f.vqm
Altera Corporation
17-34
QII5V1
2014.12.15
deletes partition assignments in the Quartus II software for Compile Points that you create, change, or
delete in the Synplify software. However, if you create, change, or delete a partition in the Quartus II
software, the Synplify software does not change your Compile Point settings. Make any corresponding
change in your Synplify project to ensure that you create the correct .vqm files.
Note: If you use the NativeLink integration feature, the Synplify software does not use any information
about design partition assignments that you have set in the Quartus II software.
If you create netlist files with multiple Synplify projects, or if you do not use the Synplify Pro or Premiergenerated .tcl files to update constraints in your Quartus II project, you must ensure that your
Synplify .vqm netlists align with your Quartus II partition settings.
After you have set up your Quartus II project with .vqm netlist files as separate design partitions, set the
appropriate Quartus II options to preserve your compilation results. On the Assignments menu, click
Design Partitions Window. Change the Netlist Type to Post-Fit to preserve the previous compilations
post-fit placement results. If you do not make these settings, the Quartus II software does not reuse the
placement or routing results from the previous compilation.
You can take advantage of incremental compilation with your Synplify design to reduce compilation time
in the Quartus II software and preserve the results for unchanged design blocks.
Related Information
Using the Quartus II Software to Run the Synplify Software on page 17-5
Quartus II Incremental Compilation for Hierarchical and Team-Based Design Documentation on
page 3-1
Version
Changes
2014.12.15
14.1.0
November 2013
13.1.0
June 2012
12.0.0
November 2011
10.1.1
Template update.
Altera Corporation
QII5V1
2014.12.15
Date
Version
17-35
Changes
December 2010
10.1.0
July 2010
10.0.0
November 2009
9.1.0
March 2009
9.0.0
Altera Corporation
17-36
QII5V1
2014.12.15
Date
November 2008
Altera Corporation
Version
8.1.0
Changes
QII5V1
2014.12.15
Date
May 2008
Version
8.0.0
17-37
Changes
Related Information
Altera Corporation
18
2014.06.30
QII5V1
Subscribe
Send Feedback
Plus Synthesis software in the Quartus II 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 II software. 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
Design Flow
The following steps describe a basic Quartus II 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.
5. Synthesize the project in the Precision Synthesis software.
6. Create a Quartus II project and import the following files generated by the Precision Synthesis
software into the Quartus II project:
2014 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
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information,
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
ISO
9001:2008
Registered
18-2
QII5V1
2014.06.30
Design Flow
Altera Corporation
QII5V1
2014.06.30
Timing Optimization
18-3
Figure 18-1: Design Flow Using the Precision Synthesis Software and Quartus II Software
Design Specifications
System
V erilog
VHDL
V erilog HDL
Functional/RTL
Si m ulation
Constraints and
Settings
Precision Synthesis
Fo r ward-Annotated Project
Configuration
(.tcl /.acf )
TechnologySpecific Netlist
(.edf )
Gate-Level
Functional
Si m ulation
Constraints and
Settings
Post-Synthesis
Simulation Files
(.vho /.vo )
Quartus II Software
Gate-Level Timing
Si m ulation
No
Post Place-and-Route
Simulation File
(.vho /.vo )
Requirements
Satisfied?
Yes
Configuration/Programming Files
(.sof /.pof )
Program/Configure Device
Related Information
Running the Quartus II Software from within the Precision Synthesis Software on page 18-9
Using the Quartus II Software to Run the Precision Synthesis Software on page 18-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 II software. Repeat the process until the area and timing
requirements are met.
Mentor Graphics Precision Synthesis Support
Send Feedback
Altera Corporation
18-4
QII5V1
2014.06.30
You can use other options and techniques in the Quartus II 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 II 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
File Description
.psp
.xdb
.rep(15)
.vqm(16)
(15)
(16)
The timing report file includes performance estimates that are based on pre-place-and-route information.
Use the fMAX reported by the Quartus II 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 II software after placeand-route for final resource utilization results.
The Precision Synthesis software-generated VQM file is supported by the Quartus II software version 10.1
and later.
Altera Corporation
QII5V1
2014.06.30
File Extension
18-5
File Description
.tcl
.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
Exporting Designs to the Quartus II Software Using NativeLink Integration on page 18-9
Synthesizing the Design and Evaluating the Results on page 18-8
Altera Corporation
18-6
QII5V1
2014.06.30
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 II software, placement constraints are written in a .tcl file and timing constraints for the
TimeQuest Timing Analyzer are written in the Quartus II .sdc file.
For details about the syntax of Synopsys Design Constraint commands, refer to the Precision RTL
Synthesis Users 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.
Altera Corporation
QII5V1
2014.06.30
18-7
Pin
number
I/O
standard
Drive
strength
set_attribute -name DRIVE -value "<drive strength in mA>" -port <port name>
Slew rate
You also can use synthesis attributes or pragmas in your HDL code to make these assignments.
Example 18-1: Verilog HDL Pin Assignment
//pragma attribute clk pin_number P10;
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.
Altera Corporation
18-8
QII5V1
2014.06.30
want the software to add I/O pads to all I/O pins in the design. The Quartus II 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.
If you are compiling a subdesign as a separate project, I/O pins cannot be primary inputs or outputs of the
device; therefore, the I/O pins should not have an I/O pad associated with them.
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
Users 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.
Altera Corporation
QII5V1
2014.06.30
18-9
Running the Quartus II 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 II 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 II 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 II executables, such as analysis and synthesis
(quartus_map), Fitter (quartus_fit), and the TimeQuest Timing Analyzer (quartus_sta) for improved
runtime and memory utilization during place and route. This flow is referred to as the Quartus II
Modular flow option in the Precision Synthesis software. By default, the Precision Synthesis software
generates a Quartus II Project Configuration File (.tcl file) for current device families. Timing constraints
Mentor Graphics Precision Synthesis Support
Send Feedback
Altera Corporation
18-10
QII5V1
2014.06.30
that you set during synthesis are exported to the Quartus II place-and-route constraints file
<project name>_pnr_constraints.sdc.
After you compile the design in the Quartus II software from within the Precision Synthesis software, you
can invoke the Quartus II GUI manually and then open the project using the generated Quartus II project
file. You can view reports, run analysis tools, specify options, and run the various processing flows
available in the Quartus II software.
For more information about running the Quartus II software from within the Precision Synthesis
software, refer to the Altera Quartus II 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 II software.
Exporting Designs to the Quartus II Software Using NativeLink Integration on page 18-9
Using the NativeLink Feature with Other EDA Tools online help
Altera Corporation
create_clock
set_input_delay
set_output_delay
set_max_delay
QII5V1
2014.06.30
create_clock
18-11
set_min_delay
set_false_path
set_multicycle_path
create_clock
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 II software.
The Quartus II 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.
Altera Corporation
18-12
QII5V1
2014.06.30
set_output_delay
set_output_delay
This port-specific output delay constraint is specified in the Precision Synthesis software.
Example 18-5: Using the set_output_delay Constraint
set_output_delay {<delay_value> <port_pin_list>} \
-clock <clock_name> -rise -fall -add_delay
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-tonode, 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.
Altera Corporation
QII5V1
2014.06.30
set_false_path
18-13
set_false_path
The false path constraint is specified in the Precision Synthesis software.
Example 18-8: Using the set_false_path Constraint
set_false_path -to <to_node_list> -from <from_node_list> -reset_path
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 II 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 II software with a through path specification.
set_multicycle_path
The multicycle path constraint is specified in the Precision Synthesis software.
Example 18-9: Using the set_multicycle_path Constraint
set_multicycle_path <multiplier_value> [-start] [-end] \
-to <to_node_list> -from <from_node_list> -reset_path
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 II 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 II software automati
cally expands all wildcards.
Any multicycle path setting in Precision Synthesis software can be mapped to a setting in the
Quartus II software with a -through specification.
Altera Corporation
18-14
QII5V1
2014.06.30
QII5V1
2014.06.30
18-15
Altera Corporation
18-16
QII5V1
2014.06.30
Altera Corporation
QII5V1
2014.06.30
Multipliers
18-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.
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.
To set the Use Dedicated Multiplier option in the Precision Synthesis GUI, compile the design, and
then in the Design Hierarchy browser, right-click the operator for the desired multiplier and click Use
Dedicated Multiplier.
To control the implementation of a multiplier in your HDL code, use the dedicated_mult attribute with
the appropriate value as shown in the examples below.
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
Mentor Graphics Precision Synthesis Support
Send Feedback
Altera Corporation
18-18
QII5V1
2014.06.30
implementation, you should preserve the signal by setting the preserve_signal attribute to
TRUE.
The Precision Synthesis software also allows you to control the device resources used to implement
multiply-accumulators or multiply-adders in your project or in a particular module.
Altera Corporation
QII5V1
2014.06.30
18-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
By default, the Precision Synthesis software infers the ALTMULT_ADD or ALTMULT_ACCUM IP cores
appropriately in your design. These IP cores allow the Quartus II software to select either logic or DSP
blocks, depending on the device utilization and the size of the function.
Description
TRUE
FALSE
To control inference, use the extract_mac attribute with the appropriate value from the examples below
in your HDL code.
Example 18-18: Setting the extract_mac Attribute in Verilog HDL
//synthesis attribute <module name> extract_mac <value>
Altera Corporation
18-20
QII5V1
2014.06.30
To control the implementation of the multiplier portion of a multiply-accumulator or multiplyadder, you must use the dedicated_mult attribute.
You can use the extract_mac, dedicated_mult, and preserve_signal attributes (in Verilog
HDL and VHDL) to implement the given DSP function in logic in the Quartus II software.
Example 18-20: Using extract_mac, dedicated_mult, and preserve_signal in Verilog HDL
module unsig_altmult_accuml (dataout, dataa, datab, clk, aclr, clken);
input [7:0} dataa, datab;
input clk, aclr, clken;
output [31:0] dataout;
reg
wire
wire
[31:0] dataout;
[15:0] multa;
[31:0] adder_out;
Altera Corporation
QII5V1
2014.06.30
18-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;
The Precision Synthesis software detects memory structures in HDL code and converts them to an
operator that infers an ALTSYNCRAM or LPM_RAM_DP IP cores, depending on the device family. The
software then places these functions in memory blocks.
The software supports inference for these functions only if the target device family has dedicated memory
blocks.
For more information about inferring RAM and ROM IP cores in HDL code, refer to the Precision
Synthesis Style Guide.
Related Information
Altera Corporation
18-22
QII5V1
2014.06.30
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 II 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 II
software, and set up the Quartus II project to use incremental compilation.
7. Compile your Quartus II project.
8. If you want, you can change the Quartus II 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.
Partitions are set using the HDL incr_partition attribute. The Precision Synthesis software creates or
deletes partitions by reading this attribute during compilation iterations. The attribute can be attached to
either the design unit definition or an instance.
To delete partitions, you can remove the attribute or set the attribute value to false.
Note: The Precision Synthesis software ignores partitions set in a black box.
Altera Corporation
QII5V1
2014.06.30
18-23
Altera Corporation
18-24
QII5V1
2014.06.30
Note: In a standard Quartus II incremental compilation flow, Precision Synthesis software constraints
made on lower-level modules are not passed to the Quartus II software. Ensure that appropriate
constraints are made in the top-level Precision Synthesis project, or in the Quartus II project.
D
Partition B
F
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 II 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.
Any design block that is not defined in the project or included in the list of files to be read for a project is
treated as a black box by the software. In Verilog HDL, you must provide an empty module declaration
for any module that is treated as a black box.
Altera Corporation
QII5V1
2014.06.30
18-25
A black box for the top-level file A.v is shown in the following example. Provide an empty module
declaration for any lower-level files, which also contain a black box for any module beneath the current
level of hierarchy.
Example 18-24: Verilog HDL Black Box for Top-Level File A.v
module A (data_in, clk, e, ld, data_out);
input data_in, clk, e, ld;
output [15:0] data_out;
wire [15:0] cnt_out;
B U1 (.data_in (data_in),.clk(clk), .ld (ld),.data_out(cnt_out));
F U2 (.d(cnt_out), .clk(clk), .e(e), .q(data_out));
// Any other code in A.v goes here.
endmodule
//Empty Module Declarations of Sub-Blocks B and F follow here.
// These module declarations (including ports) are required for black
boxes.
module B (data_in, clk, ld, data_out);
input data_in, clk, ld;
output [15:0] data_out;
endmodule
module F (d, clk, e, q);
input [15:0] d;
input clk, e;
output [15:0] q;
endmodule
Any design block that is not defined in the project or included in the list of files to be read for a project is
treated as a black box by the software. In VHDL, you must provide a component declaration for the black
box.
A black box for the top-level file A.vhd is shown in the example below. Provide a component declaration
for any lower-level files that also contain a black box or for any block beneath the current level of
hierarchy.
Example 18-25: VHDL Black Box for Top-Level File A.vhd
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;
Mentor Graphics Precision Synthesis Support
Send Feedback
Altera Corporation
18-26
QII5V1
2014.06.30
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 II software.
Running the Quartus II Software Manually Using the Precision Synthesis-Generated Tcl Script on
page 18-10
Use the <top-level project>.tcl file generated for the top-level partition to create your Quartus II project
and import all the netlists into this one Quartus II project for an incremental compilation flow. You can
optimize all partitions within the single Quartus II 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 II software in the toplevel .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 II
project.
Altera Corporation
QII5V1
2014.06.30
18-27
Use the .tcl files generated by the Precision Synthesis software for each Precision Synthesis software
implementation or project to generate multiple Quartus II projects, one for each partition in the design.
Each designer in the project can optimize their block separately in the Quartus II software and export the
placement of their blocks using incremental compilation. Designers should create a LogicLock region to
provide a floorplan location assignment for each block; the top-level designer should then import all the
blocks and assignments into the top-level project.
Best Practices for Incremental Compilation Partitions and Floorplan Assignments documentation
on page 14-1
Version
Changes
June 2014
14.0.0
Dita conversion.
Removed obsolete devices.
Replaced Megafunction,
MegaWizard, and IP
Toolbench content with IP
Catalog and Parameter Editor
content.
June 2012
12.0.0
November 2011
10.1.1
Template update.
Minor editorial changes.
Altera Corporation
18-28
QII5V1
2014.06.30
Date
Version
Changes
December 2010
10.1.0
July 2010
10.0.0
November 2009
9.1.0
March 2009
9.0.0
Altera Corporation
QII5V1
2014.06.30
Date
Version
18-29
Changes
November 2008
8.1.0
May 2008
8.0.0
For previous versions of the Quartus II Handbook, refer to the Quartus II Handbook Archive.
Related Information
Altera Corporation
19
2014.06.30
QII5V1
Subscribe
Send Feedback
This chapter describes how you can use the Quartus II 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 todays 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 II
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.
This chapter contains the following sections:
Related Information
When to Use the Netlist Viewers: Analyzing Design Problems on page 19-1
Introduction to the User Interface on page 19-5
Quartus II Design Flow with the Netlist Viewers on page 19-2
State Machine Viewer Overview on page 19-4
RTL Viewer Overview on page 19-3
Technology Map Viewer Overview on page 19-5
Filtering in the Schematic View on page 19-16
Probing to a Source Design File and Other Quartus II Windows on page 19-22
Probing to the Netlist Viewers from Other Quartus II Windows on page 19-22
Viewing a Timing Path on page 19-23
2014 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
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information,
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
ISO
9001:2008
Registered
19-2
QII5V1
2014.06.30
If you see unexpected behavior during verification, use the RTL Viewer to trace through the netlist and
ensure that the connections and logic in your design are as expected. You can also view state machine
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.
You can use the RTL Viewer, State Machine Viewer, and Technology Map Viewer in many other ways
throughout the design, debug, and optimization stages. This chapter shows you how to use the various
features of the Netlist Viewers to increase your productivity when analyzing a design.
Related Information
Altera Corporation
QII5V1
2014.06.30
19-3
Figure 19-1: Quartus II Design Flow Including the RTL Viewer and Technology Map Viewer
This figure shows how Netlist Viewers fit into the basic Quartus II design flow.
HDL or Schematic
Design Files
VQM or EDIF
Netlist Files
RTL Viewer
Synthesis
(Logic Synthesis and
Technology Mapping)
Fitter
(Place and Route)
Timing Analyzer
Analysis and
Elaboration
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 successfully compiled version of the design files.
If you receive an error during compilation and you have not yet successfully run the appropriate compila
tion stage for your project, the Netlist Viewer cannot be displayed; in this case, the Quartus II 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.
Altera Corporation
19-4
QII5V1
2014.06.30
You can view results after Analysis and Elaboration when your design uses any supported Quartus II
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 Quartus II RTL Viewer displays a schematic view of the design netlist after Analysis and Elaboration
or netlist extraction is performed by the Quartus II software, but before technology mapping and any
synthesis or fitter optimizations. This view is not the final design structure because optimizations have not
yet occurred. This view most closely represents your original source design. If you synthesized your
design with the Quartus II integrated synthesis, this view shows how the Quartus II software interpreted
your design files. If you use a third-party synthesis tool, this view shows the netlist written by your
synthesis tool.
When displaying your design, the RTL Viewer optimizes the netlist to maximize readability in the
following ways:
Logic with no fan-out (its outputs are unconnected) and logic with no fan-in (its inputs are
unconnected) are removed from the display.
Default connections such as VCC and GND are not shown.
Pins, nets, wires, module ports, and certain logic are grouped into buses where appropriate.
Constant bus connections are grouped.
Values are displayed in hexadecimal format.
NOT gates are converted to bubble inversion symbols in the schematic.
Chains of equivalent combinational gates are merged into 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 II project, first analyze the design to generate an RTL netlist. To
analyze the design and generate an RTL netlist, on the Processing menu, point to Start and click Start
Analysis & Elaboration. You can also perform a full compilation on any process that includes the initial
Analysis and Elaboration stage of the Quartus II compilation flow.
To run the RTL Viewer, on the Tools menu, point to Netlist Viewers and click RTL Viewer.
Altera Corporation
QII5V1
2014.06.30
19-5
Altera Corporation
19-6
QII5V1
2014.06.30
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 zooming.
The Refresh button restores the schematic view and optimizes the layout. Refresh does not reload the
database if you change your design and recompile.
The Find button opens and closes the Find pane.
The Selection tool and Zoom tool buttons toggle between the selection mode and zoom mode.
The Fit in Page button resets the schematic view to encompass the entire design.
The Netlist Navigator button opens or closes the Netlist Navigator pane.
The Color Settings button opens the Colors pane where you can customize the color scheme used in
the Netlist Viewer.
Altera Corporation
QII5V1
2014.06.30
19-7
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.
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
Description
Instances
State Machines
Altera Corporation
19-8
QII5V1
2014.06.30
Properties Pane
Elements
Primitives
Description
Ports
Properties Pane
You can view the properties of an instance or primitive using the Properties pane.
Altera Corporation
QII5V1
2014.06.30
Properties Pane
19-9
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.
Description
VCC
GND
Altera Corporation
19-10
QII5V1
2014.06.30
Value
Description
--
Unconnected
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.
Altera Corporation
QII5V1
2014.06.30
Schematic Symbols
19-11
You can right-click in a tab to see a shortcut menu where you can:
Create a blank view with New Tab
Create a Duplicate Tab of the tab in focus
Choose to Cascade Tabs
Choose toTile Tabs
Choose Close Tab to close the tab in focus
Choose Close Other Tabs to close all tabs except the tab in focus
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
The following table lists and describes the primitives and basic symbols that you can display in the
schematic view of the RTL Viewer and Technology Map Viewer.
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.
Table 19-3: Symbols in the Schematic View
Symbol
I/O Ports
Description
CLK_SEL[1:0]
RESET_N
I/O Connectors
MEM_OE_N
[1,15]
[1,3]
always0
Altera Corporation
19-12
QII5V1
2014.06.30
Schematic Symbols
Symbol
MULTIPLEXER
Mux5
SEL[2:0]
DATA[7:0]
OUT
BUFFER
OUT0
LATCH
latch
PRE
D
Q
ENA
CLR
Atom Primitive
F
DATAA
DATABCOMBOUT
DATAC
LOGIC_CELL_COMB (7F7F7F7F7F7F7F7F)
Other Primitive
PADOUT
BIDIR
Instance
speed_ch:speed
Altera Corporation
CPU_D[10]
PADIN
PADIO
accel_in
clk
reset
OE
DATAIN
Description
get_ticket
QII5V1
2014.06.30
Schematic Symbols
Symbol
Ecrypted Instance
streaming_cont
IN0 OUT0
IN1 OUT1
IN2 OUT2
IN3 OUT3
IN4 OUT4
IN5 OUT5
IN6
IN7
IN8
19-13
Description
speed
accel_in
clk
reset
warning
RAM
my_20k_sdp
CLK0
CLK1
CLR0
PORTAADDRSTALL
PORTAADDR[8:0]
PORTABYTEENMASK[3:0] PORTBDATAOUT[35:0]
PORTADATAIN[35:0]
PORTAWE
PORTBADDRSTALL
PORTBADDR[8:0]
PORTBRE
RAM
Constant
8h80
The following table lists and describes the symbol open only in the State Machine Viewer.
Altera Corporation
19-14
QII5V1
2014.06.30
Schematic Symbols
State Node
Description
The following lists and describes the additional higher level operator symbols in the RTL Viewer
schematic view.
Table 19-5: Operator Symbols in the RTL Viewer Schematic View
Symbol
Add0
A[3:0]
An adder operator:
OUT[3:0]
B[3:0]
Mult0
A[0]
Div0
A[0]
Equal3
A[1:0]
A[0]
Equals
ShiftLeft0
A[0]
COUNT[0]
ShiftRight0
Mod0
LessThan0
B[0]
Altera Corporation
A modulo operator:
OUT[0]
B[0]
COUNT[0]
A[0]
OUT = A / B
OUT
B[1:0]
A[0]
OUT = A B
A divider operator:
OUT[0]
B[0]
OUT = A + B
A multiplier operator:
OUT[0]
B[0]
Description
OUT = (A%B)
OUT = (A<:B:A>B)
QII5V1
2014.06.30
Symbol
SEL[2:0]
DATA[7:0]
Mux5
19-15
Description
A multiplexer:
OUT
Selector1
A selector:
OUT
Decoder0
IN[5:0]
OUT[63:0]
for x = 0 to x = 2(n+1) - 1
Related Information
Altera Corporation
19-16
QII5V1
2014.06.30
Stop filtering at registerTurning this option on directs the Netlist Viewer to filter out to the
nearest register boundary.
Filter across hierarchiesTurning this option on directs the Netlist Viewer to filter across
hierarchies.
Maximum number of hierarchy levelsSets 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.
Altera Corporation
QII5V1
2014.06.30
19-17
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.
Figure 19-5: Nodes with Connections Outside the Hierarchy
In some cases, the selected instance connects to something outside the visible level of the hierarchy in the
schematic view. In this case, the net appears as a dotted line. Double-click on the dotted line to expand the
view to display the destination of the connection .
Altera Corporation
19-18
QII5V1
2014.06.30
Right-click and click on Refresh to restore the schematic view to its default arrangement.
Zoom Controls
You can control the magnification of your schematic on the View menu, with the Zoom Tool in the
toolbar, or with mouse gestures.
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).
Altera Corporation
QII5V1
2014.06.30
19-19
Within the schematic view, you can also use the following mouse gestures to zoom in on a specific section:
zoom inDragging a box around an area starting in the upper-left and dragging to the lower right
zooms in on that area.
zoom -0.5Dragging a line from lower-left to upper-right zooms out 0.5 levels of magnification.
zoom 0.5Dragging a line from lower-right to upper-left zooms in 0.5 levels of magnification.
zoom fitDragging a line from upper-right to lower-left fits the schematic view in the page.
You can also 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.
Related Information
Altera Corporation
19-20
QII5V1
2014.06.30
Related Information
Back/Forward Display
Toolbar
Highlight
Fan-in/Fan-out
Toolbar
View
Toolbar
Tool
Toolbar
State Machine
Viewer Toolbar
Altera Corporation
QII5V1
2014.06.30
19-21
The nodes that represent each state are arranged horizontally in the state diagram view with the initial
state (the state node that receives the reset signal) in the left-most position. Nodes that connect to logic
outside of the state machine instance are represented by a double circle. The state transition is represented
by an arc with an arrow pointing in the direction of the transition.
When you select a node in the state diagram view, and turn on the Highlight Fan-in or Highlight Fanout command from the View menu or the State Machine Viewer toolbar, the respective fan-in or fan-out
transitions from the node are highlighted in red.
Note: An encrypted block with a state machine displays encoding information in the state encoding table,
but does not display a state transition diagram or table.
Altera Corporation
19-22
QII5V1
2014.06.30
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.
Altera Corporation
Project Navigator
Timing Closure Floorplan
Chip Planner
Resource Property Editor
Node Finder
Analyzing Designs with Quartus II Netlist Viewers
Send Feedback
QII5V1
2014.06.30
19-23
Assignment Editor
Messages Window
Compilation Report
TimeQuest Timing Analyzer (supports the Technology Map Viewer only)
To locate elements in the Netlist Viewer from another Quartus II window, select the node or nodes in the
appropriate window; for example, select an entity in the Entity list on the Hierarchy tab in the Project
Navigator, or select nodes in the Timing Closure Floorplan, or select node names in the From or To
column in the Assignment Editor. Next, right-click the selected object, point to Locate, and click Locate
in RTL Viewer or Locate in Technology Map Viewer. After you click this command, the Netlist Viewer
opens, or is brought to the foreground if the Netlist Viewer is open.
When cross-probing from the Time
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, point to Filter, and click Selected Nodes
using Filter across hierarchy. If the nodes cannot be found in the Netlist Viewer, a message box displays
the message: Cant find requested location.
Altera Corporation
19-24
QII5V1
2014.06.30
are created during the fitting process. In cases where the timing path displayed in the RTL Viewer might
not be the correct path, the compiler issues messages.
Version
Changes
2014.06.30
14.0.0
November 2013
13.1.0
November 2012
12.1.0
June 2012
12.0.0
November 2011
10.0.2
Template update.
December 2010
10.0.1
July 2010
10.0.0
Updated screenshots
Updated chapter for the
Quartus II software version
10.0, including major user
interface changes
November 2009
9.1.0
Updated devices
Minor text edits
Altera Corporation
QII5V1
2014.06.30
Date
Version
19-25
Changes
March 2009
9.0.0
November 2008
8.1.0
Altera Corporation
19-26
QII5V1
2014.06.30
Date
May 2008
Version
8.0.0
Changes
Related Information
Altera Corporation