G9.15.1 Measure the Schmitt Hysteresis

MediumImplementngspice 42 + SKY130 · serverReview the topic

Size a six-transistor Schmitt trigger so that its two thresholds land inside a given window.

Circuit context: A slow sensor input with a Schmitt-trigger receiver, and an open-drain interrupt line shared by several devices. Size a Schmitt trigger for a sensor whose swing is limited.

A receiver for a slow sensor line needs hysteresis, but not too much. On a weak day the sensor only swings to about 1.2 V, so the upper threshold must stay below 1.15 V.

This is an Implement problem. Build the block schmitt as a six-transistor Schmitt trigger and size it. The check sweeps the input slowly up and down and finds where the output crosses 0.9 V.

V_T+ must be from 1.05 V to 1.15 V, and V_T− from 0.60 V to 0.70 V.

What the Grader Measures

Your subcircuit schmitt (ports in, out, vdd) under the grader's own bench, one run per corner (tt):

CheckCornerRule
Upper threshold V_T+tt1.05 V to 1.15 V
Lower threshold V_T−tt600 mV to 700 mV
Threshold shift between the slow and the fast ramptt≤ 50 mV
Budget: Gate areatt≤ 2 µm², the lower the better
Full specification
The block that is checked (keep the name and the ports)
.subckt schmitt in out vdd
* sky130_fd_pr__nfet_01v8 and sky130_fd_pr__pfet_01v8
.ends
CheckRuleHow it is measured
Upper threshold V_T+1.05 V to 1.15 Vthe input where the output falls through 0.9 V, input rising
Lower threshold V_T−0.60 V to 0.70 Vthe input where the output rises through 0.9 V, input falling
Threshold shift with ramp speed≤ 50 mVthe larger change of either threshold between the slow and the ten times faster triangle
Gate area (budget)≤ 2 µm²the sum of W · L over the transistors of schmitt

The thresholds are read on a slow triangle: 0 to 1.8 V in 500 ns and back. A second copy gets a ten times faster triangle. Its thresholds must agree within 50 mV, so a slow output cannot pose as hysteresis. The output has no load. The check runs once at tt, 27 °C and 1.8 V.

Examples

Example 1

The Starter: A Plain Inverter
Design
.subckt schmitt in out vdd
XN out in 0 0 sky130_fd_pr__nfet_01v8 W=1 L=0.15
XP out in vdd vdd sky130_fd_pr__pfet_01v8 W=1 L=0.15
.ends
Measured by the grader
Upper threshold V_T+: 832.2 mV (needs 1.05 V to 1.15 V)
Lower threshold V_T−: 832 mV (needs 600 mV to 700 mV)
Threshold shift between the slow and the fast ramp: 960.5 µV (needs ≤ 50 mV)
Gate area: 300 mµm² (budget ≤ 2 µm²)

One threshold for both directions: 0.832 V and 0.832 V.

Example 2

The Lesson's Trigger, All 1 µm
Design
.subckt schmitt in out vdd
XP1 np in vdd vdd sky130_fd_pr__pfet_01v8 W=1 L=0.15
XP2 out in np vdd sky130_fd_pr__pfet_01v8 W=1 L=0.15
XN2 out in nn 0 sky130_fd_pr__nfet_01v8 W=1 L=0.15
XN1 nn in 0 0 sky130_fd_pr__nfet_01v8 W=1 L=0.15
XN3 vdd out nn 0 sky130_fd_pr__nfet_01v8 W=1 L=0.15
XP3 0 out np vdd sky130_fd_pr__pfet_01v8 W=1 L=0.15
.ends
Measured by the grader
Upper threshold V_T+: 1.185 V (needs 1.05 V to 1.15 V)
Lower threshold V_T−: 611.4 mV (needs 600 mV to 700 mV)
Threshold shift between the slow and the fast ramp: 49.61 mV (needs ≤ 50 mV)
Gate area: 900 mµm² (budget ≤ 2 µm²)

A window of 574 mV on the slow ramp. V_T− is 0.611 V, inside its range, but V_T+ is 1.185 V: too high.

Example 3

Feedback Devices of 2 µm
Design
.subckt schmitt in out vdd
XP1 np in vdd vdd sky130_fd_pr__pfet_01v8 W=1 L=0.15
XP2 out in np vdd sky130_fd_pr__pfet_01v8 W=1 L=0.15
XN2 out in nn 0 sky130_fd_pr__nfet_01v8 W=1 L=0.15
XN1 nn in 0 0 sky130_fd_pr__nfet_01v8 W=1 L=0.15
XN3 vdd out nn 0 sky130_fd_pr__nfet_01v8 W=2 L=0.15
XP3 0 out np vdd sky130_fd_pr__pfet_01v8 W=2 L=0.15
.ends
Measured by the grader
Upper threshold V_T+: 1.289 V (needs 1.05 V to 1.15 V)
Lower threshold V_T−: 545 mV (needs 600 mV to 700 mV)
Threshold shift between the slow and the fast ramp: 79.81 mV (needs ≤ 50 mV)
Gate area: 1.2 µm² (budget ≤ 2 µm²)

Stronger feedback widens the window further: 1.289 V and 0.545 V.

Constraints and Contract

  • The netlist defines .subckt schmitt in out vdd ... .ends exactly once, with these ports in this order.
  • Inside schmitt: X instances of sky130_fd_pr__nfet_01v8 or sky130_fd_pr__pfet_01v8, with comments and .param lines. No sources, resistors or capacitors. Use m= for parallel copies; mult= is refused.
  • The check writes the .lib line itself. Everything outside schmitt is replaced by its own bench.

Hints

Hint 1

Start from the circuit of lesson G9.15, all widths 1 µm. On the slow ramp its upper threshold is too high.

Hint 2

The feedback devices N3 and P3 push the thresholds apart. Make them weaker, or make the stack stronger.

Hint 3

Change one width at a time and read both thresholds; they move in opposite directions.

What the grader checks: The check places schmitt under its own bench with a slow triangle and no load, at tt and 27 °C. It reads both crossings of 0.9 V. The tool is ngspice 42 (libngspice0 42+ds-3build1) with the pinned SKY130 models, through tools/spice-judge.mjs. Corners and noise are outside this problem.

Run simulates your netlist as written, with your own analyses and measurements. Submit sends it to the grader, which keeps only the subcircuit schmitt 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 2 steps and the final capstone

Report a problem with this page

Your netlist SPICESaved locally
Ln 1, Col 1Tab indents · Ctrl/⌘ + Enter runs
Not run yet
Run your netlist to see its measurements and the ngspice log here.
ngspice 42 + SKY130 · server