7. the quartus ii timequest timing analyzer...with the timequest analyzer gui or with a tcl script....

60
QII53018-13.1.0 © 2013 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, HARDCOPY, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services. Quartus II Handbook Version 13.1 Volume 3: Verification November 2013 Feedback Subscribe Twitter ISO 9001:2008 Registered 7. The Quartus II TimeQuest Timing Analyzer The Quartus ® II TimeQuest Timing Analyzer is a powerful ASIC-style timing analysis tool that validates the timing performance of all logic in your design using an industry-standard constraint, analysis, and reporting methodology. Use the TimeQuest analyzer GUI or command-line interface to constrain, analyze, and report results for all timing paths in your design. This chapter contains the following sections: “Getting Started with the TimeQuest Analyzer” “Constraining and Analyzing with Tcl Commands” on page 7–7 “Creating Clocks and Clock Constraints” on page 7–14 “Creating I/O Requirements” on page 7–24 “Creating Delay and Skew Constraints” on page 7–26 “Creating Timing Exceptions” on page 7–27 “Examples of Basic Multicycle Exceptions” on page 7–35 “Application of Multicycle Exceptions” on page 7–44 “Timing Reports” on page 7–57 f For more information about basic timing analysis concepts and how they pertain to the TimeQuest analyzer, refer to the Timing Analysis Overview chapter in volume 3 of the Quartus II Handbook. f For more information about Altera resources available for the TimeQuest analyzer, refer to the TimeQuest Timing Analyzer Resource Center of the Altera website. f For more information about the TimeQuest analyzer, refer to the Altera Training page of the Altera website. November 2013 QII53018-13.1.0

Upload: others

Post on 21-Feb-2020

48 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

QII53018-13.1.0

© 2013 Altera Corporation. All rights reserved. ALTERA, ARRIare trademarks of Altera Corporation and registered in the U.Strademarks or service marks are the property of their respectivsemiconductor products to current specifications in accordanceservices at any time without notice. Altera assumes no responsdescribed herein except as expressly agreed to in writing by Alon any published information and before placing orders for pr

Quartus II Handbook Version 13.1Volume 3: VerificationNovember 2013

November 2013QII53018-13.1.0

7. The Quartus II TimeQuestTiming Analyzer

The Quartus® II TimeQuest Timing Analyzer is a powerful ASIC-style timing analysistool that validates the timing performance of all logic in your design using anindustry-standard constraint, analysis, and reporting methodology. Use theTimeQuest analyzer GUI or command-line interface to constrain, analyze, and reportresults for all timing paths in your design.

This chapter contains the following sections:

■ “Getting Started with the TimeQuest Analyzer”

■ “Constraining and Analyzing with Tcl Commands” on page 7–7

■ “Creating Clocks and Clock Constraints” on page 7–14

■ “Creating I/O Requirements” on page 7–24

■ “Creating Delay and Skew Constraints” on page 7–26

■ “Creating Timing Exceptions” on page 7–27

■ “Examples of Basic Multicycle Exceptions” on page 7–35

■ “Application of Multicycle Exceptions” on page 7–44

■ “Timing Reports” on page 7–57

f For more information about basic timing analysis concepts and how they pertain tothe TimeQuest analyzer, refer to the Timing Analysis Overview chapter in volume 3 ofthe Quartus II Handbook.

f For more information about Altera resources available for the TimeQuest analyzer,refer to the TimeQuest Timing Analyzer Resource Center of the Altera website.

f For more information about the TimeQuest analyzer, refer to the Altera Training pageof the Altera website.

A, CYCLONE, HARDCOPY, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos. Patent and Trademark Office and in other countries. All other words and logos identified ase holders as described at www.altera.com/common/legal.html. Altera warrants performance of itswith Altera's standard warranty, but reserves the right to make changes to any products and

ibility or liability arising out of the application or use of any information, product, or servicetera. Altera customers are advised to obtain the latest version of device specifications before relyingoducts or services.

Feedback SubscribeTwitter

ISO9001:2008Registered

Page 2: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–2 Chapter 7: The Quartus II TimeQuest Timing AnalyzerGetting Started with the TimeQuest Analyzer

Getting Started with the TimeQuest AnalyzerThis section provides an overview of the design steps for setting up your project fortiming and analysis and to constrain your design with the TimeQuest analyzer.

Running the TimeQuest AnalyzerTo run the TimeQuest analyzer directly from the Quartus II software GUI, clickTimeQuest Timing Analyzer on the Tools menu.

h For more information about the TimeQuest analyzer GUI, refer to About TimeQuestTiming Analysis in Quartus II Help.

To run the TimeQuest analyzer as a stand-alone GUI application, type the followingcommand at the command prompt:

quartus_staw r

To run the TimeQuest analyzer in command-line mode for easy integration withscripted design flows, type the following command at a system command prompt:

quartus_sta -sr

Table 7–1 describes the available command-line options.

Table 7–1. Summary of Command-Line Options (Part 1 of 2)

Command-Line Option Description

-h | --help Provides help information on quartus_sta.

-t <script file> |--script=<script file>

Sources the <script file>.

-s | --shell Enters shell mode.

--tcl_eval <tcl command> Evaluates the Tcl command <tcl command>.

--do_report_timing

For all clocks in the design, run the following commands:

report_timing -npaths 1 -to_clock $clock

report_timing -setup -npaths 1 -to_clock $clock

report_timing -hold -npaths 1 -to_clock $clock

report_timing -recovery -npaths 1 -to_clock $clock

report_timing -removal -npaths 1 -to_clock $clock

--force_dat Forces an update of the project database with new delay information.

--lower_priority Lowers the computing priority of the quartus_sta process.

--post_map Uses the post-map database results.

--sdc=<SDC file> Specifies the .sdc to use.

--report_script=<script> Specifies a custom report script to call.

--speed=<value> Specifies the device speed grade used for timing analysis.

--tq2ptGenerates temporary files to convert the TimeQuest analyzer .sdc file(s) to aPrimeTime .sdc.

-f <argument file> Specifies a file containing additional command-line arguments.

-c <revision name> |--rev=<revision_name>

Specifies which revision and its associated .qsf to use.

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 3: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–3Getting Started with the TimeQuest Analyzer

For more information about steps to perform before opening the TimeQuest analyzer,refer to “Recommended Flow” on page 7–3.

For more information about using Tcl commands to constrain and analyze yourdesign, refer to “Constraining and Analyzing with Tcl Commands” on page 7–7.

Recommended FlowThe Quartus II TimeQuest analyzer performs constraint validation to timingverification as part of the compilation flow. Figure 7–1 shows the recommendeddesign flow to maximize the benefits of the TimeQuest Analyzer.

Creating and Setting Up your DesignYou must first create your project in the Quartus II software. Include all the necessarydesign files, including any existing Synopsys Design Constraints (.sdc) files thatcontain timing constraints for your design.

h For more information, refer to Managing Files in a Project in Quartus II Help.

--multicornerSpecifies that all slack summary reports be generated for both slow- andfast-corners.

--multicorner[=on|off] Turns off multicorner timing analysis.

--voltage=<value_in_mV> Specifies the device voltage, in mV used for timing analysis.

--temperature=<value_in_C>

Specifies the device temperature in degrees Celsius, used for timing analysis.

--parallel[=<num_processors>] Specifies the number of computer processors to use on a multiprocessor system.

--64bit Enables 64-bit version of the executable.

Table 7–1. Summary of Command-Line Options (Part 2 of 2)

Command-Line Option Description

Figure 7–1. Design Flow with the TimeQuest Timing Analyzer

Create Quartus II Projectand Specify Design Files

Perform Initial Compilation

Specify Timing Requirements

Perform Compilation

Verify Timing

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 4: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–4 Chapter 7: The Quartus II TimeQuest Timing AnalyzerGetting Started with the TimeQuest Analyzer

Performing an Initial CompilationIf you have never compiled your design, or you don't have an .sdc file, and you wantto use the TimeQuest analyzer to create one interactively, you must compile yourdesign to create an initial design database before you specify timing constraints. Youcan either perform Analysis and Synthesis to create a post-map database, or perform afull compilation to create a post-fit database. Creating a post-map database is fasterthan a post-fit database, and is sufficient for creating initial timing constraints. Thetype of database you create determines the type of timing netlist generated by theTimeQuest analyzer; a post-map netlist if you perform Analysis and Synthesis or apost-fit netlist if you perform a full compilation.

1 If you are using incremental compilation, you must merge your design partitions afterperforming Analysis and Synthesis to create a post-map database.

h For more information, refer to Setting up and Running Analysis and Synthesis andSetting up and Running a Compilation in Quartus II Help.

Specifying Timing RequirementsBefore running timing analysis with the TimeQuest analyzer, you must specify initialtiming constraints that describe the clock characteristics, timing exceptions, and signaltransition arrival and required times. You can use the TimeQuest Timing AnalyzerWizard to enter initial constraints for your design, and then refine timing constraintswith the TimeQuest analyzer GUI or with a Tcl script.

1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have notbeen constrained, either in the TimeQuest GUI or an .sdc file, unless any constraintexists in the design. In that case, all unconstrained clocks remain unconstrained.

h For more information, refer to Specifying Timing Constraints and Exceptions inQuartus II Help.

The .sdc must contain only SDC commands. Tcl commands to manipulate the timingnetlist or control the compilation flow should be run as part of a separate Tcl script.After you create timing constraints, update the timing netlist to apply the newconstraints. The TimeQuest analyzer applies all constraints to the netlist forverification and removes any invalid or false paths in the design from verification.

1 The constraints in the .sdc are read in sequence. You must first make a constraintbefore making any references to that constraint. For example, if a generated clockreferences a base clock, the base clock constraint must be made before the generatedclock constraint.

The Quartus II Text Editor provides templates for SDC constraints. For moreinformation, refer to “Using the Quartus II Templates” on page 7–6.

Performing a Full CompilationAfter creating initial timing constraints, you must fully compile your design. Whencompilation is complete, you can open the TimeQuest analyzer to verify timing resultsand to generate summary, clock setup and clock hold, recovery, and removal reportsfor all defined clocks in the design.

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 5: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–5Getting Started with the TimeQuest Analyzer

Verifying TimingThe TimeQuest analyzer examines the timing paths in the design, calculates thepropagation delay along each path, checks for timing constraint violations, andreports timing results as positive slack or negative slack. Negative slack indicates atiming violation. If you encounter violations along timing paths, use the timingreports to analyze your design and determine how best to optimize your design. Ifyou modify, remove, or add constraints, you should perform a full compilation again.This iterative process helps resolve timing violations in your design.

h For more information, refer to Viewing Timing Analysis Results in Quartus II Help.

Figure 7–2 shows the recommended flow for constraining and analyzing your designwithin the TimeQuest analyzer. Included are the corresponding Tcl commands foreach step.

SDC File PrecedenceThe Fitter and the TimeQuest analyzer process .sdc files in the order you specify in theQuartus II Settings File (.qsf). You can specify the files to process and the order theyare processed from the Assignments menu. Click Settings, then TimeQuest TimingAnalyzer. and specify a processing order in the SDC files to include in the projectbox.

If no .sdc files are listed in the .qsf, the Quartus II software looks for an .sdc named<current revision>.sdc in the project directory. An .sdc can also be added from aQuartus II IP File (.qip) included in the .qsf.

Figure 7–2. The TimeQuest Timing Analyzer Flow

Open Projectproject_open

Create Timing Netlistcreate_timing_netlist

