STA assumes that data launched at one clock edge is captured at the next one. Sometimes a design is built so that the data takes two or more cycles. The receiving flip-flop may only load a new value every other cycle, for example. Then the one-cycle rule is too strict and reports violations that are not real. A multicycle path tells STA how many cycles the data may take. This article explains the setup and the hold multipliers, and shows the common trap: a multicycle setup that breaks hold.

9 min read | Intermediate

What You'll Learn

  • Explain when a path really takes more than one clock cycle
  • Write set_multicycle_path for setup and for hold
  • Say how the setup multiplier moves the hold check
  • Calculate the setup and hold slack of a multicycle path

The Default: One Cycle

For the path from _7_ to _6_ in the demo circuit, the launch edge is at 0 and the capture edge for setup is at 2.0 ns, one clock period later. The hold check uses the capture edge at 0, the same edge as the launch. The setup slack is 1.4502 ns and the hold slack is 0.4241 ns.

Suppose the second flip-flop only uses its data every second cycle. A design with a slow enable signal does this: the first flip-flop changes its value, the logic needs a long time to settle, and the second flip-flop is enabled two cycles later. The data has two periods to arrive, but STA still checks it against the first edge, and reports a violation on a path that works. A multicycle path moves the capture edge.

The Setup Multiplier

The command set_multicycle_path takes the number of cycles and the check it applies to:


set_multicycle_path 2 -setup -from [get_pins _7_/CLK] -to [get_pins _6_/D]

The setup capture edge moves from the edge at 2.0 ns to the edge at 4.0 ns. The required time grows by one period, and the setup slack becomes 3.4502 ns:

Output
   2.0000 ... clock clk (rise edge)
             4.0000 ^ _6_/CLK (sky130_fd_sc_hd__dfxtp_1)
  -0.1174    3.8826   library setup time
             3.8826   data required time
            -0.4323   data arrival time
             3.4502   slack (MET)

The Hold Trap

The hold check is defined relative to the setup check. By default it uses the edge one cycle before the setup capture edge. When the setup edge moves to 4.0 ns, the hold edge moves to 2.0 ns. The hold check then asks that the data does not arrive before 2.0 ns, and it arrives at 0.3657 ns:

Output
   0.0000    2.0000   clock clk (rise edge)
             2.0000 ^ _6_/CLK (sky130_fd_sc_hd__dfxtp_1)
  -0.0583    1.9417   library setup time
             1.9417   data required time
            -0.3657   data arrival time
            -1.5759   slack (VIOLATED)

A multicycle setup command alone gives a hold violation of -1.5759 ns, which is about one clock period. The data was never supposed to be that slow. STA now believes that the data launched at 0 must not arrive before the capture edge at 2.0 ns, which would mean that the data has to be slower than one clock cycle. That is not what you meant. In a real multicycle design, the second flip-flop ignores the edge at 2.0 ns, because its enable is off, so the only hold check that matters is the one at the launch edge, where it was before. The second command, with the hold multiplier, puts it back:


set_multicycle_path 2 -setup -from [get_pins _7_/CLK] -to [get_pins _6_/D]
set_multicycle_path 1 -hold  -from [get_pins _7_/CLK] -to [get_pins _6_/D]

The hold multiplier of 1 moves the hold edge back by one cycle from where the setup multiplier put it. Together, the two commands give a setup slack of 3.4502 ns and a hold slack of 0.4241 ns, which is the original hold slack. The rule to remember is that a multicycle setup of N goes with a multicycle hold of N-1.

ConstraintSetup edgeSetup slack (ns)Hold edgeHold slack (ns)
none2.01.450200.4241
-setup 24.03.45022.0-1.5759 (violated)
-setup 2 and -hold 14.03.450200.4241

The Design Must Match the Constraint

A multicycle path is a promise. The constraint only says what STA should check. The circuit must really behave that way, for example with an enable that is true only every second cycle. If the data actually changes at every clock edge, the capture flip-flop will see the wrong value, and STA will not warn you. The usual way to be sure is to check the enable logic in simulation or formal checks, because STA cannot do it.

Different Clock Frequencies

A multicycle path can also be used with two clocks of different periods. The multiplier is counted in cycles of the capture clock for setup, and in cycles of the launch clock for hold, unless you choose otherwise with -start and -end. These options decide which clock the cycles are counted in. For one clock, which is the case in this article, they have no effect.

Common Mistakes

Mistake #1: Writing only the setup multicycle

A setup multiplier without a hold multiplier gives a hold violation of about one clock period, and the usual reaction is to fix it by adding delay to the path. Write both commands together.

Mistake #2: Using a multicycle path for a path that fails because it is slow

A multicycle is only right when the design takes more than one cycle by construction. If you use it to remove a violation of a path that must work in one cycle, the chip will fail.

Quick Check: A path has a multicycle setup of 3. Which hold multiplier restores the hold check to the launch edge?

N - 1 = 2. With set_multicycle_path 2 -hold, the hold edge goes back by two cycles to the launch edge.

Practice Exercise

Challenge: Three Cycles

Use the sta_demo design with a 2.0 ns clock. For the path from the first flip-flop to the second, set a multicycle setup of 3 and no hold command. Predict the setup slack and the hold slack. Then add the hold command that restores the hold check.


set_multicycle_path 3 -setup -from [get_pins _7_/CLK] -to [get_pins _6_/D]

Open the ready-made example in the lab, run synthesis, and then run STA. Editing constraints.sdc and re-running only STA, and choosing another library or corner, are PRO features.

Hint

With a multiplier of 3, the setup capture edge is at 3 x 2.0 = 6.0 ns. The hold edge is two cycles earlier, at 4.0 ns.

Solution

The required time for setup is 6.0 - 0.1174 = 5.8826 ns, and the setup slack is 5.8826 - 0.4323 = 5.4502 ns. The hold edge is at 4.0 ns, so the required time is 4.0 - 0.0583 = 3.9417 ns, and the hold slack is 0.3657 - 3.9417 = -3.5759 ns, a violation of two periods. With set_multicycle_path 2 -hold on the same path, the hold check returns to the launch edge and the hold slack is 0.4241 ns again.

Summary

  • A multicycle path tells STA that data may take more than one clock cycle to reach the capture flip-flop.
  • set_multicycle_path N -setup moves the setup capture edge by N-1 cycles.
  • The hold check is relative to the setup edge, so the setup multiplier also moves the hold edge.
  • A setup multiplier of N needs a hold multiplier of N-1 to put the hold check back at the launch edge.
  • The constraint is a promise about the design, and STA cannot check that the design keeps it.
  • Never use a multicycle path to hide a slow path that must work in one cycle.
Did you find what you were looking for?

Quiz

No quiz questions available for this article.

Cron Job Starts