<@U01CHL4UY1Z> these are the correct syntaxes for ...
# analog-design
@User these are the correct syntaxes for resistors:
Copy code
XR1 M net1 B sky130_fd_pr__res_iso_pw W=2.65 L=2.65 mult=1 m=1
XR2 M net2 B sky130_fd_pr__res_generic_nd W=1 L=1 mult=1 m=1
XR3 M net3 B sky130_fd_pr__res_generic_pd W=1 L=1 mult=1 m=1
XR5 M net5 B sky130_fd_pr__res_high_po W=1 L=1 mult=1 m=1
XR6 M net6 B sky130_fd_pr__res_high_po_0p35 W=0.35 L=1 mult=1 m=1
XR7 M net7 B sky130_fd_pr__res_high_po_0p69 W=0.69 L=0.69 mult=1 m=1
XR8 M net8 B sky130_fd_pr__res_high_po_1p41 W=1.41 L=1.41 mult=1 m=1
XR9 M net9 B sky130_fd_pr__res_xhigh_po W=1 L=1 mult=1 m=1
XR10 M net10 B sky130_fd_pr__res_xhigh_po_0p35 W=0.35 L=0.35 mult=1 m=1
XR11 M net11 B sky130_fd_pr__res_xhigh_po_0p69 W=0.69 L=0.69 mult=1 m=1
XR12 M net12 B sky130_fd_pr__res_xhigh_po_1p41 W=1.41 L=1.41 mult=1 m=1
Resistors with _0pnn or_1pnn suffixes can be used only with specified width. For capacitors here is a sample for vertical metal capacitors:
Copy code
XC2 G 0 0 0 sky130_fd_pr__cap_vpp_11p5x11p7_l1m1m2m3m4_shieldm5 W=1 L=1 mult=1 m=1
and these are mim (Metal-Insulator-Metal) capacitors:
Copy code
XC6 c0 c1 sky130_fd_pr__cap_mim_m3_1 W=1 L=1 MF=1
XC7 c0 c1 sky130_fd_pr__cap_mim_m3_2 W=1 L=1 MF=1
Values for resistances must be calculated from process parameters: Rho for resistors and capacitance per unit area for caps. As an experimental feature xschem on some resistors is displaying the nominal value (keep in mind that silicon resistors are not perfectly constant, they vary with biasing conditions and temperature). If people like that i can add this for capacitors and remaining resistors.
@Stefan Schippers Really cool feature.
Whoa, that's very cool. Did you manually extract the equation, or do you just ask spice for it somehow?
no just simple "rho * L/W" calculation. I got the sheet resistance from the skywater docs
this is just an approximate value, the nominal resitance, say...
Hm, so capacitance would need to be W*H and then something with permitivity of the insulator and the distance... are these also in the skywater docs?
yes they already do the calculation based on oxide thickness and insulator, so you get a capacitance per area, all you need to do is multiply W xL
the only issue i must take care for is that in spice you can give values with suffixes, (n, u, m, k, meg, g) a number like 1e6u will not be recognized as '1' so i have to write a simple parser that recognizes these engineering suffixes, otherwise i get wrong calculations.
.model mcm3d c tc1 = 0 tc2 = 0 cox = {cm3d} capsw = {cm3dsw} w = {wminm3} tref = 25.0
for this model can i use the name of the capacitor as c1 in my design
and also i have one doubt is that in the pdk test files of nfet_01v8 (finding vth) they simply wrote the resistors as R1 only and also they have included the lib files present in r+c folder
* Transistor Vth and I-V characteristic .param TEMP=27 .option scale=1E-6 * Include SkyWater sky130 device models .include "../../../models/r+c/res_typical__cap_typical__lin.spice" .include "../../../models/r+c/res_typical__cap_typical.spice" .include "../../../models/corners/tt.spice" * Gate bias Rg 1 2 680 X1 3 2 0 0 sky130_fd_pr__nfet_01v8 Rd 3 4 100 * DC source for current measure Vid 5 4 DC 0V Vgb 1 0 DC 0V Vdd 5 0 DC 3.3V .control * Sweep Vds from 0 to 1.8V dc Vdd 0 1.8 0.01 Vgb 0 1.2 0.01 wrdata sky130_fd_pr__nfet_01v8__iv.data Vid#branch V(1) V(3) * Sweep Vgs from 0 to 1.2V dc Vgb 0 1.2 0.01 # Find threshold let ih=Vid#branch[98] let il=Vid#branch[85] let vh=V(2)[98] let vl=V(2)[85] let vth=((vl - vh) / (ih - il)) * ih + vh echo threshold voltage print vth quit .endc .end
the above is one of the test file
and they have used normal R1 to name their resistor and they have also included spice files stating that the name of the model R1 exists. is my assumption correct.
* MiM capacitor value test .param TEMP=27 * Include SkyWater sky130 device models .lib "sky130_fd_pr/models/sky130.lib.spice" tt .param freq = 1Meg .csparam freq = {freq} * Resistor bridge with capacitance V1 N2 0 1.8 IAC N3 N4 dc 0 ac 1 *X1 N3 N4 sky130_fd_pr__cap_mim_m3_1 W=1 L=1 MF=1 C34 N3 N4 50E-15 R1 N3 0 1.1Meg R2 N4 0 1.2Meg R3 N2 N3 1.3Meg R4 N2 N4 1.4Meg .ac lin 1 {freq} {freq} .control run echo capacitance print imag(1/v(N4,N3))/2/PI/freq quit .endc .end
see that in this file it will execute for both conventions C34 and X1 but the results vary because for C34 we are specifying 50E-15
whereas for X1 based on the W and L values it will give the results.
so my doubt is that ,if i name resistor and capacitor as R and C by including the libraries as mentioned above will the PDK files are really included in my circuit or (some default resistor/capacitor conventions in ngspice will substitute it)??
@Ashok Kumar Test files for active components use ideal devices for all but the device under test, usually. In all those files, Rxxx n1 n2 value , or Cxxx n1 n2 value are ideal components, no model at all is needed for them. However if you plan to use a real resistor or capacitor in the sky130 process you must follow the calling conventions, something like XRxxx node1 node2 substrate model W=... L=,,, mult=... m=..... The real value of the resistance must be calculated from process parameters, and also that value is very dependent on biasing and temperature, however a nominal value is : R0 = rho * L / W. 'rho' can be found in the device details of the sky130 docs
Thank you. I just got to know about this
Is it ok if I take values of L and W in the range of 500 ?
To get a capacitor value of the order or 1e-10
500 means 500 micron, half millimeter, this is a big number. For capacitors a reasonable value for L / W is 5, 10, 20. For resistors the width is fixed for some (0.35 for res_high_po_0p35) while the length may vary from fraction of micron (0.5 example) to bigger quantities (10? 20? ) don't exactly know the limits.
@Ashok Kumar taking mim capacitors as an example they have 2fF/um2 (2 femto-Farad per square micron). so to get 100pF you need 1e-10/2e-15 = 50000 square microns. W=224 x L=224. You probably need to build an array of smaller caps.
X1 0 A 0 sky130_fd_pr__res_high_po_5p73 l=7.6
this one is giving me 500ohms
X1 N3 N4 sky130_fd_pr__cap_mim_m3_1 W=500 L=200 MF=1
X1 N3 N4 sky130_fd_pr__cap_mim_m3_1 W=500 L=500 MF=1
yes make sense, this one has L=7.6 and W=5.73
the above two giving me the values like 500p and 200p for capacitances
can i directly write like these or should i take series caps
yes makes sense
just try. If values are not allowed ngspice will flag an error
i have tried and getting the required values but is there a problem when implementing the layout?
in ngspice it is ok for now
when i go to layout what problem can i get with those big W and L values
Don't know exactly the design rules for layout, so you need to find out 🙂
ok thank you. so if ngspice gives no error the my W and L vaues are fine right?
yes but layout drc rules might have some more requirements / limits.
ok i'll try to simulate with small L and W values. thank you.☺️