Create_clock, Create_clock –7 – Altera SDC and TimeQuest API User Manual

Page 17

Advertising
background image

Chapter 2: SDC and TimeQuest API Package and Commands

2–7

sdc

© December 2009

Altera Corporation

SDC and TimeQuest API Reference Manual

create_clock

Usage

create_clock [-add] [-name <clock_name>] -period <value> [-waveform <edge_list>]
<targets>

Options

-add: Adds clock to a node with an existing clock

-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]

Advertising