Example – Altera Quartus II Scripting User Manual

Page 618

Advertising
background image

3–488

Chapter 3: Tcl Packages & Commands

timing_assignment

Quartus II Scripting Reference Manual

© July 2013

Altera Corporation

The "-phase_shift" option takes an integer that represents degrees of phase shift from the base clock period.
For example, if a base clock has a period of 10ns and clk2 is a relative clock derived from the base clock. A
phase shift value of 45 applies a 45 degree phase shift to clk2, producing an offset of 1.25ns from the base
clock. For a given relative clock, you may specify a phase shift, an offset, or both. If both are specified, they
are additive.

If you specify the "-virtual" option, the relative clock is not assigned to any node in the timing netlist. You
cannot specify the "-virtual" option and the "-target" option at the same time.

For entity-specific assignments, use the "-entity" option to force the assignment to specified entity. If you
do not specify the "-entity" option, the value for the FOCUS_ENTITY_NAME assignment is used. If the
FOCUS_ENTITY_NAME value is not found, the revision name is used.

Assignments created or modified by using this Tcl command are not saved to the Quartus II Settings File
(.qsf) unless you explicitly call one of the following two Tcl commands:

export_assignments

project_close (unless "-dont_export_assignments" is specified)

These two Tcl commands reside in the ::quartus::project Tcl package. You must save assignment changes
before you run Quartus®II command-line executables. Note, however, that the Tcl commands
"execute_flow" and "execute_module" (part of the ::quartus::flow Tcl package) automatically call
"export_assignments" before they run command-line executables.

Example

## Specify a base clock of 10ns
create_base_clock -fmax 10ns clk10

## Specify a relative clock with 2/3 the period
create_relative_clock -base_clock clk10 -multiply 2 -divide 3 clk2_3

## Specify a relative clock with a phase shift of 45 degrees
create_relative_clock -base_clock clk10 -phase_shift 45 clk_45
## or, equivalently, with an offset of 1.25ns
create_relative_clock -base_clock clk10 -offset 1.25ns clk_45

## Specify the entity name to which the clock
## is added, using the -entity option
## This is needed if the top-level entity name is
## other than that of the project
## The following command generates a "top_level" entity
create_relative_clock -base_clock clk10 -entity top_level -multiply 2 \
-divide 3 clk2_3

Advertising