FPGA Timing Closure: Constraints, Slack and Clock Domains

Simulation shows that a design is logically correct. It does not show that every signal reaches its destination register in time. That is the job of static timing analysis, which the FPGA tools run after placement and routing using constraints the designer supplies. A design with missing or wrong constraints can report success and still fail on the bench. This article explains constraints, slack and the care needed between clock domains.

At a glance

Slack
Required arrival time minus actual arrival time. Negative slack is a timing failure.
WNS
Worst negative slack: the worst single path, which must be zero or positive.
TNS
Total negative slack: the sum over all failing endpoints, a measure of how far off the design is.
2 flops
The minimum synchroniser for a single-bit signal crossing between unrelated clocks.

The problem

Timing analysis only checks what it is told about. A clock without a constraint, an input with no input delay, or a path wrongly marked as false is either not analysed or analysed against the wrong requirement, and the report can look clean while the hardware fails intermittently.

Clock-domain crossings are a separate hazard. A signal passing between unrelated clocks will eventually be sampled while it is changing, and the receiving flip-flop can go metastable. Static timing analysis does not fix this; the design must.

A clean timing report is only as trustworthy as the constraints behind it. Review the constraints as carefully as the logic.

Reading and fixing slack

Each timing path runs from a launching register to a capturing register. Setup slack is the time available, set by the clock period and clock skew, minus the time the data takes through logic and routing. At 200 MHz the whole budget is 5 ns, shared between logic levels and interconnect.

When paths fail, look first at logic depth and fan-out. Adding pipeline registers, restructuring wide comparisons and replicating high fan-out registers usually help more than tool settings. Once the structure is sound, placement constraints and optimisation options are worth tuning.

What good looks like

Constrain every clock, including generated clocks, and every input and output with delays derived from the external devices and the board.

Declare clock relationships explicitly, marking unrelated clocks as asynchronous so the tools do not time paths that cannot be timed.

Use proper synchronisers for every crossing, review the clock-interaction and unconstrained-path reports, and treat any negative slack as a failure.

Clock period by frequency
ns
100 MHz10
125 MHz8
200 MHz5
250 MHz4
400 MHz2.5
The total time budget for a single-cycle register-to-register path, before clock uncertainty and skew.
Common timing constraints
ConstraintPurpose
create_clockDefines a clock and its period at a source
create_generated_clockDefines a clock derived from another, such as a divided clock
set_input_delayExternal delay before data reaches an input pin
set_output_delayExternal delay required after an output pin
set_clock_groupsDeclares clocks that are asynchronous to each other
set_false_pathRemoves a path that does not need timing
set_multicycle_pathAllows a path more than one clock cycle
SDC-style commands, as used in AMD Vivado XDC files and by other FPGA tools.

What it changes

Reliable Hardware

Designs that meet complete constraints work across the analysed conditions.

No Intermittent Faults

Correct synchronisers prevent rare metastability failures.

Faster Closure

Structural fixes resolve failing paths at their cause.

Trustworthy Reports

Complete constraints mean the analysis covers every path.

Where to go next

Multi-bit values crossing domains need more than individual synchronisers: use a handshake, a Gray-coded counter or an asynchronous FIFO.

Leave timing margin in early builds. A design that closes with no slack to spare tends to fail closure after the next small change.

Problems this prevents

  • Clocks or I/O left unconstrained
  • Paths hidden by incorrect false-path constraints
  • Metastability from unsynchronised crossings
  • Multi-bit buses synchronised bit by bit

Discuss your project

Email support@aavico.com or use Get in Touch when the website finishes loading.