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.
- 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.
- 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.
- 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, delta | clock-to-Q |
|---|---|
| 0.000001 fs | 1.186 ns |
| 0.00001 fs | 1.081 ns |
| 0.0001 fs | 976.2 ps |
| 0.001 fs | 871.2 ps |
| 0.01 fs | 766.4 ps |
| 0.1 fs | 661.9 ps |
| 1 fs | 557.8 ps |
| 10 fs | 454.3 ps |
| 100 fs | 351.5 ps |
| 1 ps | 249.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.
- I/O
- Neutral
- Structure
- Caught at the top
Data changed inside the window: the loop is left near the balance point.
- Rolling
The loop gain pushes any small offset away from the top. The smaller the offset, the longer it takes.
- 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/τ).
| Constant | Meaning | Measured here |
|---|---|---|
| τ | resolution time constant: the slope of the curve per e-fold | 45.45 ps |
| T0 | window constant: W(t) = T0 · e^(−t/τ), t from the clock edge | 428 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.
| Synchronizer | Clock | MTBF with 100 MHz data | In years |
|---|---|---|---|
| 2 flops | 500 MHz | 1.964e+11 s | 6.223e+03 |
| 2 flops | 1 GHz | 2.733e+01 s | 8.661e-07 |
| 3 flops | 1 GHz | 9.820e+10 s | 3.112e+03 |
| 4 flops | 1 GHz | 3.528e+20 s | 1.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
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.
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.
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?
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 yearsRead 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
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/τ).