Quartus II Handbook Version 10.1 Volume 1: Design and Synthesis December 2010 Altera Corporation
© 2010 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, HARDCOPY, MAX, MEGACORE, NIOS, QUARTUS and STRATIX are Reg. U.S. Pat.
& Tm. Off. and/or trademarks of Altera Corporation in the U.S. and other countries. All other trademarks and 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.
December 2010 Altera Corporation Quartus II Handbook Version 10.1 Volume 1: Design and Synthesis
Contents
Chapter Revision Dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
Section I. Design Flows
Chapter 1. Design Planning with the Quartus II Software
Creating Design Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–2
Intellectual Property Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–2
System Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–2
Device Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–3
Device Migration Planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–4
Planning for Device Programming or Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–4
Early Power Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–5
Early Pin Planning and I/O Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–6
Simultaneous Switching Noise Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–8
Selecting Third-Party EDA Tool Flows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–9
Synthesis Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–9
Simulation Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–9
Formal Verification Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–10
Planning for On-Chip Debugging Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–10
Design Practices and HDL Coding Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–11
Design Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–12
Recommended HDL Coding Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–12
Managing Metastability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–13
Planning for Hierarchical and Team-Based Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–13
Flat Compilation Flow with No Design Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–14
Incremental Compilation with Design Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–14
Planning Design Partitions and Floorplan Location Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–15
Fast Synthesis and Early Timing Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–16
Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–16
Document Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–17
Chapter 2. Quartus II Incremental Compilation for Hierarchical and Team-Based Design
Deciding Whether to Use an Incremental Compilation Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–1
Flat Compilation Flow with No Design Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–2
Incremental Capabilities Available When A Design Has No Partitions . . . . . . . . . . . . . . . . . . . . . 2–2
Incremental Compilation Flow With Design Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–3
Team-Based Design Flows and IP Delivery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–6
Incremental Compilation Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–7
Steps for Incremental Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–8
Preparing a Design for Incremental Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–8
Compiling a Design Using Incremental Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–9
Creating Design Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–9
Creating Design Partitions in the Project Navigator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–9
Creating Design Partitions in the Design Partitions Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–9
Creating Design Partitions With the Design Partition Planner . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–10
Creating Design Partitions With Tcl Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–10
Automatically-Generated Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–10
Common Design Scenarios Using Incremental Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–10
iv Contents
Quartus II Handbook Version 10.1 Volume 1: Design and Synthesis December 2010 Altera Corporation
Reducing Compilation Time When Changing Source Files for One Partition . . . . . . . . . . . . . . . . . 2–11
Optimizing a Timing-Critical Partition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–11
Adding Design Logic Incrementally or Working With an Incomplete Design . . . . . . . . . . . . . . . . . 2–12
Debugging Incrementally With the SignalTap II Logic Analyzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–13
Deciding Which Design Blocks Should Be Design Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–14
Impact of Design Partitions on Design Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–16
Design Partition Assignments Compared to Physical Placement Assignments . . . . . . . . . . . . . . . . 2–17
Using Partitions With Third-Party Synthesis Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–17
Synopsys Synplify Pro/Premier and Mentor Graphics Precision RTL Plus . . . . . . . . . . . . . . . . 2–17
Other Synthesis Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–18
Assessing Partition Quality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–18
Partition Statistics Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–18
Partition Timing Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–19
Incremental Compilation Advisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–19
Specifying the Level of Results Preservation for
Subsequent Compilations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–21
Netlist Type for Design Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–21
Fitter Preservation Level for Design Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–22
Where Are the Netlist Databases Saved? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–23
Deleting Netlists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–23
What Changes Initiate a Partition’s Automatic Resynthesis? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–24
Resynthesis Due to Source Code Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–25
Forcing Use of the Compilation Netlist When a Partition has Changed . . . . . . . . . . . . . . . . . . . . 2–26
Exporting Design Partitions from Separate Quartus II Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–26
Preparing the Top-Level Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–27
Empty Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–28
Project Management—Making the Top-Level Design Available to Other Designers . . . . . . . . . . . 2–28
Distributing the Top-Level Quartus II Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–28
Generating Design Partition Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–30
Exporting Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–31
Viewing the Contents of a Quartus II Exported Partition File (.qxp) . . . . . . . . . . . . . . . . . . . . . . . . . 2–31
Integrating Partitions into the Top-Level Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–32
Integrating Assignments from the .qxp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–32
Integrating Encrypted IP Cores from .qxp Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–33
Advanced Importing Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–33
Team-Based Design Optimization and Third-Party IP Delivery Scenarios . . . . . . . . . . . . . . . . . . . . . . 2–35
Using an Exported Partition to Send to a Design Without
Including Source Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–35
Creating Precompiled Design Blocks (or Hard-Wired Macros) for Reuse . . . . . . . . . . . . . . . . . . . . 2–36
Designing in a Team-Based Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–38
Enabling Designers on a Team to Optimize Independently . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–39
Resolving Assignment Conflicts During Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–41
Importing a Partition to be Instantiated Multiple Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–42
Performing Design Iterations With Lower-Level Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–42
Creating a Design Floorplan With LogicLock Regions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–44
Creating and Manipulating LogicLock Regions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–45
Changing Partition Placement with LogicLock Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–46
Taking Advantage of the Early Timing Estimator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–46
Incremental Compilation Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–47
When Timing Performance May Not Be Preserved Exactly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–47
When Placement and Routing May Not Be Preserved Exactly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–47
Using Incremental Compilation With Quartus II Archive Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–48
Limitations for HardCopy Compilation and Migration Flows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–48
Formal Verification Suppor
t .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–49
Contents v
December 2010 Altera Corporation Quartus II Handbook Version 10.1 Volume 1: Design and Synthesis
SignalProbe Pins and Engineering Change Orders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–49
SignalTap II Logic Analyzer in Exported Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–49
External Logic Analyzer Interface in Exported Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–50
Assignments Made in HDL Source Code in Exported Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–50
Design Partition Script Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–50
Warnings About Extra Clocks Due to Design Partition Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–50
Synopsys Design Constraint Files for the TimeQuest Timing Analyzer in
Design Partition Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–51
Wildcard Support in Design Partition Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–51
Derived Clocks and PLLs in Design Partition Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–51
Pin Assignments for GXB and LVDS Blocks in Design Partition Scripts . . . . . . . . . . . . . . . . . . . 2–52
Virtual Pin Timing Assignments in Design Partition Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–52
Top-Level Ports that Feed Multiple Lower-Level Pins in Design Partition Scripts . . . . . . . . . . . 2–52
Restrictions on Megafunction Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–52
Register Packing and Partition Boundaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–53
I/O Register Packing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–53
Scripting Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–54
Creating Design Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–54
Enabling or Disabling Design Partition Assignments During Compilation . . . . . . . . . . . . . . . . . . . 2–55
Setting the Netlist Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–55
Setting the Fitter Preservation Level for a Post-fit or Imported Netlist . . . . . . . . . . . . . . . . . . . . . . . 2–56
Preserving High-Speed Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–56
Specifying the Software Should Use the Specified Netlist and
Ignore Source File Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–56
Generating Design Partition Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–56
Exporting a Partition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–57
Importing a Partition into the Top-Level Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–57
Makefiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–58
Scripting and Command-Line Application Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–58
Reducing Opening a Project, Creating Design Partitions, and Performing
an Initial Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–59
Reducing Compilation Time When Changing a Source File for One
Partition—Command-Line Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–59
Optimizing the Placement for a Timing-Critical Partition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–59
Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–60
Document Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–61
Chapter 3. Quartus II Support for HardCopy Series Devices
HardCopy Series Design Benefits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–1
Quartus II Features for HardCopy Planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–2
HardCopy Development Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–2
Designing the FPGA First . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–3
Designing the HardCopy Device First . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–5
HardCopy Companion Device Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–6
HardCopy Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–7
Companion Revisions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–8
Compiling the HardCopy Companion Revision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–9
Comparing HardCopy and FPGA Companion Revisions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–9
Generating a HardCopy Handoff Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–9
Archiving HardCopy Handoff Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–10
HardCopy Advisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–10
HardCopy Device Resource Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–11
HardCopy Recommended Settings in the Quartus II Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–12
Limit DSP and RAM to HardCopy Device Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–12