Tools/Xilinx ISE/UCF Timing Constraints
m |
m |
||
(12 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
{{TOC right}} | {{TOC right}} | ||
− | * [http:// | + | * [http://www.xilinx.com/support/documentation/sw_manuals/xilinx14_2/cgd.pdf|Xilinx Constraint Guide] |
− | * [ | + | * [[Tools/Xilinx_ISE/UCF_ShortGuide|Short Guide to Timing Constraints]] |
== Comment == | == Comment == | ||
Line 18: | Line 18: | ||
NET "button_Pullup" LOC = "P2" | PULLUP; | NET "button_Pullup" LOC = "P2" | PULLUP; | ||
NET "button_Pulldown" LOC = "P3" | PULLDOWN; | NET "button_Pulldown" LOC = "P3" | PULLDOWN; | ||
+ | </source> | ||
+ | |||
+ | == All IO's the same voltage == | ||
+ | <source lang='tcl'> | ||
+ | NET "*" IOSTANDARD = LVCMOS33; | ||
</source> | </source> | ||
Line 23: | Line 28: | ||
=== Clock constraint (PERIOD) === | === Clock constraint (PERIOD) === | ||
Definition of a clock with a 50% duty cycle and it's frequency (40MHz) | Definition of a clock with a 50% duty cycle and it's frequency (40MHz) | ||
− | + | <source lang='tcl'> | |
NET "SYS_CLK" TNM_NET = "SYS_CLK"; | NET "SYS_CLK" TNM_NET = "SYS_CLK"; | ||
TIMESPEC "tnm_name" = PERIOD "sig_name" <Tcycle> HIGH <dutycycle>; | TIMESPEC "tnm_name" = PERIOD "sig_name" <Tcycle> HIGH <dutycycle>; | ||
TIMESPEC "TS_SYS_CLK" = PERIOD "SYS_CLK" 25.000 ns HIGH 50.00%; | TIMESPEC "TS_SYS_CLK" = PERIOD "SYS_CLK" 25.000 ns HIGH 50.00%; | ||
− | + | </source> | |
− | [[ | + | [[File:ise_ucf_timing_period_dutycycle.png|center]] |
=== Time Group === | === Time Group === | ||
Create timing group with particular net. | Create timing group with particular net. | ||
This code defines a clk_net timing group associated with the CLK clock net and including all synchronous elements controlled by this net (since no qualifier has been specified). | This code defines a clk_net timing group associated with the CLK clock net and including all synchronous elements controlled by this net (since no qualifier has been specified). | ||
− | + | <source lang='tcl'> | |
NET "net_name" TNM_NET = qualifier "tnm_name"; | NET "net_name" TNM_NET = qualifier "tnm_name"; | ||
NET "CLK" TNM_NET = "clk_net"; | NET "CLK" TNM_NET = "clk_net"; | ||
NET "ve_vc<0>" TNM_NET = ve_data; | NET "ve_vc<0>" TNM_NET = ve_data; | ||
NET "ve_vc<1>" TNM_NET = ve_data; | NET "ve_vc<1>" TNM_NET = ve_data; | ||
− | + | </source> | |
Create timing group by specify the name of the instance (module) | Create timing group by specify the name of the instance (module) | ||
− | + | <source lang='tcl'> | |
INST "inst_name" TNM = qualifier "tnm_name"; | INST "inst_name" TNM = qualifier "tnm_name"; | ||
− | + | </source> | |
=== OFFSET === | === OFFSET === | ||
OFFSET constraint is used to specify external setup time for input pads or necessary hold time for output pads. | OFFSET constraint is used to specify external setup time for input pads or necessary hold time for output pads. | ||
− | [[ | + | [[File:ise_ucf_timing_offset_example.png|center]] |
For input pads, OFFSET specifies a time before the (external) clock edge when the related data signals are set. | For input pads, OFFSET specifies a time before the (external) clock edge when the related data signals are set. | ||
− | + | <source lang='tcl'> | |
OFFSET = IN 5 ns AFTER "CLK"; | OFFSET = IN 5 ns AFTER "CLK"; | ||
OFFSET = IN 5 ns BEFORE "CLK"; | OFFSET = IN 5 ns BEFORE "CLK"; | ||
− | + | </source> | |
− | [[ | + | [[File:ise_ucf_timing_offset_in.png|center]] |
For output pads, OFFSET specifies a minimum time after the clock edge when the related data signals can be deasserted. | For output pads, OFFSET specifies a minimum time after the clock edge when the related data signals can be deasserted. | ||
− | + | <source lang='tcl'> | |
OFFSET = OUT 2 ns AFTER "CLK"; | OFFSET = OUT 2 ns AFTER "CLK"; | ||
OFFSET = OUT 2 ns BEFORE "CLK"; | OFFSET = OUT 2 ns BEFORE "CLK"; | ||
− | + | </source> | |
− | [[ | + | [[File:ise_ucf_timing_offset_out.png|center]] |
==== OFFSET with TimeGroup ==== | ==== OFFSET with TimeGroup ==== | ||
Set Offset after rising edge of clock constraint for all signals in Timegroup | Set Offset after rising edge of clock constraint for all signals in Timegroup | ||
− | + | <source lang='tcl'> | |
TIMEGRP "ve_data" OFFSET = OUT 10.333 ns AFTER "mb_vclk" RISING; | TIMEGRP "ve_data" OFFSET = OUT 10.333 ns AFTER "mb_vclk" RISING; | ||
TIMEGRP "ve_data" OFFSET = OUT 10.333 ns AFTER "mb_vclk" FALLING; | TIMEGRP "ve_data" OFFSET = OUT 10.333 ns AFTER "mb_vclk" FALLING; | ||
− | + | </source> | |
==== OFFSET with Valid data ==== | ==== OFFSET with Valid data ==== | ||
The VALID keyword is used in conjunction with the requirement to create a hold time requirement. The VALID keyword specifies the duration of the incoming data valid window. By default, the VALID value is equal to the OFFSET time requirement, which specifies a zero hold time requirement | The VALID keyword is used in conjunction with the requirement to create a hold time requirement. The VALID keyword specifies the duration of the incoming data valid window. By default, the VALID value is equal to the OFFSET time requirement, which specifies a zero hold time requirement | ||
− | + | <source lang='tcl'> | |
TIMEGRP DATA_IN OFFSET IN = 2ns VALID 3ns BEFORE CLK RISING; | TIMEGRP DATA_IN OFFSET IN = 2ns VALID 3ns BEFORE CLK RISING; | ||
− | + | </source> | |
− | [[ | + | [[File:ise_ucf_timing_offset_valid.png|center]] |
=== False paths === | === False paths === | ||
Line 93: | Line 98: | ||
* A set of registers for the destination time group | * A set of registers for the destination time group | ||
* A FROM-TO constraint with a TIG keyword to remove the paths between the groups | * A FROM-TO constraint with a TIG keyword to remove the paths between the groups | ||
− | + | <source lang='tcl'> | |
TIMESPEC "TSid" = FROM "SRC_GRP" TO "DST_GRP" TIG; | TIMESPEC "TSid" = FROM "SRC_GRP" TO "DST_GRP" TIG; | ||
Line 99: | Line 104: | ||
NET "CLK2" TNM_NET = FFS "GRP_2"; | NET "CLK2" TNM_NET = FFS "GRP_2"; | ||
TIMESPEC TS_Example = FROM "GRP_1" TO "GRP_2" TIG; | TIMESPEC TS_Example = FROM "GRP_1" TO "GRP_2" TIG; | ||
− | + | </source> | |
− | [[ | + | [[File:ise_ucf_timing_false_path.png|center]] |
=== Multicycle paths === | === Multicycle paths === | ||
Line 115: | Line 120: | ||
* A set of registers based on a common clock enable signal | * A set of registers based on a common clock enable signal | ||
* A FROM:TO (multi-cycle) constraint describing the new timing requirement | * A FROM:TO (multi-cycle) constraint describing the new timing requirement | ||
− | + | <source lang='tcl'> | |
TIMESPEC "TSid" = FROM "MC_GRP" TO "MC_GRP" <value>; | TIMESPEC "TSid" = FROM "MC_GRP" TO "MC_GRP" <value>; | ||
Line 122: | Line 127: | ||
NET "Enable" TNM_NET = FFS "MC_GRP"; | NET "Enable" TNM_NET = FFS "MC_GRP"; | ||
TIMESPEC TS_Example = FROM "MC_GRP" TO "MC_GRP" TS_CLK1*2; | TIMESPEC TS_Example = FROM "MC_GRP" TO "MC_GRP" TS_CLK1*2; | ||
− | + | </source> | |
+ | |||
+ | [[File:ise_ucf_timing_multicycle_path.png|center]] | ||
− | [[ | + | [[Category:Tools]] |
+ | [[Category:Xilinx]] | ||
+ | [[Category:ISE]] | ||
+ | [[Category:VHDL]] |
Latest revision as of 14:48, 4 February 2013
|
Comment
# This is a comment
I/O Pad Assigments
NET "out_sig_slow" LOC = "S1" | SLEW = SLOW; NET "out_sig_fast" LOC = "S2" | SLEW = FAST; NET "out_sig33" LOC = "V1" | IOSTANDARD = LVCMOS33 NET "in_sig18" LOC = "V2" | IOSTANDARD = LVCMOS18 NET "reset_n" LOC = "P1" | PULLUP; NET "button_Pullup" LOC = "P2" | PULLUP; NET "button_Pulldown" LOC = "P3" | PULLDOWN;
All IO's the same voltage
NET "*" IOSTANDARD = LVCMOS33;
Timing constraints
Clock constraint (PERIOD)
Definition of a clock with a 50% duty cycle and it's frequency (40MHz)
NET "SYS_CLK" TNM_NET = "SYS_CLK"; TIMESPEC "tnm_name" = PERIOD "sig_name" <Tcycle> HIGH <dutycycle>; TIMESPEC "TS_SYS_CLK" = PERIOD "SYS_CLK" 25.000 ns HIGH 50.00%;
Time Group
Create timing group with particular net. This code defines a clk_net timing group associated with the CLK clock net and including all synchronous elements controlled by this net (since no qualifier has been specified).
NET "net_name" TNM_NET = qualifier "tnm_name"; NET "CLK" TNM_NET = "clk_net"; NET "ve_vc<0>" TNM_NET = ve_data; NET "ve_vc<1>" TNM_NET = ve_data;
Create timing group by specify the name of the instance (module)
INST "inst_name" TNM = qualifier "tnm_name";
OFFSET
OFFSET constraint is used to specify external setup time for input pads or necessary hold time for output pads.
For input pads, OFFSET specifies a time before the (external) clock edge when the related data signals are set.
OFFSET = IN 5 ns AFTER "CLK"; OFFSET = IN 5 ns BEFORE "CLK";
For output pads, OFFSET specifies a minimum time after the clock edge when the related data signals can be deasserted.
OFFSET = OUT 2 ns AFTER "CLK"; OFFSET = OUT 2 ns BEFORE "CLK";
OFFSET with TimeGroup
Set Offset after rising edge of clock constraint for all signals in Timegroup
TIMEGRP "ve_data" OFFSET = OUT 10.333 ns AFTER "mb_vclk" RISING; TIMEGRP "ve_data" OFFSET = OUT 10.333 ns AFTER "mb_vclk" FALLING;
OFFSET with Valid data
The VALID keyword is used in conjunction with the requirement to create a hold time requirement. The VALID keyword specifies the duration of the incoming data valid window. By default, the VALID value is equal to the OFFSET time requirement, which specifies a zero hold time requirement
TIMEGRP DATA_IN OFFSET IN = 2ns VALID 3ns BEFORE CLK RISING;
False paths
In some cases, you may want to remove a set of paths from timing analysis if you are sure that these paths do not affect timing performance. One common way to specify the set of paths to be removed from timing analysis is to use the FROM-TO constraint with the timing ignore (TIG) keyword. This allows you to:
* Specify a set of registers in a source time group * Secify a set of registers in a destination time group * Automatically remove all paths between those time groups from analysis.
To specify the timing ignore (TIG) constraint for this method, define:
* A set of registers for the source time group * A set of registers for the destination time group * A FROM-TO constraint with a TIG keyword to remove the paths between the groups
TIMESPEC "TSid" = FROM "SRC_GRP" TO "DST_GRP" TIG; NET "CLK1" TNM_NET = FFS "GRP_1"; NET "CLK2" TNM_NET = FFS "GRP_2"; TIMESPEC TS_Example = FROM "GRP_1" TO "GRP_2" TIG;
Multicycle paths
In a multi-cycle path, data is transferred from source to destination synchronous elements at a rate less than the clock frequency defined in the PERIOD specification. This occurs most often when the synchronous elements are gated with a common clock enable signal. By defining a multi-cycle path, the timing constraints for these synchronous elements are relaxed over the default PERIOD constraint. The implementation tools are then able to appropriately prioritize the implementation of these paths. One common way to specify the set of multi-cycle paths is to define a time group using the clock enable signal. This allows you to:
* Define one time group containing both the source and destination synchronous elements using a common clock enable signal * Automatically apply the multi-cycle constraint to all paths between these synchronous elements
To specify the FROM:TO (multi-cycle) constraint for this method, define:
* A PERIOD constraint for the common clock domain * A set of registers based on a common clock enable signal * A FROM:TO (multi-cycle) constraint describing the new timing requirement
TIMESPEC "TSid" = FROM "MC_GRP" TO "MC_GRP" <value>; NET "CLK1" TNM_NET = "CLK1"; TIMESPEC "TS_CLK1" = PERIOD "CLK1" 5 ns HIGH 50%; NET "Enable" TNM_NET = FFS "MC_GRP"; TIMESPEC TS_Example = FROM "MC_GRP" TO "MC_GRP" TS_CLK1*2;