Apply Timing Constraintsread_sdc

Update Timing Netlistupdate_timing_netlist

report_clocks_transfersreport_min_pulse_width

report_net_timing

report_sdcreport_timingreport_clocks

report_min_pulse_widthreport_ucp

Verify Static Timing AnalysisResults

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 6: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–6 Chapter 7: The Quartus II TimeQuest Timing AnalyzerUsing the Quartus II Templates

Figure 7–3 shows the order in which the Quartus II software searches for an .sdc.

1 If you type the read_sdc command at the command line without any arguments, theTimeQuest analyzer reads constraints embedded in HDL files, then follows the .sdcfile precedence order shown in Figure 7–3.

Using the Quartus II TemplatesYou can create an .sdc from constraint templates in the Quartus II software with theQuartus II Text Editor, or with your preferred text editor.

Creating a Constraint File with the Quartus II Text EditorTo insert constraints with the Quartus II Text Editor, follow these steps:

1. On the File menu, click New.

2. In the New dialog box, select the Synopsys Design Constraints File type from theOther Files group. Click OK.

3. Click the Insert Template button on the text editor menu, or, right-click in theblank .sdc file in the Quartus II Text Editor, then click Insert Template.

4. In the Insert Template dialog box, expand the TimeQuest section, then expand theSDC Commands section.

5. Expand a command category, for example, Clocks.

6. Select a command. The SDC constraint appears in the Preview pane.

7. Click Insert to paste the SDC constraint into the blank .sdc you created in step 2.

8. Repeat as needed with other constraints, or click Close to close the InsertTemplate dialog box.

You can now use any of the standard features of the Quartus II Text Editor to modifythe .sdc or save the .sdc to edit in a text editor.

Figure 7–3. .sdc File Order of Precedence

Is one or more .sdc file specified in the .qsf?

No

Yes

Does an .sdc named<current revision>.sdc

exist in the projectdirectory?

No

Yes

Analyze the design

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 7: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–7Constraining and Analyzing with Tcl Commands

h For more information on inserting a template with the Quartus II Text Editor, refer toAbout the Quartus II Text Editor in Quartus II Help.

Constraining and Analyzing with Tcl CommandsYou can use Tcl commands from the Quartus II software Tcl ApplicationProgramming Interface (API) to constrain, analyze, and collect information for yourdesign. This section focuses on executing timing analysis tasks with Tcl commands;however, you can perform many of the same functions in the TimeQuest analyzerGUI. SDC commands are Tcl commands for constraining a design. SDC extensioncommands provide additional constraint methods and are specific to the TimeQuestanalyzer. Additional TimeQuest analyzer commands are available for controllingtiming analysis and reporting. These commands are contained in the following Tclpackages available in the Quartus II software:

■ ::quartus::sta

■ ::quartus::sdc

■ ::quartus::sdc_ext

h For more information about TimeQuest analyzer Tcl commands and a complete list ofcommands, refer to ::quartus::sta in Quartus II Help. For more information aboutstandard SDC commands and a complete list of commands, refer to ::quartus::sdc inQuartus II Help. For more information about Altera extensions of SDC commandsand a complete list of commands, refer to ::quartus::sdc_ext in Quartus II Help.

Collection CommandsThe TimeQuest analyzer Tcl commands often return port, pin, cell, or node names in adata set called a collection. In your Tcl scripts you can iterate over the values incollections to analyze or modify constraints in your design.

The TimeQuest analyzer supports collection commands that provide easy access toports, pins, cells, or nodes in the design. Use collection commands with any validconstraints or Tcl commands specified in the TimeQuest analyzer.

Table 7–2 describes the collection commands supported by the TimeQuest analyzer.

Table 7–2. SDC Collection Commands (Part 1 of 2)

Command Description of the collection returned

all_clocks All clocks in the design.

all_inputs All input ports in the design.

all_outputs All output ports in the design.

all_registers All registers in the design.

get_cellsCells in the design. All cell names in the collection match the specified pattern. Wildcards can beused to select multiple cells at the same time.

get_clocksClocks in the design. When used as an argument to another command, such as the -from or -toof set_multicycle_path, each node in the clock represents all nodes clocked by the clocks inthe collection. The default uses the specific node (even if it is a clock) as the target of a command.

get_netsNets in the design. All net names in the collection match the specified pattern. You can usewildcards to select multiple nets at the same time.

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 8: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–8 Chapter 7: The Quartus II TimeQuest Timing AnalyzerConstraining and Analyzing with Tcl Commands

Wildcard CharactersTo apply constraints to many nodes in a design, use the “*” and “?” wildcardcharacters. The “*” wildcard character matches any string; the “?” wildcard charactermatches any single character.

If you make an assignment to node reg*, the TimeQuest analyzer searches for andapplies the assignment to all design nodes that match the prefix reg with any numberof following characters, such as reg, reg1, reg[2], regbank, and reg12bank.

If you make an assignment to a node specified as reg?, the TimeQuest analyzersearches and applies the assignment to all design nodes that match the prefix reg andany single character following; for example, reg1, rega, and reg4.

Adding and Removing Collection ItemsWildcards used with collection commands define collection items identified by thecommand. For example, if a design contains registers named src0, src1, src2, anddst0, the collection command [get_registers src*] identifies registers src0, src1,and src2, but not register dst0. To identify register dst0, you must use an additionalcommand, [get_registers dst*]. To include dst0, you could also specify a collectioncommand [get_registers {src* dst*}].

To modify collections, use the add_to_collection and remove_from_collectioncommands. The add_to_collection command allows you to add additional items toan existing collection. Example 7–1 shows the add_to_collection command andarguments.

1 The add_to_collection command creates a new collection that is the union of the twospecified collections.

The remove_from_collection command allows you to remove items from an existingcollection. Example 7–2 shows the remove_from_collection command andarguments.

get_pinsPins in the design. All pin names in the collection match the specified pattern. You can usewildcards to select multiple pins at the same time.

get_ports Ports (design inputs and outputs) in the design.

Table 7–2. SDC Collection Commands (Part 2 of 2)

Command Description of the collection returned

Example 7–1. add_to_collection Command

add_to_collection <first collection> <second collection>

Example 7–2. remove_from_collection Command

remove_from_collection <first collection> <second collection>

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 9: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–9Constraining and Analyzing with Tcl Commands

Example 7–3 shows examples of how to add elements to collections.

1 In the Quartus II software, keepers are I/O ports or registers. An .sdc that includesget_keepers can only be processed as part of the TimeQuest analyzer flow and is notcompatible with third-party timing analysis flows.

h For more information about the add_to_collection and remove_from_collectioncommands—including full syntax information, options, and example usage—refer toadd_to_collection and remove_from_collection in Quartus II Help.

Using the query_collection CommandYou can display the contents of a collection with the query_collection command.

Example 7–4 shows how to report the contents of a collection:

You can also examine collections and experiment with collections using wildcards inthe TimeQuest analyzer by clicking Name Finder from the View menu.

Using the get_pins CommandThe collection commands get_pins allow you to refine searches that include wildcardcharacters.

Table 7–3 shows examples of search strings that use options to refine the search andwildcards. The examples in Table 7–3 filter the following node and pin names toillustrate function:

■ foo

■ foo|dataa

■ foo|datab

■ foo|bar

■ foo|bar|datac

Example 7–3. Adding Items to a Collection

#Setting up initial collection of registersset regs1 [get_registers a*]

#Setting up initial collection of keepersset kprs1 [get_keepers b*]

#Creating a new set of registers of $regs1 and $kprs1set regs_union [add_to_collection $kprs1 $regs1]

#OR# Creating a new set of registers of $regs1 and b*# Note that the new collection appends only registers with name b*# not all keepersset regs_union [add_to_collection $regs1 b*]

Example 7–4. query_collection Command

query_collection -report -all $regs_union

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 10: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–10 Chapter 7: The Quartus II TimeQuest Timing AnalyzerConstraining and Analyzing with Tcl Commands

■ foo|bar|datad

The default method separates hierarchy levels of instances from nodes and pins withthe pipe character (|). A match occurs when the levels of hierarchy match, and thestring values including wildcards match the instance and/or pin names. For example,the command get_pins <instance_name>|*|datac returns all the datac pins forregisters in a given instance. However, the command get_pins *|datac returns andempty collection because the levels of hierarchy do not match.

Use the -hierarchical matching scheme to return a collection of cells or pins in allhierarchies of your design.

For example, the command get_pins -hierarchical *|datac returns all the datacpins for all registers in your design. However, the command get_pins -hierarchical*|*|datac returns an empty collection because more than one pipe character (|) is notsupported.

The -compatibility_mode option returns collections matching wildcard stringsthrough any number of hierarchy levels. For example, an asterisk can match a pipecharacter when using -compatibility_mode.

Table 7–3. Sample Search Strings and Search Results

Search String Search Result

get_pins *|dataa foo|dataa

get_pins *|datac <empty> (1)

get_pins *|*|datac foo|bar|datac

get_pins foo*|* foo|dataa, foo|datab

get_pins -hierarchical *|*|datac <empty> (1)

get_pins -hierarchical foo|* foo|dataa, foo|datab

get_pins -hierarchical *|datac foo|bar|datac

get_pins -hierarchical foo|*|datac <empty> (1)

get_pins -compatibility_mode *|datac foo|bar|datac

get_pins -compatibility_mode *|*|datac foo|bar|datac

Note to Table 7–3:(1) The search result is <empty> because more than one pipe character (|) is not supported.

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 11: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–11Constraining and Analyzing with Tcl Commands

Identifying the Quartus II Software Executable from the SDC FileTo identify which Quartus II software executable is currently running you can use the$::TimeQuestInfo(nameofexecutable) variable from within an .sdc. Example 7–5shows how to specify different SDC constraints for a specific Quartus II softwareexecutable.

Examples of different executable names are quartus_map for Analysis & Synthesis,quartus_fit for Fitter, and quartus_sta for the TimeQuest analyzer.

Locating Timing Paths in Other ToolsYou can locate paths and elements from the TimeQuest analyzer to other tools in theQuartus II software. Use the Locate Path command in the TimeQuest analyzer GUI orthe locate command.

h For more information about locating paths from the TimeQuest analyzer, refer toViewing Timing Analysis Results and locate in Quartus II Help.

Example 7–6 shows how to locate ten paths from TimeQuest analyzer to the ChipPlanner and locate all data ports in the Technology Map Viewer.

Example 7–5. Identifying the Quartus II Executable

#Identify which executable is running:set current_exe $::TimeQuestInfo(nameofexecutable)

