Metastability and MTBF

Measure how a flip-flop settles when its input changes inside the window, and turn that into a mean time between failures.

You Will Be Able To

  • Explain metastability with the balance point of a bistable.
  • Read the resolution time constant tau from a measured clock-to-Q curve.
  • Compute an MTBF from tau, T0 and the clock and data rates.
  • Explain why each extra synchronizer flop multiplies the MTBF.
Lesson
G5.11
Time
30 min
Runs on
Your browser
Check
5 questions

A flip-flop whose input changes at just the wrong moment does not choose 0 or 1 at once. On the SKY130 flop measured here, data 1 ps from the balance point needed 250 ps to reach the output. Data a billionth of a picosecond away needed 1186 ps.

DC sweepClock-to-Q Against the Distance from the Balance PointSKY130 flip-flop (a close copy of dfxtp_1), tt, 1.8 V, 2 fF load. delta is how much earlier than the balance time the data rose.
0.2 ns0.4 ns0.6 ns0.8 ns1.0 ns1.2 ns1.4 nsClock-to-Q0.000001 fs0.0001 fs0.01 fs1 fs100 fsData before the balance point, delta1 ps: 250 ps1e-9 ps: 1186 ps0.2 ns0.4 ns0.6 ns0.8 ns1.0 ns1.2 ns1.4 nsClock-to-Q0.000001 fs0.001 fs1 fs1 psData before the balance point, delta1 ps: 250 ps1e-9 ps: 1186 ps
  1. Data before the balance point, delta 0.000001 fsclock-to-Q = 1.186 ns

    Data a billionth of a picosecond from the balance point: the flop needs 1186 ps. Closer still would take longer still.

  2. Data before the balance point, delta 0.1 fsclock-to-Q = 661.9 ps

    Each tenfold step away from the balance point saves the same time: the curve is a straight line on a log axis.

  3. Data before the balance point, delta 1 psclock-to-Q = 249.5 ps

    Data 1 ps before the balance point: 250 ps, close to the normal clock-to-Q.

Read the plot as a table
Data before the balance point, deltaclock-to-Q
0.000001 fs1.186 ns
0.00001 fs1.081 ns
0.0001 fs976.2 ps
0.001 fs871.2 ps
0.01 fs766.4 ps
0.1 fs661.9 ps
1 fs557.8 ps
10 fs454.3 ps
100 fs351.5 ps
1 ps249.5 ps

Measured with ngspice 42 on SKY130 (19 runs; the balance point found by bisection to 1e-10 ps). The slope gives τ = 45.45 ps.

A Ball on a Hill

Inside a flip-flop is a bistable (G5.4). If the input changes inside the setup and hold window, the latch can close with the loop near its balance point.

Three Moments of a Metastable FlopThe two stable states are valleys; the balance point is the hilltop between them.
  • I/O
  • Neutral
  • Structure
Three moments of a metastable flopThe two stable states are valleys; the balance point is the hilltop between them. io Data in the window changes at the edge neutral Hilltop balanced: output near0.84 V neutral Valley 0 stable neutral Valley 1 stable latch closesrolls leftrolls right
  1. io Data in the windowchanges at the edge
    • latch closes → Hilltop
  2. neutral Hilltopbalanced: output near 0.84 V
    • rolls left → Valley 0
    • rolls right → Valley 1
  3. neutral Valley 0stable
  4. neutral Valley 1stable
  1. Caught at the top

    Data changed inside the window: the loop is left near the balance point.

  2. Rolling

    The loop gain pushes any small offset away from the top. The smaller the offset, the longer it takes.

  3. Settled

    It ends in one valley or the other, which one is not known in advance.

Read the diagram as text
  • Data in the window: changes at the edge
  • Hilltop: balanced: output near 0.84 V
  • Valley 0: stable
  • Valley 1: stable
  • Data in the window → Hilltop: latch closes
  • Hilltop → Valley 0: rolls left
  • Hilltop → Valley 1: rolls right

The offset grows like e^(t/τ). So the settling time grows like τ times the logarithm of 1/offset.

The measured curve in the hook shows that law. Each tenfold step closer to the balance point added the same time, about 105 ps. That is τ · ln 10, so τ = 105 / 2.30 ≈ 45 ps.

From the Curve to an MTBF

The first flop of a synchronizer gets a resolution time t_r before the next flop samples it. In a two-flop synchronizer that is one clock period minus the setup time of the second flop. It fails if its input arrived within a tiny window of the balance point. That window shrinks like T0 · e^(−t_r/τ).

ConstantMeaningMeasured here
τresolution time constant: the slope of the curve per e-fold45.45 ps
T0window constant: W(t) = T0 · e^(−t/τ), t from the clock edge428 ps

Fitted to the sweep from 0.01 ps down. The sweep is measured on the capture side; T0 counts both sides of the balance point alike. A close copy of dfxtp_1: the lean SKY130 library has no special_nfet, so nfet_01v8 at 0.42 µm stands in.

The chance that one data change lands in the window is W / T_clk. With f_data changes per second, failures come f_data · f_clk · W apart. So MTBF = e^(t_r/τ) / (T0 · f_clk · f_data).

Each Flop Multiplies the MTBF

A two-flop synchronizer gives the first flop one period to settle. Each further flop adds a whole period. That period goes into the exponent, so it multiplies the MTBF; it does not add to it.

SynchronizerClockMTBF with 100 MHz dataIn years
2 flops500 MHz1.964e+11 s6.223e+03
2 flops1 GHz2.733e+01 s8.661e-07
3 flops1 GHz9.820e+10 s3.112e+03
4 flops1 GHz3.528e+20 s1.118e+13

