Size a 20 µA current mirror so its copy error has σ of at most 1 % over 40 Monte Carlo dies. It must still work at 0.3 V, in at most 32 µm² of gate.
Circuit context: A 1:1 NMOS mirror that copies a converter's 20 µA bias, 40 dies drawn with SKY130's mismatch model. Size a bias mirror so every die copies its current within one percent.
A converter takes its 20 µA bias from a 1:1 NMOS current mirror. Each die copies the current a little differently, because the two thresholds differ at random. The converter needs the copy error to have a standard deviation of at most 1 %.
The output node sits at 0.6 V and can fall to 0.3 V. At 0.3 V the mirror must still deliver at least 95 % of its current at 0.6 V.
The layout gives the mirror at most 32 µm² of gate, the sum of W · L over its transistors. The mirror in the netlist uses 30 µm² and misses the spec twice. Resize it.
What the Grader Measures
Your subcircuit mirror (ports in, out) under the grader's own bench, one run per corner (tt):
| Check | Corner | Rule |
|---|---|---|
| σ of the copy error | tt | ≤ 1% |
| Mean copy error | tt | -2% to 2% |
| Mismatch is live (σ) | tt | ≥ 0.1% |
| Current lost at 0.3 V | tt | ≤ 5% |
| Budget: Gate area | tt | ≤ 32 µm², the lower the better |
Full specification
.subckt mirror in out
* sky130_fd_pr__nfet_01v8 only; 20 uA flows into in, out sinks the copy
.ends
| Check | Rule | How the grader measures it |
|---|---|---|
| σ of the copy error | ≤ 1 % | 40 mirrors with their own mismatch draws, outputs at 0.6 V: the standard deviation of I_out/20 µA − 1 |
| Mean copy error | −2 % to 2 % | the mean of the same 40 errors |
| Mismatch is live | σ ≥ 0.1 % | the same σ: dies that all come out alike mean the mismatch model is off |
| Current lost at 0.3 V | ≤ 5 % | the same 40 dies with the outputs at 0.3 V: the fall of their summed current from its value at 0.6 V |
| Gate area (budget) | ≤ 32 µm² | the sum of W · L · m over the FETs of mirror, read from the netlist |
One run at tt and 27 °C. The grader's seed is not the one in your bench, so it draws other dies. A σ from 40 dies is known to about ±11 %: leave that much room.
Examples
Example 1
The Starter: A 4/1.5 Reference and an 8/3 Output- Design
.subckt mirror in out XM1 in in 0 0 sky130_fd_pr__nfet_01v8 W=4 L=1.5 XM2 out in 0 0 sky130_fd_pr__nfet_01v8 W=8 L=3 .ends
- Measured by the grader
σ of the copy error: 1.446% (needs ≤ 1%) Mean copy error: 19.69% (needs -2% to 2%) Current lost at 0.3 V: 2.987% (needs ≤ 5%) Gate area: 30 µm² (budget ≤ 32 µm²)
The small reference device sets the spread. The mean is far off too: the threshold changes with L, so equal W/L does not give equal currents.
Example 2
Wide and Short: 8/2 Twice- Design
.subckt mirror in out XM1 in in 0 0 sky130_fd_pr__nfet_01v8 W=8 L=2 XM2 out in 0 0 sky130_fd_pr__nfet_01v8 W=8 L=2 .ends
- Measured by the grader
σ of the copy error: 1.293% (needs ≤ 1%) Mean copy error: -1% (needs -2% to 2%) Current lost at 0.3 V: 3.022% (needs ≤ 5%) Gate area: 32 µm² (budget ≤ 32 µm²)
The whole budget, with a small overdrive. The output holds at 0.3 V, but the spread is too large.
Example 3
Lesson E7.4's 4/4 Pair- Design
.subckt mirror in out XM1 in in 0 0 sky130_fd_pr__nfet_01v8 W=4 L=4 XM2 out in 0 0 sky130_fd_pr__nfet_01v8 W=4 L=4 .ends
- Measured by the grader
σ of the copy error: 0.6175% (needs ≤ 1%) Mean copy error: -1.141% (needs -2% to 2%) Current lost at 0.3 V: 7.279% (needs ≤ 5%) Gate area: 32 µm² (budget ≤ 32 µm²)
Well matched. At 20 µA its overdrive is so large that the output leaves saturation above 0.3 V.
Example 4
6/4 Twice- Design
.subckt mirror in out XM1 in in 0 0 sky130_fd_pr__nfet_01v8 W=6 L=4 XM2 out in 0 0 sky130_fd_pr__nfet_01v8 W=6 L=4 .ends
- Measured by the grader
σ of the copy error: 0.6217% (needs ≤ 1%) Current lost at 0.3 V: 3.856% (needs ≤ 5%) Gate area: 48 µm² (budget ≤ 32 µm²)
Every check is met, at 48 µm²: 16 µm² over the limit.
Constraints and Contract
- The netlist defines .subckt mirror in out ... .ends exactly once, with these ports in this order.
- Inside mirror: X instances of sky130_fd_pr__nfet_01v8 with W= and L= given as numbers or .param values, comments and .param lines. No sources and no resistors.
- A line may carry m= for parallel copies, and the area counts them. mult= is refused: it does not change the device.
- Leave the mismatch model alone: do not set MC_MM_SWITCH or any model parameter inside the block. The grader writes the .lib line, the seed and MC_MM_SWITCH itself.
Hints
Hint 1
Lesson E7.4: σ(ΔI/I) = (g_m/I_D) · σ(ΔV_th). The current is fixed here, so a wider device has a smaller σ(ΔV_th) and a larger g_m/I_D.
Hint 2
Run an experiment before you size: double W and read σ, then double L and read σ.
Hint 3
The two threshold errors add as powers, so the smaller device sets the sum. Two devices with the same W/L but different lengths also have different thresholds.
Hint 4
A narrow, long device needs a large overdrive. Then the output leaves saturation before it reaches 0.3 V.
What the grader checks: The grader runs 40 copies of mirror with its own seed, at tt and 27 °C. SKY130's mismatch model is on (MC_MM_SWITCH = 1). Engine: ngspice 42 (libngspice0 42+ds-3build1) with the pinned SKY130 models, measured 2026-11-12 with tools/spice-judge.mjs. The area is the sum of W · L · m in the netlist. σ from 40 dies is an estimate: it proves the spread of those dies, not a yield. The model varies the threshold only, so mismatch of the current factor is not in this result.
Run simulates your netlist as written, with your own analyses and measurements. Submit sends it to the grader, which keeps only the subcircuit mirror and makes 1 ngspice run. The numbers come from ngspice and the SKY130 models the site pins; they prove the measured cases, not every condition a chip meets.
See all 1 steps and the final capstone