The following table shows the typographic conventions that this document uses.
Visual CueMeaning
Bold Type with Initial Capital
Letters
bold type
Italic Type with Initial Capital Letters
Italic type
Initial Capital Letters
“Subheading Title”
Courier type
1., 2., 3., and
a., b., c., etc.
■ ■Bullets are used in a list of items when the sequence of the items is not important.
v The checkmark indicates a procedure that consists of one step only.
1 The hand points to information that requires special attention.
c
w
r The angled arrow indicates you should press the Enter key.
f The feet direct you to more information on a particular topic.
Command names, dialog box titles, checkbox options, and dialog box options are
shown in bold, initial capital letters. Example: Save As dialog box.
External timing parameters, directory names, project names, disk drive names, file
names, file name extensions, and software utility names are shown in bold type.
Examples: f
The TimeQuest timing analyzer is a powerful ASIC-style timing analysis tool that
validates the timing performance of all logic in a design using industry standard
constraint, analysis, and reporting methodology.
The TimeQuest timing analyzer includes support for Synopsis Design Constraints
(SDC). Additionally, the TimeQuest timing analyzer includes an extensive tool
command language (Tcl) scripting API. This reference manual includes the supported
SDC constraints and commands, and the TimeQuest Tcl API commands.
This overview covers the TimeQuest timing analyzer support for scripted operation.
At the end of this overview is a table of additional documentation and resources.
What's Inside the SDC and TimeQuest API Reference Manual?
The Quartus II SDC and TimeQuest API Reference Manual is your reference guide to
TimeQuest timing analyzer constraints and commands, including command details,
usage, and examples.
All the information included in the Quartus II SDC and TimeQuest API Reference Manual, as well as the most up-to-date list of commands, can also be found in the
Quartus II software Tcl API and command-line executable online help reference,
Qhelp. To access this information within Quartus II design software, type the
following command at the command prompt:
quartus_sh --qhelpr
TimeQuest Timing Analyzer Scripting Support
The sdc and sta packages are supported in the quartus_sta command-line executable.
The sdc package contains the Synopsys Design Constraints (SDC) functions used to
specify constraints and exceptions to the TimeQuest timing analyzer.
The sta package contains the set of Tcl functions for obtaining advanced information
from the TimeQuest timing analyzer.
The quartus_sta command-line executable validates the timing performance of all
logic in a design using industry standard constraint, analysis, and reporting
methodology. You can use the TimeQuest analyzer's graphical user interface (GUI) or
command-line interface to constrain, run, and view results for all timing paths in your
design.
fFor information about other command-line executables and Tcl packages, refer to the
Synopsys Design Constraint (SDC) format is used to specify the design intent, including the timing and
area constraints of the design. The TimeQuest Timing Analyzer only implements the set of SDC
commands required to specify the timing constraints of the design. For area constraints, the QSF file
should be used.
This package implements the SDC Spec Version 1.5 (June 2005).
Any command in this package can be specified in a TimeQuest SDC file.
This package is loaded by default in the following executable:
■ quartus_sta
This package is available for loading in the following executable:
-name <clock_name>: Clock name of the created clock
-period <value>: Speed of the clock in terms of clock period
-waveform <edge_list>: List of edge values
<targets>: List or collection of targets
Description
Defines a clock. If the -name option is not used, the clock name is the same as the first target in the list or
collection. The clock name is used to refer to the clock in other commands.
The -period option specifies the clock period. It is also possible to use this option to specify a frequency to
define the clock period. This can be done by using -period option followed by either <frequency>MHz or
"<frequency> MHz". However, this is a TimeQuest-only extension and makes the SDC syntax
non-standard.
The -waveform option specifies the rising and falling edges (duty cycle) of the clock, and is specified as a
list of two time values: the first rising edge and the next falling edge. The rising edge must be within the
range [0, period]. The falling edge must be within one clock period of the rising edge. The waveform
defaults to (0, period/2).
If a clock with the same name is already assigned to a given target, the create_clock command will
overwrite the existing clock. If a clock with a different name exists on the given target, the create_clock
command will be ignored unless the -add option is used. The -add option can be used to assign multiple
clocks to a pin or port.
If the target of the clock is internal (i.e. not an input port), the source latency is zero by default.
If a clock is on a path after another clock, then it blocks or overwrites the previous clock from that point
forward.
The value of the targets is either a collection or a Tcl list of wildcards used to create a collection of the
appropriate type. The values used must follow standard Tcl or TimeQuest-extension substitution rules.
See the help for use_timequest_style_escaping for details.
Example
# Create a simple 10ns with clock with a 60% duty cycle
create_clock -period 10 -waveform {0 6} -name clk [get_ports clk]
# Create a clock with a falling edge at 2ns, rising edge at 8ns,
# falling at 12ns, etc.
create_clock -period 10 -waveform {8 12} -name clk [get_ports clk]
# Assign two clocks to an input port that are switched externally
create_clock -period 10 -name clk100Mhz [get_ports clk]
create_clock -period 6.667 -name clk150Mhz -add [get_ports clk]
# Two ways to use MHz to define clock period (TimeQuest only)
create_clock -period 250MHz -name clk250MHz [get_ports clk]
create_clock -period "250 MHz" -name clk250MHz [get_ports clk]
-duty_cycle <percent>: Specifies the duty cycle as a percentage of the clock
period--accepts floating point values
-edge_shift <shift_list>: List of edge shifts
-edges <edge_list>: List of edge values
-invert: Invert the clock waveform
-master_clock <clock>: Specifies clock of the source node
-multiply_by <factor>: Multiplication factor
-name <clock_name>: Name of generated clock
-offset <time>: Specifies the offset as an absolute time shift
-phase <degrees>: Specifies the phase shift in degrees
-source <clock_source>: Source node for the generated clock
<targets>: List or collection of targets
Description
Defines an internally generated clock. If -name is not specified, the clock name is the same as the first
target in the list or collection. The clock name is used to refer to the clock in other commands.
If a clock with the same name is already assigned to a given target, the create_generated_clock command
will overwrite the existing clock. If a clock with a different name exists on the given target, the
create_generated_clockcommand will be ignored unless the -add option is used. The -add option can be
used to assign multiple clocks to a pin or port, and is recommended be used with -master_clock option.
The source of the generated clock, specified by -source, is a port, pin, register, or net in the design. All
waveform modifications are relative to this point. If more than one clock feeds the source node, the
-master_clock option must be used to specify which clock to modify.
The source latency of the generated clock is based on the clock network of the generated clock, and not the
clock network of the node specified using -source. This latency is added to any source latency of the
master clock.
The -divide_by, -multiply_by, -invert, -duty_cycle, -edges, and -edge_shift options modify the waveform
relative to the waveform at the source node.
Clock division and multiplication, using -divide_by and -multiply_by, is performed relative to the first
rising edge. Clock division is based on edges in the master clock waveform, and scaled if the division is an
odd number. Use the -duty_cycle option to specify the new duty cycle for clock multiplication. Use the
-phase option to specify any phase shift relative to the new clock period. Use the -offset option to specify
an arbitrary offset or time shift. Use the -invert option to invert the waveform.
Chapter 2: SDC and TimeQuest API Package and Commands2–9
sdc
Clock generation can also be specified with the -edges and -edge_shift options. The -edges option accepts a
list of three numbers specifying the master clock edges to use for the first rising edge, the next falling edge,
and next rising edge. Edges of the master clock are labeled according to the first rising edge (1), next falling
edge (2), next rising edge (3), etc. For example, a basic clock divider can be specified equivalently with
-divide_by 2 or -edges {1 3 5}. The -edge_shift option accepts a list of three time values, the amount to shift
each of the three edges.
The value of the targets is either a collection or a Tcl list of wildcards used to create a collection of the
appropriate type. The values used must follow standard Tcl or TimeQuest-extension substitution rules.
See the help for use_timequest_style_escaping for details.
Example
# Create a clock and a divide-by-2 generated clock
create_clock -period 10 [get_ports clk]
create_generated_clock -divide_by 2 -source [get_ports clk] -name clkdiv \
[get_registers clkdiv]
-period <period_value>: Speed of the default clock in terms of clock period
-waveform <edge_list>: List of edge values
Description
Creates a clock on sources of clock pins in the design that do not already have at least one clock sourcing
the clock pin. This command is equivalent to calling create_clock on each clock source in the design that
does not already have a clock assigned to it.
See the help for create_clock for more information.
Altera does not recommend using this command during final sign-off analysis of a design. derive_clocks
should only be used early in the design phase when the clocks are not completely known. When possible,
create_clock and create_generated_clock should be used instead.
Example
# Automatically create a 10ns, 60% duty cycle clock on all
# unconstrained clock sources
derive_clocks -period 10 -waveform {0 6}
-compatibility_mode: Use simple Tcl matching (Classic Timing Analyzer style)
-hierarchical: Specifies use of a hierarchical searching method
-no_duplicates: Do not match duplicated cell names
-nocase: Specifies case insensitive node name matching
-nowarn: Do not issue warnings messages about unmatched patterns
<filter>: Valid destinations (string patterns are matched using Tcl string matching)
Description
Returns a collection of cells in the design. All cell names in the collection match the specified pattern.
Wildcards can be used to select multiple cells at once.
There are three Tcl string matching schemes available with this command: the default method, the
-hierarchical option, and the -compatibility_mode option.
When you use the default matching scheme, use pipe characters to separate one hierarchy level from the
next. They are treated as special characters and are taken into account when string matching with
wildcards is performed. When this matching scheme is enabled, the specified pattern is matched against
absolute cell names: the names that include the entire hierarchical path. A full cell name can contain
multiple pipe characters in it to reflect the hierarchy. All hierarchy levels in the pattern are matched level
by level. Any included wildcards refer to only one hierarchical level. For example, "*" and "*|*" produce
different collections since they refer to the highest hierarchical level and second highest hierarchical level
respectively.
When using the -hierarchical matching scheme, pipe characters are treated as special characters and are
taken into account when string matching with wildcards is performed. This matching scheme forces the
search to proceed recursively down the hierarchy. The specified pattern is matched against the relative cell
names: the immediate names that do not include any of the hierarchy information. Note that a short cell
name cannot contain pipe characters in it. Any included wildcards are expanded to match the relative pin
names.
The -compatibility_mode matching scheme mimics the string matching behavior of the Classic Timing
Analyzer. The simple Tcl string matching on full, absolute cell names is used. Pipe characters are not
treated as special characters when used with wildcards.
The default matching scheme returns cells whose names match the specified filter and also cells
automatically generated by the Quartus II software from these cells). Use -no_duplicates option to not
include duplicated cells.
The filter for the collection is a Tcl list of wildcards, and must follow standard Tcl or TimeQuest-extension
substitution rules. See help for the use_timequest_style_escaping command for details.
Example
# Find a cell called "reg" using case insensitive search
get_cells -nocase reg
# Create a collection of all cells whose names start with "reg"
get_cells reg*
# Create a collection of all cells on the highest hierarachical level
Chapter 2: SDC and TimeQuest API Package and Commands2–13
sdc
get_clocks
Usage
get_clocks [-nocase] [-nowarn] <filter>
Options
-nocase: Specifies the matching of node names to be case-insensitive
-nowarn: Do not issue warnings messages about unmatched patterns
<filter>: Valid destinations (string patterns are matched using Tcl string matching)
Description
Returns a collection of clocks in the design. When used as an argument to another command, such as the
-from or -to options of set_multicycle_path, each node in the clock represents all nodes driven by the
clocks in the collection.
# The following multicycle constraint applies to all paths ending at registers
# driven by clk
set_multicycle_path -to [get_clocks clk] 2
The filter for the collection is a Tcl list of wildcards, and must follow standard Tcl or TimeQuest-extension
substitution rules. See the help for use_timequest_style_escaping for details.
Example
project_open chiptrip
create_timing_netlist
read_sdc
update_timing_netlist
set clocks [get_clocks c* -nocase]
foreach_in_collection clk $clocks {
set name [get_clock_info -name $clk]
set period [get_clock_info -period $clk]
puts "$name: $period"
}
delete_timing_netlist
project_close
-nocase: Specifies case-insensitive node name matching
-nowarn: Do not issue warnings messages about unmatched patterns
<filter>: Valid destinations (string patterns are matched using Tcl string matching)
Description
Returns a collection of nets in the design. All net names in the collection match the specified pattern.
Wildcards can be used to select multiple nets at once.
The default matching scheme returns nets whose names match the specified filter and nets that are
automatically generated by the Quartus II software from these nets. Use the -no_duplicates option to
exclude duplicated nets.
The filter for the collection is a Tcl list of wildcards, and must follow standard Tcl or TimeQuest-extension
substitution rules. See help for the use_timequest_style_escaping command for details.
Example
# Find a net called "reg" using case insensitive search
get_nets -nocase reg
# Create a collection of all nets whose names start with "reg"
get_nets reg*
# Create a collection of all nets in the design
set mycollection [get_nets *]
# Output net names.
foreach_in_collection net $mycollection {
puts [get_net_info -name $net]
}
-compatibility_mode: Use simple Tcl matching (Classic Timing Analyzer style)
-hierarchical: Specifies use of a hierarchical searching method
-no_duplicates: Do not match duplicated pin names
-nocase: Specifies case-insensitive node name matching
-nowarn: Do not issue warnings messages about unmatched patterns
<filter>: Valid destinations (string patterns are matched using Tcl string matching)
Description
Returns a collection of pins in the design. All pin names in the collection match the specified pattern.
Wildcards can be used to select multiple pins at once.
There are three Tcl string matching schemes available with this command: the default method, the
-hierarchical option, and the -compatibility_mode option.
By default, pipe characters are used to separate one hierarchy level from the next. They are treated as
special characters and are taken into account when string matching with wildcards is performed. When
the default matching scheme is enabled, the specified pattern is matched against absolute pin names: the
names that include the entire hierarchical path. All hierarchy levels in the pattern are matched level by
level. Pin names of the form <absolute full cell name>|<pin suffix> are used for matching. Note that a full
cell name can contain multiple pipe characters in it to reflect the hierarchy. Any included wildcards refer to
only one hierarchical level. For example, "*|*" and "*|*|*" produce different collections since they refer to
the highest hierarchical level and second highest hierarchical level respectively.
When uisng the -hierarchical matching scheme, pipe characters are treated as special characters and are
taken into account when string matching with wildcards is performed. This matching scheme forces the
search to proceed recursively through the hierarchy. The specified pattern is matched against the relative
pin names: the immediate names that do not include any of the hierarchy information. Pin names of the
form <relative short cell name>|<pin suffix> are used for matching. Note that a short cell name cannot
contain pipe characters. Any included wildcards are expanded to match the relative pin names. For
example, "*" and "*|*" match exactly the same pins since the former is expanded into the latter.
The -compatibility_mode matching scheme mimics the string matching behavior of the Classic timing
analyzer for full, absolute pin names. Pipe characters are not treated as special characters when used with
wildcards.
The default matching scheme returns not only pins whose names match the specified filter, but also pins
duplicated from these pins (refers to pins are automatically generated by Quartus from the pins). Use
-no_duplicates option to not include duplicated pins.
The filter for the collection is a Tcl list of wildcards, and must follow standard Tcl or TimeQuest-extension
substitution rules. See help for the use_timequest_style_escaping command for details.
Example
# Get regout pin of "reg" cell
get_pins -nocase reg|regout
# Create a collection of all pins of "reg" cell
Chapter 2: SDC and TimeQuest API Package and Commands2–17
sdc
get_ports
Usage
get_ports [-nocase] [-nowarn] <filter>
Options
-nocase: Specifies case-insensitive node name matching
-nowarn: Do not issue warnings messages about unmatched patterns
<filter>: Valid destinations (string patterns are matched using Tcl string matching)
Description
Returns a collection of ports (design inputs and outputs) in the design.
The filter for the collection is a Tcl list of wildcards, and must follow standard Tcl or TimeQuest-extension
substitution rules. See help for the use_timequest_style_escaping command for details.
Example
project_open chiptrip
create_timing_netlist
# Get all ports starting with "In".
set ports [get_ports In*]
foreach_in_collection port $ports {
puts [get_port_info -name $port]
}
Chapter 2: SDC and TimeQuest API Package and Commands2–19
sdc
remove_clock_latency
Usage
remove_clock_latency -source <targets>
Options
-source: Specifies the source clock latency
<targets>: Valid destinations (string patterns are matched using Tcl string matching)
Description
Removes clock latency for a given clock or clock target.
There are two types of latency: network and source. Network latency is the clock network delay between
the clock and register clock pins. Source latency is the clock network delay between the clock and its
source (e.g., a system clock or a base clock of a generated clock).
The TimeQuest Timing Analyzer automatically computes network latencies for all register and generated
clocks. Overriding clock network latencies is not supported by the TimeQuest analyzer. Therefore, the
-source option must always be specified. Remove_clock_latency requires this option as well.
You can apply clock latency to a clock, which affects all targets of the clock, or to a specific clock target.
Therefore, you can remove clock latency from a collection of clocks, or from a collection of target nodes.
remove_clock_latency removes all latencies from a clock or node, so removing a node's clock latency with
respect to a particular clock, or removing only latencies with particular conditions is not supported.
The value of the targets is either a collection or a Tcl list of wildcards used to create a collection of the
appropriate type. The values used must follow standard Tcl or TimeQuest-extension substitution rules.
See the help for use_timequest_style_escaping for details.
-from <from_clock>: Valid destinations (string patterns are matched using Tcl string
matching)
-to <to_clock>: Valid destinations (string patterns are matched using Tcl string
matching)
Description
Removes clock uncertainty from a collection of clocks to a collection of clocks. The source and destination
clocks can be any arbitrary collection of clocks. This command removes all uncertainty between two
clocks. If there does not exist uncertainty between two clocks specified in remove_clock_uncertainty, the
command does nothing for those two clocks but continues to attempt to remove uncertainty between other
clocks specified.
The values of the -from and -to options are either collections or a Tcl list of wildcards used to create
collections of appropriate types. The values used must follow standard Tcl or TimeQuest-extension
substitution rules. See the help for use_timequest_style_escaping for details.