Measured: the lab below, with the SKY130 τ and T0 and a 51 ps setup time for the next flop.

At 500 MHz the two-flop synchronizer of G5.12 lasts about 6,200 years. At 1 GHz the period halves, and the same two flops fail about every 27 seconds. A third flop pushes that to about 3,000 years, and a fourth far beyond the age of the universe. That is why fast designs often use three.

Asked in interviews
  1. What is metastability?

    A flip-flop's input may change inside its setup and hold window. Its internal loop can then stop near the balance point between 0 and 1. It then takes an unbounded, random time to settle, and settles to either value.

  2. Write the MTBF formula and explain each term.

    MTBF = e^(t_r/τ) / (T0 · f_clk · f_data). t_r is the time allowed to settle and τ how fast the flop settles. T0 is its window, and the two rates say how often a data change meets a clock edge.

  3. Does adding a flop double the MTBF?

    No, it multiplies it by e^(T/τ), because the extra period goes into the exponent. At 1 GHz with τ = 45 ps that factor is about 4.5e9.

The RTL view of the same formula, with a synchronizer bench model, is lesson R6.1.

Try It

A two-flop synchronizer at 1 GHz gives the first flop 1 ns − 51 ps to settle: the MTBF is 27 seconds. Every extra flop adds 1 ns to the exponent.

Halving the clock to 500 MHz doubles the settling time and halves f_clk: the same two flops then last 2e11 seconds.

Change the data rate to 1 MHz and run again. Which lines move, and by how much?

RUNIcarus Verilog · in your browser
Edit the code, then run it
Expected: 2 flops, 500 MHz clock, 100 MHz data: MTBF = 1.964e+11 s = 6.223e+03 years 2 flops, 1 GHz clock, 100 MHz data: MTBF = 2.733e+01 s = 8.661e-07 years 3 flops, 1 GHz clock, 100 MHz data: MTBF = 9.820e+10 s = 3.112e+03 years 4 flops, 1 GHz clock, 100 MHz data: MTBF = 3.528e+20 s = 1.118e+13 years
Read included file: tb.sv
// tb.sv: a two-flop synchronizer at 500 MHz, then two, three and four flops at 1 GHz (read-only).
module tb;
  mtbf_calc m ();
  real year = 365.25 * 24 * 3600;
  initial begin
    $display("2 flops, 500 MHz clock, 100 MHz data: MTBF = %.3e s = %.3e years", m.mtbf(2, 5e8, 1e8), m.mtbf(2, 5e8, 1e8) / year);
    for (int n = 2; n <= 4; n++)
      $display("%0d flops, 1 GHz clock, 100 MHz data:   MTBF = %.3e s = %.3e years", n, m.mtbf(n, 1e9, 1e8), m.mtbf(n, 1e9, 1e8) / year);
  end
endmodule

Check Yourself

ConceptOn the measured curve, clock-to-Q grows by about 105 ps for each tenfold step closer to the balance point. What is τ?
ConceptThe data rate into a synchronizer doubles. What happens to the MTBF?
ConceptWhich statement about a two-flop synchronizer is true?
ConceptWhy does a faster clock reduce the MTBF so sharply?
Predict the outputThe lab calculator with a two-flop synchronizer, a 1 GHz clock and 1 MHz data. Predict the exact line.
// mtbf_calc: MTBF of an n-flop synchronizer, from the flop's tau and T0 and the clock and data rates.
module mtbf_calc;
  real tau  = 45.45e-12;   // resolution time constant, s (measured on the SKY130 flop)
  real T0   = 428e-12;     // window constant, s (measured on the same flop)
  real tsu  = 51e-12;      // setup time of the next flop, s
  // n flops in a row: the first may go metastable, the last samples it. The first gets n - 1 periods to settle,
  // minus the setup time of the flop that samples it. A two-flop synchronizer gets one period.
  function real mtbf(input int n, input real fclk, input real fdata);
    real tr;
    tr = (n - 1) / fclk - tsu;
    return $exp(tr / tau) / (T0 * fclk * fdata);
  endfunction
endmodule

module tb;
  mtbf_calc m ();
  initial $display("MTBF = %.3e s", m.mtbf(2, 1e9, 1e6));
endmodule

Common Mistakes

Wrong Say that a synchronizer removes metastability.

It only gives the first flop time to settle. A data change close enough to the edge still needs longer than any wait.

Fix A synchronizer makes failures rare: its MTBF can be made longer than the product's life.

Wrong Leave the data rate out of the MTBF.

Each data change is one chance to hit the window. Twice the changes, half the MTBF.

Fix MTBF = e^(t_r/τ) / (T0 · f_clk · f_data).

Wrong Expect a faster clock to cost only a little MTBF.

The period sits in the exponent. The lab's two-flop synchronizer lasts about 6,200 years at 500 MHz and 27 s at 1 GHz.

Fix Recompute the MTBF whenever the clock changes, and add a flop if needed.

Wrong Take τ and T0 from a textbook for your flop.

They depend on the cell, its load, the supply and the corner.

Fix Use the library vendor's values or measure them in SPICE, as this lesson does.

Remember

  • An input that changes inside the window can leave the flop near its balance point for an unbounded time.
  • The settling time grows like τ · ln(1/offset); measured on SKY130, τ = 45.45 ps.
  • MTBF = e^(t_r/τ) / (T0 · f_clk · f_data): settling time is in the exponent, the rates divide.
  • Each extra flop adds a period to t_r and multiplies the MTBF by e^(T/τ).

Practice

Report a problem with this page