blob: f527873bc3dcca64eb8f49e4bfdaec74b8d7b182 [file] [log] [blame]
Tim Edwards367711e2021-01-27 10:35:12 -05001Attempting to get a valid IRSIM .prm file for the sky130 process
2Specifically for the sky130_fd_sc_hd library, but should work with all of
3them except for sky130_fd_sc_hvl.
4------------------------------------------------------------------------
5Following directions from the irsim web page. . .
6
7Get the "getres" script from ~/gitsrc/irsim/lib/calibrate_spice3/
8Change "spice" (with path) to "ngspice" (with path)
9Added string.h, stdlib.h, and malloc.h to findr.c to make it compile,
10and compiled it.
11
12Get characteristics from SPICE, cell sky130_fd_sc_hd__nand2_1
13
14 P device (sky130_fd_pr__pfet_01v8_lvt): 1.00um wide, 0.15um long
15 N device (sky130_fd_pr__nfet_01v8): 0.65um wide, 0.15um long
16
17 Using 50fF for loading cap (essentially irrelevant)
18
19Writing these values into "config.txt" (but not using).
20
21Copy "ckt.spi" to local directory
22Substitute values by hand (obvious)
23Use ".lib" to get models (sky130.lib.spice) with corner "tt"
24Convert "M" to "X" on devices.
25
26Changed voltage source on ground to 0.01 ohm resistor because ngspice
27doesn't like shorted voltage sources.
28
29Added ".save all".
30
31Spice models are in
32
33 ~/projects/efabless/tech/SW/sky130A/libs.tech/ngspice/sky130.lib.spice
34
35Note that the raw file reader expects an ASCII raw file, which in ngspice
36requires in ".spiceinit":
37
38 set filetype=ascii
39
40Running:
41
42 ngspice -b -r spi.out ckt.spi
43
44Do *not* use "-n" because that suppresses the reading of the .spiceinit file.
45
46Run:
47
48 ./findr -c 100 -n 0.8,0.18 -p 1.0,0.18 spi.out |& tee resists
49
50Had to change "findr.c" to replace "vdd" with "v(vdd)" and the same for all
51the vouts.
52
53Success!
54
55Now: Redo this at all nine corners for low-typ-high voltage and low-typ-high temp.
56
57Add header. sky130 gate thickness, from sky130_fd_pr__nfet_01v8 model is 4.15E-9 m,
58so:
59 Cox = Eox / Tox = 8.854E-12 F/m * 3.9 / 4.15E-9 = 8.32E-3 F/m^2 = pF/um^2
60
61The other cap values need to be looked up and corrected. . .