Intro To Quartus2
Intro To Quartus2
Quartus® II Software
Version 9.0
Introduction to the
Quartus II
®
Software
Altera Corporation
101 Innovation Drive
San Jose, CA 95134
(408) 544-7000
www.altera.com
Introduction to the Quartus II Software
Altera, the Altera logo, HardCopy, MAX, MAX+PLUS, MAX+PLUS II, MegaCore, MegaWizard, Nios, OpenCore,
Quartus, Quartus II, the Quartus II logo, and SignalTap are registered trademarks of Altera Corporation in the
United States and other countries. Avalon, ByteBlaster, ByteBlasterMV, Cyclone, Excalibur, IP MegaStore, Jam,
LogicLock, MasterBlaster, SignalProbe, Stratix, and USB-Blaster are trademarks and/or service marks of Altera
Corporation in the United States and other countries. Product design elements and mnemonics used by Altera
Corporation are protected by copyright and/or trademark laws.
Altera Corporation acknowledges the trademarks and/or service marks of other organizations for their
respective products or services mentioned in this document, specifically: ARM is a registered trademark and
AMBA is a trademark of ARM, Limited. Mentor Graphics and ModelSim are registered trademarks of Mentor
Graphics Corporation.
Altera reserves the right to make changes, without notice, in the devices or the device specifications identified in
this document. Altera advises its customers to obtain the latest version of device specifications to verify, before
placing orders, that the information being relied upon by the customer is current. Altera warrants performance
of its semiconductor products to current specifications in accordance with Altera’s standard warranty. Testing
and other quality control techniques are used to the extent Altera deems such testing necessary to support this
warranty. Unless mandated by government requirements, specific testing of all parameters of each device is not
necessarily performed. In the absence of written agreement to the contrary, Altera assumes no liability for Altera
applications assistance, customer’s product design, or infringement of patents or copyrights of third parties by or
arising from use of semiconductor devices described herein. Nor does Altera warrant or represent any patent
right, copyright, or other intellectual property right of Altera covering or relating to any combination, machine,
or process in which such semiconductor devices might be or are used.
Altera products are not authorized for use as critical components in life support devices or systems without the
express written approval of the president of Altera Corporation. As used herein:
1. Life support devices or systems are devices or systems that (a) are intended for surgical implant into the body
or (b) support or sustain life, and whose failure to perform, when properly used in accordance with instructions
for use provided in the labeling, can be reasonably expected to result in a significant injury to the user.
2. A critical component is any component of a life support device or system whose failure to
perform can be reasonably expected to cause the failure of the life support device or system, or
to affect its safety or effectiveness.
Altera products are protected under numerous U.S. and foreign patents and pending
applications, maskwork rights, and copyrights.
Contents
Preface ............................................................................................................................................. ix
Documentation Conventions ....................................................................................................... xi
Chapter 8: Simulation..................................................................................................................111
Introduction................................................................................................................... 112
Simulating with EDA Tools ........................................................................................ 113
Specifying EDA Simulation Tool Settings .................................................. 114
Generating Simulation Output Files ........................................................... 115
EDA Simulation Flow.................................................................................... 116
EDA Tool Functional Simulation Flow......................................... 116
NativeLink Simulation Flow.......................................................... 117
Manual Timing Simulation Flow .................................................. 117
Simulation Libraries ........................................................................ 118
Using the Quartus II Simulator .................................................................................. 119
Creating Waveform Files............................................................................... 121
Using the Simulator Tool .............................................................................. 122
The first two chapters give an overview of the major graphical user interface,
EDA tool, and command-line interface design flows. Each subsequent
chapter begins with an introduction to the specific purpose of the chapter,
and leads you through an overview of each task flow. In addition, the
manual refers you to other resources that are available to help you use the
Quartus II software, such as Quartus II online Help and the Quartus II
interactive tutorial, application notes, white papers, and other documents
and resources that are available on the Altera website.
Use this manual to learn how the Quartus II software can help you increase
productivity and shorten design cycles; integrate with existing
programmable logic design flows; and achieve design, performance, and
timing requirements quickly and efficiently.
Typographic Conventions
Bold Initial Command names; dialog box, page, and tab titles; and button names
Capitals are shown in bold, with initial capital letters. For example: Find Text
command, Save As dialog box, and Start button.
bold Directory, project, disk drive, file names, file extensions, software
utility and software executable names; file name extensions, and
options in dialog boxes are shown in bold. Examples: quartus
directory, d: drive, license.dat file.
Initial Capitals Keyboard keys, user-editable application window fields, window
names, view names, and menu names are shown with initial capital
letters. For example: Delete key, the Options menu.
“Subheading Subheadings within a manual section are enclosed in quotation
Title” marks. In manuals, titles of Help topics are also shown in quotation
marks.
Italic Initial Help categories, manual titles, section titles in manuals, and
Capitals application note and brief names are shown in italics with initial
capital letters. For example: Introduction to the Quartus II Software.
italics Variables are enclosed in angle brackets (< >) and shown in italics.
For example: <file name>, <DVD-ROM drive>.
Courier font Anything that must be typed exactly as it appears is shown in
Courier. For example: \quartus\bin\lmutil lmhostid.
r Enter or return key.
■ Bullets are used in a list of items when the sequence of the items is
not important.
Terminology
Term Meaning
“click” Indicates a quick press and release of the left mouse button. It
also indicates that you need to use a mouse or key combination
to start an action.
“double-click” Indicates two clicks in rapid succession.
“select” Indicates that you need to highlight text and/or objects or an
option in a dialog box with a key combination or the mouse. A
selection does not start an action. For example: Select Chain
Description File, and then click OK.
“point” Indicates that you need to position the mouse pointer, without
clicking, at an appropriate location on the screen, such as a
menu or submenu. For example: On the Help menu, point to
Altera on the Web, and then click Quartus II Service
Request.
turn on/turn off Indicates that you must click a check box to turn a function on
or off.
What’s in Chapter 1:
Introduction 2
Graphical User Interface Design Flow 3
EDA Tool Design Flow 7
Design Methodologies and Planning 11
CHAPTER 1: DESIGN FLOW
INTRODUCTION
Introduction
The Altera Quartus II design software provides a complete, multiplatform
design environment that easily adapts to your specific design needs. It is a
comprehensive environment for system-on-a-programmable-chip (SOPC)
design. The Quartus II software includes solutions for all phases of FPGA
and CPLD design (Figure 1).
Power
Synthesis
Analysis
Engineering
Timing Change
Analysis Management
Timing
Simulation Closure
Programming &
Configuration
■ Fitter
■ Assembler*
■ TimeQuest Timing Analyzer*
■ Design Assistant*
■ EDA Netlist Writer*
■ HardCopy® Netlist Writer*
In addition, you can use the Tasks window to start Compiler modules
individually (Figure 3). The Tasks window also allows you to open the
settings file or report file for the module, or to start other tools related to each
stage in a flow.
Quartus II Command
Flow Description
from Processing Menu
The following steps describe the basic design flow for using the Quartus II
graphical user interface:
3. Use the Block Editor to create a block diagram with symbols that
represent other design files, or to create a schematic.
5. Specify any initial design constraints using the Assignment Editor, the
Pin Planner, the Settings dialog box, the Floorplan Editor, or the Design
Partitions window.
11. Perform a power estimation and analysis with the PowerPlay Power
Analyzer.
12. Use the Simulator to perform timing simulation for the design.
13. Use the TimeQuest Timing Analyzer to analyze the timing of your
design.
15. Create programming files for your design with the Assembler, and then
program the device with the Programmer and Altera programming
hardware.
16. (Optional) Debug the design with the SignalTap® II Logic Analyzer, an
external logic analyzer, the SignalProbe feature, or the Chip Planner.
17. (Optional) Manage engineering changes with the Chip Planner, the
Resource Property Editor, or the Change Manager.
Quartus II
Quartus II EDA Synthesis
Analysis &
Simulator Tool
Synthesis
Quartus II
Timing Analysis Quartus II Fitter EDA Physical
Synthesis Tool
EDIF netlist
files (.edf) or Verilog
Quartus Mapping Files (.vqm)
EDA Simulation
Tools
Quartus II
EDA Netlist Writer
EDA
Output files for EDA tools Timing Analysis
including Verilog Output Files Tools
(.vo), VHDL Output Files (.vho),
VQM Files, Standard Delay Format
Output Files (.sdo), testbench
files, symbol files, Tcl script files
(.tcl), IBIS Output Files (.ibs), EDA
HSPICE Simulation Deck Files Formal Verification
(.sp), and STAMP model files Tools
(.data, or .mod)
EDA
Quartus II Quartus II Board Level
Assembler Programmer Design Tools
Table 2 shows the EDA tools that are supported by the Quartus II software,
and indicates which EDA tools have NativeLink® support. NativeLink
technology facilitates the seamless transfer of information between the
Quartus II software and other EDA tools, and allows you to run the EDA
tool automatically from within the Quartus II software.
NativeLink
Function Supported EDA Tools
Support
To specify which EDA tools you want to use on the EDA Tool Settings page
of the Settings dialog box, click Settings on the Assignments menu
(Figure 5).
The individual pages under EDA Tool Settings provide additional options
for each type of EDA tool.
The following steps describe the basic design flow for using other EDA tools
with the Quartus II software. Refer to Table 2 on page 8 for a list of the
supported EDA tools.
3. Create a Verilog HDL or VHDL design file with a standard text editor
or use the MegaWizard Plug-In Manager to create custom variations
of megafunctions.
6. Compile your design with the Quartus II software. Run the EDA Netlist
Writer to generate output files for use with other EDA tools.
11. Program the device with the Programmer and Altera hardware.
Using the Quartus II software with Mentor Graphics ModelSim Support chapter
Mentor Graphics ModelSim software in volume 3 of the Quartus II Handbook
Using the Quartus II software with Synopsys VCS Support chapter in volume 3
Synopsys VCS software of the Quartus II Handbook
partitions to a reasonable amount, avoid having too many critical paths that
go beyond partition boundaries, and avoid having partitions that are
smaller than 1,000 logic elements or Adaptive Logic Modules (ALMs).
You can use EDA design entry and synthesis tools in the block-based design
flow to design and synthesize individual modules, and then incorporate the
modules into a top-level design in the Quartus II software, or completely
design and synthesize a block-based design in EDA design entry and
synthesis tools. For more information on the block-based design flow, refer
to “Chapter 7: Block-Based Design” on page 101.
What’s in Chapter 2:
Introduction 16
Command-Line Executables 17
Using Tcl Commands 23
Creating Makefile Scripts 25
CHAPTER 2: COMMAND-LINE AND TCL DESIGN FLOWS
INTRODUCTION
Introduction
The Quartus II software provides a complete command-line interface and
Tcl scripting API. You can use command-line executables and scripts to
perform every stage of the design flow. Using the command-line flow allows
you to reduce memory requirements, control the Quartus II software with
scripts or Tcl commands, and create makefiles (Figure 1).
Quartus II Shell
quartus_sh
Analysis &
Synthesis
quartus_map
Command-Line Executables
The Quartus II software includes separate executables for each stage of the
design flow. Each executable occupies memory only while it is being run.
You can use these executables with standard command-line commands and
scripts, with Tcl scripts, and in makefile scripts. See Table 1 for a list of all
available command-line executables.
The Quartus II software also provides some stand-alone GUI executables available
from the command prompt. The qmegawiz executable provides a command-line
interface for the MegaWizard Plug-In Manager, as well as a way to start the GUI
as a stand-alone application.
In addition, the quartus_pgmw executable provides the GUI for the Programmer as
a stand-alone application. The quartus_stpw executable provides the GUI for the
SignalTap II Logic Analyzer as a stand-alone application. Similarly, the
quartus_staw executable provides the GUI for the TimeQuest timing analyzer as a
stand-alone application.
Executable
Title Function
Name
quartus_map Analysis & Creates a project if one does not already exist,
Synthesis and then creates the project database,
synthesizes your design, and performs
technology mapping on design files of the
project.
quartus_fit Fitter Places and routes a design. Analysis & Synthesis
must be run successfully before running the
Fitter.
quartus_drc Design Assistant Checks the reliability of a design based on a set
of design rules. Design Assistant is especially
useful for checking the reliability of a design
before migrating the design to HardCopy and
HardCopy Stratix devices. Either Analysis &
Synthesis or the Fitter must be run successfully
before running the Design Assistant.
quartus_sta TimeQuest Timing Performs ASIC-style timing analysis of the circuit
Analyzer using constraints entered in Synopsys Design
Constraint format.
Executable
Title Function
Name
Executable
Title Function
Name
If you want to get help on the command-line options that are available for each of
the Quartus II executables, type one of the following commands at the command
prompt:
<executable name> -h r
<executable name> --help r
<executable name> --help=<topic or option name> r
You can also get help on command-line executables by using the Quartus II
Command-Line Executable and Tcl API Help Browser, which is a Tcl- and Tk-based
GUI that lets you browse the command-line and Tcl API help. To use this help, type
the following command at the command prompt:
quartus_sh --qhelp r
Some of the executables create a separate text-based report file, named after
the current project revision, that you can view with any text editor. The
name of each report file uses the following format:
For example, if you want to run the quartus_map executable for a project,
you could type the following command at the command prompt:
When you are using the Quartus II executables, by default the Quartus II software
uses the revision that has the same name as the project name. If you want to use a
revision with a name that is different from the project name, you can use the -c
option to specify the name of the revision and its associated Quartus II Settings
File (.qsf). For example, if you want to run the quartus_map executable for the
chiptrip project with a revision named speed_ch and its associated speed_ch.qsf
file, you could type the following command at the command prompt:
The quartus_map executable performs Analysis & Synthesis using that revision
and its settings, and produces a report file with the name speed_ch.map.rpt.
#!/bin/sh
FILES_WITH_ERRORS=""
for filename in `ls *.bdf *.v`
do
quartus_map fir_filter --analyze_file=$filename
if [ $? -ne 0 ]
then
FILES_WITH_ERRORS="$FILES_WITH_ERRORS $filename"
fi
done
if [ -z "$FILES_WITH_ERRORS" ]
then
echo "All files passed the syntax check"
exit 0
else
echo "There were syntax errors in the following file(s)"
echo $FILES_WITH_ERRORS
exit 1
fi
There are several ways to use Tcl scripts in the Quartus II software. You can
create a Tcl script by using commands from the Quartus II API for Tcl. You
should save a Tcl script as a Tcl Script File (.tcl).
The Templates command on the Edit menu in the Quartus II Text Editor
allows you to insert Tcl templates and Quartus II Tcl templates (for
Quartus II commands) into a text file to create Tcl scripts. Commands used
in the Quartus II Tcl templates use the same syntax as the Tcl API
commands.
If you want to use an existing project as a baseline for another project, you
can click Generate Tcl File for Project on the Project menu to generate a Tcl
Script File for the project. After editing this generated script to target your
new project, run the script to apply all assignments from the previous project
to the new project.
You can run Tcl scripts from the system command prompt with the
quartus_sh executable, from the Quartus II Tcl Console window, or from the
Tcl Scripts dialog box by clicking Tcl Scripts on the Tools menu.
The Quartus II software includes a Quartus II command-line and Tcl API Help
browser, which is a Tcl- and Tk-based GUI that lets you browse the command-line
and Tcl API help. To use this help, type the following command at the command
prompt:
quartus_sh --qhelp r
You can also view Tcl API Help in Quartus II Help that is available in the GUI. Refer
to “About Quartus II Scripting” in Quartus II Help for more information.
# Set Family
set_global_assignment -name family APEX 20KE
# Set Device
set_global_assignment -name device ep20k100eqc208-1
load_package flow
execute_flow -compile
# Close Project
project_close
###################################################################
# Project Configuration:
#
# Specify the name of the design (project) and Quartus II Settings
# File (.qsf) and the list of source files used.
###################################################################
PROJECT = chiptrip
SOURCE_FILES = auto_max.v chiptrip.v speed_ch.v tick_cnt.v time_cnt.v
ASSIGNMENT_FILES = chiptrip.qpf chiptrip.qsf
###################################################################
# Main Targets
#
# all: build everything
# clean: remove output files and database
###################################################################
clean:
rm -rf *.rpt *.chg smart.log *.htm *.eqn *.pin *.sof *.pof db
###################################################################
# Executable Configuration
###################################################################
MAP_ARGS = --family=Stratix
FIT_ARGS = --part=EP1S20F484C6
ASM_ARGS =
STA_ARGS =
###################################################################
# Target implementations
###################################################################
smart.log: $(ASSIGNMENT_FILES)
quartus_sh --determine_smart_action $(PROJECT) > smart.log
###################################################################
# Project initialization
###################################################################
$(ASSIGNMENT_FILES):
quartus_sh --prepare $(PROJECT)
map.chg:
$(STAMP) map.chg
fit.chg:
$(STAMP) fit.chg
sta.chg:
$(STAMP) sta.chg
asm.chg:
$(STAMP) asm.chg
What’s in Chapter 3:
Introduction 30
Creating a Project 31
Creating a Design 38
Using Altera Megafunctions 42
CHAPTER 3: DESIGN ENTRY
INTRODUCTION
Introduction
A Quartus II project includes all of the design files, software source files, and
other related files necessary for the eventual implementation of a design in
a programmable logic device. You can use the Quartus II Block Editor, Text
Editor, MegaWizard Plug-In Manager, and EDA design entry tools to create
design files that include Altera megafunctions, library of parameterized
modules (LPM) functions, and intellectual property (IP) functions. Figure 1
shows the design entry flow.
EDA Synthesis
Tool
to
Quartus II
Analysis &
Files generated by the
Synthesis
MegaWizard Plug-In Quartus II
Manager Text Editor
Quartus II
Block Editor
Block Symbol Files (.bsf)
Quartus II
Symbol Editor
Quartus II Exported
Partition Files (.qxp)
The Quartus II software also supports system-level design entry flows with
the Altera SOPC Builder and DSP Builder software. For more information
about these methods, refer to “Chapter 16: System-Level Design” on
page 203.
Creating a Project
You can create a new project by clicking New Project Wizard on the File
menu. When creating a new project, you specify the working directory for
the project, assign the project name, and designate the name of the top-level
design entity. You can also specify which design files, other source files, user
libraries, and EDA tools you want to use in the project, as well as the target
device. Table 1 lists the project and settings files for a Quartus II project.
Quartus II Project File (.qpf) Specifies the version of the Quartus II software used to
create the project and specifies all revisions of the
project.
Quartus II Settings File (.qsf) Contains all assignments you made with the
Assignment Editor, Chip Planner, Settings dialog box,
Tcl scripts, or Quartus II executables. There is one
Quartus II Settings File for each revision of the project.
Quartus II IP File (.qip) Contains a list of all of the files required for a project
that includes an Altera MegaCore function. The
Quartus II IP File allows you to add a custom MegaCore
function variation to the project by adding only the
Quartus II IP File, rather than adding all the necessary
files individually. A separate Quartus II IP File exists for
each individual custom MegaCore function variation.
Synopsys Design Constraints Contains timing constraints in the industry-standard
File (.sdc) Synopsys Design Constraints format required by the
TimeQuest Timing Analyzer. The constraints in a
Synopsys Design Constraints File are written in Tcl.
Quartus II Workspace Contains user preferences and other information such as
File (.qws) the positions of windows and open files.
Quartus II Default Settings Located in the \<Quartus II system directory>\bin
File (.qdf) directory and contains all the global default project
settings. These settings are overridden by the settings
in the Quartus II Settings File.
Once you have created a project, you can add and remove design files and
other files from the project in the Files page of the Settings dialog box.
During Analysis & Synthesis, the Quartus II software processes the files in
the order they appear in the Files page.
You can also copy an entire project to a new directory by clicking Copy
Project on the Project menu. This command causes the Quartus II software
to copy the project design database files, design files, settings files, and
report files to a new directory and then open the project in the new directory,
creating the directory if it does not already exist.
The Project Navigator also allows you to assign design partitions. For more
information, see “Creating Design Partitions” on page 57.
Creating and working with Quartus II “About the Project Navigator” in Quartus II
projects Help
Using Revisions
You can use revisions to specify, save, and use different groups of settings
and assignments for the design files in a design. Revisions allow you to
compare results using different settings and assignments for the same
design files in a design.
The Revisions dialog box allows you to view all the revisions for the current
project, create a revision for a specific design entity, delete a revision, or set
a particular revision as the current revision for compilation, simulation, or
timing analysis. The information in the Revisions dialog box shows the
top-level design entity for a particular revision and the family and device
selected for the revision. A check mark icon indicates the current revision.
With the Create Revision dialog box, you can create a new revision (based
on an existing revision), enter a description for the revision, copy the
database used to create the revision, and set a revision as the current
revision. You can also select which columns appear in the Revisions dialog
box (Figure 3).
Creating a revision does not affect the source design files for the project. You
can create a revision, set it as the current revision for the design, and then
make assignments and settings for the entity. This feature allows you to
create different settings and assignments for the same design entity and save
those settings as different revisions for comparison. Each revision has a
corresponding report file that you can open to view and compare the results
of the effects of settings and assignments changes against other revisions.
You can use the Compare Revisions dialog box, which is available from the
Revisions dialog box, to compare the results of compilations with different
revisions. The Compare Revisions dialog box has a Results tab and an
Assignments tab. By default, the comparison shows all revisions for the
project, but you can also customize the comparison by selecting which
revisions you want to display and adjusting the order. You can export a
Comma-Separated Value File (.csv) from the comparison. Figure 4 shows
the Results tab of the Compare Revisions dialog box, which allows you to
compare the results of each revision.
Figure 5 shows the Assignments tab of the Compare Revisions dialog box,
which allows you to compare the assignment settings for each revision.
You can use this feature to create and optimize a design and then preserve
the database for timing analysis in a later version of the Quartus II software
to ensure that the design still meets the timing requirements when measured
against the updated timing models in the later version.
To use the quartus_cdb executable to import or export a database, type one of the
following commands at a command prompt:
If you want to get help on the quartus_cdb executable, type one of the following
commands at the command prompt:
quartus_cdb -h r
quartus_cdb --help r
quartus_cdb --help=<topic name> r
Creating a Design
You can create designs in the Quartus II Block Editor or Text Editor. The
Quartus II software also supports designs created from EDIF Input
Files (.edf) or Verilog Quartus Mapping Files (.vqm) generated by EDA
design entry and synthesis tools. You can also create Verilog HDL or VHDL
designs in EDA design entry tools, and either generate EDIF Input Files and
VQM Files, or use the Verilog HDL or VHDL design files directly in
Quartus II projects. For more information on using EDA synthesis tools to
generate EDIF Input Files or VQM Files, see “Using Other EDA Synthesis
Tools” on page 68 in Chapter 5, “Synthesis.”
You can use the design file types listed in Table 2 to create a design in the
Quartus II software or in EDA design entry tools.
Block Design File A schematic design file created with the .bdf
Quartus II Block Editor.
EDIF Input File An EDIF netlist file, generated by any .edf
standard EDIF netlist writer. .edif
State Machine File A state machine design file created with .smf
the State Machine Editor.
Text Design File A design file written in the Altera .tdf
Hardware Description Language (AHDL).
Each Block Design File contains blocks and symbols that represent logic in
the design. The Block Editor incorporates the design logic represented by
each block diagram, schematic, or symbol into the project.
You can create new design files from blocks in a Block Design File, update
the design files when you modify the blocks and the symbols, and generate
Block Symbol Files (.bsf), AHDL Include Files (.inc), and HDL files from
Block Design Files. You can also analyze the Block Design Files for errors
before compilation. The Block Editor also provides a set of tools that help
you connect blocks and primitives in a Block Design File, including bus and
node connections and signal name mapping.
You can customize the Block Editor display to show options, such as
guidelines and grid spacing, rubberbanding, colors and screen elements,
zoom, and different block and primitive properties to suit your preferences.
You can use the following features of the Block Editor to create a Block
Design File in the Quartus II software:
The Text Editor also allows you to insert a template for any AHDL statement
or section, Tcl command, or supported VHDL or Verilog HDL construct into
the current file. AHDL, VHDL, and Verilog HDL templates provide an easy
way for you to enter HDL syntax, increasing the speed and accuracy of
design entry. You can also get context-sensitive help on all AHDL elements,
keywords, statements, megafunctions, and primitives.
Verilog Design Files and VHDL Design Files can contain any combination of
Quartus II–supported constructs. They can also contain Altera-provided
logic functions, including primitives and megafunctions, and user-defined
logic functions.
In the Text Editor, you use the Create/Update command on the File menu to
create a Block Symbol File from the current Verilog HDL or VHDL design
file and then incorporate it into a Block Design File. Similarly, you can create
an AHDL Include File that represents a Verilog HDL or VHDL design file
and incorporate it into an Text Design File or another Verilog HDL or VHDL
design file.
For VHDL designs, you can specify the name of a VHDL library for a design
in the Properties dialog box, which is available from the Files page of the
Settings dialog box on the Assignments menu.
For more information on using the Verilog HDL and VHDL languages in the
Quartus II software, see “Using Quartus II Verilog HDL & VHDL
Integrated Synthesis” on page 65 in Chapter 5, “Synthesis.”
Using the Quartus II Block Editor and “About Design Entry” in Quartus II Help
Symbol Editor
Using the Quartus II Text Editor “About the Quartus II Text Editor” in
Quartus II Help
The State Machine Editor provides a state machine diagram view where you
can view the state diagram you created with the State Machine wizard or
the drawing tools provided, and a ports list that lists all of the input and
output ports of the state machine.
You can use the MegaWizard Plug-In Manager on the Tools menu to create
Altera megafunctions, LPM functions, and IP functions for use in designs in
the Quartus II software and EDA design entry and synthesis tools. Table 3
shows the types of Altera-provided megafunctions and LPM functions that
you can create with the MegaWizard Plug-In Manager.
Type Description
Using the MegaWizard Plug-In Manager “About the MegaWizard Plug-In Manager” in
Quartus II Help
You can use the MegaWizard Plug-In Manager from outside the Quartus II
software by typing the following command at a command prompt:
qmegawiz r
Inferring Megafunctions
Quartus II Analysis & Synthesis automatically recognizes certain types of
HDL code and infers the appropriate megafunction. The Quartus II software
uses inference because Altera megafunctions are optimized for Altera
devices, and performance may be better than standard HDL code. For some
architecture-specific features, such as RAM and DSP blocks, you must use
Altera megafunctions.
■ Counters
■ Adders/Subtractors
■ Multipliers
■ Multiply-accumulators and multiply-adders
■ RAM
■ Shift registers
The Verilog HDL or VHDL wrapper file contains the ports and parameters
for the megafunction, which you can use to instantiate the megafunction in
the top-level design file as well as a sample instantiation file and then direct
the EDA tool to treat the megafunction as a black box during synthesis.
The following steps describe the basic flow for using the MegaWizard
Plug-In Manager to create a black box for an Altera megafunction or LPM
function in EDA design entry and synthesis tools:
2. Instantiate the function in the EDA synthesis tool with the black box file
or component declaration (along with the sample instantiation file)
generated by the MegaWizard Plug-In Manager.
Instantiation by Inference
EDA synthesis tools automatically recognize certain types of HDL code and
infer the appropriate megafunction.You can directly instantiate memory
blocks (RAM and ROM), DSP blocks, shift registers, and some arithmetic
components in Verilog HDL or VHDL code. The EDA tool then maps the
logic to the appropriate Altera megafunction during synthesis.
The following steps describe the basic flow for using clear box
megafunctions with EDA synthesis tools:
2. Instantiate the function in the EDA synthesis tool using the Verilog or
VHDL design file generated by the MegaWizard Plug-In Manager.
What’s in Chapter 4:
Introduction 52
Using the Assignment Editor 53
Using the Pin Planner 54
The Settings Dialog Box 56
Making Timing Constraints 57
Creating Design Partitions 57
Importing Assignments 60
Verifying Pin Assignments 62
CHAPTER 4: CONSTRAINT ENTRY
INTRODUCTION
Introduction
Once you have created a project and your design, you can use the
Assignment Editor, Settings dialog box, TimeQuest Timing Analyzer, Pin
Planner, Design Partitions window, and the Chip Planner to specify initial
design constraints, such as pin assignments, device options, logic options,
and timing constraints. You can import assignments by clicking Import
Assignments on the Assignments menu and export assignments by clicking
Export on the File menu. You can also import assignments from other EDA
synthesis tools using Tcl commands or scripts. Figure 1 shows the constraint
and assignment entry flow.
Quartus II
Quartus II
Settings Dialog Box design files
Quartus II
Quartus II
Assignment Editor Project File (.qpf) to Quartus II
Analysis & Synthesis
Quartus II Quartus II
Pin Planner Settings File (.qsf)
Quartus II
Design Partitions
Window Verilog Quartus Mapping
Files (.vqm)
TimeQuest
Timing Analyzer
Synopsys Design
Constraints File (.sdc)
The following steps illustrate the basic flow for using the Assignment Editor
to make assignments:
3. Specify the appropriate node or entity in the Node Filter bar, or use the
Node Finder dialog box to find a specific node or entity.
4. In the spreadsheet that displays the assignments for the current design,
add the appropriate assignment information.
To export the data from the Assignment Editor to a Tcl Script File (.tcl) or a
Comma-Separated Value File (.csv), click Export on the File menu. To
import assignments data from a Comma-Separated Value File or text file,
click Import Assignments on the Assignments menu. For more information
about importing assignments, see “Importing Assignments” on page 60.
By default, the Pin Planner displays a Groups list, an All Pins list, and a
package view diagram of the device. You can make pin assignments by
dragging pins from the Groups list and All Pins list to available pin or I/O
bank locations in the package diagram. In the All Pins list, you can filter the
node names, change the I/O standards, and specify options for reserved
pins. You can also filter the All Pins list to display only unassigned pins, so
you can change the node name and direction for user-added nodes. You can
also specify options for reserved pins.
You can also display the properties and available resources for the selected
pin, and can display a legend that explains the different colors and symbols
that are used in the Pin Planner.
Using the Pin Planner to assign pins I/O Management chapter in volume 2 of the
Quartus II Handbook
You can perform the following types of tasks in the Settings dialog box:
■ Modify project settings: specify and view the current top-level entity
for project and revision information; add and remove files from the
project; specify custom user libraries; specify device options for
package, pin count, and speed grade; and specify migration devices.
■ Specify EDA tool settings: specify EDA tools for design entry/
synthesis, simulation, timing analysis, board-level verification, formal
verification, physical synthesis, and related tool options.
The Project Navigator, the Design Partition Planner, and the Design
Partitions window allow you to assign design partitions.
To make a LogicLock assignment for a partition, drag the partition from the
Project Navigator window directly to the LogicLock Regions window or to
a LogicLock region in the Timing Closure Floorplan. You can also right click
the partition/entity in the Project Navigator, point to LogicLock Region,
and then click Create New LogicLock Region.
Right-click the partition and click Rename if you want to use a name other
than the full hierarchy path name. To generate an incremental compilation
Tcl script, right-click the partition and click Generate Incremental
Compilation Tcl Script.
The Design Partitions window allows you to specify one of the following
options for Netlist Type:
You can specify the netlist type from the list in the Netlist Type column or
by right-clicking the partition and clicking Properties.
If you want to make a LogicLock assignment for a partition, you can drag the
partition from the Design Partitions window directly to the LogicLock
Regions window or to a LogicLock region in the Chip Planner.
Importing Assignments
To import assignments into a project in the Quartus II software, click Import
Assignments on the Assignments menu.
The Import Assignments dialog box allows you to specify the file that
contains the assignments to import and the specific types of assignments
(assignment categories) to import into the Quartus II Settings File for the
You can use this command to import settings and assignments from other
projects created in the Quartus II software into your current project. For
example, you can use this command to import pin assignments from a
previous Quartus II project into the current Quartus II project.
What’s in Chapter 5:
Introduction 64
Using Quartus II Verilog HDL & VHDL
Integrated Synthesis 65
Using Other EDA Synthesis Tools 68
Controlling Analysis & Synthesis 71
Using the Design Assistant to Check
Design Reliability 74
Analyzing Synthesis Results With the
Netlist Viewers 77
CHAPTER 5: SYNTHESIS
INTRODUCTION
Introduction
You can use the Analysis & Synthesis module of the Compiler to analyze
your design files and create the project database. Analysis & Synthesis uses
Quartus II Integrated Synthesis to synthesize your Verilog Design Files (.v)
or VHDL Design Files (.vhd). If you prefer, you can use other EDA synthesis
tools to synthesize your Verilog HDL or VHDL design files, and then
generate an EDIF netlist file (.edf) or a Verilog Quartus Mapping File (.vqm)
that can be used with the Quartus II software. Figure 1 shows the synthesis
design flow.
Library Mapping
Files (.lmf) &
User Libraries
You can start a full compilation in the Quartus II software, which includes
the Analysis & Synthesis module, or you can start Analysis & Synthesis
separately. You can perform an Analysis & Elaboration to check a design for
syntax and semantic errors without performing a complete Analysis &
Synthesis or use the Analyze Current File command on the Processing
menu to check a single design file for syntax errors.
You can also run Analysis & Synthesis separately at the command prompt or in a
script that contains the quartus_map executable. The quartus_map executable
creates a new project if one does not already exist.
The quartus_map executable creates a separate text-based report file that can be
viewed with any text editor.
If you want to get help on the quartus_map executable, type one of the following
commands at the command prompt:
quartus_map -h r
quartus_map --help r
quartus_map --help=<topic name> r
Analysis & Synthesis supports the Verilog-1995 (IEEE Std. 1364-1995) and
Verilog-2001 (IEEE Std. 1364-2001) standards, a subset of features of the
SystemVerilog-2005 (IEEE Std. 1800-2005) standard, and also supports the
VHDL 1987 (IEEE Std. 1076-1987) and 1993 (IEEE Std. 1076-1993) standards.
You can select which standard to use; Analysis & Synthesis uses
Verilog-2001 and VHDL 1993 by default. If you are using another EDA
synthesis tool, you can also specify a Library Mapping File (.lmf) that the
Quartus II software should use to map non–Quartus II functions to
Quartus II functions. You can specify these and other options in the Verilog
HDL Input and VHDL Input pages, which are under Analysis & Synthesis
Settings in the Settings dialog box. These pages are shown in Figure 2.
Figure 2. Verilog HDL & VHDL Input Pages of Settings Dialog Box
VHDL Input
Page
Verilog HDL
Input Page
You can compile most Verilog HDL and VHDL designs successfully with
Quartus II Integrated Synthesis and other EDA synthesis tools. If your
design instantiates Altera megafunctions, library of parameterized modules
(LPM) functions, or intellectual property (IP) megafunctions in a third-party
EDA tool, you need to use a hollow-body or black box file. When you are
Add the design files when creating a project with the New Project Wizard,
or in the Files page of the Settings dialog box. When you add files to the
project, ensure you add them in the order you want Quartus II Analysis &
Synthesis to process them. In addition, if your design is coded in VHDL,
specify the VHDL library for the design in the Properties dialog box that is
available from the Files page. If you do not specify a VHDL library, Analysis
& Synthesis compiles VHDL entities into the work library. For more
information about adding files to a project, refer to “Creating a Design” on
page 38 in Chapter 3, “Design Entry.”
Analysis & Synthesis builds a single project database that integrates all the
design files in a design entity or project hierarchy. The Quartus II software
uses this database for the remainder of project processing. Other Compiler
modules update the database until it contains the fully optimized project. In
the beginning, the database contains only the original netlists; at the end, it
contains a fully optimized, fitted project, which is used to create one or more
files for timing simulation, timing analysis, and device programming.
The Messages window and the Messages section of the Report window
display any messages Analysis & Synthesis generates. The Status window
and Tasks window display the time spent performing Analysis & Synthesis
during project compilation.
Altera provides libraries for use with many EDA synthesis tools. Altera also
provides NativeLink support for many tools. NativeLink technology
facilitates the seamless transfer of information between the Quartus II
software and other EDA tools and allows you to run EDA tools
automatically from within the Quartus II graphical user interface.
If you have created assignments or constraints using other EDA tools, you
can use Tcl commands or scripts to import those constraints into the
Quartus II software with your design files. Many EDA tools generate an
assignment Tcl script automatically.
Verilog Quartus
EDIF Netlist NativeLink
Synthesis Tool Name Mapping
File (.edf) Support
File (.vqm)
Mentor Graphics v v
LeonardoSpectrum
Mentor Graphics Precision v v
Synthesis
Verilog Quartus
EDIF Netlist NativeLink
Synthesis Tool Name Mapping
File (.edf) Support
File (.vqm)
Synopsys Design Compiler v
Synopsys Synplify v v v
Synopsys Synplify Pro v v v
Agility DK Design Suite v
You can also use attributes, which are sometimes known as pragmas or
directives, that drive the synthesis process for a a specific design element.
Some attributes are also available as Quartus II logic options.
The Quartus II logic options that are available on the Analysis & Synthesis
Settings page allow you to specify that the Compiler should optimize for
speed or area, or perform a “balanced” optimization, which attempts to
achieve the best combination of speed and area. It also provides other
options, such as options that control timing-driven synthesis, the logic level
for power-up, and the removal of duplicate or redundant logic.
■ Timing-driven synthesis
■ Power-Up Don’t Care
■ Perform WYSIWYG primitive resynthesis
■ PowerPlay power optimization
Using Quartus II synthesis and netlist Netlist Optimizations & Physical Synthesis
optimization options and Design Optimizations for Altera
Devices and the Quartus II Design Assistant
chapters in volume 2 of the Quartus II
Handbook
You can also run the Design Assistant separately at the command prompt or in a
script by using the quartus_drc executable. You must run the Quartus II Fitter
executable quartus_fit before running the Design Assistant.
The quartus_drc executable creates a separate text-based report file that can be
viewed with any text editor.
If you want to get help on the quartus_drc executable, type one of the following
commands at the command prompt:
quartus_drc -h r
quartus_drc -help r
quartus_drc --help=<topic name> r
Using the Quartus II Design Assistant “Analyzing Designs with the Design
Assistant” and “About the Design Assistant”
in Quartus II Help
Using Quartus II synthesis options, Design Recommendations for Altera
following synchronous design Devices and the Quartus II Design
practices, and following coding style Assistant, Recommended HDL Coding
guidelines Styles, and Quartus II Integrated Synthesis
chapters in volume 1 of the Quartus II
Handbook
The RTL Viewer displays the Analysis & Elaboration results for Verilog
HDL or VHDL designs, and AHDL Text Design Files (.tdf), Block Design
Files (.bdf), and Graphic Design Files (.gdf). For Verilog Quartus Mapping
Files or EDIF netlist files that were generated from other EDA synthesis
tools, the RTL Viewer displays the hierarchy for the atom representations of
WYSIWYG primitives.
You can select one or more items in the hierarchy list to highlight in the
schematic view. The RTL Viewer allows you to adjust the view or focus by
zooming in and out to see different levels of detail, searching through the
RTL Viewer for a specific name, moving up or down in the hierarchy, or
going to the source that feeds the selected net. If you want to adjust the fan-in
or fan-out display, you can expand or collapse it. You can use the tooltips to
see node and source information for individual items. You can also select a
node in the RTL Viewer and locate it in the design file, Assignment Editor,
Chip Planner, Resource Property Editor, or Technology Map Viewer,
depending on which locations are available for that node.
If a design is large, the RTL Viewer partitions it into multiple pages for
display. The Netlist Viewers page of the Options dialog box allows you to
specify, in number of nodes or ports, how much of the design the RTL
Viewer displays on each page. You can navigate through pages in the RTL
Viewer by clicking Next Page and Previous Page or by clicking Go To on the
Edit menu.
The Filter command allows you to filter the view to show the sources, and
destinations of the selected node(s) or net(s). You can also filter the view to
show the paths and nodes between two selected nodes. Each filter you
choose creates a new filtered page in the RTL Viewer. Navigate through the
filtered pages and the original page of the design with the Forward and Back
buttons.
Double-clicking
a state machine
instance symbol
in the RTL
Viewer opens the
State Machine
Viewer window
The State Machine Viewer includes a schematic view and a transition table
(Figure 8).
Schematic
view
Double circles
indicate nodes
that have
connections to
outside logic
Transition table
shows source
and destination
states and
transition
conditions
If you decide to make changes to your design after viewing it with the RTL
Viewer, you should perform Analysis & Elaboration again so you can
analyze the updated design in the RTL Viewer.
Using the Quartus II RTL Viewer Analyzing Designs with Quartus II Netlist
Viewers chapter in volume 1 of the
Quartus II Handbook
You can also use the Technology Map Viewer to display post-Analysis &
Synthesis mapping and compare those results to the results from a full
compilation. Display the results from Analysis & Synthesis by pointing to
Netlist Viewers on the Tools menu, and then clicking Technology Map
Viewer (Post Mapping).
If you have run only Analysis & Synthesis and have not performed a full compilation
of your design, both of the Technology Map Viewer commands display the same
post-mapping information.
In the Technology Map Viewer, you can select one or more items in the
hierarchy list to highlight in the schematic view. The Technology Map
Viewer allows you to navigate the view in much the same way as the RTL
Viewer; see “Analyzing Synthesis Results With the Netlist Viewers” on
page 77. The tooltips in the Technology Map Viewer display equation
information as well as node and source information.
Using the Quartus II Technology Map Analyzing Designs with Quartus II Netlist
Viewer Viewers chapter in volume 1 of the
Quartus II Handbook
What’s in Chapter 6:
Introduction 84
Using Incremental Compilation 86
Analyzing Fitting Results 87
Optimizing the Fit 92
CHAPTER 6: PLACE AND ROUTE
INTRODUCTION
Introduction
The Quartus II Fitter places and routes your design, which is also referred to
as “fitting” in the Quartus II software. Using the database that has been
created by Analysis & Synthesis, the Fitter matches the logic and timing
requirements of the project with the available resources of the target device.
It assigns each logic function to the best logic cell location for routing and
timing, and selects appropriate interconnection paths and pin assignments.
Figure 1 shows the place and route design flow.
Quartus II
Design Assistant
quartus_drc
If you have made resource assignments in your design, the Fitter attempts to
match those resource assignments with the resources on the device, tries to
meet any other constraints you have set, and then attempts to optimize the
remaining logic in the design. If you have not set any constraints on the
design, the Fitter automatically optimizes it. If it cannot find a fit, the Fitter
terminates compilation and issues an error message.
In the Compilation Process Settings page of the Settings dialog box, you
can specify whether you want to use a normal compilation or smart
compilation. With a “smart” compilation, the Compiler creates a detailed
database that can help future compilations run faster, but may consume
extra disk space. During a smart recompilation, the Compiler evaluates the
changes made to the current design since the last compilation and then runs
only the Compiler modules that are required to process those changes. If you
make any changes to the logic of a design, the Compiler uses all modules
during processing.
You can start a full compilation in the Quartus II software, which includes
the Fitter module, or you can start the Fitter separately. You must run
Analysis & Synthesis successfully before starting the Fitter separately. For
information about performing a full compilation, refer to “Graphical User
Interface Design Flow” on page 3 in Chapter 1, “Design Flow.”
You can also run the Fitter separately at the command prompt or in a script by using
the quartus_fit executable. You must run the Analysis & Synthesis executable
quartus_map before running the Fitter.
The quartus_fit executable creates a separate text-based report file that can be
viewed with any text editor.
If you want to get help on the quartus_fit executable, type one of the following
commands at the command prompt:
quartus_fit -h r
quartus_fit -help r
quartus_fit --help=<topic name> r
The Status window and the Tasks window each display the time spent
processing in the Fitter during project compilation, as well as the processing
time for any other modules you may have been running (Figure 2).
Figure 3 shows the Tasks window during compilation, while the TimeQuest
timing analyzer is running.
The following steps describe the basic flow for performing an incremental
compilation:
8. Compile the design again. Only the partitions that have changed are
recompiled.
In the Messages window, you can right-click a message and click Help to get
Help on a particular message.
By default, all message types are displayed in the Processing tab of the
Messages window. If you want to filter the messages that appear in the
Messages window, you can set options in the Filtering tab under Messages
in the Options dialog box that control the display of warning messages,
critical warning messages, information messages, and extra information
messages. The Colors tab allows you to customize the colors for each type of
message. The Messages tab of the Options dialog box allows you to specify
options for displaying separate optional tabs that display the Processing
tab’s messages by type: Extra Info, Info, Warning, Critical Warning, and
Error. Right-clicking messages in the Messages window also provides
commands that allow you to filter messages and display optional message
tabs.
By default, the Report window opens automatically when you run the Fitter
or any other compilation or simulation module; however, you can specify
that it should not open automatically by turning off Automatically open the
Report window before starting a processing task if the appropriate Tool
window is not already open in the Processing page of the Options dialog
box. Also, if the Compiler Tool window is open, the Report window does not
open automatically, but clicking the Report File icon for each module
displays the report for that module. When the Fitter is processing the design,
the Report window continuously updates with new information. If you stop
the Fitter, the Report window contains only the information created prior to
the point at which you stopped the Fitter.
Resource usage in the Chip Planner is color coded. Different colors represent
different resources, such as unassigned and assigned pins and logic cells,
unrouted items, MegaLAB™ structures, columns, and row FastTrack®
fan-outs. The Chip Planner also allows you to customize the floorplan view
using filters to show pins and the interior structure of the device.
To edit assignments in the Chip Planner, you can click a resource assignment
and drag it to a new location. You can use rubberbanding to display a visual
representation of the number of routing resources affected by the move.
You can view the routing congestion in a design, view routing delay
information for paths, and view connection counts to specific nodes. The
Chip Planner also allows you to view the node fan-out and fan-in for specific
structures, or view the paths between specific nodes. If necessary, you can
change or delete resource assignments. For more information on using the
Chip Planner, refer to “Using the Chip Planner” on page 141 in Chapter 10,
“Timing Closure.”
Viewing the fit in the Chip Planner Engineering Change Management with the
Chip Planner chapter in volume 3 of the
Quartus II Handbook
■ Fitter options
■ Fitting optimization and physical synthesis options
■ Individual and global logic options that affect fitting
hardest to meet your fMAX timing requirements, to use the fast fit feature,
which improves the compilation speed but may reduce the fMAX, or to use
the auto fit feature, which reduces Fitter effort after meeting timing
requirements and may decrease compilation time. The Fitter Settings page
also allows to you specify that you want to limit Fitter effort to only one
attempt, which may also reduce the fMAX.
■ Logic elements
■ Memory blocks
■ DSP blocks
■ I/O elements
■ Routing resources
If you have an open project, you can view the Resource Optimization
Advisor by clicking Resource Optimization Advisor on the Tools menu. If
the project has not been compiled yet, the Resource Optimization Advisor
provides only general recommendations for optimizing resource usage. If
the project has been compiled, however, the Resource Optimization Advisor
can provide specific recommendations for the project, based on the project
information and current settings. Figure 6 shows the Resource Optimization
Advisor.
If you want to view recommendations for improving timing results, you can
use the Timing Optimization Advisor. See “Using the Timing Optimization
Advisor” on page 143 in Chapter 10, “Timing Closure.”
You can specify the effort level that DSE puts into determining the optimal
settings the current project. The DSE interface also allows you to specify
optimization goals and allowable compilation time.
Selecting the Advanced Search option opens the Advanced tab, which
allows you to specify additional options for exploration space, optimization
goal, and search method.
After you have specified your exploration settings, you can use the Explore
Space command on the Processing menu to start the exploration. You can
see the results of the exploration on the Explore tab.
You can run DSE in graphical user interface mode by typing the following command
at a command prompt:
quartus_sh --dse r?
You can run DSE in command-line mode by typing the following command at a
command prompt, along with any additional DSE options:
For help on DSE options, type quartus_sh --help=dse r at command prompt, or,
on the help menu, click Show Documentation.
Many of the exploration space modes allow you to specify the degree of
effort you want DSE to spend in fitting the design; however, increasing the
effort level usually increases the compilation time. Custom exploration
mode allows you to specify various parameters, options, and modes and
then explore their effects on your design.
The Signature modes allow you to explore the effect of a single parameter on
your design and its trade-offs for fMAX, slack, compile time, and area. In the
Signature modes, DSE tests the effects of a single parameter over multiple
seeds, and then reports the average of the values so you can evaluate how
that parameter interacts in the space of your design.
DSE also provides a list of Optimization Goal options, which allow you to
specify whether DSE should optimize for area, speed, or for negative slack
and failing paths.
After you have completed a design exploration with DSE, you can create a
new revision from a DSE point. You can then close DSE and open the project
with the new revision from within the Quartus II software.
Using the Design Space Explorer Design Space Explorer chapter in volume 2
of the Quartus II Handbook
Parameters and settings for optimizing Area and Timing Optimization chapter in
performance volume 2 of the Quartus II Handbook
What’s in Chapter 7:
Introduction 102
Block-Based Design Flow 102
Using LogicLock Regions 103
Using LogicLock Regions in Top-Down
Incremental Compilation Flows 107
Exporting & Importing Partitions for
Bottom-Up Design Flows 108
CHAPTER 7: BLOCK-BASED DESIGN
INTRODUCTION
Introduction
The Quartus II Incremental Compilation feature and LogicLock regions
feature enable a block-based design flow by allowing you to create modular
designs, designing and optimizing each module separately before
incorporating it into the top-level design. Incorporating each module into
the top-level design does not affect the performance of the lower level
modules, as long as each module has registered inputs and outputs.
LogicLock regions are flexible, reusable constraints that increase your ability
to guide logic placement on the target device. You can define any region of
physical resources on the target device as a LogicLock region. Assigning
nodes or entities to a LogicLock region directs the Fitter to place those nodes
or entities inside the region during fitting.
The LogicLock feature also allows you to assign design partitions to physical
locations in the device as part of a top-down or bottom-up incremental
compilation flow.
■ Modular design flow: In the modular design flow, you divide a design
into a top-level design that instantiates separate submodules. You can
develop each module separately and then incorporate each module
into the top-level design. Placement is determined manually by you or
automatically by the Quartus II software.
In all three design flows, you can preserve performance at all levels of
development by partitioning designs into functional blocks, organized
according to the physical structure of the circuit or by critical paths.
Reserved On, Limited, or The reserved property allows you to define whether
Off the Quartus II software can use the resources within a
region for entities that are not assigned to the region.
If the reserved property is on, only items assigned to
the region can be placed within its boundaries.
With the LogicLock design flow, you can define a hierarchy for a group of
regions by declaring parent and child regions. The Quartus II software
places child regions completely within the boundaries of a parent region.
You can lock a child module relative to its parent region without
constraining the parent region to a locked location on the device.
You can create and modify LogicLock regions by using the Chip Planner, the
LogicLock Regions Window command on the Assignments menu, the
Hierarchy tab of the Project Navigator, or by using Tcl scripts. All LogicLock
attributes and constraint information (clock settings, pin assignments, and
relative placement information) are stored in the Quartus II Settings File for
the project.
You can draw LogicLock regions in the Chip Planner with the Create New
Region button and then drag and drop nodes from the floorplan view, the
Node Finder, or the Hierarchy tab of the Project Navigator.
After you have created a LogicLock region, you can use the LogicLock
Regions window to view all of the LogicLock regions in your design,
including size, state, width, height, and origin. You can also edit and add
new LogicLock regions. (Figure 1).
You can also use the LogicLock Regions Properties dialog box to edit
existing LogicLock regions, open the Back-Annotate Assignments dialog
box to back-annotate all nodes in a LogicLock region, view information on
the LogicLock regions in the design, and determine which regions contain
illegal assignments.
After you have performed analysis and elaboration or a full compilation, the
Quartus II software displays the hierarchy of the design in the Hierarchy tab
of the Project Navigator. You can click any of the design entities in this view
and create new LogicLock regions from them, or drag them into an existing
LogicLock region in the Timing Closure floorplan.
Using LogicLock with the Quartus II Area and Timing Optimization chapter in
software volume 2 of the Quartus II Handbook
Altera recommends that you create one LogicLock region for each partition
in your design. You can achieve the best performance when these regions are
all fixed-size, fixed-location regions. Ideally, you should assign the
LogicLock regions manually to specific physical locations in the device by
using the Chip Planner; however, you can also allow the Quartus II software
to assign LogicLock regions to physical locations somewhat automatically
by setting the LogicLock region Size option to Auto and the State properties
to Floating. After the initial compilation, you should back-annotate the
LogicLock region properties (not the nodes) to ensure that all the LogicLock
regions have a fixed size and a fixed location. This process creates initial
floorplan assignments that can be modified more easily, as needed.
After the initial or setup compilation, Altera recommends that you set the
Size to Fixed in order to yield better fMAX results. If device utilization is low,
increasing the size of the LogicLock region may allow the Fitter additional
flexibility in placement and may produce better final results.
1. Create a top-level project. The top-level design file must include the
top-level entity that instantiates all the lower-level subdesigns that you
plan to compile in separate Quartus II projects and import as separate
design partitions.
You must import the design netlist from the Quartus II Exported Partition
File and add it to the database for the top-level project. Importing filters the
assignments from the subdesign and creates the appropriate assignments in
the top-level project.
What’s in Chapter 8:
Introduction 112
Simulating with EDA Tools 113
Using the Quartus II Simulator 119
CHAPTER 8: SIMULATION
INTRODUCTION
Introduction
You can perform functional and timing simulation of your design by using
EDA simulation tools or the Quartus II Simulator. The Quartus II software
provides the following features for performing simulation of designs in
EDA simulation tools:
Figure 1 shows the simulation flow with EDA simulation tools and the
Quartus II Simulator.
Signal Activity
Files (.saf)
Quartus II EDA
EDA Netlist Writer Simulation Tool
quartus_eda (Functional)
Verilog Output
Files, VHDL
Verilog Output Files (.vo), Output Files &
VHDL Output Files (.vho), test bench files
Functional
Standard Delay Format simulation
Output Files (.sdo) & libraries
test bench files (.vt, .vht)
EDA
Simulation Tool
(Timing)
Timing simulation
libraries
Table 1 lists the EDA simulation tools that are supported by the Quartus II
software and indicates which tools support the NativeLink feature.
Simulation NativeLink
Tool Name Support
Cadence NC-Verilog v
Cadence NC-VHDL v
Mentor Graphics ModelSim v
Mentor Graphics ModelSim-Altera v
Active-HDL v
Synopsys VCS MX v
Synopsys VCS v
You can also run the EDA Netlist Writer separately at the command prompt or in a
script by using the quartus_eda executable.
The quartus_eda executable creates a separate text-based report file that can be
viewed with any text editor.
If you want to get help on the quartus_eda executable, type one of the following
commands at the command prompt:
quartus_eda -h r
quartus_eda --help r
quartus_eda --help=<topic name> r
The Quartus II software also allows you to generate the following types of
output files for use in performing functional and timing simulation in EDA
simulation tools:
■ Test Bench Files: You can create Verilog Test Bench Files (.vt) and
VHDL Test Bench Files (.vht) for use with EDA simulation tools from a
Vector Waveform File (.vwf) in the Quartus II Waveform Editor, using
the Export command on the File menu. Verilog HDL and VHDL Test
Bench Files are test bench template files that contain an instantiation of
the top-level design file and test vectors from the Vector Waveform File.
You can also generate self-checking test bench files if you specify the
expected values in the Vector Waveform File.
■ Signal Activity Files: You can create Signal Activity Files for use with
the PowerPlay Power Analyzer. A Signal Activity File contains toggle
rate and static probability data for a design. You can specify a limit for
the signal activity period, and can also specify that glitch filtering can
be performed.
1. If you have not already done so, set up the project in the EDA
simulation tool.
4. Compile the design files and test bench files with the EDA simulation
tool.
3. On the EDA Tool Options page of the Options dialog box, double-click
the Location of Executable column for the appropriate tool and specify
the correct path.
4. Set up the project and a working directory with the EDA simulation
tool.
Simulation Libraries
Altera provides functional simulation libraries for designs that contain
Altera-specific components, and atom-based timing simulation libraries for
designs compiled in the Quartus II software. You can use these libraries to
perform functional or timing simulation of any design with Altera-specific
components in EDA simulation tools that are supported by the Quartus II
software. Additionally, Altera provides pre-compiled functional and timing
simulation libraries for simulation in the ModelSim-Altera software.
Altera provides functional simulation libraries for designs that use Altera
megafunctions and standard library of parameterized modules (LPM)
functions. Altera also provides precompiled versions of the altera_mf and
220model libraries for simulation in the ModelSim software.
Performing simulation with the VCS Synopsys VCS Support chapter in volume 3
software of the Quartus II Handbook
Performing simulation with the Aldec Aldec Active HDL Support chapter in
Active-HDL software volume 3 of the Quartus II Handbook
You can specify the type of simulation that should be performed, the time
period covered by the simulation, the source of vector stimuli, and other
simulation options in the Simulator Settings page of the Settings dialog box
on the Assignments menu or in the Simulator Tool window on the Tools
menu. Figure 3 shows the Simulator Settings page.
The following steps describe the basic flow for performing either a
functional or timing simulation in the Quartus II software:
4. To run the simulation, point to Start on the Processing menu and click
Start Simulation.
The Status window shows the progress of a simulation and the processing
time. The Summary report in the Report window shows the simulation
results.
You can also run the Simulator separately at the command prompt or in a script by
using the quartus_sim executable.
The quartus_sim executable creates a separate text-based report file that can be
viewed with any text editor.
If you want to get help on the quartus_sim executable, type one of the following
commands at the command prompt:
quartus_sim -h r
quartus_sim --help r
quartus_sim --help=<topic name> r
What’s in Chapter 9:
Introduction 126
Running the TimeQuest Timing
Analyzer 126
Early Timing Estimation 131
Performing Timing Analysis
with EDA Tools 135
CHAPTER 9: TIMING ANALYSIS
INTRODUCTION
Introduction
The Quartus II TimeQuest Timing Analyzer allows you to analyze the
performance of all logic in your design and help to guide the Fitter to meet
timing requirements. The TimeQuest analyzer uses industry-standard
Synopsys Design Constraint (SDC) methodology for constraining designs
and reporting results. You can use the information generated by the timing
analyzer to analyze, debug, and validate the timing performance of your
design.
■ View pane
■ Tasks pane
■ Console
■ Report pane
Report pane
View pane
Tasks pane
Console
Tasks Pane
The Tasks pane provides easy access to commonly performed tasks such as
netlist and report generation. Each command found in the Tasks pane has
an equivalent Tcl command, which you can specify and view results from in
the Console.
Console
The Console displays messages and a command prompt for the TimeQuest
analyzer. The Console has two tabs: the Console tab and the History tab. All
information and warning messages appear in the Console tab. All executed
Synopsys Design Constraints files and Tcl commands are recorded in the
History tab. You can rerun a command in the History tab after the timing
netlist has been updated by right-clicking the command you want to repeat,
and then clicking Rerun.
Report Pane
The Report pane lists the reports you generate from the Tasks pane and
those that are generated by any custom report commands. Once you select a
report from the Report pane, the report appears in the View pane. If a report
is out-of-date with respect to the current constraints, a “?” icon is shown next
to the report.
You can use the Write SDC File command to save the constraints you have
created to a Synopsys Design Constraints File (.sdc).
View Pane
The View pane displays timing analysis results, including any summary
reports, custom reports, or histograms. Figure 2 shows the View pane when
you use the Report Clocks command in the Tasks pane for a design that
includes two defined clocks, clk and clkx2.
The TimeQuest analyzer reports results only when requested. You can
customize each report on demand to display specific timing information.
You can make the following types of individual timing assignments in the
TimeQuest analyzer:
■ False paths—You can designate as false paths any paths in the design
which the timing analyzer disregards during analysis and reporting. By
default, the Quartus II software cuts (directs the timing analyzer to
ignore) paths between unrelated clock domains when there are no
timing requirements set or only the default required fMAX clock setting
is used. The Quartus II software also cuts paths between unrelated
clock domains if individual clock assignments are set but there is no
defined relationship between the clock assignments.
You can also run the TimeQuest analyzer separately at the command prompt or in
a script by using the quartus_sta executable. You must run the Quartus II Fitter
executable quartus_fit before running the TimeQuest analyzer.
The quartus_sta executable creates a separate text-based report file that can be
viewed with any text editor.
You can also launch the quartus_sta Tcl scripting shell, to run timing-related Tcl
commands, by typing the following command at a command prompt:
quartus_sta -s r
If you want to get help on the quartus_sta executable, type one of the following
commands at the command prompt:
quartus_sta --h r
quartus_sta --help r
quartus_sta --help=<topic name> r
Additionally, the quartus_staw executable provides the GUI for the TimeQuest
analyzer as a stand-alone application.
To generate data for an early timing estimate before completely fitting the
design, on the Processing menu, point to Start, and then click Start Early
Timing Estimate. You can specify options for early timing estimation in the
Early Timing Estimate page under Compilation Process Settings in the
Settings dialog box on the Assignments menu. You can select from the
following options:
■ Realistic
■ Optimistic
■ Pessimistic
The Report Timing dialog box allows you to filter reported paths. For
information on every constrained path in the design (except false paths),
leave the fields in the Report Timing dialog box unchanged and click
Report Timing. (Figure 4).
You can also use the Locate Path command to take advantage of the Chip
Planner features for making assignments to a specific path. For more
information on using the Chip Planner, refer to “Using the Chip Planner” on
page 141 in Chapter 10, “Timing Closure.”
Using the Quartus II Technology Map Analyzing Designs with Quartus II Netlist
Viewer Viewers chapter in volume 1 of the
Quartus II Handbook
You can also generate the files by pointing to Start on the Processing menu,
and then clicking Start EDA Netlist Writer after an initial compilation. If
you are using the NativeLink feature, you can also run a timing analysis
after an initial compilation by clicking Run EDA Timing Analysis Tool on
the Tools menu.
You can also run the EDA Netlist Writer to generate the necessary output files
separately at the command prompt or in a script by using the quartus_eda
executable. You must run the Quartus II Fitter executable quartus_fit before
running the EDA Netlist Writer.
The quartus_eda executable creates a separate text-based report file that can be
viewed with any text editor.
If you want to get help on the quartus_eda executable, type one of the following
commands at the command prompt:
quartus_eda -h r
quartus_eda -help r
quartus_eda --help=<topic name> r
With the NativeLink feature, you can specify that the Quartus II software
launches the PrimeTime software in either command-line or GUI mode. You
can also specify a Synopsys Design Constraints File that contains timing
assignments for use in the PrimeTime software.
The following steps describe the basic flow to manually use the PrimeTime
software to perform timing analysis on a design after compilation in the
Quartus II software:
1. Specify EDA tool settings, either in the Settings dialog box on the
Assignments menu, or during project setup, with the New Project
Wizard, on the File menu.
3. Source the Quartus II-generated Tcl Script File to set up the PrimeTime
environment.
The following steps describe the basic flow for generating STAMP model
files:
1. Specify EDA tool settings, either in the Settings dialog box on the
Assignments menu, or during project setup, using the New Project
Wizard on the File menu.
3. Use the STAMP model files in the Tau software to perform board-level
timing verification.
Using the Mentor Graphics Tau “About Using the Tau Software with the
software with the Quartus II software Quartus II Software” in Quartus II Help
Introduction
The Quartus II software offers a fully integrated timing closure flow that
allows you to meet your timing goals by controlling the synthesis and place
and route of a design. Using the timing closure flow results in faster timing
closure for complex designs, reduced optimization iterations, and automatic
balancing of multiple design constraints.
The timing closure flow allows you to perform an initial compilation, view
design results, and perform further design optimization efficiently. You can
use Chip Planner to analyze the placement and routing of the design and
make assignments, use the Timing Optimization Advisor to view
recommendations for optimizing your design for timing, use netlist
optimizations on the design after synthesis and during place and route, use
LogicLock region assignments, and use the Design Space Explorer (DSE) to
further optimize the design. Figure 1 shows the timing closure flow.
The Quartus II Chip Planner provides a single interface for viewing and making
changes to the design floorplan as well as making ECO-style post-fit netlist changes.
For the list of devices supported by Chip Planner, see Quartus II Help.
to Quartus II
Compiler
Netlist
from Quartus II Optimizations
Compiler No
Performance
Met?
Timing
Optimization
Yes Advisor
The Quartus II Chip Planner provides a single interface for viewing and making
changes to the design floorplan as well as making ECO-style post-fit netlist changes.
For the list of devices supported by Chip Planner, see Quartus II Help.
■ Floorplan editing
■ Post compilation editing
■ Partition display
■ Clock region assignment creation
You can use the Layers Settings command on the View menu to select more
than one combination of these elements for a customized view of your
design in the device. You can view global and local routing, ports, used and
unused assignments, pin and location assignments, user and fitter-placed
LogicLock regions, clock regions, and other elements in any combination.
Making Assignments
To facilitate achieving timing closure, the Chip Editor assignment tasks
allow you to make or change location assignments directly in the floorplan.
You can create and assign nodes or entities to custom regions and to
LogicLock regions, and you can also edit existing assignments to logic cells,
rows, columns, regions, MegaLAB structures, and LABs. You can also locate
any node (or set of nodes) and make assignments in the Assignment Editor.
Working with the Chip Planner Engineering Change Management with the
Chip Planner chapter in volume 2 of the
Quartus II Handbook
You can specify synthesis and physical synthesis netlist optimizations in the
Physical Synthesis Optimizations page of the Settings dialog box. See
Figure 3 on page 145.
Analysis
&Synthesis
Optimizations
Physical Synthesis
Optimizations
Netlist optimizations for physical synthesis and fitting include the following
groups of options:
■ Effort level: Specifies the level of effort used by the Quartus II software
when performing physical synthesis (Normal, Extra, and Fast).
Path-Based Assignments
The Quartus II software enables you to assign specific source and
destination paths to LogicLock regions, allowing for easy grouping of
critical design nodes into a LogicLock region. You can create path-based
assignments with the Add Paths dialog box, by dragging and dropping
critical paths from the Timing Analyzer reports and the Chip Planner into
LogicLock regions.
The Add Path dialog box allows you to specify a path by identifying a source
and destination node and using wildcards when identifying nodes. You can
click List Nodes to determine how many nodes are assigned to the
LogicLock region. You open this dialog box by clicking Add Path in the
General tab of the LogicLock Region Properties dialog box, or by
double-clicking a path in the Chip Planner. Figure 4 shows the Add Path
dialog box.
To run the Design Space Explorer click Launch Design Space Explorer on
the Tools menu. For more information on using the Design Space Explorer,
refer to “Using the Design Space Explorer” on page 98 in Chapter 6, “Place
and Route”.
Introduction
The Quartus II PowerPlay Power Analysis Tools provide an interface that
allows you to estimate static and dynamic power consumption throughout
the design cycle. The PowerPlay Power Analyzer performs postfitting
power analysis and produces a power report that highlights, by block type
and entity, the power consumed. The Altera PowerPlay Early Power
Estimator estimates power consumption at other stages of the design
process and produces a Microsoft Excel-based spreadsheet with estimate
information.
User-defined settings
PowerPlay Early
Power Estimator
Spreadsheet
from Quartus II
Compiler
You can then start power analysis by clicking Start in the Power Analyzer
Tool window. When power analysis is complete, click Report to display the
Report File (.rpt, .htm). Figure 2 shows the Power Play Power Analyzer
Tool dialog box.
The Start button starts The progress bar shows The Report button displays
power analysis. the elapsed time spent the Power Analysis section
processing the design. of the Report File.
You can also run the PowerPlay Power Analyzer separately at the command prompt
or in a script by using the quartus_pow executable. You must run the Quartus II
Fitter, quartus_fit (and in some cases quartus_asm), successfully before running
the PowerPlay Power Analyzer.
The quartus_pow executable creates a separate text-based report file that can be
viewed with any text editor.
If you want to get help on the quartus_pow executable, type one of the following
commands at the command prompt:
quartus_pow -h r
quartus_pow -help r
quartus_pow --help=<topic name> r
Depending on the target device family, you can also specify default
operating conditions for power analysis. You can specify the junction
temperature, cooling solution requirements, and device characteristics in the
Operating Settings and Conditions pages of the Settings dialog box.
You can use the PowerPlay Early Power Estimator to estimate power at any
stage of the design process; however, Altera recommends that you use the
PowerPlay Power Analyzer, rather than the PowerPlay Early Power
Estimator, after the design is complete in order to obtain the most accurate
power analysis.
If you use the PowerPlay Early Power Estimator before you start your
design, you can specify device resources, operating frequency, toggle rates,
and other parameters for the PowerPlay Early Power Estimator. If you use it
after you have created a design, you can compile the design in the Quartus II
software and then use the Generate Power Play Early Power Estimator File
command on the Project menu to generate a power estimation file, which is
a text-based file named <revision name>_early_pwr.csv that contains power
information for the current device and design. You can then import this
power estimation file into the PowerPlay Early Power Estimator.
Power calculations that are provided by the PowerPlay Early Power Estimator should
be used only as an estimation of power, not as a specification. Be sure to verify the
actual ICC during device operation, because this measurement is sensitive to the
actual device design and the environmental operating conditions.
Using the PowerPlay Early Power Power Calculator User Guide on the Altera
Estimator website
Introduction
Once you have successfully compiled a project with the Quartus II software,
you can program or configure an Altera device. The Assembler module of
the Quartus II Compiler generates programming files that the Quartus II
Programmer can use to program or configure a device with Altera
programming hardware. You can also use a stand-alone version of the
Quartus II Programmer to program and configure devices. Figure 1 shows
the programming design flow.
Chain
Programmer Object Description
Files (.pof) & SRAM Files (.cdf)
Object Files (.sof)
I/O Pin
Jam Files (.jam) & State
Jam Byte-Code Files (.ips)
Files (.jbc)
Quartus II Convert
to other systems, such
Programming Files
Serial Vector Format as embedded
quartus_cpf processors
Files (.svf) & In System
Configuration Files (.isc)
You can start a full compilation in the Quartus II software, which includes
the Assembler module, or you can run the Assembler separately.
You can also run the Assembler separately at the command prompt or in a script by
using the quartus_asm executable. You must run the Quartus II Fitter executable,
quartus_fit, successfully before running the Assembler.
The quartus_asm executable creates a separate text-based report file that can be
viewed with any text editor.
If you want to get help on the quartus_asm executable, type one of the following
commands at the command prompt:
quartus_asm -h r
quartus_asm -help r
quartus_asm --help=<topic name> r
You can also direct the Quartus II software to generate programming files in
other formats by using one of the following methods:
■ The Device and Pin Options dialog box, which is available on the
Device page of the Settings dialog box, allows you to specify optional
programming file formats, such as Hexadecimal (Intel-Format) Output
Files (.hexout), Tabular Text Files (.ttf), Raw Binary Files (.rbf), Jam™
Files (.jam), Jam Byte-Code Files (.jbc), Serial Vector Format Files (.svf),
and In System Configuration Files (.isc).
The Programmer uses the Programmer Object Files and SRAM Object Files
generated by the Assembler to program or configure all Altera devices
supported by the Quartus II software. You use the Programmer with Altera
programming hardware, such as the MasterBlaster™, ByteBlasterMV™,
ByteBlaster™ II, USB-Blaster™, or EthernetBlaster download cable; or the
Altera Programming Unit (APU).
If you want to use only the Quartus II Programmer, you can install the stand-alone
version of the Quartus II Programmer, quartus_pgmw, instead of installing the
complete Quartus II software.
The Programmer allows you to create a Chain Description File (.cdf) that
contains the name and options of devices used for a design. You can also
open a JTAG Chain File (.jcf) or FLEX Chain File (.fcf) and save it in the
Quartus II Programmer as a Chain Description File.
You can also run the Programmer separately at the command prompt or in a script
by using the quartus_pgm executable. You may need to run the Assembler
executable, quartus_asm, in order to produce a programming file before running
the Programmer.
If you want to get help on the quartus_pgm executable, type one of the following
commands at the command prompt:
quartus_pgm -h r
quartus_pgm -help r
quartus_pgm --help=<topic name> r
■ Passive Serial
■ JTAG
■ Active Serial
■ In-Socket
The Passive Serial and JTAG programming modes allow you to program
single or multiple devices using a Chain Description File and Altera
programming hardware. You can program a single EPCS1 or EPCS4 serial
configuration device using Active Serial Programming mode and Altera
programming hardware. You can program a single CPLD or configuration
device using In-Socket Programming mode with a Chain Description File
and Altera programming hardware.
You can use the Convert Programming Files dialog box to set up output
programming files by arranging the chain of SRAM Object Files stored in a
HEXOUT File for SRAM, Programmer Object Files, Raw Binary Files, or
For Programmer Object Files for Local Update and Programmer Object Files
for Remote Update, you can specify the following information:
You can also use the Convert Programming Files dialog box to arrange and
combine multiple SRAM Object Files into a single Programmer Object Files
in Active Serial Configuration mode. The Programmer Object File can be
used to program an EPCS1 or EPCS4 serial configuration device, which can
then be used to configure multiple devices.
You can also run the Convert Programming Files feature separately at the command
prompt or in a script by using the quartus_cpf executable. You may need to run
the Assembler executable, quartus_asm, in order to produce a programming file
before running the Programmer.
If you want to get help on the quartus_cpf executable, type one of the following
commands at the command prompt:
quartus_cpf -h r
quartus_cpf -help r
quartus_cpf --help=<topic name> r
You can specify that remote clients should be enabled to connect to the JTAG
server in the Configure Local JTAG Server dialog box, which is available
from the JTAG Settings tab of the Hardware Setup dialog box.
You can specify the remote server you want to connect to in the Add Server
dialog box, which is available from the JTAG Settings tab of the Hardware
Setup dialog box. When you connect to a remote server, the programming
hardware type that is attached to the remote server is displayed in the
Hardware Settings tab.
Introduction
The Quartus II SignalTap II Logic Analyzer, the External Logic Analyzer
Interface, the SignalProbe feature, the In-System Memory Content Editor,
and the In-System Sources and Probes Editor enable you to analyze internal
device nodes and I/O pins while operating in-system and at system speeds.
The SignalTap II Logic Analyzer is an embedded logic analyzer that routes
the signal data through the JTAG port to the Quartus II software based on
user-defined trigger conditions. You can use the External Logic Analyzer
Interface to connect an off-chip logic analyzer to nodes in the design. The
SignalProbe feature uses otherwise unused device routing resources to route
selected signals to an external logic analyzer or oscilloscope. The In-System
Memory Content and In-System Sources and Probes Editors allow you to
view and modify, at run-time, data in a design.
SignalTap II
File (.stp)
Quartus II
Analysis & Synthesis
quartus_map
for standard
SignalTap II flow
Quartus II Fitter Quartus II Assembler
quartus_fit quartus_asm
Programming
Quartus II Files
Altera Device Programmer
quartus_pgm
External Logic
SignalTap II
Analyzer or
Logic Analyzer View data in the Quartus II software
Oscilloscope via the JTAG programming interface
from Quartus II
Compiler (Full Compilation)
Programming
Files
Each logic analyzer instance is embedded in the logic on the device. The
SignalTap II Logic Analyzer supports up to 1,024 channels and 128K
samples on a single device.
After compilation, you can run the SignalTap II Logic Analyzer with the
Run Analysis command on the Processing menu.
The following steps describe the basic flow of setting up a SignalTap II File
and acquire signal data:
2. Add instances to the SignalTap II File and nodes to each instance. You
can use the SignalTap II filters in the Node Finder to find all
pre-synthesis and post-fitting SignalTap II nodes.
4. Set other options, such as sample depth and trigger level, and assign
signals to the data/trigger input and debug port.
If you want to use only the SignalTap II Logic Analyzer, you can use the stand-alone
graphical user interface version of the SignalTap II Logic Analyzer, quartus_stpw.
You can use the following features to set up the SignalTap II Logic Analyzer:
associated instance, and the number of logic elements and memory bits
used in the associated instance. The Instance Manager helps you to
check the amount of resource usage that each logic analyzer requires on
the device. You can start multiple logic analyzers at the same time by
selecting them and clicking Run Analysis on the Processing menu.
You can configure the logic analyzer with up to ten trigger levels, which
help you view only the most significant data. You can specify four
separate trigger positions: pre, center, post, and continuous. The trigger
position allows you to specify the amount of data that should be
acquired before the trigger and after.
In the waveform view, you can insert time bars, align node names, and
duplicate nodes; create, rename, and ungroup a bus; specify a data format
for bus values; and print the waveform data. The data log that is used to
create the waveform shows a history of data that is acquired with the
SignalTap II Logic Analyzer. The data is organized in a hierarchical manner;
logs of captured data with the same trigger are grouped together in Trigger
Sets. Figure 5 shows the waveform view.
The Waveform Export utility allows you to export the acquired data to the
following industry-standard formats that can be used by other tools:
You can also configure the SignalTap II Logic Analyzer to create mnemonic
tables for a group of signals. The mnemonic table feature allows you to
assign a predefined name to a set of bit patterns, so that captured data is
more meaningful. See Figure 6.
Using the SignalTap II Logic Analyzer Design Debugging Using the SignalTap II
Embedded Logic Analyzer chapter in
volume 3 of the Quartus II Handbook
Logic Analyzer Interface Files (.lai) appear in the Logic Analyzer Interface
Editor window.
Edit the Logic Analyzer Interface File to specify the number of pins and
banks to use, and the capture mode. In the Output/Capture mode list,
specify Combinational/Timing or Registered State. In the Clock box,
specify the clock signal associated with the design. In the Power-up state list,
select Bank 0 or Tri-stated.
To specify the nodes to be observed, in the Setup View pane, select a bank
from the list. Click the table of banks to open the Node Finder to find and use
any node name in a Quartus II project after you have performed
compilation. In the Nodes Found list, select the node names you want to
analyze. Click OK. Connect the probe points from your external logic
analyzer to the debug header of your device.
To enable the Logic Analyzer Interface for a project, turn on Enable Logic
Analyzer Interface on the Logic Analyzer Interface page of the Settings
dialog box on the Assignments menu. In the Logic Analyzer Interface file
name box, specify the name of the Logic Analyzer Interface File you want to
enable. Click OK, and then program the device.
Using SignalProbe
The SignalProbe feature allows you to route user-specified signals to output
pins without affecting the existing fitting in a design, so that you can debug
signals without having to perform another full compilation. Starting with a
fully routed design, you can select and route signals for debugging through
I/O pins that were either previously reserved or are currently unused.
The SignalProbe feature allows you to specify which signals in the design to
debug, perform a SignalProbe compilation that connects those signals to
unused or reserved output pins, and then send the signals to an external
logic analyzer. You can use the Node Finder when assigning pins to find the
available SignalProbe sources. A SignalProbe compilation typically takes
approximately 20% to 30% of the time required for a standard compilation.
2. Select signals for debugging and the I/O pins to route the signals, and
point to Signal Probe Pins on the Tools menu, and then click
SignalProbe Pins. Figure 7 shows the Signal Probe Pins dialog box.
4. Configure the device with the new programming data to examine the
signals.
You can also use the register pipelining feature to force signal states to
output on a clock edge, or to delay a signal output. You can also use register
pipelining to synchronize multiple SignalProbe outputs from a bus of
signals.
You can use the SignalProbe feature with Tcl. With Tcl commands, you can
add and remove SignalProbe assignments and sources, perform a
SignalProbe compilation on a design, and compile routed SignalProbe
signals in a full compilation.
You can enable RAM and ROM for the In-System Memory Content Editor
with the MegaWizard Plug-In Manager on the Tools menu when
generating lpm_rom, lpm_ram_dq, altsyncram, and lpm_constant
megafunctions or when instantiating these megafunctions directly in the
design, with the LPM_HINT megafunction parameter.
The In-System Memory Content Editor captures and updates data in the
device. You can export or import data in Memory Initialization File (.mif),
Hexadecimal (Intel-Format) File (.hex), and RAM Initialization File (.rif)
formats. The In-System Memory Content Editor offers the following
features:
■ HEX Editor: used to make edits and save changes to in-system memory
at run-time, to display the current data within the memory block, and
to update or offload selected sections of a memory block. You can use
the Go To command shortcut to automatically go to a specific data
address within a specific memory block within a specific instance.
Words are displayed with each hexadecimal value separated by a
space. Memory addresses are displayed in the left column, and the
ASCII values (if the word width is a multiple of eight) in the right
column. Each memory instance has a separate pane in the HEX Editor.
Figure 8 shows the HEX Editor in the In-System Memory Content
Editor window.
To add in-system sources and probes functionality to your design, you must
first customize and instantiate the altsource_probe megafunction. Like any
other megafunction, the altsource_probe megafunction can be easily
customized using the MegaWizard Plug-In Manager. Each source or probe
port can be up to 256 bits wide. You can have up to 128 instances of the
altsource_probe megafunction in your design.
The Sources and Probes Editor window organizes and displays the data
from all sources and probes in your design, organized according to the index
numbers of the altsource_probe instances. The editor provides an easy way
to manage your signals, allowing you to rename signals or to group them
into buses. All data collected from source and probe nodes are recorded in
the event log and displayed as a timing diagram. The In-System Sources and
Probes Editor has the following features:
■ Sources and Probes Editor Window—Displays the data read from the
selected instance and allows you to modify source data to be written to
your device.
Using the In-System Sources and Design Debugging Using In-System Sources
Probes Editor and Probes chapter in volume 3 of the
Quartus II Handbook
For more information on using the RTL Viewer and the Technology Map
Viewer, refer to “Analyzing Synthesis Results With the Netlist Viewers” and
“The Technology Map Viewer” on pages 77 and 80 in Chapter 5,
“Synthesis.”
Introduction
The Quartus II software allows you to make small modifications, often
referred to as engineering change orders (ECO), to a design after a full
compilation. These ECO changes can be made directly to the design
database, rather than to the source code or the Quartus II Settings File (.qsf).
Making the ECO change to the design database allows you to avoid running
a full compilation in order to implement the change. Figure 1 shows the
engineering change management design flow.
from Quartus II
Compiler (full Resource Change
compilation) Chip Planner
Property Editor Manager
Compiler
Database
Files (.cdb)
to Assembler, EDA
Netlist Writer, or
Timing Analyzer
The following steps describe the design flow for engineering change
management in the Quartus II software.
1. After a full compilation, use the Chip Planner to view design placement
and routing details and identify which resources you want to change.
4. Repeat steps 2 and 3 until you have finished making all changes.
5. View the summary and status of your changes in the Change Manager
and control which changes to resource properties are implemented
and/or saved. Add comments to help you reference each change.
6. Use the Start Check & Save All Netlist Changes command on the
Processing menu to check the legality of the change for all of the other
resources in the netlist.
7. Run the Assembler to generate a new programming file or run the EDA
Netlist Writer to generate a new netlist.
You can then use the information from the Chip Planner to determine which
properties and settings you may want to edit in the Resource Property
Editor. Right-click one or more resources in the Chip Planner, and then click
Locate in Resource Property Editor to open the Resource Property Editor
and make edits to the resource(s). Refer to “Modifying Resource Properties
With the Resource Property Editor” on page 192 for more information.
Using the Chip Planner “About the Chip Planner” and “Making
Post-Compilation Changes” in Quartus II
Help
To create a new atom, select Post Compilation Editing (ECO) from the Task
list in the Chip Planner, then right-click a resource location and click Create
Atom. After specifying a new name for the atom, you can then right-click the
atom and click Locate in Resource Property to modify the properties and
connections for the new atom.
Property table displays the properties Port connection table Cell delay panel shows
and values for the selected resource shows the input and delay information for the
and allows you to make changes output ports selected node
You can make changes to the resource in the schematic, the port connection
table, or the property table. If you make a change in the port connection table
or property table, that change is reflected automatically in the schematic
diagram. You can also view equation and cell delay information.
right-clicking the port and clicking Create or Remove. In the schematic, you
can right-click a node and then specify one or more fan-outs to remove with
the Fan-Outs dialog box by pointing to Remove and clicking Fan-Outs.
Once you have made a change, you can use the Check Resource Properties
command on the Edit menu to perform simple design-rule checking on the
resource. On the Processing menu point to Start then click Check and Save
All Netlist Changes to save the changes you have made to atoms before you
run the Assembler. You can also view a summary of your changes in the
Change Manager. Refer to the next section, “Viewing & Managing Changes
with the Change Manager,” for more information.
Using the Resource Property Editor “About the Resource Property Editor” and
“About Making Post-Compilation Changes”
in Quartus II Help
The log view of the Change Manager displays the following information for
each ECO change:
■ Index
■ Node Name
■ Change Type
■ Old Value
■ Target Value
■ Current Value
■ Disk Value
■ Comments (your comments about the ECO change)
Green shading in the Current Value column indicates that the changes have
been applied to the current value. Blue shading in the Disk Value column
indicates that the changes have been saved successfully to disk.
After you have committed the changes you want, right-click the change and
click Check & Save All Netlist Changes to check the legality of the change
for all of the other resources in the netlist. When you choose one of the
commands for exporting, you can save the exported data as a Tcl Script File
(.tcl), which is a sequence of Chip Planner Tcl commands that can be sourced
back into the Quartus II software to reproduce a set of changes if the Change
Manager log has been lost or corrupted. You can also save a Comma-
Separated Values File (.csv) or a Text File (.txt)—these files contain tabular
representations of the data for documentation purposes.
Using the Change Manager “About the Change Manager” and “About
Making Post-Compilation Changes” in
Quartus II Help
Introduction
The Quartus II software allows you to use formal verification EDA tools to
verify the logical equivalence between source design files and Quartus II
output files. Figure 1 shows the formal verification flow.
EDA Synthesis
Tools
Verilog
Quartus
Mapping
Files (.vqm) Quartus II Quartus II Fitter
Analysis & Synthesis quartus_fit
quartus_map
Quartus II
Gate-level VQM Files
EDA Netlist Writer
compared against Quartus II quartus_eda
Verilog Output Files (.vo)
Verilog
Output
EDA Formal Files (.vo)
Verification Tool
RTL VHDL & Verilog HDL source
design files compared against
Verilog Output Files (.vo) (Cadence Compared against VQM Tool-specific
Encounter Conformal Only) Files or RTL source files formal
verification
scripts
Quartus II Formal
Verification Libraries
between RTL VHDL design files (.vhd) or Verilog HDL design files (.v) and
Quartus II–generated Verilog Output Files. Figure 2 shows which file types
are compared in formal verification.
Compared with
Compared with
In the Formal Verification page under EDA Tool Settings in the Settings
dialog box on the Assignments menu, you can specify the EDA formal
verification tool you are using. See Figure 3.
Altera recommends that you turn off these options because they often result
in moving and merging registers along the critical path, which may affect
the registers in cones of logic that the formal verification tools may use as
comparison points.
Introduction
The Quartus II software supports the SOPC Builder and DSP Builder
system-level design flows. System-level design flows allow engineers to
rapidly design and evaluate system-on-a-programmable-chip (SOPC)
architectures and design at a higher level of abstraction.
Intellectual
Processors OS/RTOS
property (IP)
Select components
MATLAB/ Intellectual
DSP Builder Simulink property (IP)
SignalCompiler
Quartus II ModelSim/
EDA Synthesis SOPC
Analysis & Synthesis ModelSim-Altera
Tool Builder
quartus_map Simulator
Quartus II
Fitter
quartus_fit
Quartus II
EDA Netlist Writer
quartus_eda
Quartus II Assembler
quartus_asm
Altera Programming
Software and
Hardware
■ Processors
■ Intellectual property (IP) and peripherals
■ Memory interfaces
■ Communications peripherals
■ Buses and interfaces, including the Avalon™ interface
■ Digital signal processing (DSP) cores
■ Software
■ Header files
■ Generic C drivers
■ Operating system (OS) kernels
You can use the System Contents page of SOPC Builder to define the
system. You can select library components in the module pool and display
the added components in the module table.
You can use the information in the module table of the System Contents
page or in a separate wizard to define the following component options:
Once system definition is complete, you can generate the system using the
System Generation page of SOPC Builder.
SOPC Builder can also create software development kit (SDK) software
components, such as header files, generic peripheral drivers, custom
software libraries, and OS/real-time operating system (RTOS kernels), to
provide a complete design environment when the system is generated.
A Tcl script that sets up all the files necessary for compilation of the system
in the Quartus II software is also generated.
DSP Builder also provides support for system-level debugging using the
SignalTap II block or the Hardware in the Loop (HIL) block. You can
synthesize, compile and download the design, and then perform debugging,
all through the MATLAB/Simulink interface. Adding the Hardware in the
Loop block to your Simulink model allows you to co-simulate a Quartus II
software design with a physical FPGA board implementing a portion of that
design. You define the contents and function of the FPGA by creating and
compiling a Quartus II project. A simple JTAG interface between Simulink
and the FPGA board links the two.
Instantiating Functions
You can combine existing MATLAB functions and Simulink blocks with
Altera DSP Builder blocks and MegaCore functions, including those that
support the OpenCore Plus hardware evaluation feature, to link
system-level design and implementation with DSP algorithm development.
You can use the automated flow to control the entire synthesis and
compilation flow from within the MATLAB/Simulink design environment.
The SignalCompiler block creates VHDL Design Files and Tcl scripts,
performs synthesis in the Quartus II, LeonardoSpectrum, or Synplify
software, compiles the design in the Quartus II software, and can also
optionally download the design to a DSP development board. You can
specify which synthesis tool to use for the design from within the Simulink
software.
In the manual flow, the SignalCompiler block generates VHDL Design Files
and Tcl scripts that you can then use to perform synthesis manually in an
EDA synthesis tool, or the Quartus II software, which allows you to specify
your own synthesis or compilation settings. When generating output files,
the SignalCompiler block maps each Altera DSP Builder block to the VHDL
library. MegaCore functions are treated as black boxes.
Using the DSP Builder DSP Builder User Guide on the Altera
website
■ Pentium III (400 MHz or faster) based computer, running one of the
following Windows operating systems:
– Microsoft Windows XP
– Microsoft Windows Vista (32-bit and 64-bit)
The following steps describe the basic flow for licensing your software:
1. When you start the Quartus II software, if the software cannot detect a
valid ASCII text license file, license.dat, you see a prompt with the
following options:
– Start the 30-day evaluation period with no license file (no device
programming file support). This option allows you to evaluate
the Quartus II software, without programming file support, for
30 days. After the 30-day grace period is over, you must obtain a
valid license file from the Licensing section of the Altera website
at www.altera.com/licensing, and then follow the remaining steps
in this procedure.
2. If you are requesting a new license file, in the Licensing section of the
Altera website, choose the link for the appropriate license type. Refer to
Table 1 on page 213.
6. Set up and configure the FLEXlm license manager server for your
system.
To register for an Altera.com account user name and password, follow these
steps:
or
If you are not a current Altera subscription user, you can still register for an
Altera.com account.
Resource Description
(408) 544-8767
(7:00 a.m. to 5:00 p.m. Pacific time, M–F)
To print Help topics from the Contents tab, right-click the Help folder or individual
Help topic that you want to print, and click Print or click the Print button on the
toolbar. If you select a Help folder to print, you can choose to print all the topics in
the folder. You can also use the Print command or Print button to print any
individual Help topic you are viewing.
To search for a keyword in an open Quartus II Help topic, press Ctrl+F to open the
Find dialog box, and type the search text, and then click Find Next.
This tutorial includes audio and Flash animation components. For best
results, use the tutorial on a system that includes a sound card, speakers, and
at least 1024x768 display resolution.
Once you start the tutorial, you can jump immediately to any tutorial
module by clicking Contents. Once you select a tutorial module, you can
click Show Me, Guide Me, or Test Me at any time to jump directly to the
tutorial mode that best suits your learning style.
The literature that is available from the Altera website is the most current
information about Altera products and features; it is updated frequently,
even after a product has been released. Altera continues to add new
literature in order to provide more information on the latest features of
Altera tools and devices, and to provide additional information that Altera
customers have requested.
P Quartus II software
command-line design flow 16
partitions 12, 57, 58, 107 EDA tool design flow 7
path-based assignments 148 general design flow 2
Perl scripts 21 GUI design flow 3
Physical Synthesis Optimizations Quartus II Workspace Files (.qws) 31
page 94, 144 quartus_asm executable 18, 161
physical synthesis, optimization 94, 145 quartus_cdb executable 18, 37
Pin Planner 54 quartus_cpf executable 18, 166
place and route quartus_drc executable 17, 75
see also fitting quartus_eda executable 18, 115, 137
design flow 84 quartus_fit executable 17, 85
POFs 161 quartus_map executable 17, 65
power analysis 152 quartus_pgm executable 18, 163
PowerPlay Early Power Estimator 156 quartus_pgmw executable 17, 140, 141, 162
PowerPlay Power Analyzer 152 quartus_pow executable 18, 154
PowerPlay Power Analyzer Tool 154 quartus_sh executable 19
PowerFit Fitter 84 quartus_si executable 19
PowerPlay Early Power Estimator 152, 156 quartus_sim executable 18, 121
PowerPlay Power Analyzer Settings quartus_sta executable 17
page 154 quartus_staexecutable 130
PowerPlay Power Analyzer Tool 152, 154 quartus_stp executable 18
PowerPlay Power Analyzer Tool quartus_stpw executable 17, 140, 141, 173
command 152
Priority dialog box 105 R
Programmer 160
quartus_pgm executable 163 Raw Binary Files (.rbf) 161
quartus_pgmw executable 17, 140, 141 Remove Connection command 193
stand-alone version 17, 140, 141, 162 Report window 89
Programmer Object Files (.pof) 161 Resource Optimization Advisor 95
programming 160 Resource Property Editor 186, 192
design flow 160 revisions 33
programming hardware 162 Revisions dialog box 33
programming files routing 84
converting 161 RTL Viewer 77, 185
Project Navigator window 32 Run EDA Simulation Tool command 115
Run EDA Timing Analysis Tool
Q command 136
U
USB-Blaster download cable 162, 171
V
Value Change Dump Files (.vcd) 152, 177
Vector Files (.vec), 122
Vector Table Output Files (.tbl) 122
Vector Waveform Files (.vwf) 122, 177
MNL-01045-1.0