Some alignment of Spice reader details with ngspice (not all possible ways of specifying R, L or C elements are supported currently)

This commit is contained in:
Matthias Koefferlein
2023-03-24 13:29:14 +01:00
parent c6bfb03a18
commit a39441cdbd
7 changed files with 228 additions and 36 deletions
+29
View File
@@ -0,0 +1,29 @@
* Test
.options scale=1e-6
.model sky130_fd_pr__pfet_01v8 NMOS level=8 version=3.3.0
.model sky130_fd_pr__nfet_01v8 NMOS level=8 version=3.3.0
XXpmos Q I VDD VDD pmos4_standard v=1.5 l=0.15 nf=4
XXnmos Q I VSS VSS nmos4_standard v=1.5 l=0.15 nf=4
XXDUMMY0 VSS VSS VSS VSS nmos4_standard v=1.5 l=0.15 nf=2
XXDUMMY1 VSS VSS VSS VSS nmos4_standard v=1.5 l=0.15 nf=2
XXDUMMY2 VDD VDD VDD VDD pmos4_standard v=1.5 l=0.15 nf=2
XXDUMMY3 VDD VDD VDD VDD pmos4_standard v=1.5 l=0.15 nf=2
* NOTE: "W" in the "ad" formula uses the previously computed parameter "W"
.subckt pmos4_standard D G S B v=0.1 l=0.018 nf=4
MM1 D G S B sky130_fd_pr__pfet_01v8 L=l W='v * nf ' ad='int((nf+1)/2) * W/nf**2 * 0.29' as='int((nf+2)/2) * W/nf**2 * 0.29'
+ pd='2*int((nf+1)/2) * (W/nf**2 + 0.29)' ps='2*int((nf+2)/2) * (W/nf**2 + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
+ m=1
.ends
* NOTE: "W" in the "ad" formula uses the previously computed parameter "W"
.subckt nmos4_standard D G S B v=0.1 l=0.018 nf=4
MM1 D G S B sky130_fd_pr__nfet_01v8 L=l W='v * nf ' ad='int((nf+1)/2) * W/nf**2 * 0.29' as='int((nf+2)/2) * W/nf**2 * 0.29'
+ pd='2*int((nf+1)/2) * (W/nf**2 + 0.29)' ps='2*int((nf+2)/2) * (W/nf**2 + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
+ m=1
.ends
.end
+37
View File
@@ -0,0 +1,37 @@
.subckt test
* Variations are:
* (1) Cname n1 n2 C=value [other params]
* (2) Cname n1 n2 value [params]
* (3) Cname n1 n2 model C=value [other params]
* Cname n1 n2 n3 C=value [other params] -> not supported, cannot tell from (3) without further analysis
* (4) Cname n1 n2 model value [params]
* Cname n1 n2 n3 value [params] -> not supported, cannot tell from (4) without further analysis
* (5) Cname n1 n2 n3 model C=value [other params]
* (6) Cname n1 n2 value model [params]
* (7) Cname n1 n2 n3 model value [params]
* (8) Cname n1 n2 n3 value model [params]
* ngspice takes second C parameter (5p)
c1 a b M=1 l=50.000u w=50.000u c=2.5p c=5p
* ngspice ignores C parameter and uses 2.5p
c2a a b M=1 l=50.000u w=50.000u 2.5p c=5p
* ngspice ignores C parameter and uses 2.5p
c2b a b 2.5p M=1 l=50.000u w=50.000u c=5p
* ngspice ignores first C parameter and uses 5p
c3 a b cap_model1 c=2.5p M=1 l=50.000u w=50.000u c=5p
* ngspice ignores C parameter and uses 2.5p
c4 a b cap_model1 2.5p M=1 l=50.000u w=50.000u c=5p
* ngspice ignores first C parameter and uses 5p
c5 a b c cap_model2 M=1 l=50.000u w=50.000u c=2.5p c=5p
* C parameter must not be present for this to be recognized as value
c6 a b 2.5p cap_model1 M=1 l=50.000u w=50.000u
* ngspice ignores C parameter and uses 2.5p
c7a a b c cap_model2 2.5p M=1 l=50.000u w=50.000u c=5p
* ngspice ignores C parameter and uses 2.5p
c7b a b c cap_model2 M=1 l=50.000u w=50.000u 2.5p c=5p
* ngspice ignores C parameter and uses 2.5p
c8 a b c 2.5p cap_model2 M=1 l=50.000u w=50.000u c=5p
.ends