if { [string equal $current_exe “quartus_fit"] } {

#Apply .sdc assignments for Fitter executable here} else {

#Apply .sdc assignments for non-Fitter executables here}

if { ! [string equal "quartus_sta" $::TimeQuestInfo(nameofexecutable)] } {

#Apply .sdc assignments for non-TimeQuest executables here} else {

#Apply .sdc assignments for TimeQuest executable here

Example 7–6. Locating from the TimeQuest Analyzer

# Locate in the Chip Planner all of the nodes in ten paths with thelongest delay

locate [get_path -npaths 10] -chip

# locate all ports that begin with data to the Technology Map Viewer

locate [get_ports data*] -tmv

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 12: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–12 Chapter 7: The Quartus II TimeQuest Timing AnalyzerDesign Constraints: An Example

Design Constraints: An ExampleFigure 7–4 shows an example circuit including two clocks, a phase-locked loop (PLL),and other common synchronous design elements.

Figure 7–4. TimeQuest Constraint Example

data1

data2

clk1

clk2

inst

inst1

inst2lpm_add_sub0 myfifo

altpll0

dataout

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 13: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–13Design Constraints: An Example

Example 7–7 shows an .sdc file containing basic constraints for the circuit inFigure 7–4.

The .sdc in Example 7–7 contains the following basic constraints you should includefor most designs:

■ Definitions of clockone and clocktwo as base clocks, and assignment of thosesettings to nodes in the design.

■ Definitions of clockone_ext and clocktwo_ext as virtual clocks, which representclocks driving external devices interfacing with the FPGA.

■ Automated derivation of generated clocks on PLL outputs.

■ Derivation of clock uncertainty.

■ Specification of two clock groups, the first containing clockone and its relatedclocks, the second containing clocktwo and its related clocks, and the third groupcontaining the output of the PLL. This specification overrides the default analysisof all clocks in the design as related to each other. For more information aboutasynchronous clock groups, refer to “Asynchronous Clock Groups” on page 7–22.

■ Specification of input and output delays for the design.

The following sections describe each of these constraint types in detail.

Example 7–7. Example Basic SDC Constraints

# Create clock constraints

create_clock -name clockone -period 10.000 [get_ports {clk1}]create_clock -name clocktwo -period 10.000 [get_ports {clk2}]

# Create virtual clocks for input and output delay constraints

create clock -name clockone_ext -period 10.000create clock -name clockone_ext -period 10.000

derive_pll_clocks

# derive clock uncertainty

derive_clock_uncertainty

# Specify that clockone and clocktwo are unrelated by assinging# them to seperate asynchronus groups

set_clock_groups \-asynchronous \-group {clockone} \-group {clocktwo \

altpll0|altpll_component|auto_generated|pll1|clk[0]}]

# set input and output delays

set_input_delay -clock { clockone_ext } -max 4 [get_ports {data1}]set_input_delay -clock { clockone_ext } -min -1 [get_ports {data1}]

set_input_delay -clock { clockone_ext } -max 4 [get_ports {data2}]set_input_delay -clock { clockone_ext } -min -1 [get_ports {data2}]

set_output_delay -clock { clocktwo_ext } -max 6 [get_ports {dataout}]

set_output_delay -clock { clocktwo_ext } -min -3 [get_ports {dataout}]

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 14: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–14 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating Clocks and Clock Constraints

Creating Clocks and Clock ConstraintsTo ensure accurate static timing analysis results, you must specify all clocks and anyassociated clock characteristics in your design. The TimeQuest analyzer supports SDCcommands that accommodate various clocking schemes and clock characteristics.

The TimeQuest analyzer supports the following types of clocks:

■ Base clocks

■ Virtual clocks

■ Multifrequency clocks

■ Generated clocks

Clocks are used to specify requirements for synchronous transfers and guide the Fitteroptimization algorithms to achieve the best possible placement for your design.

Specify clock constraints first in the .sdc because other constraints may referencepreviously defined clocks. The TimeQuest analyzer reads SDC constraints andexceptions from top to bottom in the file.

Creating Base ClocksBase clocks are the primary input clocks to the device. Unlike clocks from PLLs thatare generated in the device, base clocks are generated by off-chip oscillators orforwarded from an external device. Define base clocks first because generated clocksand other constraints often reference base clocks.

To create clock settings for the signal from any register, port, or pin, use thecreate_clock command. You can create each clock with unique characteristics.

Example 7–8 shows how to create a 10 ns clock with a 50% duty cycle that is phaseshifted by 90 degrees applied to port clk_sys.

Use the create_clock command to constrain all primary input clocks. The target forthe create_clock command is usually a pin. To specify the pin as the target, use theget_ports command. Example 7–9 shows how to specify a 100 MHz requirement on aclk_sys input clock port.

You can apply multiple clocks on the same clock node with the -add option.Example 7–10 shows how to specify that two oscillators drive the same clock port onthe device.

Example 7–8. 100 MHz Shifted by 90 Degrees Clock Creation

create_clock -period 10 -waveform { 2.5 7.5 } [get_ports clk_sys]

Example 7–9. create_clock Command

create_clock -period 10 -name clk_sys [get_ports clk_sys]

Example 7–10. Two Oscillators Driving the Same Clock Port

create_clock -period 10 -name clk_100 [get_ports clk_sys]

create_clock -period 5 -name clk_200 [get_ports clk_sys] -add

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 15: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–15Creating Clocks and Clock Constraints

h For more information about the create_clock and get_ports commands—includingfull syntax information, options, and example usage—refer to create_clock andget_ports in Quartus II Help.

Creating Virtual ClocksA virtual clock is a clock that does not have a real source in the design or that does notinteract directly with the design. Virtual clocks are used in most I/O constraints, theyrepresent the clock at the external device connected to the FPGA.

To create virtual clocks, use the create_clock command with no value specified forthe <targets> option. Use virtual clocks for the reference clocks of set_input_delayand set_output_delay constraints.

Example 7–11 shows how to create a 10 ns virtual clock. The example is a virtual clockbecause no target is specified.

h For more information about the set_input_delay, and set_output_delaycommands—including full syntax information, options, and example usage—refer toset_input_delay, and set_output_delay in Quartus II Help.

Figure 7–5 shows a design where a virtual clock is required for the TimeQuestanalyzer to properly analyze the relationship between the external register and theregisters in the design. Because the oscillator, virt_clk, does not interact with theAltera device, but acts as the clock source for the external register, you must declarethe clock as a virtual clock. After you create the virtual clock, you can perform aregister-to-register analysis between the register in the Altera device and the registerin the external device.

Example 7–11. Create Virtual Clock

create_clock -period 10 -name my_virt_clk

Figure 7–5. Virtual Clock Board Topology

Altera FPGA External Device

system_clk virt_clk

reg_a reg_bdataout

datain

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 16: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–16 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating Clocks and Clock Constraints

Example 7–12 shows how to create a 10 ns virtual clock named virt_clk with a 50%duty cycle where the first rising edge occurs at 0 ns. The virtual clock is then used asthe clock source for an output delay constraint.

I/O Interface UncertaintyVirtual clocks are recommended for I/O constraints because thederive_clock_uncertainty command can add different uncertainty values on clocksthat interface with an external I/O port than uncertainty values between registerpaths fed by a clock inside the FPGA.

To specify I/O interface uncertainty, you must create a virtual clock and constrain theinput and output ports with the set_input_delay and set_output_delay commandsthat reference the virtual clock. When the set_input_delay or set_output_delaycommands reference a clock port or PLL output, the virtual clock allows thederive_clock_uncertainty command to apply separate clock uncertainties forinternal clock transfers and I/O interface clock transfers

Create the virtual clock with the same properties as the original clock that is drivingthe I/O port. Figure 7–6 shows a typical input I/O interface with clock specifications.

Example 7–12. Virtual Clock Example

#create base clock for the designcreate_clock -period 5 [get_ports system_clk]

#create the virtual clock for the external registercreate_clock -period 10 -name virt_clk

#set the output delay referencing the virtual clockset_output_delay -clock virt_clk -max 1.5 [get_ports dataout]set_output_delay -clock virt_clk -min 0.0 [get_ports dataout]

Figure 7–6. I/O Interface Clock Specifications

Altera FPGAExternal Devicedata_in

clk_in

Q Q

reg1

D

reg1

D

100 MHz

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 17: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–17Creating Clocks and Clock Constraints

Example 7–13 shows the SDC commands to constrain the I/O interface shown inFigure 7–6.

f For more information about clock uncertainty and clock transfers, refer to “ClockUncertainty” on page 7–23

Creating Multifrequency ClocksYou must create a multifrequency clock if your design has more than one clock sourcefeeding a single clock node in your design. The additional clock may act as alow-power clock, with a lower frequency than the primary clock. If your design usesmultifrequency clocks, use the set_clock_groups command to define clocks that areexclusive. For more information about creating exclusive clock groups, refer to“Creating Clock Groups” on page 7–21.

To create multifrequency clocks, use the create_clock command with the -add optionto create multiple clocks on a clock node. Example 7–14 shows how to create a 10 nsclock applied to clock port clk, and then add an additional 15 ns clock to the sameclock port. The TimeQuest analyzer uses both clocks when it performs timinganalysis.

Creating Generated ClocksGenerated clocks are applied in the design when you modify the properties of asource synchronous clock signal, including phase, frequency, offset, and duty cycle. Inthe .sdc, generated clocks, which can be the outputs of PLLs or register clock dividers,are constrained after all base clocks. Generated clocks capture all clock delays andclock latency where the generated clock target is defined, ensuring that all base clockproperties are accounted for in the generated clock.

Use the create_generated_clock command to constrain generated clocks in yourdesign. The source of the create_generated_clock command should be a node inyour design and not a previously constrained clock.

Example 7–13. SDC Commands to Constrain the I/O Interface

# Create the base clock for the clock portcreate_clock -period 10 -name clk_in [get_ports clk_in]

# Create a virtual clock with the same properties of the base clock# driving the source registercreate_clock -period 10 -name virt_clk_in

# Create the input delay referencing the virtual clock and not the base# clock# DO NOT use set_input_delay -clock clk_in <delay value># [get_ports data_in]set_input_delay -clock virt_clk_in <delay value> [get_ports data_in]

Example 7–14. Multifrequency Clock Example

create_clock –period 10 –name clock_primary –waveform { 0 5 } \[get_ports clk]

create_clock –period 15 –name clock_secondary –waveform { 0 7.5 } \[get_ports clk] -add

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 18: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–18 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating Clocks and Clock Constraints

A common form of generated clock is a clock divider. Example 7–15 creates a baseclock, clk_sys, then defines a generated clock clk_div_2, which is the clock frequencyof clk_sys divided by two.

When you use the create_generated_clock command, the -source option specifies anode with a clock used as a reference for your generated clock. Best practice is tospecify the input clock pin of the target node for your new generated clock. You canalso specify the target node of the reference clock. In Example 7–15, the -sourceoption specifies the clock port clk feeding the clock pin of register reg.

If you have multiple base clocks feeding a node that is the source for a generatedclock, you must define multiple generated clocks. Each generated clock is associatedto one base clock using the -master_clock option in each generated clock statement.

The TimeQuest analyzer provides the derive_pll_clocks command to automaticallygenerate clocks for all PLL clock outputs. The properties of the generated clocks onthe PLL outputs match the properties defined for the PLL. For more informationabout deriving PLL clock outputs, refer to “Deriving PLL Clocks” on page 7–19.

h For more information about the create_generated_clock and derive_pll_clockscommands—including for full syntax information, options, and example usage—referto create_generate_clock and derive_pll_clocks in Quartus II Help.

Example 7–15. Clock Divider

create_clock -period 10 -name clk_sys [get_ports clk_sys]

create_generated_clock -name clk_div_2 -divide_by 2 -source[get_ports clk_sys] [get_pins reg|regout]

1 2 3 4 5 6 7 8Edges

clk_sys

clk_div_2

0 10 20 30Time

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 19: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–19Creating Clocks and Clock Constraints

The inverse of a clock divider is a clock multiplier. Figure 7–7 shows the effect ofapplying a multiplication factor to the generated clock.

An uncommon but useful type of generated clock is one with shifted edges.Figure 7–8 shows how to modify the generated clock by defining and shifting theedges.

h For information about creating generated clocks, refer to create_generated_clocks andSpecifying Timing Constraints and Exceptions in Quartus II Help.

Deriving PLL ClocksUse the derive_pll_clocks command to direct the TimeQuest analyzer toautomatically search the timing netlist for all unconstrained PLL output clocks. Thederive_pll_clocks command automatically creates generated clocks on the outputsof every PLL by calling the create_generated_clock command. The source for thecreate_generated_clock command is the input clock pin of the PLL.

Figure 7–7. Multiplying a Generated Clock

create_clock -period 10 -waveform { 0 5 } [get_ports clk]

# Creates a multiply-by-two clockcreate_generated_clock -source [get_ports clk] -multiply_by 2 [get_registers \clkmult|clkreg]

clk

clkmult|clkreg

0 10 20 30Time

Figure 7–8. Edge Shifting a Generated Clock

create_clock -period 10 -waveform { 0 5 } [get_ports clk]

# Creates a divide-by-two clockcreate_generated_clock -source [get_ports clk] -edges { 1 3 5 } [get_registers \clkdivA|clkreg]

# Creates a divide-by-two clock independent of the master clock’s duty cycle (now 50%)create_generated_clock -source [get_ports clk] -edges { 1 1 5 } \-edge_shift { 0 2.5 0 } [get_registers clkdivB|clkreg]

1 2 3 4 5 6 7 8Edges

clk

clkdivA|clkreg

clkdivB|clkreg

0 10 20 30Time

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 20: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–20 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating Clocks and Clock Constraints

Example 7–16 shows the command to create a base clock for the PLL input clock portand call derive_pll_clocks to create PLL output clocks.

1 If your design contains LVDS transmitters, LVDS receivers, or transceivers, Alterarecommends using the derive_pll_clocks command. The command automaticallyconstrains this logic in your design by adding the appropriate multicycle constraintsto account for any deserialization factors.

h For more information about the derive_pll_clocks command—including full syntaxinformation, options, and example usage—refer to derive_pll_clocks and Derive PLLClocks in Quartus II Help.

You can include the derive_pll_clocks command in your .sdc, which automaticallydetects any changes to the PLL settings. Each time the TimeQuest analyzer reads your.sdc, the appropriate create_generated_clocks command is generated for the PLLoutput clock pin.

Figure 7–9 shows a simple PLL design with a register-to-register path.

Example 7–17 shows the messages generated by the TimeQuest analyzer when youuse the derive_pll_clocks command to automatically constrain the PLL for thedesign shown in Figure 7–9.

The input clock pin of the PLL is the nodepll_inst|altpll_component|pll|inclk[0] is used for the -source option. The nameof the output clock of the PLL is the PLL output clock node,pll_inst|altpll_component|pll|clk[0].

Example 7–16. Create Base Clock for PLL input Clock Ports

create_clock -period 10.0 -name fpga_sys_clk [get_ports fpga_sys_clk]derive_pll_clocks

Figure 7–9. Simple PLL Design

Example 7–17. derive_pll_clocks Command Messages

Info:Info: Deriving PLL Clocks:Info: create_generated_clock -sourcepll_inst|altpll_component|pll|inclk[0] -divide_by 2 -namepll_inst|altpll_component|pll|clk[0]pll_inst|altpll_component|pll|clk[0]Info:

reg_1 reg_2

pll_inclk pll_inst

dataout

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 21: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–21Creating Clocks and Clock Constraints

If the PLL is in clock switchover mode, multiple clocks are created for the output clockof the PLL; one for the primary input clock (for example, inclk[0]), and one for thesecondary input clock (for example, inclk[1]). You should create exclusive clockgroups for the primary and secondary output clocks.

For more information about creating exclusive clock groups, refer to “Creating ClockGroups” on page 7–21.

Automatically Detecting Clocks and Creating Default Clock ConstraintsTo automatically create clocks for all clock nodes in your design, use thederive_clocks command. The derive_clocks command is equivalent to using thecreate_clock command for each register or port feeding the clock pin of a register.The derive_clocks command creates clock constraints on ports or registers to ensureevery register in your design has a clock constraints, and it applies one period to allbase clocks in your design.

If there are no clock constraints in your design, the TimeQuest analyzer automaticallycreates default clock constraints for all detected unconstrained clock nodes to providea complete clock analysis. The TimeQuest analyzer automatically creates clocks onlywhen all synchronous elements have no associated clocks. For example, theTimeQuest analyzer does not create a default clock constraint if your design containstwo clocks and you assigned constraints to one of the clocks. However, if you do notassign constraints to either clock, then the TimeQuest analyzer creates a default clockconstraint.

Example 7–18 shows how the TimeQuest analyzer creates a base clock with a 1 GHzrequirement for unconstrained clock nodes.

1 Do not use the derive_clocks command for final timing sign-off; instead, you shouldcreate clocks for all clock sources with the create_clock andcreate_generated_clock commands. If your design has more than a single clock, thederive_clocks command constrains all the clocks to the same specified frequency. Toachieve a thorough and realistic analysis of your design’s timing requirements, youshould make individual clock constraints for all clocks in your design.

You can also use the command derive_pll_clocks -create_base_clocks to createthe input clocks for all PLL inputs automatically.

h For more information about the derive_clocks command—including full syntaxinformation, options, and example usage—refer to derive_clocks in Quartus II Help.

Creating Clock GroupsThe TimeQuest analyzer assumes all clocks are related unless constrained otherwise.To specify clocks in your design that are exclusive or asynchronous, use theset_clock_groups command. The set_clock_groups command cuts timing betweenclocks in different groups, and performs the same analysis regardless of whether youspecify -exclusive or -asynchronous.

Example 7–18. Create Base Clock for Unconstrained Clock Nodes

derive_clocks -period 1

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 22: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–22 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating Clocks and Clock Constraints

h For more information about the set_clock_groups command—including full syntaxinformation, options, and example usage—refer to set_clock_groups in Quartus II Help.

Exclusive Clock GroupsUse the -exclusive option to declare that two clocks are mutually exclusive. You maywant to declare clocks as mutually exclusive when multiple clocks are created on thesame node or for multiplexed clocks. For example, a port can be clocked by either a25-MHz or a 50-MHz clock. To constrain this port, you should create two clocks on theport, and then create clock groups to declare that they cannot coexist in the design atthe same time. Declaring the clocks as mutually exclusive eliminates any clocktransfers that may be derived between the 25-MHz clock and the 50-MHz clock.Example 7–19 shows how to create mutually exclusive clock groups.

A group is defined with the -group option. The TimeQuest analyzer excludes thetiming paths between clocks for each of the separate groups.

If you apply multiple clocks to the same port, use the set_clock_groups commandwith the -exclusive option to place the clocks into separate groups and declare thatthe clocks are mutually exclusive. The clocks cannot physically exist in your design atthe same time.

Asynchronous Clock GroupsUse the -asynchronous option to create asynchronous clock groups. Clocks containedwithin an asynchronous clock group are considered asynchronous to clocks in otherclock groups; however, any clocks within a clock group are considered synchronousto each other.

For example, if your design has three clocks, clk_A, clk_B, and clk_C, and youestablish that clk_A and clk_B are related to each other, but clock clk_C operatescompletely asynchronously, you can set up clock groups to define the clock behavior.If set_clock_groups is used with only one group, the clocks in that group areasynchronous with all other clocks in the design. For example, you can create a clockgroup containing only clk_C to ensure that clk_A and clk_B are synchronous witheach other and asynchronous with clk_C. Because clk_C is the only clock in theconstraint, it is asynchronous with every other clock in the design.

Example 7–20 shows how to create a clock group containing clocks clk_A and clk_Band a second unrelated clock group containing clk_C.

h For more information about the set_clock_groups command—including full syntaxinformation, options, and example usage—refer to set_clock_groups in Quartus II Help.

Example 7–19. Create Mutually Exclusive Clock Groups

create_clock -period 40 -name clk_A [get_ports {port_A}]create_clock -add -period 20 -name clk_B [get_ports {port_A}]set_clock_groups -exclusive -group {clk_A} -group {clk_B}

Example 7–20. Create Asynchronous Clock Groups

set_clock_groups -asynchronous -group {clk_A clk_B} -group {clk_C}

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 23: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–23Creating Clocks and Clock Constraints

Accounting for Clock Effect CharacteristicsThe clocks you create with the TimeQuest analyzer are ideal clocks that do notaccount for any board effects. You can account for clock effect characteristics withclock latency and clock uncertainty.

Clock LatencyThere are two forms of clock latency, clock source latency and clock network latency.Source latency is the propagation delay from the origin of the clock to the clockdefinition point (for example, a clock port). Network latency is the propagation delayfrom a clock definition point to a register’s clock pin. The total latency at a register’sclock pin is the sum of the source and network latencies in the clock path.

To specify source latency to any clock ports in your design, use theset_clock_latency command.

1 The TimeQuest analyzer automatically computes network latencies; therefore, youonly can characterize source latency with the set_clock_latency command. Youmust use the -source option.

h For more information about the set_clock_latency command—including full syntaxinformation, options, and example usage—refer to set_clock_latency in Quartus IIHelp.f

Clock UncertaintyThe TimeQuest analyzer accounts for uncertainty clock effects for three types ofclock-to-clock transfers; intraclock transfers, interclock transfers, and I/O interfaceclock transfers.

■ Intraclock transfers occur when the register-to-register transfer takes place in thecore of the device and the source and destination clocks come from the same PLLoutput pin or clock port.

■ Interclock transfers occur when a register-to-register transfer takes place in thecore of the device and the source and destination clocks come from a different PLLoutput pin or clock port.

■ I/O interface clock transfers occur when data transfers from an I/O port to thecore of the device or from the core of the device to the I/O port.

To manually specify clock uncertainty, or skew, for clock-to-clock transfers, use theset_clock_uncertainty command. You can specify the uncertainty separately forsetup and hold, and you can specify separate rising and falling clock transitions. TheTimeQuest analyzer subtracts setup uncertainty from the data required time for eachapplicable path and adds the hold uncertainty to the data required time for eachapplicable path.

To automatically apply interclock, intraclock, and I/O interface uncertainties, use thederive_clock_uncertainty command. The TimeQuest analyzer automaticallyapplies clock uncertainties to clock-to-clock transfers in the design, and calculatesboth setup and hold uncertainties for each clock-to-clock transfer.

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 24: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–24 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating I/O Requirements

Any clock uncertainty constraints applied to source and destination clock pairs withthe set_clock_uncertainty command have a higher precedence than the clockuncertainties derived with the derive_clock_uncertainty command for the samesource and destination clock pairs. For example, if you use theset_clock_uncertainty command to set clock uncertainty between clka and clkb,the TimeQuest analyzer ignores the values for the clock transfer calculated with thederive_clock_uncertainty command. The TimeQuest analyzer reports the valuescalculated with the derive_clock_uncertainty command even if they are not used.

Use set_clock_uncertainty or derive_clock_uncertainty with the -overwriteoption to overwrite previously applied clock uncertainty assignments. Useset_clock_uncertainty or derive_clock_uncertainty with the -add option to applyadditional clock uncertainty to previously applied clock uncertainty. Use theremove_clock_uncertainty command to remove previous clock uncertaintyassignments.

h For more information about the set_clock_uncertainty, derive_clock_uncertainty,and remove_clock_uncertainty commands—including full syntax information,options, and example usage—refer to set_clock_uncertainty, remove_clock_uncertaintyand derive_clock_uncertainty, in Quartus II Help.

Creating I/O RequirementsThe TimeQuest analyzer reviews setup and hold relationships for designs in which anexternal source interacts with a register internal to the design. The TimeQuestanalyzer supports input and output external delay modeling with theset_input_delay and set_output_delay commands. You can specify the clock andminimum and maximum arrival times relative to the clock.

You must specify timing requirements, including internal and external timingrequirements, before you fully analyze a design. With external timing requirementsspecified, the TimeQuest analyzer verifies the I/O interface, or periphery of thedevice, against any system specification.

Input ConstraintsInput constraints allow you to specify all the external delays feeding into the device.Specify input requirements for all input ports in your design.

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 25: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–25Creating I/O Requirements

You can use the set_input_delay command to specify external input delayrequirements. Use the -clock option to reference a virtual clock. Using a virtual clockallows the TimeQuest analyzer to correctly derive clock uncertainties for interclockand intraclock transfers. The virtual clock defines the launching clock for the inputport. The TimeQuest analyzer automatically determines the latching clock inside thedevice that captures the input data, because all clocks in the device are defined.Figure 7–10 shows an example of an input delay referencing a virtual clock.

Equation 7–1 shows a typical input delay calculation.

Output ConstraintsOutput constraints allow you to specify all external delays from the device for alloutput ports in your design.

You can use the set_output_delay command to specify external output delayrequirements. Use the -clock option to reference a virtual clock. The virtual clockdefines the latching clock for the output port. The TimeQuest analyzer automaticallydetermines the launching clock inside the device that launches the output data,because all clocks in the device are defined. Figure 7–11 shows an example of anoutput delay referencing a virtual clock.

Figure 7–10. Input Delay

Equation 7–1. Input Delay Calculation

External Device Altera Device

Oscillator

dd

cd_altrcd_ext

tco_ext

input delayMAX cd_extMAX cd_altrMIN–( ) tco_extMAX ddMAX+ +=

input delayMIN cd_extMIN cd_altrMAX–( ) tco_extMIN ddMIN+ +=

Figure 7–11. Output Delay

External DeviceAltera Device

Oscillator

dd

cd_altr

cd_ext

tsu_ext/th_ext

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 26: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–26 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating Delay and Skew Constraints

Equation 7–2 shows a typical output delay calculation.

h For more information about the set_input_delay and set_output_delaycommands—including full syntax information, options, and example usage—refer toset_input_delay and set_output_delay in Quartus II Help.

Creating Delay and Skew ConstraintsThe TimeQuest analyzer supports the Synopsys Design Constraint format forconstraining timing for the ports in your design. These constraints allow theTimeQuest analyzer to perform a system static timing analysis that includes not onlythe device internal timing, but also any external device timing and board timingparameters.

Advanced I/O Timing and Board Trace Model DelayThe TimeQuest analyzer can use advanced I/O timing and board trace modelassignments to model I/O buffer delays in your design.

If you change any advanced I/O timing settings or board trace model assignments,recompile your design before you analyze timing, or use the -force_dat option toforce delay annotation when you create a timing netlist. Example 7–21 shows how toforce delay annotation when creating a timing netlist.

h For more information about using advanced I/O timing, refer to Using Advanced I/OTiming in Quartus II Help.

f For more information about advanced I/O timing, refer to the I/O Managementchapter in volume 2 of the Quartus II Handbook.

Maximum SkewTo specify the maximum path-based skew requirements for registers and ports in thedesign and report the results of maximum skew analysis, use the set_max_skewcommand in conjunction with the report_max_skew command.

By default, the set_max_skew command excludes any input or output delayconstraints.

h For more information about the set_max_skew and report_max_skew commands—including full syntax information, options, and example usage—refer to set_max_skewreport_max_skew in Quartus II Help.

Equation 7–2. output Delay Calculation

output delayMAX ddMAX tsu_ext cd_altrMAX cd_extMIN–( )+ +=

output delayMIN ddMIN th_ext + cd_altrMIN cd_extMAX–( )+( )=

Example 7–21. Forcing Delay Annotation

create_timing_netlist -force_dat r

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 27: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–27Creating Timing Exceptions

Creating Timing ExceptionsTiming exceptions in the TimeQuest analyzer provide a way to modify the defaulttiming analysis behavior to match the analysis required by your design. Specifytiming exceptions after clocks and input and output delay constraints because timingexceptions can modify the default analysis.

PrecedenceIf a conflict of node names occurs between timing exceptions, the following order ofprecedence applies:

1. False path

2. Minimum delays and maximum delays

3. Multicycle path

The false path timing exception has the highest precedence. Within each category,assignments to individual nodes have precedence over assignments to clocks. Finally,the remaining precedence for additional conflicts is order-dependent, such that theassignments most recently created overwrite, or partially overwrite, earlierassignments.

False PathsSpecifying a false path in your design removes the path from timing analysis. Use theset_false_path command to specify false paths in your design. You can specifyeither a point-to-point or clock-to-clock path as a false path. For example, a path youshould specify as false path is a static configuration register that is written onceduring power-up initialization, but does not change state again. Although signalsfrom static configuration registers often cross clock domains, you may not want tomake false path exceptions to a clock-to-clock path, because some data may transferacross clock domains. However, you can selectively make false path exceptions fromthe static configuration register to all endpoints.

Example 7–22 shows how to make false path exceptions from all registers beginningwith A to all registers beginning with B.

The TimeQuest analyzer assumes all clocks are related unless you specify otherwise.The “Creating Clock Groups” on page 7–21 describes how you can use clock groups.Clock groups are a more efficient way to make false path exceptions between clocks,compared to writing multiple set_false_path exceptions between every clocktransfer you want to eliminate.

h For more information about the set_false_path command—including full syntaxinformation, options, and example usage—refer to set_false_path in Quartus II Help.

Example 7–22. False Path

set_false_path -from [get_pins A*] -to [get_pins B*]

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 28: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–28 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating Timing Exceptions

Minimum and Maximum DelaysTo specify an absolute minimum or maximum delay for a path, use theset_min_delay command or the set_max_delay commands, respectively. Specifyingminimum and maximum delay directly overwrites existing setup and holdrelationships with the minimum and maximum values.

Use the set_max_delay and set_min_delay commands to create constraints forasynchronous signals that do not have a specific clock relationship in your design, butrequire a minimum and maximum path delay. You can create minimum andmaximum delay exceptions for port-to-port paths through the device without aregister stage in the path. If you use minimum and maximum delay exceptions toconstrain the path delay, specify both the minimum and maximum delay of the path;do not constrain only the minimum or maximum value.

If the source or destination node is clocked, the TimeQuest analyzer takes into accountthe clock paths, allowing more or less delay on the data path. If the source ordestination node has an input or output delay, that delay is also included in theminimum or maximum delay check.

If you specify a minimum or maximum delay between timing nodes, the delayapplies only to the path between the two nodes. If you specify a minimum ormaximum delay for a clock, the delay applies to all paths where the source node ordestination node is clocked by the clock.

You can create a minimum or maximum delay exception for an output port that doesnot have an output delay constraint. You cannot report timing for the paths associatedwith the output port; however, the TimeQuest analyzer reports any slack for the pathin the setup summary and hold summary reports. Because there is no clock associatedwith the output port, no clock is reported for timing paths associated with the outputport.

1 To report timing with clock filters for output paths with minimum and maximumdelay constraints, you can set the output delay for the output port with a value ofzero. You can use an existing clock from the design or a virtual clock as the clockreference.

h For more information about the set_min_delay, and set_max_delay, commands—including full syntax information, options, and example usage—refer to set_min_delay,and set_max_delay, in Quartus II Help.

Delay AnnotationTo modify the default delay values used during timing analysis, use theset_annotated_delay and set_timing_derate commands. You must update thetiming netlist to see the results of these commands

To specify different operating conditions in a single .sdc, rather than having multiple.sdc files that specify different operating conditions, use the set_annotated_delaycommand with the -operating_conditions option.

h For more information about the set_annotated_delay and set_timing_deratecommands—including full syntax information, options, and example usage—refer toset_annotated_delay and set_timing_derate in Quartus II Help.

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 29: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–29Creating Timing Exceptions

Multicycle PathsBy default, the TimeQuest analyzer performs a single-cycle analysis, which is themost restrictive type of analysis. When analyzing a path, the setup launch and latchedge times are determined by finding the closest two active edges in the respectivewaveforms. For a hold analysis, the timing analyzer analyzes the path against twotiming conditions for every possible setup relationship, not just the worst-case setuprelationship. Therefore, the hold launch and latch times may be completely unrelatedto the setup launch and latch edges. The TimeQuest analyzer does not report negativesetup or hold relationships. When either a negative setup or a negative holdrelationship is calculated, the TimeQuest analyzer moves both the launch and latchedges such that the setup and hold relationship becomes positive.

A multicycle constraint adjusts setup or hold relationships by the specified number ofclock cycles based on the source (-start) or destination (-end) clock. An end setupmulticycle constraint of 2 extends the worst-case setup latch edge by one destinationclock period. If -start and -end values are not specified, the default constraint is -end.

Hold multicycle constraints are based on the default hold position (the default valueis 0). An end hold multicycle constraint of 1 effectively subtracts one destination clockperiod from the default hold latch edge.

When the objects are timing nodes, the multicycle constraint only applies to the pathbetween the two nodes. When an object is a clock, the multicycle constraint applies toall paths where the source node (-from) or destination node (-to) is clocked by theclock. When you adjust a setup relationship with a multicycle constraint, the holdrelationship is adjusted automatically.

Table 7–4 shows the commands you can use to modify either the launch or latch edgetimes that the TimeQuest analyzer uses to determine a setup relationship or holdrelationship.

Common Multicycle VariationsMulticycle exceptions adjust the timing requirements for a register-to-register path,allowing the Fitter to optimally place and route a design in a device. Multicycleexceptions also can reduce compilation time and improve the quality of results, andcan be used to change timing requirements. Two common multicycle variations arerelaxing setup to allow a slower data transfer rate, and altering the setup to accountfor a phase shift.

Relaxing Setup with set_multicyle_pathA common type of multicycle exception occurs when the data transfer rate is slowerthan the clock cycle.

Table 7–4. Commands to Modify Edge Times

Command Description of Modification

set_multicycle_path -setup -end <value> Latch edge time of the setup relationship

set_multicycle_path -setup -start<value> Launch edge time of the setup relationship

set_multicycle_path -hold -end <value> Latch edge time of the hold relationship

set_multicycle_path -hold -start <value> Launch edge time of the hold relationship

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 30: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–30 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating Timing Exceptions

In this example, the source clock has a period of 10 ns, but a group of registers areenabled by a toggling clock, so they only toggle every other cycle. Since they are fedby a 10 ns clock, the TimeQuest analyzer reports a set up of 10 ns and a hold of 0 ns,However, since the data is transferring every other cycle, the relationships should beanalyzed as if the clock were operating at 20 ns, which would result in a setup of20 ns, while the hold remains 0 ns, in essence, extending the window of time when thedata can be recognized.

Example 7–23 shows a pair of multicycle assignments that relax the setup relationshipby specifying the -setup value of N and the -hold value as N-1. You must specify thehold relationship with a -hold assignment to prevent a positive hold requirement.

Figure 7–12 shows how the exception relaxes the setup by two or three cycles.

This pattern can be extended to create larger setup relationships in order to easetiming closure requirements. A common use for this exception is when writing toasynchronous RAM across an I/O interface. The delay between address, data, and awrite enable may be several cycles. A multicycle exception to I/O ports can allowextra time for the address and data to resolve before the enable occurs.

Example 7–24 shows how a relaxing the setup by three cycles can be achieved.

Example 7–23. Relaxing Setup while Maintaining Hold

set_multicycle_path -setup -from src_reg* -to dst_reg* 2set_multicycle_path -hold -from src_reg* -to dst_reg* 1

Figure 7–12. Relaxing Setup by Multiple Cycles

Example 7–24. Three Cycle I/O Interface Exception

set_multicycle_path -setup -to [get_ports {SRAM_ADD[*] SRAM_DATA[*]} 3set_multicycle_path -hold -to [get_ports {SRAM_ADD[*] SRAM_DATA[*]} 2

0 ns 10 ns 20 ns 30 ns

0 ns 10 ns 20 ns 30 ns

0 ns 10 ns 20 ns 30 ns

No Multicycles(Default Relationship)

Setup = 10 nsHold = 0 ns

Setup = 2Hold = 1

Setup = 20 nsHold = 0 ns

Setup = 3Hold = 2

Setup = 30 nsHold = 0 ns

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 31: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–31Creating Timing Exceptions

Accounting for a Phase ShiftIn this example, the design contains a PLL that performs a phase-shift on a clockwhose domain exchanges data with domains that do not experience the phase shift.For example, when the destination clock is phase-shifted forward and the source clockis not, the default setup relationship becomes that phase-shift.

Example 7–25 shows a circumstance where a PLL phase-shifts one output forward bya small amount, for example 0.2 ns.

The default setup relationship for this phase-shift is 0.2 ns, shown in Figure A,creating a scenario where the hold relationship is negative, which makes achievingtiming closure nearly impossible.

Adding the constraint shown in Example Y allows the data to transfer to the followingedge.

The hold relationship is derived from the setup relationship, making a multicyle holdconstraint unnecessary. For a more complete example refer to “Same FrequencyClocks with Destination Clock Offset” on page 7–44.

h For more information about the set_multicycle_path command—including fullsyntax information, options, and example usage—refer to set_multicycle_path inQuartus II Help.

Example 7–25. Cross Domain Phase-Shift

create_generated_clock -source pll|inclk[0] -name pll|clk[0] pll|clk[0]create_generated_clock -source pll|inclk[0] -name pll|clk[1] -phase 30 pll|clk[1]

Figure 7–13. Phase-Shifted Setup and Hold

-10 ns 0 ns 10 ns 20 ns

-10 ns 0 ns 10 ns 20 ns

No Multicycles(Default Relationship)

Setup = 0.2 nsHold = -9.8 ns

Setup = 2

Setup = 10.2 nsHold = 0.2 ns

Example 7–26. Adjusting the Phase-Shift with a set_multicycle_path Constraint

set_multicycle_path -setup -from [get_clocks clk_a] -to [get_clocks clk_b] 2

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 32: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–32 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating Timing Exceptions

Multicycle Clock Setup Check and Hold Check AnalysisYou can modify the setup and hold relationship when you apply a multicycleexception to a register-to-register path. Figure 7–14 shows a register-to-register pathwith various timing parameters labeled.

Multicycle Clock SetupThe setup relationship is defined as the number of clock periods between the latchedge and the launch edge. By default, the TimeQuest analyzer performs a single-cyclepath analysis, which results in the setup relationship being equal to one clock period(latch edge – launch edge). Applying a multicycle setup assignment, adjusts the setuprelationship by the multicycle setup value. The adjustment value may be negative.

An end multicycle setup assignment modifies the latch edge of the destination clockby moving the latch edge the specified number of clock periods to the right of thedetermined default latch edge. Figure 7–15 shows various values of the endmulticycle setup assignment and the resulting latch edge.

Figure 7–14. Register-to-Register Path

REG1 REG2Combinational

LogicSET SET

D Q D Q

CLR CLR

CLK

Tclk1

TCO TSU / TH

Tdata

Tclk2

Figure 7–15. End Multicycle Setup Values

-10 0 10 20

REG1.CLK

REG2.CLK

EMS = 2

EMS = 1(default)

EMS = 3

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 33: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–33Creating Timing Exceptions

A start multicycle setup assignment modifies the launch edge of the source clock bymoving the launch edge the specified number of clock periods to the left of thedetermined default launch edge. Figure 7–16 shows various values of the startmulticycle setup assignment and the resulting launch edge.

Figure 7–17 shows the setup relationship reported by the TimeQuest analyzer for thenegative setup relationship shown in Figure 7–16.

Multicycle Clock HoldThe setup relationship is defined as the number of clock periods between the launchedge and the latch edge. By default, the TimeQuest analyzer performs a single-cyclepath analysis, which results in the hold relationship being equal to one clock period(launch edge – latch edge). When analyzing a path, the TimeQuest analyzer performstwo hold checks. The first hold check determines that the data launched by thecurrent launch edge is not captured by the previous latch edge. The second hold checkdetermines that the data launched by the next launch edge is not captured by thecurrent latch edge. The TimeQuest analyzer reports only the most restrictive holdcheck. Equation 7–3 shows the calculation that the TimeQuest analyzer performs todetermine the hold check.

Figure 7–16. Start Multicycle Setup Values

100 20 30 40

SMS = 2

SMS = 3SMS = 1(default)

Source Clock

Destination Clock

Figure 7–17. Start Multicycle Setup Values Reported by the TimeQuest Analyzer

-10 0 10 20

Source Clock

Destination Clock

SMS = 2

SMS = 1(default)

SMS = 3

Equation 7–3. Hold Check

hold check 1 current launch edge= previous latch edge–

hold check 2 next launch edge= current latch edge–

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 34: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–34 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating Timing Exceptions

1 If a hold check overlaps a setup check, the hold check is ignored.

A start multicycle hold assignment modifies the launch edge of the destination clockby moving the latch edge the specified number of clock periods to the right of thedetermined default launch edge. Figure 7–18 shows various values of the startmulticycle hold assignment and the resulting launch edge.

An end multicycle hold assignment modifies the latch edge of the destination clock bymoving the latch edge the specific ed number of clock periods to the left of thedetermined default latch edge. Figure 7–19 shows various values of the endmulticycle hold assignment and the resulting latch edge.

Figure 7–18. Start Multicycle Hold Values

-10 0 10 20

Source Clock

Destination Clock

SMH = 1SMH = 0(default) SMH = 2

Figure 7–19. End Multicycle Hold Values

-10-20 0 10 20

Source Clock

Destination Clock

EMH = 2

EMH= 0(default)EMH = 1

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 35: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–35Creating Timing Exceptions

Figure 7–20 shows the hold relationship reported by the TimeQuest analyzer for thenegative hold relationship shown in Figure 7–19.

Examples of Basic Multicycle ExceptionsThis section describes the following examples of combinations of multicycleexceptions:

■ “Default Settings” on page 7–35

■ “End Multicycle Setup = 2 and End Multicycle Hold = 0” on page 7–38

■ “End Multicycle Setup = 2 and End Multicycle Hold = 1” on page 7–41

Each example explains how the multicycle exceptions affect the default setup andhold analysis in the TimeQuest analyzer. The multicycle exceptions are applied to asimple register-to-register circuit. Both the source and destination clocks are set to10 ns.

Default SettingsBy default, the TimeQuest analyzer performs a single-cycle analysis to determine thesetup and hold checks. Also, by default, the TimeQuest analyzer sets the endmulticycle setup assignment value to one and the end multicycle hold assignmentvalue to zero.

Figure 7–20. End Multicycle Hold Values Reported by the TimeQuest Analyzer

-10 0 10 20

Source Clock

Destination Clock

EMH = 2EMH = 0default)

EMH = 1

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 36: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–36 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating Timing Exceptions

Figure 7–21 shows the source and the destination timing waveform for the sourceregister and destination register, respectively where HC1 and HC2 are hold checksone and two and SC is the setup check.

Equation 7–4 shows the calculation that the TimeQuest analyzer performs todetermine the setup check.

The most restrictive setup relationship with the default single-cycle analysis, that is, asetup relationship with an end multicycle setup assignment of one, is 10 ns.

Figure 7–21. Default Timing Diagram

-10 0 10 20

Current Launch

Current Latch

0 1 2

HC1 HC2SC

REG1.CLK

REG2.CLK

Equation 7–4. Setup Check

=

=

=

setup check current latch edge closest previous launch edge–

10 ns 0 ns–

10 ns

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 37: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–37Creating Timing Exceptions

Figure 7–22 shows the setup report for the default setup in the TimeQuest analyzerwith the launch and latch edges highlighted.

Equation 7–5 shows the calculation that the TimeQuest analyzer performs todetermine the hold check. Both hold checks are equivalent.

The most restrictive hold relationship with the default single-cycle analysis, that ahold relationship with an end multicycle hold assignment of zero, is 0 ns.

Figure 7–22. Setup Report

Equation 7–5. Hold Check

=

=

=

=

=

hold check 1 current launch edge previous latch edge–

0 ns 0 ns–

0 ns

hold check 2 next launch edge current latch edge–

10 ns 10 ns–

0 ns

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 38: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–38 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating Timing Exceptions

Figure 7–23 shows the hold report for the default setup in the TimeQuest analyzerwith the launch and latch edges highlighted.

End Multicycle Setup = 2 and End Multicycle Hold = 0In this example, the end multicycle setup assignment value is two, and the endmulticycle hold assignment value is zero. Example 7–27 shows the multicycleexceptions applied to the register-to-register design for this example.

1 An end multicycle hold value is not required because the default end multicycle holdvalue is zero.

In this example, the setup relationship is relaxed by a full clock period by moving thelatch edge to the next latch edge. The hold analysis is unchanged from the defaultsettings.

Figure 7–23. Hold Report

Example 7–27. Multicycle Exceptions

set_multicycle_path -from [get_clocks clk_src] -to [get_clocks clk_\dst] -setup -end 2

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 39: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–39Creating Timing Exceptions

Figure 7–24 shows the setup timing diagram. The latch edge is a clock cycle later thanin the default single-cycle analysis.

Equation 7–6 shows the calculation that the TimeQuest analyzer performs todetermine the setup check.

The most restrictive setup relationship with an end multicycle setup assignment oftwo is 20 ns.

Figure 7–25 shows the setup report in the TimeQuest analyzer with the launch andlatch edges highlighted.

Figure 7–24. Setup Timing Diagram

-10 0 10 20

Current Launch

Current Latch

SC

REG1.CLK

REG2.CLK

Equation 7–6. Setup Check

=

=

=

setup check current latch edge closest previous launch edge–

20 ns 0 ns–

20 ns

Figure 7–25. Setup Report

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 40: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–40 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating Timing Exceptions

Because the multicycle hold latch and launch edges are the same as the results of holdanalysis with the default settings, the multicycle hold analysis in this example isequivalent to the single-cycle hold analysis. Figure 7–26 shows the timing diagram forthe hold checks for this example. The hold checks are relative to the setup check.Usually, the TimeQuest analyzer performs hold checks on every possible setup check,not only on the most restrictive setup check edges.

Equation 7–7 shows the calculation that the TimeQuest analyzer performs todetermine the hold check. Both hold checks are equivalent.

The most restrictive hold relationship with an end multicycle setup assignment valueof two and an end multicycle hold assignment value of zero is 10 ns.

Figure 7–26. Hold Timing DIagram

-10 0 10 20

Current Launch

Current Latch

REG1.CLK

REG2.CLK

SCHC1Data HC2

Equation 7–7. Hold Check

=

=

=

=

=

=

hold check 1 current launch edge previous latch edge–

0 ns 10 ns–

10 ns–

hold check 2 next launch edge current latch edge–

10 ns 20 ns–

10 ns–

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 41: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–41Creating Timing Exceptions

Figure 7–27 shows the hold report for this example in the TimeQuest analyzer withthe launch and latch edges highlighted.

End Multicycle Setup = 2 and End Multicycle Hold = 1In this example, the end multicycle setup assignment value is two, and the endmulticycle hold assignment value is one. Example 7–28 shows the multicycleexceptions applied to the register-to-register design for this example.

In this example, the setup relationship is relaxed by two clock periods by moving thelatch edge to the left two clock periods. The hold relationship is relaxed by a fullperiod by moving the latch edge to the previous latch edge.

Figure 7–27. Hold Report

Example 7–28. Multicycle Exceptions

set_multicycle_path -from [get_clocks clk_src] -to [get_clocks clk_dst]-setup -end 2set_multicycle_path -from [get_clocks clk_src] -to [get_clocks clk_dst]-hold -end 1

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 42: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–42 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating Timing Exceptions

Figure 7–28 shows the setup timing diagram.

Equation 7–8 shows the calculation that the TimeQuest analyzer performs todetermine the setup check.

The most restrictive hold relationship with an end multicycle setup assignment valueof two is 20 ns.

Figure 7–29 shows the setup report for this example in the TimeQuest analyzer withthe launch and latch edges highlighted.

Figure 7–28. Setup Timing Diagram

-10 0

0 1 2

10 20

SC

SRC.CLK

DST.CLK

CurrentLaunch

CurrentLatch

Equation 7–8. Setup Check

=

=

=

setup check current latch edge closest previous launch edge–

20 ns 0 ns–

20 ns

Figure 7–29. Setup Report

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 43: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–43Creating Timing Exceptions

Figure 7–30 shows the timing diagram for the hold checks for this example. The holdchecks are relative to the setup check.

Equation 7–9 shows the calculation that the TimeQuest analyzer performs todetermine the hold check. Both hold checks are equivalent.

The most restrictive hold relationship with an end multicycle setup assignment valueof two and an end multicycle hold assignment value of one is 0 ns.

Figure 7–30. Hold Timing Diagram

-10 0 10 20

SRC.CLK

DST.CLK

CurrentLaunch

CurrentLatch

SC

HC1

HC2

Equation 7–9. Hold Check

=

=

=

=

=

=

hold check 1 current launch edge previous latch edge–

0 ns 0 ns–

0 ns

hold check 2 next launch edge current latch edge–

10 ns 10 ns–

0 ns

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 44: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–44 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating Timing Exceptions

Figure 7–31 shows the hold report for this example in the TimeQuest analyzer withthe launch and latch edges highlighted.

Application of Multicycle ExceptionsThis section shows the following examples of applications of multicycle exceptions:

■ “Same Frequency Clocks with Destination Clock Offset” on page 7–44

■ “The Destination Clock Frequency is a Multiple of the Source Clock Frequency” onpage 7–47

■ “The Destination Clock Frequency is a Multiple of the Source Clock Frequencywith an Offset” on page 7–50

■ “The Source Clock Frequency is a Multiple of the Destination Clock Frequency” onpage 7–52

■ “The Source Clock Frequency is a Multiple of the Destination Clock Frequencywith an Offset” on page 7–55

Each example explains how the multicycle exceptions affect the default setup andhold analysis in the TimeQuest analyzer. All of the examples are between relatedclock domains. If your design contains related clocks, such as PLL clocks, and pathsbetween related clock domains, you can apply multicycle constraints.

Same Frequency Clocks with Destination Clock OffsetIn this example, the source and destination clocks have the same frequency, but thedestination clock is offset with a positive phase shift. Both the source and destinationclocks have a period of 10 ns. The destination clock has a positive phase shift of 2 nswith respect to the source clock. Figure 7–32 shows an example of a design with samefrequency clocks and a destination clock offset.

Figure 7–31. Hold Report

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 45: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–45Creating Timing Exceptions

Figure 7–33 shows the timing diagram for default setup check analysis performed bythe TimeQuest analyzer.

Equation 7–10 shows the calculation that the TimeQuest analyzer performs todetermine the setup check.

The setup relationship shown in Figure 7–33 is too pessimistic and is not the setuprelationship required for typical designs. To correct the default analysis, you must usean end multicycle setup exception of two. Example 7–29 shows the multicycleexception used to correct the default analysis in this example.

Figure 7–32. Same Frequency Clocks with Destination Clock Offset

Figure 7–33. Setup Timing Diagram

Equation 7–10. Setup Check

=

=

=

Example 7–29. Multicycle Exceptions

set_multicycle_path -from [get_clocks clk_src] -to [get_clocks clk_dst]-setup -end 2

REG1 REG2Combinational

LogicSET SET

D Q D Q

CLR CLR

clk1

In

clk0

Out

-10 0

1 2

10 20

REG1.CLK

REG2.CLK

Launch

Latch

SC

setup check current latch edge closest previous launch edge–

2 ns 0 ns–

2 ns

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 46: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–46 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating Timing Exceptions

Figure 7–34 shows the timing diagram for the preferred setup relationship for thisexample..

Figure 7–35 shows the timing diagram for default hold check analysis performed bythe TimeQuest analyzer with an end multicycle setup value of two.

Equation 7–11 shows the calculation that the TimeQuest analyzer performs todetermine the hold check.

In this example, the default hold analysis returns the preferred hold requirements andno multicycle hold exceptions are required.

Figure 7–34. Preferred Setup Relationship

Figure 7–35. Default Hold Check

Equation 7–11. Hold Check

=

=

=

=

=

=

-10 0

1 2

10 20

REG1.CLK

REG2.CLK

Launch

Latch

SC

-10 0 10 20

REG1.CLK

REG2.CLK

CurrentLaunch

CurrentLatch

SCHC1 HC2

hold check 1 current launch edge previous latch edge–

0 ns 2 ns–

2 ns–

hold check 2 next launch edge current latch edge–

10 ns 12 ns–

2 ns–

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 47: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–47Creating Timing Exceptions

Figure 7–36 shows the associated setup and hold analysis if the phase shift is –2 ns. Inthis example, the default hold analysis is correct for the negative phase shift of 2 ns,and no multicycle exceptions are required.

The Destination Clock Frequency is a Multiple of the Source ClockFrequencyIn this example, the destination clock frequency value of 5 ns is an integer multiple ofthe source clock frequency of 10 ns. The destination clock frequency can be an integermultiple of the source clock frequency when a PLL is used to generate both clockswith a phase shift applied to the destination clock. Figure 7–37 shows an example of adesign where the destination clock frequency is a multiple of the source clockfrequency.

Figure 7–36. Negative Phase Shift

Figure 7–37. Destination Clock is Multiple of Source Clock

-10 0 10 20

REG1.CLK

REG2.CLK

CurrentLaunch

CurrentLatch

SCHC1 HC2

REG1 REG2Combinational

LogicSET SET

D Q D Q

CLR CLRclk

In

clk0

clk1

Out

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 48: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–48 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating Timing Exceptions

Figure 7–38 shows the timing diagram for default setup check analysis performed bythe TimeQuest analyzer.

Equation 7–12 shows the calculation that the TimeQuest analyzer performs todetermine the setup check.

The setup relationship shown in Figure 7–38 demonstrates that the data does not needto be captured at edge one, but can be captured at edge two; therefore, you can relaxthe setup requirement. To correct the default analysis, you must shift the latch edge byone clock period with an end multicycle setup exception of two. Example 7–30 showsthe multicycle exception used to correct the default analysis in this example.

Figure 7–38. Setup Timing Diagram

Equation 7–12. Setup Check

=

=

=

Example 7–30. Multicycle Exceptions

set_multicycle_path -from [get_clocks clk_src] -to [get_clocks clk_dst]-setup -end 2

-10 0

1 2

10 20

REG1.CLK

REG2.CLK

Launch

Latch

SC

setup check current latch edge closest previous launch edge–

5 ns 0 ns–

5 ns

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 49: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–49Creating Timing Exceptions

Figure 7–39 shows the timing diagram for the preferred setup relationship for thisexample.

Figure 7–40 shows the timing diagram for default hold check analysis performed bythe TimeQuest analyzer with an end multicycle setup value of two.

Equation 7–13 shows the calculation that the TimeQuest analyzer performs todetermine the hold check.

In this example, hold check one is too restrictive. The data is launched by the edge at0 ns and should check against the data captured by the previous latch edge at 0 ns,which does not occur in hold check one. To correct the default analysis, you must usean end multicycle hold exception of one.

Figure 7–39. Preferred Setup Analysis

Figure 7–40. Default Hold Check

Equation 7–13. Hold Check

=

=

=

=

=

=

-10 0

1 2

10 20

REG1.CLK

REG2.CLK

Launch

Latch

SC

-10 0 10 20

REG1.CLK

REG2.CLK

CurrentLaunch

CurrentLatch

SCHC1

HC2

hold check 1 current launch edge previous latch edge–

0 ns 5 ns–

5 ns–

hold check 2 next launch edge current latch edge–

10 ns 10 ns–

0 ns

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 50: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–50 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating Timing Exceptions

The Destination Clock Frequency is a Multiple of the Source ClockFrequency with an OffsetThis example is a combination of the previous two examples. The destination clockfrequency is an integer multiple of the source clock frequency and the destinationclock has a positive phase shift. The destination clock frequency is 5 ns and the sourceclock frequency is 10 ns. The destination clock also has a positive offset of 2 ns withrespect to the source clock. The destination clock frequency can be an integer multipleof the source clock frequency with an offset when a PLL is used to generate bothclocks with a phase shift applied to the destination clock. Figure 7–41 shows anexample of a design in which the destination clock frequency is a multiple of thesource clock frequency with an offset.

Figure 7–42 shows the timing diagram for default setup check analysis performed bythe TimeQuest analyzer.

Equation 7–14 shows the calculation that the TimeQuest analyzer performs todetermine the setup check..

The setup relationship shown in Figure 7–42 demonstrates that the data does not needto be captured at edge one, but can be captured at edge two; therefore, you can relaxthe setup requirement. To correct the default analysis, you must shift the latch edge byone clock period with an end multicycle setup exception of three.

Figure 7–41. Destination Clock is Multiple of Source Clock with Offset

Figure 7–42. Setup Timing Diagram

Equation 7–14. Setup Check

=

=

=

REG1 REG2Combinational

LogicSET SET

D Q D Q

CLR CLRclk

In

clk0

clk1

Out

-10 0

1 2 3

10 20

REG1.CLK

REG2.CLK

Launch

Latch

SC

setup check current latch edgeˆ closest previous launch edge–

2 ns 0 ns–

2 ns

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 51: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–51Creating Timing Exceptions

Example 7–31 shows the multicycle exception used to correct the default analysis inthis example.

Figure 7–43 shows the timing diagram for the preferred setup relationship for thisexample.

Figure 7–44 shows the timing diagram for default hold check analysis performed bythe TimeQuest analyzer with an end multicycle setup value of three.

Example 7–31. Multicycle Exceptions

set_multicycle_path -from [get_clocks clk_src] -to [get_clocks clk_dst]-setup -end 3

Figure 7–43. Preferred Setup Analysis

Figure 7–44. Default Hold Check

SC

-10 0

1 2 3

10 20

REG1.CLK

REG2.CLK

Launch

Latch

SC

-10 0 10 20

REG1.CLK

REG2.CLK

CurrentLaunch

CurrentLatch

HC1HC2

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 52: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–52 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating Timing Exceptions

Equation 7–15 shows the calculation that the TimeQuest analyzer performs todetermine the hold check.

In this example, hold check one is too restrictive. The data is launched by the edge at0 ns and should check against the data captured by the previous latch edge at 2 ns,which does not occur in hold check one. To correct the default analysis, you must usean end multicycle hold exception of one.

The Source Clock Frequency is a Multiple of the Destination ClockFrequencyIn this example, the source clock frequency value of 5 ns is an integer multiple of thedestination clock frequency of 10 ns. The source clock frequency can be an integermultiple of the destination clock frequency when a PLL is used to generate bothclocks and different multiplication and division factors are used. Figure 7–45 showsan example of a design where the source clock frequency is a multiple of thedestination clock frequency.

Equation 7–15. Hold Check

=

=

=

=

=

=

Figure 7–45. Source Clock Frequency is Multiple of Destination Clock Frequency

hold check 1 current launch edge previous latch edge–

0 ns 5 ns–

5 ns–

hold check 2 next launch edge current latch edge–

10 ns 10 ns–

0 ns

REG1 REG2Combinational

LogicSET SET

D Q D Q

CLR CLRclk

In

clk0

clk1

Out

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 53: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–53Creating Timing Exceptions

Figure 7–46 shows the timing diagram for default setup check analysis performed bythe TimeQuest analyzer.

Equation 7–16 shows the calculation that the TimeQuest analyzer performs todetermine the setup check.

The setup relationship shown in Figure 7–46 demonstrates that the data launched atedge one does not need to be captured, and the data launched at edge two must becaptured; therefore, you can relax the setup requirement. To correct the defaultanalysis, you must shift the launch edge by one clock period with a start multicyclesetup exception of two.

Example 7–32 shows the multicycle exception used to correct the default analysis inthis example.

Figure 7–46. Default Setup Check Analysis

Equation 7–16. Setup Check

=

=

=

Example 7–32. Multicycle Exceptions

set_multicycle_path -from [get_clocks clk_src] -to [get_clocks clk_dst]-setup -start 2

SC

-10 0

2 1

10 20

REG1.CLK

REG2.CLK

Launch

Latch

setup check current latch edge closest previous launch edge–

10 ns 5 ns–

5 ns

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 54: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–54 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating Timing Exceptions

Figure 7–47 shows the timing diagram for the preferred setup relationship for thisexample.

Figure 7–48 shows the timing diagram for default hold check analysis performed bythe TimeQuest analyzer with a start multicycle setup value of two.

Equation 7–17 shows the calculation that the TimeQuest analyzer performs todetermine the hold check..

In this example, hold check two is too restrictive. The data is launched next by theedge at 10 ns and should check against the data captured by the current latch edge at10 ns, which does not occur in hold check two. To correct the default analysis, youmust use a start multicycle hold exception of one.

Figure 7–47. Preferred Setup Check Analysis

Figure 7–48. Default Hold Check

Equation 7–17. Hold Check

=

=

=

=

=

=

SC

-10 0

2 1

10 20

REG1.CLK

REG2.CLK

Launch

Latch

SC

-10 0 10 20

REG1.CLK

REG2.CLK

CurrentLaunch

CurrentLatch

HC1 HC2

hold check 1 current launch edge previous latch edge–

0 ns 0 ns–

0 ns

hold check 2 next launch edge current latch edge–

5 ns 10 ns–

5 ns–

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 55: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–55Creating Timing Exceptions

The Source Clock Frequency is a Multiple of the Destination ClockFrequency with an OffsetIn this example, the source clock frequency is an integer multiple of the destinationclock frequency and the destination clock has a positive phase offset. The source clockfrequency is 5 ns and destination clock frequency is 10 ns. The destination clock alsohas a positive offset of 2 ns with respect to the source clock. The source clockfrequency can be an integer multiple of the destination clock frequency with an offsetwhen a PLL is used to generate both clocks, different multiplication and divisionfactors are used, and a phase shift applied to the destination clock. Figure 7–49 showsan example of a design where the source clock frequency is a multiple of thedestination clock frequency with an offset.

Figure 7–50 shows the timing diagram for default setup check analysis performed bythe TimeQuest analyzer.

Equation 7–18 shows the calculation that the TimeQuest analyzer performs todetermine the setup check..

The setup relationship shown in Figure 7–50 demonstrates that the data is notlaunched at edge one, and the data that is launched at edge three must be captured;therefore, you can relax the setup requirement. To correct the default analysis, youmust shift the launch edge by two clock periods with a start multicycle setupexception of three.

Figure 7–49. Source Clock Frequency is Multiple of Destination Clock Frequency with Offset

Figure 7–50. Setup Timing Diagram

Equation 7–18. setup Check

=

=

=

REG1 REG2Combinational

LogicSET SET

D Q D Q

CLR CLRclk

In

clk0

clk1

Out

C

-10 0

3 2 1

10 20

REG1.CLK

REG2.CLK

Launch

Latch

setup check current latch edge closest previous launch edge–

12 ns 10 ns–

2 ns

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 56: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–56 Chapter 7: The Quartus II TimeQuest Timing AnalyzerCreating Timing Exceptions

Example 7–33 shows the multicycle exception used to correct the default analysis inthis example.

Figure 7–51 shows the timing diagram for the preferred setup relationship for thisexample.

Figure 7–52 shows the timing diagram for default hold check analysis performed bythe TimeQuest analyzer with a start multicycle setup value of three.

Equation 7–19 shows the calculation that the TimeQuest analyzer performs todetermine the hold check.

Example 7–33. Multicycle Exceptions

set_multicycle_path -from [get_clocks clk_src] -to [get_clocks clk_dst]-setup -start 3

Figure 7–51. Preferred Setup Check Analysis

Figure 7–52. Default Hold Check Analysis

Equation 7–19. Hold Check

=

=

=

=

-10 0

3 2 1

10 20

REG1.CLK

REG2.CLK

Launch

Latch

SC

-10 0 10 20

REG1.CLK

REG2.CLK

CurrentLaunch

CurrentLatch

HC1

HC2

SC

hold check 1 current launch edge previous latch edge–

0 ns 2 ns–

2 ns–

hold check 2 next launch edge current latch edge–

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 57: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–57Timing Reports

In this example, hold check two is too restrictive. The data is launched next by theedge at 10 ns and should check against the data captured by the current latch edge at12 ns, which does not occur in hold check two. To correct the default analysis, youmust use a start multicycle hold exception of one.

Timing ReportsThe TimeQuest analyzer provides real-time static timing analysis result reports. TheTimeQuest analyzer does not automatically generate reports; you must create eachreport individually in the TimeQuest analyzer GUI or with command-line commands.You can customize in which report to display specific timing information, excludingfields that are not required.

Table 7–5 shows some of the different command-line commands you can use togenerate reports in the TimeQuest analyzer and the equivalent reports shown in theTimeQuest analyzer GUI.

h For more information—including a complete list of commands to generate timingreports and full syntax information, options, and example usage—refer to::quartus::sta in Quartus II Help.

During compilation, the Quartus II software generates timing reports on differenttiming areas in the design. You can configure various options for the TimeQuestanalyzer reports generated during compilation.

h For more information about the options you can set to customize the reports, refer toTimeQuest Timing Analyzer Page in Quartus II Help.

You can also use the TIMEQUEST_REPORT_WORST_CASE_TIMING_PATHS assignment togenerate a report of the worst-case timing paths for each clock domain. This reportcontains worst-case timing data for setup, hold, recovery, removal, and minimumpulse width checks.

Use the TIMEQUEST_REPORT_NUM_WORST_CASE_TIMING_PATHS assignment to specify thenumber of paths to report for each clock domain.

=

=

Equation 7–19. Hold Check

5 ns 12 ns–

7 ns–

Table 7–5. TimeQuest Analyzer Reports

Command-Line Command Report

report_timing Timing report

report_exceptions Exceptions report

report_clock_transfers Clock Transfers report

report_min_pulse_width Minimum Pulse Width report

report_ucp Unconstrained Paths report

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 58: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–58 Chapter 7: The Quartus II TimeQuest Timing AnalyzerDocument Revision History

Example 7–34 shows an example of how to use theTIMEQUEST_REPORT_WORST_CASE_TIMING_PATHS andTIMEQUEST_REPORT_NUM_WORST_CASE_TIMING_PATHS assignments in the .qsf togenerate reports.

f For more information about timing closure recommendations, refer to the Area andTiming Optimization chapter in volume 2 of the Quartus II Handbook.

Document Revision HistoryTable 7–6 shows the revision history for this chapter.

Example 7–34. Generating Worst-Case Timing Reports

#Enable Worst-Case Timing Reportset_global_assignment -name TIMEQUEST_REPORT_WORST_CASE_TIMING_PATHS ON#Report 10 paths per clock domainset_global_assignment -name TIMEQUEST_REPORT_NUM_WORST_CASE_TIMING_PATHS 10

Table 7–6. Document Revision History (Part 1 of 2)

Date Version Changes

November 2013 13.1.0 ■ Removed HardCopy device information.

June 2012 12.0.0

■ Reorganized chapter.

■ Added “Using the Quartus II Templates” section on creating an SDC constraints file withthe Insert Template dialog box.

■ Added “Identifying the Quartus II Software Executable from the SDC File” section.

■ Revised multicycle exceptions section.

November 2011 11.1.0■ Consolidated content from the Best Practices for the Quartus II TimeQuest

Timing Analyzer chapter.

■ Changed to new document template.

May 2011 11.0.0 ■ Updated to improve flow. Minor editorial updates.

December 2010 10.1.0

■ Changed to new document template.

■ Revised and reorganized entire chapter.

■ Linked to Quartus II Help.

July 2010 10.0.0 Updated to link to content on SDC commands and the TimeQuest analyzer GUI in Quartus IIHelp.

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification

Page 59: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

Chapter 7: The Quartus II TimeQuest Timing Analyzer 7–59Document Revision History

f For previous versions of the Quartus II Handbook, refer to the Quartus II HandbookArchive.

November 2009 9.1.0

Updated for the Quartus II software version 9.1, including:

■ Added information about commands for adding and removing items from collections

■ Added information about the set_timing_derate and report_skew commands

■ Added information about worst-case timing reporting

■ Minor editorial updates

November 2008 8.1.0

Updated for the Quartus II software version 8.1, including:

■ Added the following sections:

■ “set_net_delay” on page 7–42

■ “Annotated Delay” on page 7–49

■ “report_net_delay” on page 7–66

■ Updated the descriptions of the -append and -file <name> options in tablesthroughout the chapter

■ Updated entire chapter using 8½” × 11” chapter template

■ Minor editorial updates

Table 7–6. Document Revision History (Part 2 of 2)

Date Version Changes

November 2013 Altera Corporation Quartus II Handbook Version 13.1Volume 3: Verification

Page 60: 7. The Quartus II TimeQuest Timing Analyzer...with the TimeQuest analyzer GUI or with a Tcl script. 1 The Quartus II software assigns a default frequency of 1 GHz for clocks that have

7–60 Chapter 7: The Quartus II TimeQuest Timing AnalyzerDocument Revision History

Quartus II Handbook Version 13.1 November 2013 Altera CorporationVolume 3: Verification