H-S-S-11 | 34f5c74 | 2021-09-21 19:00:34 +0100 | [diff] [blame] | 1 | * comparator Simulation |
| 2 | * this file edited to remove everything not in tt lib |
| 3 | .lib "./sky130_fd_pr/models/sky130.lib.spice" tt |
| 4 | .include comparator-preamp.spice |
| 5 | .include comparator-decision.spice |
| 6 | .include comparator-diffamp.spice |
H-S-S-11 | 9f8a1a8 | 2021-09-24 14:40:51 +0100 | [diff] [blame] | 7 | .include comparator-whole.spice |
H-S-S-11 | 639a3fa | 2021-09-28 12:39:24 +0100 | [diff] [blame] | 8 | .include comparator-preamp-selfbias.spice |
H-S-S-11 | 34f5c74 | 2021-09-21 19:00:34 +0100 | [diff] [blame] | 9 | |
| 10 | * instantiate the comparator |
H-S-S-11 | 639a3fa | 2021-09-28 12:39:24 +0100 | [diff] [blame] | 11 | *Xpre VP VN VPAMP VNAMP VI BIASN VGND VDD3v3 comparator-preamp |
| 12 | Xpre VP VN VPAMP VNAMP VGND VDD3v3 comparator-preamp-selfbias |
| 13 | Xdec VPAMP VNAMP VOP VON VGND VDD3v3 comparator-decision |
| 14 | Xdif VOP VON VOUTdiff VGND VDD1v8 comparator-diffamp |
| 15 | |
| 16 | Xpuredif VP VN VOUTpurediff VGND VDD1v8 comparator-diffamp |
| 17 | |
H-S-S-11 | 9f8a1a8 | 2021-09-24 14:40:51 +0100 | [diff] [blame] | 18 | |
| 19 | Xcomp VP VN BIASN VOUT VGND VDD3v3 VDD1v8 comparator-whole |
H-S-S-11 | 34f5c74 | 2021-09-21 19:00:34 +0100 | [diff] [blame] | 20 | |
| 21 | * set gnd and power |
| 22 | Vgnd VGND 0 0 |
H-S-S-11 | 9f8a1a8 | 2021-09-24 14:40:51 +0100 | [diff] [blame] | 23 | Vdd3v3 VDD3v3 VGND 3 |
| 24 | Vdd1v8 VDD1v8 VGND 1.8 |
H-S-S-11 | 34f5c74 | 2021-09-21 19:00:34 +0100 | [diff] [blame] | 25 | |
| 26 | * set bias voltage |
| 27 | Vbias BIASN VGND 0.3 |
| 28 | |
| 29 | VNin VN VGND 1.5 |
H-S-S-11 | 34f5c74 | 2021-09-21 19:00:34 +0100 | [diff] [blame] | 30 | |
H-S-S-11 | 9c2329d | 2021-09-22 20:15:05 +0100 | [diff] [blame] | 31 | |
| 32 | * create VP-in |
H-S-S-11 | 34f5c74 | 2021-09-21 19:00:34 +0100 | [diff] [blame] | 33 | *VPin VP VGND pulse(0 3 1p 1n 1n 1n 2n) |
H-S-S-11 | 8cfcc2e | 2021-09-28 12:02:46 +0100 | [diff] [blame] | 34 | *VPin VP VGND SINE(1.5 0.1 10Meg) |
| 35 | VPin VP VGND 1.5 |
H-S-S-11 | 34f5c74 | 2021-09-21 19:00:34 +0100 | [diff] [blame] | 36 | |
H-S-S-11 | 8cfcc2e | 2021-09-28 12:02:46 +0100 | [diff] [blame] | 37 | *.tran 10e-12 200e-09 0e-00 |
| 38 | .dc VPin 0 3 0.002 VNin 0 3 0.2 |
H-S-S-11 | 34f5c74 | 2021-09-21 19:00:34 +0100 | [diff] [blame] | 39 | |
| 40 | .control |
| 41 | run |
| 42 | set color0 = white |
| 43 | set color1 = black |
H-S-S-11 | 639a3fa | 2021-09-28 12:39:24 +0100 | [diff] [blame] | 44 | plot VOUT VOUTdiff VDD3v3 |
| 45 | plot VOUTdiff VOUTpurediff VDD3v3 |
H-S-S-11 | 34f5c74 | 2021-09-21 19:00:34 +0100 | [diff] [blame] | 46 | *plot VPAMP VNAMP VI |
| 47 | *plot VOP VON |
H-S-S-11 | 9f8a1a8 | 2021-09-24 14:40:51 +0100 | [diff] [blame] | 48 | plot i(Vdd3v3) i(Vdd1v8) |
H-S-S-11 | 34f5c74 | 2021-09-21 19:00:34 +0100 | [diff] [blame] | 49 | .endc |
| 50 | |
| 51 | .end |