We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

# AR# 38099

## Description

It is common for designs to have one or more divided clocks. There are different ways to divide a clock and it is recommended that you use a clock management component, such as an MMCM to achieve the division. In this situation, the tool propagates the period constraint to the divided clock, for example, CLKDV and any multicycle path is also constrained automatically by the tool.

But, for a number of reasons, you might optout ofusing of an MMCM. In these cases, you normally use gated clocks for the division.

Because gated clocks generally are implemented using flip flops and look up tables, the tool does not propagate the period constraint on the input clock and as a result, the divided clock is left unconstrained and the you need to constrain these clocks.

## Solution

The next diagram shows an example of a divider circuit using four flip flops and one inverter.

To constrain this kind of clock, add a period on the clock input as:

NET "CLKIN" TNM_NET = CLKIN;
TIMESPEC TS_CLKIN = PERIOD "CLKIN" 10 ns HIGH 50%;

Then, apply a period on the clock out and relate it to the clock in manually as:

NET "CLKOUT" TNM_NET = CLKOUT;
TIMESPEC TS_CLKOUT = PERIOD "CLKOUT" TS_CLKIN*16 PHASE XYZ ns;

The value 16 is the division factor brought by the divider circuit, while the PHASE XYZ is the delay edge relation between CLKIN and CLKOUT. This phase is actually the delay from the output pin of component, which generates CLKIN to the output clock pin of FF4. The delay includes the switching delay from clock to Q output of all four FFs as well as the routing delays from FF to the next, shown in red in the diagram.

Because the phase depends on the routings, everytime something is changed in the design (even constraints) the routing delays change, and, therefore, it affects the PHASE XYZ. This needs to be fixed at a certain value. This is done in two ways:

1. Add LOC constraints on the flip flops(to fix the placement) and use DIRT constraints (to fix the routings between the flip flops) in the UCF.
2. Create an RPM for the divider circuit. In this way, the MAP/PAR tool is free to move the RPM around the device, but keeping the phase between the generated clock and input clock constant. This method is best option if the divider consists of several components and it would tedious to apply LOC all the components and add the DIRT constraint.

You can compute the delay using the FPGA Editor (selecting pins and pressing the 'delay' button) or Timing Analyzer (endpoint-to-endpoint analysis).

AR# 38099
Date 05/19/2012
Status Active
Tools
• ISE Design Suite - 12.4
• ISE Design Suite - 13.1
• ISE Design Suite - 13.2
• ISE Design Suite - 13.3
Page Bookmarked