MacSpice_Templates (ongoing personal cheatsheet)
Array_Tests Inverter_Modeling PWL_Noise_Tests
Bsim_MOS_Gate_Cap Lateral_PNP Ring_At_StartUp
Binary_Decoder Lissajous Root_Locus
BSIM_MOS_CAPS Math Sanity_Test_NPN_TC
Clipping_White_Noise NMOS Self_Heating_NPN
CMOS_Delay_vs_VCC NMOS_Noise_Curves Show_Details
Control_Loops Noise_Current_Curves Simple_ADC_2_DAC
Converge Noise_Voltage_Curves Spectrum_2_Jitter
Create_PWL_Noise_File Non-linear Sources SubCircuit_Tests
Devices_Details One_F_Noise_PWL SubThresshold_Curves
D_FlipFlop One_F_Noise_Shape Sweep_Decades
Extract_and_Remake One_Line_Logic THD_Curves
FFT_Scale_Tests OpAmp_Corner_Tester Transfer_Function
FFT_Tests Pinch_Resistor Variable_Array_Details
Ftau_Curves Pole_Zero_Extraction Vertical_NPN
Functions PulseWidthMod_Balanced
Gummel_Curves PulseWidthMod_Sync
*======== ====== ====== ====== ====== ====== ====== ====== ======
*V_DC_NUM NODE_P NODE_N DC VALUE AC ACMAG ACPHASE
*I_DC_NUM NODE_P NODE_N DC VALUE AC ACMAG ACPHASE
*======== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ======
*V_PULSE# NODE_P NODE_N DC VALUE PULSE( VINIT VPULSE TDELAY TRISE TFALL PWIDTH PERIOD )
*V_SIN# NODE_P NODE_N DC VALUE SIN( V_DC AC_MAG FREQ DELAY FDamp)
*V_FM # NODE_P NODE_N DC VALUE SFFM( V_DC AC_MAG FREQ_C MODLEV FREQ_M)
*V_PWL# NODE_P NODE_N DC VALUE PWL( T1 V1 T2 V2 T3 V3 ...>)
*======== ====== ====== ====== ====== ====== ====== ====== ======
*E_GAIN# NODE_P NODE_N CNTL_P CNTL_N GAIN
*G_GM#B NODE_P NODE_N CNTL_P CNTL_N GM ON/OFF
*======== ====== ====== ====== ====== ====== ====== ====== ======
*D_NUMB NODE_P NODE_N MODEL AREA IC=? TEMP=?
*Q_NUMB NCOL NBASE NEMIT NSUB MODEL AREA IC=? TEMP=?
*MOS_NUMB NDRAIN NGATE NSOUR NBULK MODEL L=VAL W=VAL AD=? AS=? PD=? PS=?
*M1 2 9 3 0 MOD1 L=10U W=5U AD=100P AS=100P PD=40U PS=40U
*JFET_NUM NDRAIN NGATE NSOUR MODEL AREA IC=? TEMP=?
*R_Rsemi# N1 N2 VALU MNAME L=? W=? TEMP=?
*======== ====== ====== ====== ====== ====== ====== ====== ======
*R_NUMB NODE1 NODE2 RVALUE MODEL L=VAL W=VAL
*C_NUMB NODE1 NODE2 CVALUE MODEL IC=V0
*L_NUMB NODE1 NODE2 LVALUE MODEL IC=I0
*K_L_NUM LNUM1 LNUM2 KVALUE
*S_NUMB NODE1 NODE2 CNTL_P CNTL_N MODEL ON/OFF
*======== ====== ====== ====== ====== ====== ====== ====== ======
*DC SOURC1 VSTART VSTOP VSTEP SOURC2 START2 STOP2 STEP2
*AC DECLin NUMDEC FSTART FSTOP TRAN TSTEP TSTOP TSTART TMAX ?UIC?
*TRAN TSTEP TSTOP TSTART TMAX ?UIC?
*PZ NODE1 NODE2 NODE3 NODE4 CUR/VOL POL/ZER/PZ
*NOISE V(OUT) VIN DECLIN POINTS FSTART FSTOP [PPS]
*======== ====== ====== ====== ====== ====== ====== ====== ======
*SET SPECWINDOW= "BLACKMAN"
*SPEC FSTART FSTOP FSTEP VECTOR
*PLOT MAG( VECTOR )
*======== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ======
*specwindow none, hanning, cosine, rectangular, hamming, triangle, bartlet, blackman, gaussian.
*======== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ======
*plot xlog ylog loglog linear samep vs~~~~~xname
*plot ylimit~ylo~~~~yhi xlimit~xlo~~~~xhi xdelta~xdel ydelta~ydel xindices~xilo~xihi
*plot xlabel~word ylabel~word title~~word xcompress~comp
*======== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ======
*PLOT MAG() PH() DB() REAL() IMAG() LOG() LN() EXP() ABS() MEAN() SQRT() DERIV()
*PLOT SIN() COS() TAN() ATAN() VECTOR RND() J() NORM() POS() LENGTH
*======== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ======
T = 1012 G = 109 Meg = 106 K = 103 mil = 25.4*10-6
m = 10?3 u = 10-6 n = 10-9 p = 10?12 f = 10-15
Math + - * / ^ %
logical & = and | = or != not
relation < > >= <= = <> producing values of 0 or 1
gt > lt < ge >=
le <= ne <> eq =
and & or | not !
Nutmeg pre-defined constants
pi 3.14159...)
e 2.71828...)
c 299,792,500 m/s)
i square root of -1
kelvin Absolute 0 in Centigrade (-273.15°C)
echarge The charge on an electron (1.6021918e-19 C)
boltz Boltzman's constant (1.3806226e-23 J/K)
planck Planck's constant (h = 6.626200e-34 J/Hz)
MacSpice 14 -> display
MacSpice 12 -> show qn1
MacSpice 40 -> showmod
MacSpice 36 -> dump
MacSpice 34 -> listing
====================Converge=====================================
.OPTIONS SRCSTEPS =100 100 is the number of steps of stepping algorithm.
.OPTIONS GMINSTEPS =200 Gminsteps option adjusts number of Gmin increments used during DC analysis.
.OPTIONS GMIN =1n default 1e-12
.OPTIONS RSHUNT =100Meg The Rshunt option places a resistor every node in the circuit to ground
.OPTIONS RAMPTIME =10ns Ramptime causes all independent sources ramped up from zero initial values at beginn
.OPTIONS ALTINIT =10 Setting Altinit to 1 causesmore lenient algorithm used when UIC
.OPTIONS METHOD =gear default is "trapezoidal" (or just "trap").
.OPTIONS RELTOL =.01 sets accuracy, reset to default value of .001 after things working
.OPTIONS ABSTOL =1n sets accuracy, use 1u in amp applications default Abstol=1pA
.OPTIONS VNTOL =1m sets accuracy, default Vntol=1µV.
.OPTIONS TRTOL =x Sets transient error tolerance. default 7.0. an estimate of overestimates truncation error.
.OPTIONS ITL1 =400 dc iteration limit. default is 100.
.OPTIONS ITL2 =100 dc transfer curve iteration limit. default 50.
.OPTIONS ITL3 =x lower transient analysis iteration limit. default 4. (Note: not implemented in Spice3).
.OPTIONS ITL4 =500 transient analysis timepoint iteration limit. default is 10.
.OPTIONS ITL5 =x transient analysis total iteration limit. default 5000. Set ITL5=0 to omit test.not in Spice3.
.OPTIONS PIVREL =x Resets relative ratio between largest column entry and an acceptable pivot value. default 1.0e-3.
.OPTIONS PIVTOL =x Sets absolute minimum value for matrix entry to be accepted as pivot. default 1.0e-13.
.OPTIONS RELTOL =x Sets the relative error tolerance of the program. Tdefault value is 0.001 (0.1%).
.OPTIONS TEMP =x Sets operating temperature of the circuit. default s 27 deg C (300 deg K).
.OPTIONS TNOM =x Sets the nominal temperature at which device parameters
Add UIC (Use Initial Conditions) to the .TRAN line. Example: .TRAN .1N 100N UIC
Add .NODESET values Example: .NODESET V(6)=0
Add RC snubbers around diodes.
Add Capacitance for all semiconductor junctions
Add rise/fall times of the sources.
nodesets "filename" //Create a file of .nodeset statements
.NODESET: Specify Initial Node Voltage Guesses
.NODESET V(12)=4.5 V(4)=2.23
.NODESET V(6)=0 Add .NODESET values for top level circuit nodes (not subcircuit nodes)
.IC: Set Initial Conditions
uic on tran statement stops tran from doing op
starts with everything at zero unless specified with .ic statements.
safer to use a .IC statement and not specify UIC on the tran statement.
R2 VIN BP 10
L2 BP 0 .159 IC= 0
C2 BP 0 .159 IC= 1
.tran 1 20 0 UIC
====================Non-linear Sources============================
BXXXXXXX N+ N- <I=EXPR> <V=EXPR>
B1 0 1 I = cos(v(1))+sin(v(2))
B2 0 1 V = ln(cos(log(v(1,2)^2)))-v(3)^4+v(2)^v(1)
B3 3 4 I = 17
B4 3 4 V = exp(pi^i(vdd))
abs asinh cosh sin acos atan exp sinh
acosh atanh ln sqrt asin cos log tan
+ - * / ^ unary -
u() unit step function, zero = ( arguments <=0) one ( arguments > 0)
uramp(x) integral of the unit step:
===================Math=====================================
Logic gt > lt < ge >= le <= ne <> eq = and & or | not !
mag(vector) magnitude of vector. [Note: magnitude() is a synonym for this.]
ph(vector) phase of vector. [Note: phase() is a synonym for this.]
j(vector) i (sqrt(-1)) times vector.
real(vector) real parts of vector.
imag(vector) imaginary parts of vector.
db(vector) 20log10(mag(vector)).
log(vector) logarithm (base 10) of vector.
ln(vector) natural logarithm (base e) of vector.
exp(vector) e to the vector power.
abs(vector) absolute value of vector.
sqrt(vector) square root of vector.
sin(vector) sine of vector.
cos(vector) cosine of vector.
tan(vector) tangent of vector.
acos(vector) inverse cosine of vector.
asin(vector) inverse sine of vector.
atan(vector) inverse tangent of vector.
norm(vector) vector normalized to 1 (i.e. the largest magnitude of any element is 1).
pos(vector) 1 if the real part of vector is positive, 0 otherwise.
rnd(vector) random integer between 0 and absolute value of vector's corresponding element.
mean(vector) a scalar (length 1 vector) mean of the elements of vector.
maximum(vector) maximum element of vector.with the greatest magnitude.
minimum(vector) minimum element of vector.with the smallest magnitude.
unitvec(number) vector length number, with elements 1. If number=first element taken,floor magnitude used
vector(number) result vector of length number If number = vector then = first element taken, floor used.
length(vector) The length of vector.
sortorder(vector) Result vector has elements of positions for input vector after sorted increasing order
interpolate(plot.vector) result named vector onto scale of current plot.
deriv(vector)
Calculates derivative of the given
vector.
integral(vector) Interpolates its argument onto the current scale.
===========Array_Tests==============================
--------------------------------------------------------------------------------
Index x y z w r
--------------------------------------------------------------------------------
0 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00
1 1.00000e+00 3.00000e+00 1.00000e+00 2.00000e+00 4.25000e+00
2 2.00000e+00 2.00000e+00 2.00000e+00 4.00000e+00 8.50000e+00
3 3.00000e+00 4.00000e+00 3.00000e+00 6.00000e+00 1.27500e+01
4 4.00000e+00 8.00000e+00 0.00000e+00
5 5.00000e+00 0.00000e+00
6 6.00000e+00
7 7.00000e+00
8 8.00000e+00
9 9.00000e+00
10 0.00000e+00
--------------------------------------------------------------------------------
Index z x y
--------------------------------------------------------------------------------
0 0.00000e+00 0.00000e+00 0.00000e+00
1 4.81888e-01 2.00000e+00 3.00000e+00
2 2.00000e+00 1.00000e+00 2.00000e+00
3 3.00000e+00 3.00000e+00 4.00000e+00
4 4.00000e+00
5 5.00000e+00
6 6.00000e+00
7 7.00000e+00
8 8.00000e+00
9 9.00000e+00
10 0.00000e+00
...
===========Copy_Paste_Text_Below_And_Simulate=========
Array_Tests
* dsauersanjose@aol.com 1/18/10
* www.idea2ic.com replace(OPT-SPACE)=>SPACE
*
* ___ ___
* |VIN|__/\ /\ /\_|OUT|
* |___| \/ \/ |___|
* _|_ R1 _|_
* /_ \ ___
* // \ \ C1 _|_
* \ \// ///
* \___/
* _|_
* ///
.OPTIONS GMIN=1e-15 METHOD=gear ABSTOL=1e-15 srcsteps = 1 gminsteps = 1
*======== ====== ====== ====== ====== ====== ====== ====== ====== ======
*V_SIN# NODE_P NODE_N DC VAL SIN( V_DC AC_MAG FREQ DELAY FDamp)
VIN VIN 0 DC 0 sin( 0 1 1 )
*=========Run_Sim============================================
.control
set pensize = 2
*=========Create_Arrays============================================
let x= (0;1;2;3)
let y= (0;3;2;4)
compose z start = 0 stop = 10 step =1
compose w start = 0 stop = 10 step =2
compose r start = 0 stop = 17 lin =5
*=========Define_Array_Type========================================
settype time x
settype voltage y
*notype time*voltage*current*frequency*power*decibel*temperature
*=========View_Arrays========================================
plot y vs x
print x y z w r
*=========View_Info========================================
display
*show all show vin showmod dump
*=========Modify_Arrays========================================
let z[1] = (1+rnd(32768))/32769
let x = sortorder(y)
print z x y
.endc
.end
===========SubCircuit_Tests======================
===========Copy_Paste_Text_Below_And_Simulate=========
SubCircuit_Tests
* dsauersanjose@aol.com 1/18/10
* www.idea2ic.com replace(OPT-SPACE)=>SPACE
*
* VIN ___ ___
* ____________|LC1|______|OUT|
* _|__ |___| |___|
* /_ \ VIN _|_ |
* // \ \ /// |
* \ \_// |
* \____/ _/\ /\ /\____|
* _|_ _|_ \/ \/ R1
* /// ///
*
*======== ====== ====== ====== ====== ====== ====== ====== ====== ======
.OPTIONS GMIN=1e-15 METHOD=gear ABSTOL=1e-15 TEMP=27 srcsteps = 1 gminsteps = 1
VIN VIN 0 DC 0V AC 1V
XLC1 VIN OUT LC1
R1 OUT 0 10
*=========Run_Sim=======================================================
.control
run
*AC DECLin NUMDEC FSTART FSTOP
ac dec 30 .01 100
plot db(out)
.endc
*=========Create_SubCircuit============================================
.SUBCKT LC1 IN OUT
L1 IN OUT 1
C1 OUT 0 1
.ENDS LC1
* _ _ _ L1 http://www.idea2ic.com/PlayWithJavascript/L_C_R_F.html
* ___ / \/ \/ \ ___ ___ _______ ___
* |IN |_| () () |___|OUT| |IN |__| |___|OUT|
* |___| | |___| |___| | LC1 | |___|
* _|_ |_______|
* ___ C1 _|_
* | /// Freq=0.159Hz Z=1 Ohm
* _|_
* /// .SUBCKT LC1 N1 IN OUT
*
*=======================================================================
.end
===========Sweep_Decades======================
===========Copy_Paste_Text_Below_And_Simulate========
Sweep_3_decades
* www.idea2ic.com
* dsauersanjose@aol.com 1/17/10 replace(OPT-SPACE)=>SPACE
*
VTime Vtime 0 PWL ( 0 0 1 3 )
R Vtime 0 1k
B1 OUT 0 V = exp(ln(10)*V(Vtime))
.control
*TRAN TSTEP TSTOP TSTART TMAX ?UIC?
tran .1m 1000m 0
plot v(vtime)
plot v(out) ylog
.endc
.end
===========FFT_Tests======================
freq = 1 real = 3.68976E-15 imag = -1.28998E-15
freq = 5 real = 1.27313 imag = -2.08248E-05
freq = 10 real = -4.61957E-15 imag = 2.43275E-16
freq = 15 real = -0.424087 imag = 2.0813E-05
freq = 20 real = 3.46294E-15 imag = 4.14668E-16
freq = 25 real = 0.254103 imag = -2.07895E-05
freq = 30 real = -4.2453E-15 imag = -2.88472E-16
freq = 35 real = -0.181129 imag = 2.07544E-05
===========Copy_Paste_Text_Below_And_Simulate========
FFT_tests
* www.idea2ic.com
* dsauersanjose@aol.com 1/17/10 replace(OPT-SPACE)=>SPACE
*
*
* Vtime ^ OUT
* ____ /_\
* VT _|_ | _|_
* /_ \ | /_ \
* // \ \ |_// \ \
* \ \// \ \//
* \___/ \___/ B1
* | |
* _|_ _|_
* /// ///
*
.Option srcsteps = 1 set Gmin = 1.0000E-02
*===========Circuit_Netlist=========================
VT Vt 0 PWL ( 0 0 1 1 )
V2PI P 0 DC 6.283185307179586
B1 V1 0 V = cos(v(p)*5*v(Vt) )
B2 OUT 0 V = tanh((v(V1))*100)
*TRAN TSTEP TSTOP TSTART TMAX ?UIC?
.tran 1m 1 0 .1m
*===========Run_Transient=========================
.control
run
set pensize = 2
plot v(out)
*===========Find_Spectrum_OUT=========================
linearize
set specwindow= "none"
spec 1 500 1 v(out)
set pensize = 3
plot dB(abs(real(v(out)))) dB(abs(imag(v(out)))) xlog
*===========Print_Spectrum_OUT=========================
foreach ii 1 5 10 15 20 25 30 35
let i = $ii
let fr= frequency[i-1]
let vfftr = real(v(out)[i-1])
let vffti = imag(v(out)[i-1])
echo freq= $&fr real= $&vfftr imag= $&vffti
end
.endc
.end
===========FFT_Scale_Tests======================
Warning: Out of range index (-1), reset to 0.
freq = 1 real = -1.76235E-06 imag = -4.67344E-12
freq = 1 real = -1.76235E-06 imag = -4.67344E-12
freq = 2 real = -2.01374E-06 imag = -1.06821E-11
freq = 3 real = -2.64221E-06 imag = -2.10302E-11
freq = 4 real = -4.69524E-06 imag = -4.98467E-11
freq = 5 real = 1 imag = 1.32779E-05
freq = 6 real = 3.83675E-06 imag = 6.11724E-11
freq = 7 real = 1.75709E-06 imag = 3.27082E-11
Warning: Out of range index (-1), reset to 0.
freq = 1 real = -2.65005E-08 imag = -3.51973E-07
freq = 1 real = -2.65005E-08 imag = -3.51973E-07
freq = 2 real = -2.64972E-08 imag = -8.04502E-07
freq = 3 real = -2.64888E-08 imag = -1.58384E-06
freq = 4 real = -2.64616E-08 imag = -3.75421E-06
freq = 5 real = -1.33044E-05 imag = 1
freq = 6 real = -2.65749E-08 imag = 4.60709E-06
freq = 7 real = -2.65473E-08 imag = 2.46341E-06
===========Copy_Paste_Text_Below_And_Simulate========
FT_Scale_tests
* dsauersanjose@aol.com 1/21/10
* www.idea2ic.com
* the spectrum output appears to have..
* 1Vpk cosine => real 1
* Vtime ^ OUT 1Vpk sine => imag 1
* ____ /_\
* VT _|_ | _|_ frequency(0) = out of range
* /_ \ | /_ \ (No DC term )
* // \ \ |_// \ \
* \ \// \ \//
* \___/ \___/ B1
* | |
* _|_ _|_
* /// ///
*
.Option srcsteps = 1 set Gmin = 1.0000E-02
*=========Circuit_Netlist=========================
VT Vtime 0 PWL ( 0 0 1 1 )
B1C OUT1C 0 V = cos(2*3.14159*5*v(Vtime)) +.5
B1S OUT1S 0 V = sin(2*3.14159*5*v(Vtime))
B2 OUT 0 V = v(OUT1C) + v(OUT1C)
.tran 1m 1 0 .1m
*=========Run_Simulation=========================
.control
run
set pensize = 2
plot v(out1c) v(out1s)
plot out1c deriv(out1c)
plot out1c integral(out1c)
*=========Find_Cosine_Spectrum=========================
linearize
set specwindow= "none"
spec 1 500 1 v(out1c)
set pensize = 3
plot dB(abs(real(v(out1c)))) dB(abs(imag(v(out1c)))) xlog
*=========Print_Cosine_Spectrum=========================
foreach ii 1 2 3 4 5 6 7
let i = $ii
let fr= frequency[i-1]
let vfftr = real(v(out1c)[i-1])
let vffti = imag(v(out1c)[i-1])
echo freq= $&fr real= $&vfftr imag= $&vffti
end
*=========ReRun_Simulation=========================
run
*=========Find_Sine_Spectrum=========================
linearize
set specwindow= "none"
spec 1 500 1 v(out1s)
set pensize = 3
plot dB(abs(real(v(out1s)))) dB(abs(imag(v(out1s)))) xlog
*=========Print_Sine_Spectrum=========================
foreach ii 1 2 3 4 5 6 7
let i = $ii
let fr=frequency[i-1]
let vfftr = real(v(out1s)[i-1])
let vffti = imag(v(out1s)[i-1])
echo freq= $&fr real= $&vfftr imag= $&vffti
end
.endc
.end
=========Create_PWL_Noise_File=========================
MacSpice 2 -> rndsrc .5m 1
PWL_File.inc has been created in the MacSpice folder
MacSpice 3 ->
========="rndsrc"_File_Needs_To_Be_In_MacSpice_Folder=========
* rndsrc -- by CDHW -- writes a gausian random voltage source
*
* Note: see also the frontend command 'compose'
*
.control
begin
setplot new
set outfile = "PWL_File.inc"
if ($argc = 2)
let step = $argv[1]
let duration = $argv[2]
else
echo "usage - rndsrc timestep duration"
echo "effect - gaussian source written to file -- $outfile"
unset outfile
goto done
endif
set parity = true
let time = 0
echo "VpwlT OUT 0 PWL(" > $outfile
while time < duration
let time = time + step
if $parity
let X1 = (1+rnd(32768))/32769
let X2 = rnd(32768)/32768*8*atan(1)
let Vnoise = sqrt(-2*ln(X1))*cos(X2)
set parity = false
else
let Vnoise = sqrt(-2*ln(X1))*sin(X2)
set parity = true
endif
echo "+ $&time $&Vnoise" >> $outfile
end
echo "+ )" >> $outfile
unset outfile parity
label done
destroy
end
echo "PWL_File.inc has been created in the MacSpice folder"
.endc
==========="PWL_File.inc"_in_MacSpice_Folder===================
VpwlT OUT 0 PWL(
+ 0.0005 1.04178
+ 0.001 0.772328
+ 0.0015 -0.276687
+ 0.002 -0.314243
+ 0.0025 0.412586
+ 0.003 -0.619019
+ 0.0035 1.81929
.....
+ 0.9995 -0.432622
+ 1 -0.0988927
+ 1.0005 -0.726563
+ )
===========PWL_Noise_Tests=========================
Circuit: PWL_Noise_1VRMS_@1KHz
Warning: Source 'vpwlt' has no DC value specified, transient time=0s value used.
Here are the vectors currently active:
Title: PWL_Noise_1VRMS_@1KHz
Name: spect20 (Spectrum)
Date: Mon Jan 18 13:11:09 2010
frequency : frequency, real, 10000 long [default scale]
v(out) : voltage, complex, 10000 long
INPUT RMS = 1.09874
===========Copy_Paste_Text_Below_And_Simulate=========
PWL_Noise_1VRMS_@1KHz
* www.idea2ic.com
* dsauersanjose@aol.com 1/17/10 replace(OPT-SPACE)=>SPACE
* OUT Rload
* _____/\ __ need to have a file called
* _|_ \/ | "rndsrc" in the "MacSpice"
* / \ | folder inside "Doucments"
* /VpwlT\ |
* \ / _|_ First typing in a MacSpice
* \___/ /// window "rndsrc .5m 1"
* | Gnd
* _|_ Then run this file
* ///
* Gnd
* timestep = .5m means 1KHz bandwidth
* duration = 1 means 1Hz resolution
* type into a MacSpice window => "rndsrc .5m 1"
* it will generate PWL_File.inc in this format..
* VpwlT OUT 0 PWL( + 0.0005 0.988835 +.....
*===========Circuit_Netlist=========================
.include PWL_File.inc
Rload OUT 0 1k
*TRAN TSTEP TSTOP TSTART TMAX ?UIC?
.tran .05m 1 0 .05m UIC
*===========Run_Transient=========================
.control
run
plot OUT ylimit -3 +3
*===========Find_Spectrum=========================
linearize
set specwindow = "rectangular"
*SPEC FSTART FSTOP FSTEP VECTOR
spec 1 10k 1 v(OUT)
display
*===========Find_Spectrum_RMS=========================
let i = 0
let vpwr = 0
repeat 1000
let i = i +1
let tr = 0
let vpwr = vpwr + mag(OUT[i])* mag(OUT[i])
end
let vrms = sqrt(vpwr)
echo INPUT RMS = $&vrms
*===========View_Spectrum=========================
let vperHz = vrms/sqrt(1000)
set pensize = 2
plot mag(v(OUT)) vperHz loglog
.endc
.end
===========One_F_Noise_Shape====================
===========Copy_Paste_Text_Below_And_Simulate=========
ONE_F_Noise_Shape
* dsauersanjose@aol.com 1/18/10
* www.idea2ic.com replace(OPT-SPACE)=>SPACE
*
* ___ V1H V2H V3H V4H ___
* |VIN|__/\ /\ /\______/\ /\ /\______/\ /\ /\______/\ /\ /\______| |
* |___| \/ \/ | \/ \/ | \/ \/ | \/ \/ | |___|
* _|_ R1H _|_ R2H _|_ R3H _|_ R4H _|_
* /_ \ C1 ___ C2 ___ C3 ___ C4 ___
* // \ \ | | | |
* \ \// _/\ /\ /\_| _/\ /\ /\_| _/\ /\ /\_| _/\ /\ /\_|
* \___/ | \/ \/ V1L | \/ \/ V2L | \/ \/ V3L | \/ \/ V4L
* _|_ _|_ R1L _|_ R2L _|_ R3L _|_ 41L
* /// /// /// /// ///
*
.OPTIONS GMIN=1e-15 METHOD=trap ABSTOL=1e-15 srcsteps = 1 gminsteps = 1
*======== ====== ====== ====== ====== ====== ====== ====== ====== ======
VIN VIN 0 DC 0 AC 1
R1H VIN V1H 10k
C1 V1H V1L 10u
R1L V1L 0 10k
R2H V1H V2H 10k
C2 V2H V2L 1u
R2L V2L 0 10k
R3H V2H V3H 10k
C3 V3H V3L .1u
R3L V3L 0 10k
R4H V3H V4H 10k
C4 V4H V4L .01u
R4L V4L 0 10k
*=========Run_Sim=======================================================
.control
run
*AC DECLin NUMDEC FSTART FSTOP
ac dec 30 .01 100k
plot db(v1h) db(v2h) db(v3h) db(v4h)
.endc
.end
===========One_F_Noise_PWL========================
===========Copy_Paste_Text_Below_And_Simulate=========
ONE_F_Noise_PWL
* dsauersanjose@aol.com 1/18/10
* www.idea2ic.com replace(OPT-SPACE)=>SPACE
*
* ___ V1H V2H V3H V4H ___
* |OUT|__/\ /\ /\______/\ /\ /\______/\ /\ /\______/\ /\ /\______| |
* |___| \/ \/ | \/ \/ | \/ \/ | \/ \/ | |___|
* _|_ R1H _|_ R2H _|_ R3H _|_ R4H _|_
* /_ \ C1 ___ C2 ___ C3 ___ C4 ___
* // \ \ | | | |
* \ \// _/\ /\ /\_| _/\ /\ /\_| _/\ /\ /\_| _/\ /\ /\_|
* \___/ | \/ \/ V1L | \/ \/ V2L | \/ \/ V3L | \/ \/ V4L
* _|_ _|_ R1L _|_ R2L _|_ R3L _|_ 41L
* /// /// /// /// ///
*
* VpwlT OUT 0 PWL( + 0.0005 0.988835 +.....
.OPTIONS GMIN=1e-15 METHOD=trap ABSTOL=1e-15 srcsteps = 1 gminsteps = 1
*======== ====== ====== ====== ====== ====== ====== ====== ====== ======
.include PWL_File.inc
R1H OUT V1H 10k
C1 V1H V1L 10u
R1L V1L 0 10k
R2H V1H V2H 10k
C2 V2H V2L 1u
R2L V2L 0 10k
R3H V2H V3H 10k
C3 V3H V3L .1u
R3L V3L 0 10k
R4H V3H V4H 10k
C4 V4H V4L .01u
R4L V4L 0 10k
*TRAN TSTEP TSTOP TSTART TMAX ?UIC?
.tran .05m 1 0 .05m UIC
*=========Run_Sim=======================================================
.control
run
plot v4h
*=========Find_Spectrum=========================
linearize
set specwindow = "rectangular"
*SPEC FSTART FSTOP FSTEP VECTOR
spec 1 10k 1 v(v4h)
display
plot mag(v(v4h)) loglog ylimit .001 .1
.endc
.end
===========CMOS_Delay_vs_VCC================
n = 1 out_rise = 3.18366E-10 ref = 0 delay = 3.18366E-10
n = 2 out_fall = 5.24173E-09 ref = 4E-09 delay = 1.24173E-09
n = 3 out_rise = 9.111E-09 ref = 8E-09 delay = 1.111E-09
n = 4 out_fall = 1.31712E-08 ref = 1.2E-08 delay = 1.17118E-09
n = 5 out_rise = 1.70892E-08 ref = 1.6E-08 delay = 1.08922E-09
n = 6 out_fall = 2.11208E-08 ref = 2E-08 delay = 1.12083E-09
n = 7 out_rise = 2.50105E-08 ref = 2.4E-08 delay = 1.01051E-09
n = 8 out_fall = 2.90805E-08 ref = 2.8E-08 delay = 1.08052E-09
n = 9 out_rise = 3.29686E-08 ref = 3.2E-08 delay = 9.68584E-10
n = 10 out_fall = 3.70402E-08 ref = 3.6E-08 delay = 1.04022E-09
n = 11 out_rise = 4.09382E-08 ref = 4E-08 delay = 9.38156E-10
n = 12 out_fall = 4.49999E-08 ref = 4.4E-08 delay = 9.99948E-10
n = 13 out_rise = 4.89025E-08 ref = 4.8E-08 delay = 9.02517E-10
n = 14 out_fall = 5.29697E-08 ref = 5.2E-08 delay = 9.6969E-10
n = 15 out_rise = 5.69321E-08 ref = 5.6E-08 delay = 9.3212E-10
n = 16 out_fall = 6.09381E-08 ref = 6E-08 delay = 9.3812E-10
n = 17 out_rise = 6.49021E-08 ref = 6.4E-08 delay = 9.0212E-10
n = 18 out_fall = 6.89181E-08 ref = 6.8E-08 delay = 9.1812E-10
n = 19 out_rise = 7.28311E-08 ref = 7.2E-08 delay = 8.31067E-10
n = 20 out_fall = 7.68981E-08 ref = 7.6E-08 delay = 8.9812E-10
n = 21 out_rise = 8.08588E-08 ref = 8E-08 delay = 8.58754E-10
n = 22 out_fall = 8.48681E-08 ref = 8.4E-08 delay = 8.6812E-10
n = 23 out_rise = 8.88383E-08 ref = 8.8E-08 delay = 8.3833E-10
n = 24 out_fall = 9.28581E-08 ref = 9.2E-08 delay = 8.5812E-10
n = 25 out_rise = 9.67713E-08 ref = 9.6E-08 delay = 7.71272E-10
===========Copy_Paste_Text_Below_And_Simulate=========
CMOS_Delay_vs_VCC
* XINVR1 XINVR2 ___ XINVR3 XINVR4 XINVR5 XINVR6
* ___ |\ ___ |\ ___ /_ \ ___ |\ ___ |\ ___ |\ ___ |\ ___
* |VIN|_| \/\_|VR2|_| \/\_|VR3|_// \ \_|R3B|_| \/\_|VR4|_| \/\_|VR5|_| \/\_|VR6|_| \/\_|VR7|
* |___| | /\/ |___| | /\/ |___| \ \// |___| | /\/ |___| | /\/ |___| | /\/ |___| | /\/ |___|
* | |/ |/ \___/ |/ |/ |/ |/
* _|_ VN
* /_ \ _|_
* // \ \ /VCC\
* \ \// \___/ replace(OPT-SPACE)=>SPACE
* \___/ _|_
* _|_ /// 1.18.10_6.42PM dsauersanjose@aol.com www.idea2ic.com
* ///
.OPTIONS GMIN=1e-18 METHOD=traps
VCC VCC 0 PWL ( 0 3 100n 5 ) DC 2
VCLK VCLK 0 DC 0 PULSE( 0 1 1p 6p 6p 4n 8n )
BIN VIN 0 V = V(VCC)*u( V(VCLK)-.5)
XINVR1 VIN VR2 VCC INV_R
XINVR2 VR2 VR3 VCC INV_R
XINVR3 VR3 VR4 VCC INV_R
XINVR4 VR4 VR5 VCC INV_R
XINVR5 VR5 VR6 VCC INV_R
XINVR6 VR6 VR7 VCC INV_R
BOUT OUT 0 V = 2*u( V(VR7)-V(VCC)/2) -1
*TRAN TSTEP TSTOP TSTART TMAX ?UIC?
.tran 10p 100n 0 10p UIC
*=========Run_Sim============================================
.control
run
set pensize = 2
plot vin vr7 out-2.5
display
*=========Create_Arrays============================================
compose vplus start = 0 stop = 24 step =1
compose delay start = 0 stop = 24 step =1
let i = 0
let tr = 0
let td = 0
let n = 0
*=========Find_Rise_And_Fall_Points============================================
repeat 10300
let i = i +1
let t = time[i-1]
if ((tr + 4e-9 )< t)
let tr = tr + 4e-9
end
if ( out[i] > 0 & out[i+1] < 0)
let td = t - tr
let vplus[n]= vcc[i]
let delay[n]= td
let n = n +1
echo n= $&n out_fall= $&t ref= $&tr delay= $&td
end
if ( out[i] < 0 & out[i+1] > 0)
let td = t - tr
let vplus[n]= vcc[i]
let delay[n]= td
let n = n +1
echo n= $&n out_rise= $&t ref= $&tr delay= $&td
end
end
*=========View_Delay_VS_VCC============================================
let delay[0]= delay[1]
plot delay vs vplus
.endc
*=========The_Inverter_SubCircuit============================================
*
* ^
* INV_R /_\ VCC
* |
* <- 1200ps at 6 stages at 3V
* ||___ 700ps at 6 stages at 5V
* __||
* ___ | ||_ MP1
* |VIN|__| | ___ 2V overdrive at VCC = 3V
* |___| | |__|VOUT 4V overdrive at VCC = 5V
* | _| |___|
* |__||
* ||___ MN1
* ||->
* _|_
* ///
*
.SUBCKT INV_R IN OUT VCC
MN1 OUT IN 0 0 NMOSC W=1u L=1u
MP1 OUT IN VCC VCC PMOSC W=3u L=1u
C1 OUT 0 6f
.ENDS INV_R
*==================The_CMOS_Model_Files==================================
.model NMOSC NMOS(
+ Level= 8 Tnom=27.0
*------------------Process-----------------------------------------------
+ tox=160e-10 xj=0.25e-06 nch=0.5e+17
*------------------V_threshold-------------------------------------------
+ vth0=0.72 nlx=0.12e-06
*------------------Bulk--------------------------------------------------
+ k1=1.04 k2=-1.209E-01
+ cdsc=-2.4E-4 cdscd=-1.506E-04 cdscb=-2.219E-04
*------------------mobility----------------------------------------------
+ u0=678 ua=8.964e-10
+ ub=1.472e-18 uc=-4.441E-17 vsat=86000
*------------------Subthresshold-----------------------------------------
+ nfactor=1.8
+ cit=-5.0E-04 voff=-7.862E-02
+ eta0=4.441e-16 etab=-2.E-01 dsub=0.7
*------------------Hot electrons-----------------------------------------
* alpha0=1.61e-05 beta0=36.68
*------------------VAF---------------------------------------------------
+ lint=.12e-06 pclm=.19 pscbe1=3.79e+08 pscbe2=9.4e-05
+ delta=0.01655 pvag=0.4484
*------------------Bulk_diode--------------------------------------------
+ js=5.858e-08
*------------------Resistance--------------------------------------------
+ rsh=70 rdsw=375
+ wr=0.7586 prwb=0 prwg=-4.441E-17
*------------------Capacitance-------------------------------------------
+ cj=0.0002424 cjsw=2.73e-10 mj=0.3551 mjsw=0.3873
+ cgso=9e-13 cgdo=9e-13 cgbo=7e-10
+ pb=0.5614 pbsw=0.8 xpart=0
+ dlc=5e-08 dwc=1.5e-07
*------------------BulkChargeEffect--------------------------------------
* a0=0.7 a1=0 a2=1 ags=0.05583
* b0=6.305e-08 b1=6.579e-08 keta=-1.531E-02
*------------------ShortChannel------------------------------------------
+ dvt0=2.2 dvt1=0.53 dvt2=-1.521E-01 drout=0.76
+ pdiblcb=.4 pdiblc1=0.00886 pdiblc2=0.00029
*------------------NarrowChannel-----------------------------------------
+ w0=2.6e-04 wint=0.16e-06
+ ww=-9.525E-14 wwn=1.0
+ dvt0w=0 dvt1w=5.3e6 dvt2w=-1.E-01
+ k3=2.53 k3b=-5 dwg=0 dwb=0
*------------------Noise-------------------------------------------------
* af=1 kf=1e-28 ef=0.95
*------------------Temperature-------------------------------------------
* pvsat=0 ute=-1.258E+00 kt1=-3.85E-01
* kt1l=0 kt2=-3.098E-02 ua1=5.705e-09
* ub1=-1.147E-17 uc1=-1.302E-01 at=20380
* prt=-3.287E+02 lk1=0 lk2=0
* lvsat=0 la0=0 lags=0 lute=0
+ luc=0 )
.model PMOSC PMOS(
+ Level= 8 Tnom=27.0
*------------------Process-----------------------------------------------
+ tox=1.725e-08 xj=2e-07 nch=1e+17
*------------------V_threshold-------------------------------------------
+ vth0=-0.90 nlx=1.84e-08
*------------------Bulk--------------------------------------------------
+ k1=0.3969 k2=0.03536
*------------------mobility----------------------------------------------
+ u0=268 ua=4.124e-09
* ub=-3.8E-19 uc=-1.512E-02 vsat=140000
*------------------Subthresshold-----------------------------------------
+ nfactor=.5016
* cit=0.0001 voff=-0.08 nfactor=1.0016 vth0=-0.94
* eta0=0.038 etab=-1.057E-02 dsub=0.3501
*------------------Hot electrons-----------------------------------------
+ alpha0=2.5e-08 beta0=28.92
*------------------VAF---------------------------------------------------
+ lint=.1e-06 pclm=3.2 pscbe1=5e+08 pscbe2=1e-05
* delta=0.009 pvag=4
*------------------Bulk_diode--------------------------------------------
+ js=3.95e-08
*------------------Resistance--------------------------------------------
+ rsh=135 rdsw=2500
* prwg=-7.2E-02 prwb=0.06 wr=0.8625
*------------------Capacitance-------------------------------------------
+ cj=0.0002424 cjsw=2.73e-10 mj=0.3551 mjsw=0.3873
+ cgso=9e-13 cgdo=9e-13 cgbo=7e-10
* cdsc=-2.4E-4 cdscd=-1.506E-01 cdscb=-2.219E-04
* pb=0.85 pbsw=0.88 xpart=0
* dlc=5e-08 dwc=1.5e-07
*------------------BulkChargeEffect--------------------------------------
* a0=1 a1=0 a2=2 ags=0.268
* b0=5e-07 b1=1e-07 keta=-1.0E-02
*------------------ShortChannel------------------------------------------
* dvt0=2.9 dvt1=0.2 dvt2=-1.521E-01 drout=0.175
* pdiblcb=0 pdiblc1- pdiblc2=0.001
*------------------NarrowChannel-----------------------------------------
+ w0=2.6e-04 wint=0.16e-06
+ ww=-3.1E-19 wwn=1.9
* dvt0w=0.68 dvt1w=5.3e6 dvt2w=0.051
* k3=56 k3b=-3 dwg=0 dwb=1e-08
*------------------Noise-------------------------------------------------
+ af=0.8 kf=1.50e-30 ef=0.95
*------------------Temperature-------------------------------------------
* ldelta=0.02282 lpdiblc1=0.01877 ute=-1.500E+00
* cgsl=1.5e-10 cgdl=1.5e-10 ckappa=0.2463 cf=0
* kt1=-4.684E-01 kt1l=-2.0E-08 kt2=-2.818E-02
* ua1=-2.E-10 ub1=-4.5E-18 uc1=-2.000E-02
+ at=-1.5E+05 prt=1400 )
.end
===========PulseWidthMod_Balanced==================
===========Copy_Paste_Text_Below_And_Simulate=========
PWM_Balanced
* dsauersanjose@aol.com 1/18/10
* www.idea2ic.com replace(OPT-SPACE)=>SPACE
*
*
* Vtime ^ OUT
* ____ /_\
* VT _|_ | _|_
* /_ \ | /_ \
* // \ \ |_// \ \
* \ \// \ \//
* \___/ \___/ B1
* | |
* _|_ _|_
* /// ///
*
VP VP 0 DC 3.141592653589793
VT VT 0 PWL ( 0 0 1 1 )
B1 TRI 0 V = acos(cos(v(VP)*20*v(VT))) - v(VP)/2
B2 OUT 0 V = 2*u( v(TRI)+.5*cos(v(VP)*1*v(VT))) -1
*TRAN TSTEP TSTOP TSTART TMAX ?UIC?
.tran .1m 1 0 .1m
*=========Run_Sim============================================
.control
run
set pensize = 2
plot v(tri) v(out)
.endc
.end
===========PulseWidthMod_Sync===================
===========Copy_Paste_Text_Below_And_Simulate=========
PWM_Sync
* dsauersanjose@aol.com 1/18/10
* www.idea2ic.com replace(OPT-SPACE)=>SPACE
*
*
* Vtime ^ OUT
* ____ /_\
* VT _|_ | _|_
* /_ \ | /_ \
* // \ \ |_// \ \
* \ \// \ \//
* \___/ \___/ B1
* | |
* _|_ _|_
* /// ///
*
VP VP 0 DC 3.141592653589793
VT VT 0 PWL ( 0 0 1 1 )
B1 SAW 0 V = atan(tan(v(VP)*20*v(VT)+v(VP)/4))
B2 OUT 0 V = 2*u( v(SAW)+.6*cos(v(VP)*1*v(VT))) -1
*TRAN TSTEP TSTOP TSTART TMAX ?UIC?
.tran .1m 1 0 .1m
*=========Run_Sim============================================
.control
run
set pensize = 2
plot v(saw) v(out)
.endc
.end
===========Ring_At_StartUp========================
===========Copy_Paste_Text_Below_And_Simulate=========
Ring_At_StartUp
* ___ ___
* XL = XC = 1 Ohms @1Hz __________|LP | __________|BP |
* | |___| | |___|
* _ _ _ | | _ _ _
* VIN / \/ \/ \ | R1 VIN R2 | / \/ \/ \
* ____| () () |__|_/\ /\ /\_ ___/\ /\ /\__|_| () () |_
* _|__ | \/ \/ _|_ _|__ \/ \/ | L2 _|_
* /_ \ L1 _|_ /// /_ \ _|_ ///
* // \ \ ___ C2 // \ \ ___ C2
* \ \_// | \ \_// |
* \____/ _|_ \____/ _|_
* _|_ /// _|_ ///
* /// ///
* H(s) = 1/(s^2 +s*w0/Q + w0^2) dsauersanjose@aol.com 4/15/08
.OPTIONS GMIN=1e-15 METHOD=gear ABSTOL=1e-15 TEMP=27 srcsteps = 1 gminsteps = 1
*======== ====== ====== ====== ====== ====== ====== ====== ======
VIN VIN 0 DC 0V PWL(0 1 2 1 2.1 0) AC 1V
R2 VIN BP 10
L2 BP 0 .159 IC= 0
C2 BP 0 .159 IC= 1
*TRAN TSTEP TSTOP TSTART TMAX ?UIC?
.tran 1 20 0 1 UIC
*=========Run_Sim============================================
.control
run
plot bp title Settle_Time_Q_10
.endc
.end
===========Transfer_Function========================
===========Copy_Paste_Text_Below_And_Simulate=========
Transfer_Function
* dsauersanjose@aol.com 4/15/08
* www.idea2ic.com ^ VC
* /_\
* |
* __/\ /\ /\_|__/\ /\ /\__
* | \/ \/ \/ \/ |
* | R1 R2 |
* VBN1 _|VCN1 VCN2 |_
* _____________|'QN1 QN2`|__
* VIN| |`->1X 1X<-'| |
* | |VEN1 | |
* | |____________________________| _|_
* _|_ _|_ VEN1 ///
* /AC1\ / _ \1I
* \___/ \/ \/
* | /\_/\ replace(OPT-SPACE)=>SPACE
* _|_ \___/
* /// _|_
* ///
*
.OPTIONS GMIN=1e-18 METHOD=trap srcsteps = 1 gminsteps = 1
*======== ====== ====== ====== ====== ====== ====== ====== ======
VCC VC 0 DC 10
VIN VIN 0 DC 0
I1 VEN1 0 1u
QN1 VCN1 VIN VEN1 NPN1 1.00
QN2 VCN2 0 VEN1 NPN1 1.00
R1 VCN1 VC 52K
R2 VCN2 VC 52K
*=========Run_Sim============================================
.control
*DC SOURC1 VSTART VSTOP VSTEP SOURC2 START2 STOP2 STEP2
dc vin -.3 .3 1m
plot VCN1 -VCN2
.endc
*======== ====== ====== ====== ====== ====== ====== ====== ======
.model NPN1 NPN( BF=2100 VAF=216 )
.model PNP1 PNP( BF=2100 VAF=21)
.end
===========Find_RC_3dB========================
Circuit: Find_RC_3dB
Here are the vectors currently active:
Title: Find_RC_3dB
Name: ac30 (AC Analysis)
Date: Mon Jan 18 19:01:43 2010
frequency : frequency, real, 41 long, grid = xlog [default scale]
in : voltage, complex, 41 long
out : voltage, complex, 41 long
vin#branch : current, complex, 41 long
3dB point = 158.489 Hz
===========Copy_Paste_Text_Below_And_Simulate=========
Find_RC_3dB
* dsauersanjose@aol.com 4/15/08
* www.idea2ic.com replace(OPT-SPACE)=>SPACE
*
* R1
* VIN ___
* _____/\ /\ /\________|OUT|
* | \/ \/ | |___|
* _|__ |
* /_ \ _|_
* // \ \ ___ C1 Find 3dB freq
* \ \_// |
* \____/ _|_
* _|_ ///
* ///
*
.OPTIONS GMIN=1e-15 METHOD=gear ABSTOL=1e-15 temp=27
*======== ====== ====== ====== ====== ====== ====== ====== ======
VIN IN 0 DC 0V AC 1V
R1 IN OUT 1k
C1 OUT 0 1u
*=========Run_Sim============================================
.control
run
*AC DECLin NUMDEC FSTART FSTOP
ac dec 10 1 10khz
plot db(v(out)) ylimit -3 0 title Find_R_C_3dB
display
*=========Find_3dB_Point============================================
let n = 0
let f = 0
repeat 39
let n = n+1
if ( db( out[n]) >-3)
let f = mag(frequency[n])
endif
endrepeat
*=========Print_Out_Results=========================================
echo "3dB point = $&f Hz"
.endc
.end
===========One_Line_Logic========================
===========Copy_Paste_Text_Below_And_Simulate=========
One_Line_Logic
* dsauersanjose@aol.com 4/15/08
* www.idea2ic.com replace(OPT-SPACE)=>SPACE
*=========Input_Signal============================================
VT Vtime 0 PWL ( 0 0 1 1 )
B1 A 0 V = u(sin(3.142*50*v(Vtime))) -.03
B2 B 0 V = u(sin(3.142*33*v(Vtime))) -.06
*=========Logic============================================
BAND VAND 0 V = u( v(A)*v(B)-.1) -2.03
BOR VOR 0 V = u( v(A)+v(B)-.1) -2.13
BNOT VNOT 0 V = u(.9-v(B)) -2.26
BXOR VXOR 0 V = u( v(A)*(.9-v(B)) + v(B)*(.9-v(A))-.1) -2.39
BNAND VNAND 0 V = 1- u(v(A)*v(B)-.1) -2.42
BNOR VNOR 0 V = 1- u(v(A)+v(B)-.1) -2.55
*=========Run_Sim============================================
.control
set pensize = 2
*TRAN TSTEP TSTOP TSTART TMAX ?UIC?
tran .1m .1 0 .1m
plot v(a) v(b) v(vand) v(vor) v(vnot) v(vxor) v(vnand) v(vnor)
.endc
.end
===========Binary_Decoder========================
===========Copy_Paste_Text_Below_And_Simulate=========
Binary_Decoder
* dsauersanjose@aol.com 1/18/20s
* www.idea2ic.com replace(OPT-SPACE)=>SPACE
*=========Input_Signal============================================
VT Vtime 0 PWL ( 0 0 1 1 )
B0 A 0 V = u(-1*sin( 3.142*20*v(Vtime)+1u))-.03
B1 B 0 V = u(-1*sin( 3.142*40*v(Vtime)+1u))-.06
B2 C 0 V = u(-1*sin( 3.142*80*v(Vtime)+1u))-.09
B3 D 0 V = u(-1*sin(3.142*160*v(Vtime)+1u))-.11
*=========Logic============================================
B0110 V0110 0 V = 0.3*u((.9-v(A))*(V(B))*(V(C))*(.9-V(D)) -.1) -.55
B1010 V1010 0 V = 0.3*u((v(A))*(.9-V(B))*(V(C))*(.9-V(D)) -.1) -.65
*=========Run_Sim============================================
.control
set pensize = 2
*TRAN TSTEP TSTOP TSTART TMAX ?UIC?
tran .1m .1 0 .1m
plot v(a) v(b) v(c) v(d) v(v1010) v(v0110)
.endc
.end
===========D_FlipFlop========================
===========Copy_Paste_Text_Below_And_Simulate=========
D_FlipFlop
* dsauersanjose@aol.com 1/18/20s
* www.idea2ic.com replace(OPT-SPACE)=>SPACE
.OPTIONS GMIN=1p METHOD=gear ABSTOL=1u TEMP=27 srcsteps = 1 gminsteps = 1
.OPTIONS RELTOL=.001 ABSTOL=1n VNTOL=1n ITL4=500 ITL1=400
*======== ====== ====== ====== ====== ====== ====== ====== ======
VT Vtime 0 PWL ( 0 0 1 1 )
B1 CLK 0 V = u(sin(3.142*100*v(Vtime))-.95)-.03
B2 D 0 V = u(sin(3.142*50*v(Vtime)))-.06
XD_FF D CLK OUT D_FF
.control
set pensize = 2
tran .1m .1 0 .1m
plot v(clk) v(d) V(out)
.endc
*======== ====== ====== ====== ====== ====== ====== ====== ======
.SUBCKT D_FF D CLK Q
B5 E 0 V = u( v(CLK)*v(D) -.5) -u( (.9-v(D))*v(CLK)-.5)
D1 E F DD
D2 F E DD
C1 F 0 1p
B6 Q 0 V = .5*u( v(F ))
.ends
* _______
* ____| D Q |__
* | |
* ____|>CLK |
* |_______|
*
* E _______________
* ___ | D1 _|_ _|_D2 _______
* |D |_____|_ \ / ^ _|_ | ___
* |___| /_ \ _v_ /_\ F /_ \ |_|Q |
* // \ \ |_____|_____// \ \ |___|
* ___ \ \// _|_ \ \//
* |CLK|___\___/ ___ C1 \___/
* |___| _|_ _|_ _|_
* /// /// ///
*
*
.model DD D(IS=3.15e-18)
.end
===========Noise_Voltage_Curves=================
===========Copy_Paste_Text_Below_And_Simulate=========
LM394_Noise
* dsauersanjose@aol.com 1/18/20s
* www.idea2ic.com replace(OPT-SPACE)=>SPACE
* _______
* _|_ _|_
* /// / _ \
* \/ \/ I1
* /\_/\
* \___/
* _______|
* | _|
* |____|'
* VB |`->
* _|_ VE
* /VIN\
* \___/
* _|_
* ///
*
*
*=========Input_Circuit============================================
vin VE 0 DC 0.0 ac 1.0u
I1 0 VB 1uA
q1 VB VB VE LM394
.model LM394 npn kf=.3e-16 af=.75 bf=600 rb=50
*=========Run_Sim============================================
.control
setplot new
let "V1u" = 0*vector(41)
let "V10u" = 0*vector(41)
let "V100u" = 0*vector(41)
let "V1000u" = 0*vector(41)
*=========Noise_at_1uA============================================
op
*noise v(out) vin decLin points Fstart Fstop [PPS]
noise v(vb) vin dec 10 10 100k 1
destroy
let unknown.V1u = sqrt(v(onoise_spectrum))
*=========Noise_at_10uA============================================
alter I1 dc = 10u
op
noise v(vb) vin dec 10 10 100k 1
destroy
let unknown.V10u = sqrt(v(onoise_spectrum))
*=========Noise_at_100uA============================================
alter I1 dc = 100u
op
noise v(vb) vin dec 10 10 100k 1
destroy
let unknown.V100u = sqrt(v(onoise_spectrum))
*=========Noise_at_1000uA============================================
alter I1 dc = 1000u
op
noise v(vb) vin dec 10 10 100k 1
destroy
let unknown.V1000u = sqrt(v(onoise_spectrum))
*=========Plot_Output============================================
set pensize = 2
plot unknown.V1u unknown.V10u unknown.V100u unknown.V1000u vs frequency loglog title LM394NoiseVoltage
echo " ... done."
.endcontrol
.end
===========Noise_Current_Curves=================
===========Copy_Paste_Text_Below_And_Simulate=========
BJT Noise Current Test
* dsauersanjose@aol.com 1/18/20s
* www.idea2ic.com replace(OPT-SPACE)=>SPACE
* _______
* _|_ _|_
* /// / _ \
* \/ \/ I1
* /\_/\
* R1 \___/
* _/\ __|
* | \/ _|
* |____|'
* VB |`->
* _|_ VE
* /VIN\
* \___/
* _|_
* ///
*===================Input_Circuit============================================
vin VE 0 DC 0.0 ac 1.0u
I1 0 VC 1uA
R1 VC VB 1000k
q1 VC VB VE LM394
.model LM394 npn kf=.3e-16 af=.75 bf=600 rb=50
*===================Run_Sim============================================
.control
setplot new
let "V1u" = 0*vector(41)
let "V10u" = 0*vector(41)
let "V100u" = 0*vector(41)
let "V1000u" = 0*vector(41)
*===================Noise_at_1uA============================================
op
*display
*noise v(out) vin decLin points Fstart Fstop [PPS]
noise v(vc) vin dec 10 10 100k 1
destroy
let unknown.V1u = sqrt(v(onoise_spectrum))*1u
*===================Noise_at_10uA============================================
alter I1 dc = 10u
op
*noise v(out) vin decLin points Fstart Fstop [PPS]
noise v(vc) vin dec 10 10 100k 1
destroy
let unknown.V10u = sqrt(v(onoise_spectrum))*1u
*===================Noise_at_100uA============================================
alter I1 dc = 100u
op
*noise v(out) vin decLin points Fstart Fstop [PPS]
noise v(vc) vin dec 10 10 100k 1
destroy
let unknown.V100u = sqrt(v(onoise_spectrum))*1u
*===================Noise_at_1000uA============================================
alter I1 dc = 1000u
op
*noise v(out) vin decLin points Fstart Fstop [PPS]
noise v(vc) vin dec 10 10 100k 1
destroy
let unknown.V1000u = sqrt(v(onoise_spectrum))*1u
*===================Plot_Noise============================================
set pensize = 2
plot unknown.V1u unknown.V10u unknown.V100u unknown.V1000u vs frequency loglog title LM394NoiseCurrent
echo "... done."
.endcontrol
.end
===========NMOS_Noise_Curves=================
===========Copy_Paste_Text_Below_And_Simulate=========
NMOS Noise Voltage Test
* dsauersanjose@aol.com 1/20/10
* www.idea2ic.com replace(OPT-SPACE)=>SPACE
* _______
* _|_ _|_ Tox = 160Angs
* /// / _ \
* \/ \/ I1
* /\_/\ Glass is 10e10 to 10E14 Ohms-m
* \___/ 10Ee10*160E-10/(.8e-6*40e-6) = 5e12 Ohms to 5e16 Ohms
* _______| At Vtox = 1V expect .5pA to .05fA
* | _|
* |____|| .5pA = 3,125,000 electrons/sec
* VG ||-> .05fA = 32.5 electrons/sec
* _|_ VS
* /VIN\
* \___/ 1 electron @ 40fF = 4uV
* _|_
* ///
*
*===================Input_Circuit============================================
vin VS 0 DC 0.0 ac 1.0u
I1 0 VG 10uA
m1 VG VG VS 0 N1 W=40u L=.8u
*===================Run_Sim============================================
.control
setplot new
let "V10u" = 0*vector(61)
let "V100u" = 0*vector(61)
let "V1000u" = 0*vector(61)
*===================Noise_at_10uA============================================
op
*noise v(out) vin decLin points Fstart Fstop [PPS]
noise v(vg) vin dec 10 1 1000k 1
destroy
let unknown.V10u = sqrt(v(onoise_spectrum))
*===================Noise_at_100uA============================================
alter I1 dc = 100u
op
*noise v(out) vin decLin points Fstart Fstop [PPS]
noise v(vg) vin dec 10 1 1000k 1
destroy
let unknown.V100u = sqrt(v(onoise_spectrum))
*===================Noise_at_1000uA============================================
alter I1 dc = 1000u
op
*noise v(out) vin decLin points Fstart Fstop [PPS]
noise v(vg) vin dec 10 1 1000k 1
destroy
let unknown.V1000u = sqrt(v(onoise_spectrum))
*===================Plot_Noise_============================================
set pensize = 2
plot unknown.V10u unknown.V100u unknown.V1000u vs frequency loglog title NMOSNoiseVoltage
echo "... done."
.endcontrol
.model N1 NMOS
+ Level= 8 Tnom=27.0
*------------------Process-----------------------------------------------
+ tox=160e-10 xj=0.25e-06 nch=0.5e+17
*------------------V_threshold-------------------------------------------
+ vth0=0.72 nlx=0.12e-06
*------------------Bulk--------------------------------------------------
+ k1=1.04 k2=-1.209E-01
+ cdsc=-2.4E-4 cdscd=-1.506E-04 cdscb=-2.219E-04
*------------------mobility----------------------------------------------
+ u0=678 ua=8.964e-10
+ ub=1.472e-18 uc=-4.441E-17 vsat=86000
*------------------Subthresshold-----------------------------------------
+ nfactor=1.8
+ cit=-5.0E-04 voff=-7.862E-02
+ eta0=4.441e-16 etab=-2.E-01 dsub=0.7
*------------------Hot electrons-----------------------------------------
+ alpha0=1.61e-05 beta0=36.68
*------------------VAF---------------------------------------------------
+ lint=.12e-06 pclm=.19 pscbe1=3.79e+08 pscbe2=9.4e-05
+ delta=0.01655 pvag=0.4484
*------------------Bulk_diode--------------------------------------------
+ js=5.858e-08
*------------------Resistance--------------------------------------------
+ rsh=70 rdsw=375
+ wr=0.7586 prwb=0 prwg=-4.441E-17
*------------------Capacitance-------------------------------------------
+ cj=0.0002424 cjsw=2.73e-10 mj=0.3551 mjsw=0.3873
+ cgso=9e-13 cgdo=9e-13 cgbo=7e-10
+ pb=0.5614 pbsw=0.8 xpart=0
+ dlc=5e-08 dwc=1.5e-07
*------------------BulkChargeEffect--------------------------------------
+ a0=0.7 a1=0 a2=1 ags=0.05583
+ b0=6.305e-08 b1=6.579e-08 keta=-1.531E-02
*------------------ShortChannel------------------------------------------
+ dvt0=2.2 dvt1=0.53 dvt2=-1.521E-01 drout=0.76
+ pdiblcb=.4 pdiblc1=0.00886 pdiblc2=0.00029
*------------------NarrowChannel-----------------------------------------
+ w0=2.6e-04 wint=0.16e-06
+ ww=-9.525E-14 wwn=1.0
+ dvt0w=0 dvt1w=5.3e6 dvt2w=-1.E-01
+ k3=2.53 k3b=-5 dwg=0 dwb=0
*------------------Noise-------------------------------------------------
+ af=1 kf=5e-29 ef=0.95
*------------------Temperature-------------------------------------------
+ pvsat=0 ute=-1.258E+00 kt1=-3.85E-01
+ kt1l=0 kt2=-3.098E-02 ua1=5.705e-09
+ ub1=-1.147E-17 uc1=-1.302E-01 at=20380
* prt=-3.287E+02 lk1=0 lk2=0
+ lvsat=0 la0=0 lags=0 lute=0
+ luc=0
* SPICE MODEL ___
* __/\ ______|(D)| Drain
* CGD | \/ RD |___|
* 1.2fF _____________|__________
* _|_ _|_ _|_ _|_
* Gate ___ / _ \ I_ds ^ ___ CBD
* ___ | \/ \/ /_\ | 90fF <- (Caps for L/W .8u/40u)
* |(G)|__| /\_/\ | |_____| ___
* |___| |___ \___/ V ___| |_________| | Bulk
* | | | | _|_ _|_ 90fF |___|
* _|_ |__/|\___||_| \ / ___ _|_
* 1.2fF ___ |40fF|| _V_ | CBS \(B)/SUB=gnd!
* |_______|__________|_____| \ /
* CGS CGS | ___ V
* |__/\ ______|(S)|
* \/ RS |___| Source
*
* BiCMOS typical noise IDS =20uA @3V tox=160A
* Hz nV/rt_Hz nV/rt_Hz
* freq NMOS 40/.8 PMOS 40/.8
* 10 800 150
* 100 400 60
* 1000 150 30
* 10000 50 20
* 100000 10 15
.END
===========Ftau_Curves========================
15um^2 Ftau vs IE and TF
=>Ibias = Ftau@TF=1E-12
1E-05 9.9928E+08
0.0001 9.25452E+09
0.001 4.63825E+10
0.01 8.57078E+10
0.03 9.25452E+10
0.06 8.57078E+10
0.1 7.93756E+10
=>Ibias = Ftau@TF=2E-12
1E-05 9.9928E+08
0.0001 8.57078E+09
0.001 3.68429E+10
0.01 5.4078E+10
0.03 5.83921E+10
0.06 5.83921E+10
0.1 5.4078E+10
=>Ibias = Ftau@TF=4E-12
1E-05 9.9928E+08
0.0001 7.93756E+09
0.001 2.51008E+10
0.01 3.41209E+10
0.03 3.41209E+10
0.06 3.41209E+10
0.1 3.16E+10
Done.
===========Copy_Paste_Text_Below_And_Simulate=========
NPN_Ftau_15uu_TF
* dsauersanjose@aol.com 1/18/20s
* www.idea2ic.com replace(OPT-SPACE)=>SPACE
* ________
* | |
* | _|_
* |C /VCC\
* R1 _| \___/
* ____/\ /\ /\____|'QN1 |
* _|_ \/ \/ B |`-> _|_
* /// |E ///
* |
* _|_
* / _ \
* 1I \/ \/
* /\_/\
* \___/
* _|_
* ///
.OPTIONS GMIN=1e-15 METHOD=gear ABSTOL=1e-15 TEMP=27 srcsteps = 1 gminsteps = 1
VCC C 0 DC 5V
QN1 C B E NPNV
R1 0 B 1
I1 E 0 DC 100u AC .01u
.control
echo "15um^2 Ftau vs IE and TF"
setplot new
* ================Create_Arrays============
set NameList = ( TF_1p TF_2p TF_4p )
compose TfVals values 1p 2p 4p
compose IbiasVals values 10u 100u 1m 10m 30m 60m 100m
settype current IbiasVals
let NoOfTf = length(TfVals)
let NoOfIbias = length(IbiasVals)
begin
unset interrupt
* ================Loop_CJE============
let j = 1
while ( j <= NoOfTf )
let tf = TfVals[j-1]
altermod npnv tf = $&tf
echo "=>Ibias = Ftau@TF=$&tf"
set thisName = $NameList[$&j]
let $thisName = 0*vector(NoOfIbias)
* ================Loop_Ibias==============
let k = 1
while ( k <= NoOfIbias )
let Ibias = IbiasVals[k-1]
alter I1 dc = $&Ibias
alter I1 ac = .01u
ac dec 30 .0001GHz 100GHz
* ================Find_Ftau=============
let g = (-db(b) - 160)
let f = 3.16*mag(frequency[ sortorder( abs(g-10.0) )[0] ] )
echo "$&unknown.Ibias $&f"
let unknown.{$thisName}[unknown.k-1] = f
destroy
if ($?interrupt)
goto bail
endif
let k = k + 1
endwhile
let j = j + 1
endwhile
* ================Plot_Ftau=============
setscale IbiasVals
plot $NameList loglog title "15um^2 Ftau vs IE and TF"
label bail
echo "Done."
end
.endc
* ================Model_File=============
.MODEL NPNV NPN(
+ IS=10.15e-18 NF=1.0 BF=89 VAF=107 IKF=.4
+ NR=1.006 BR=0.4822 VAR=4.286 IKR=0.0002472
+ ISE=9.15E-17 NE=2
+ ISC=1E-21 NC=2
+ RB=12 RBM=3 IRB=.1
+ RE=2 RC=33
+ CJE=37e-15 VJE=0.75 MJE=0.35
+ CJC=45E-15 VJC=0.6399 MJC=0.3531
+ CJS=2.939E-15 VJS=0.3488 MJS=0.1813 XCJC=0.4201
+ TF=1e-12 XTF=1 VTF=1.5 ITF=.8
+ TR=5.9e-9 FC=0.5 PTF=30
+ KF=1.000E-16 AF=1
+ XTB=2 EG=1.11 XTI=5 TNOM=25 )
.end
=============THD_Curves========================
THD% versus VIN_vpk and Temp_C
1 -55 -55 minus55C
0.001 0.00589131
0.003 0.052947
0.01 0.579029
0.03 4.58812
0.1 22.6833
0.3 35.9754
Error: No such vector plus25C
2 25 25 plus25C
0.001 0.003154
0.003 0.0283646
0.01 0.312478
0.03 2.6185
0.1 16.8027
0.3 33.8248
Error: No such vector plus125C
3 125 125 plus125C
0.001 0.00176857
0.003 0.0159104
0.01 0.175934
0.03 1.51973
0.1 11.766
===========Copy_Paste_Text_Below_And_Simulate=========
DIFF_Thd_Temp
* dsauersanjose@aol.com 1/18/20
* www.idea2ic.com replace(OPT-SPACE)=>SPACE
* ^ VC
* /_\
* |
* __/\ /\ /\_|__/\ /\ /\__
* | \/ \/ \/ \/ |
* | R1 R2 |
* VBN1 _|VCN1 VCN2 |_
* ___|'QN1 QN2`|__
* VIN _|_ |`->1X 1X<-'| |
* ______ / \ |VEN1 | |
* |VAC1 |EGin | |____________________________| _|_
* _|_ _| | _|_ VEN1 ///
* /AC1\ | \___/ / _ \1I
* \___/ |___| \/ \/
* | _|_ /\_/\
* _|_ /// \___/
* /// _|_
* OUT ///
* _____/\ _____
* _|_ R33 \/1K _|_
* VCN1__ / \ /// www.idea2ic.com
* |Eg1 |E_GAIN1 dsauersanjose@aol.com 4/15/08
* VCN2__| |
* \___/
* _|_
* ///
*
.OPTIONS GMIN=1e-18 METHOD=trap srcsteps = 1 gminsteps = 1
*======== ====== ====== ====== ====== ====== ====== ====== ======
VCC VC 0 DC 10
VAC1 VIN 0 DC 0 SIN( 0 1 1000 )
I1 VEN1 0 1u
QN1 VCN1 VBN1 VEN1 NPN1 1.00
QN2 VCN2 0 VEN1 NPN1 1.00
R1 VCN1 VC 52K
R2 VCN2 VC 52K
E_GAIN1 OUT 0 VCN1 VCN2 1
E_GAININ VBN1 0 VIN 0 1m
* ===============Run_Sim============
.control
tran 25u 5m 0 1u
plot out
* ===============Set_Up_Arrays============
echo "THD% versus VIN_vpk and Temp_C"
setplot new
set NameList = ( minus55C plus25C plus125C )
compose TempVals values (-55) 25 125
compose VinVals values 1m 3m 10m 30m 100m 300m
settype voltage VinVals
let NoOfTemp = length(TempVals)
let NoOfVin = length(VinVals)
begin
unset interrupt
* ===============Loop_Temp============
let j = 1
while (j <= NoOfTemp )
let Tmp = TempVals[j-1]
set temp = $&Tmp
set thisName = $NameList[$&j]
let $thisName = 0 * vector(NoOfVin)
echo "$&j $&Tmp $temp $thisName "
* ===============Loop_Vin==============
let k = 1
while (k <= NoOfVin )
let Vin = VinVals[k-1]
alter e_gainin gain = $&Vin
tran 25u 5m 0 1u
* ===============Do_Spectrum==============
linearize
set specwindow= "blackman"
spec 200 8k 200 v(out)
* ===============Find_THD==============
let thdsq =mag(out[9])^2 +mag(out[14])^2 +mag(out[19])^2 +mag(out[24])^2
let thd_percent= 100*sqrt(thdsq)/mag(out[4])
echo "$&unknown.Vin $&thd_percent"
let unknown.{$thisName}[unknown.k-1] = thd_percent
repeat 3
destroy
end
if ($?interrupt)
goto bail
endif
let k = k + 1
endwhile
* ===============Plot_THD==============
setscale VinVals
set pensize = 2
plot $NameList loglog title "THD_% vs Vin_pK and Temp_C" xlimit .01 1 ylimit .01 100
let j = j + 1
endwhile
label bail
echo "Done."
end
.endc
*======== ====== ====== ====== ====== ====== ====== ====== ======
.model NPN1 NPN( BF=2100 VAF=216 )
.model PNP1 PNP( BF=2100 VAF=210)
.end
===========Gummel_Curves========================
===========Copy_Paste_Text_Below_And_Simulate=========
NPN_gummel
* MEASURE IS,ISE,NF,NE,RE,IKF,BETA
* dsauersanjose@aol.com 1/18/20
* www.idea2ic.com replace(OPT-SPACE)=>SPACE
*
*
* ________
* | | VC
* |C _|_
* B _| /2v \
* ____|' npnv \___/
* | |`-> |
* VB _|_ | 0 |
* /.7v\ |________|
* \___/ _|_
* | ///
* _|_
* ///
.OPTIONS GMIN=1e-15 METHOD=gear ABSTOL=1e-15
*======== ====== ====== ====== ====== ====== ====== ====== ======
VC C 0 DC 5V
VB B 0 0V
Q1 C B 0 NPNV
.MODEL NPNV NPN(
*==========================================================
+IS=1.1E-18 NF=1.005 BF=220 VAF=130 IKF=5e-03
+ISE=9.15E-15 NE=2
*==========================================================
+CJE=2E-12 CJC=2E-13 CJS=3E-12 TF=.6E-9 )
.control
*DC SOURC1 VSTART VSTOP VSTEP SOURC2 START2 STOP2 STEP2
dc vb .4 1.2 .1
set pensize = 2
plot mag(-i(vc)) mag(-i(vb)) vs mag(V(b)) ylog title Gummel
plot mag(i(vc)/i(vb)) vs mag(vc#branch) loglog title Beta_vs_IC
.endc
.end
===========SubThresshold_Curves========================
===========Copy_Paste_Text_Below_And_Simulate=========
NMOS_bsim3_SubSanity
* MEASURE IS,ISE,NF,NE,RE,IKF,BETA
* dsauersanjose@aol.com 1/18/20
* www.idea2ic.com replace(OPT-SPACE)=>SPACE
*
*
* ________
* | | VC
* |D _|_
* G _| /5v \
* ____|| m1 \___/
* | ||-> |
* VB _|_ | 0 |
* /.7v\ |________|
* \___/ _|_
* | ///
* _|_
* ///
.OPTIONS GMIN=1e-15 METHOD=gear ABSTOL=1e-15
*======== ====== ====== ====== ====== ====== ====== ====== ======
Vds D 0 dc 5v
Vgs G 0 dc 1.2v
v1 D 1 dc 0v
m1 1 G 0 0 N1 W=3u L=1u AD=7p AS=7p PD=10u PS=10u
*DC SOURC1 VSTART VSTOP VSTEP SOURC2 START2 STOP2 STEP2
.dc Vds 1m 5 0.01 vgs 0 1 .1
.control
run
plot mag(i(v1)) loglog
.endc
.model N1 NMOS
+ Level= 8 Tnom=27.0
*------------------Process-----------------------------------------------
+ tox=160e-10 xj=0.25e-06 nch=0.5e+17
*------------------V_threshold-------------------------------------------
+ vth0=0.72 nlx=0.12e-06
*------------------Bulk--------------------------------------------------
+ k1=1.04 k2=-1.209E-01
+ cdsc=-2.4E-4 cdscd=-1.506E-04 cdscb=-2.219E-04
*------------------mobility----------------------------------------------
+ u0=678 ua=8.964e-10
+ ub=1.472e-18 uc=-4.441E-17 vsat=86000
*------------------Subthresshold-----------------------------------------
+ nfactor=1.8
+ cit=-5.0E-04 voff=-7.862E-02
+ eta0=4.441e-16 etab=-2.E-01 dsub=0.7
*------------------Hot electrons-----------------------------------------
+ alpha0=1.61e-05 beta0=36.68
*------------------VAF---------------------------------------------------
+ lint=.12e-06 pclm=.19 pscbe1=3.79e+08 pscbe2=9.4e-05
+ delta=0.01655 pvag=0.4484
*------------------Bulk_diode--------------------------------------------
+ js=5.858e-08
*------------------Resistance--------------------------------------------
+ rsh=70 rdsw=375
+ wr=0.7586 prwb=0 prwg=-4.441E-17
*------------------Capacitance-------------------------------------------
+ cj=0.0002424 cjsw=2.73e-10 mj=0.3551 mjsw=0.3873
+ cgso=9e-13 cgdo=9e-13 cgbo=7e-10
+ pb=0.5614 pbsw=0.8 xpart=0
+ dlc=5e-08 dwc=1.5e-07
*------------------BulkChargeEffect--------------------------------------
+ a0=0.7 a1=0 a2=1 ags=0.05583
+ b0=6.305e-08 b1=6.579e-08 keta=-1.531E-02
*------------------ShortChannel------------------------------------------
+ dvt0=2.2 dvt1=0.53 dvt2=-1.521E-01 drout=0.76
+ pdiblcb=.4 pdiblc1=0.00886 pdiblc2=0.00029
*------------------NarrowChannel-----------------------------------------
+ w0=2.6e-04 wint=0.16e-06
+ ww=-9.525E-14 wwn=1.0
+ dvt0w=0 dvt1w=5.3e6 dvt2w=-1.E-01
+ k3=2.53 k3b=-5 dwg=0 dwb=0
*------------------Noise-------------------------------------------------
+ af=1 kf=1e-28 ef=0.95
*------------------Temperature-------------------------------------------
+ pvsat=0 ute=-1.258E+00 kt1=-3.85E-01
+ kt1l=0 kt2=-3.098E-02 ua1=5.705e-09
+ ub1=-1.147E-17 uc1=-1.302E-01 at=20380
* prt=-3.287E+02 lk1=0 lk2=0
+ lvsat=0 la0=0 lags=0 lute=0
+ luc=0
.end
****************SILICON_DATA*****************************
*
* NMOS_Subthresshold_Drain_Current and Gate_Voltage
* 1mA _______________________________________________
* | . . . .
* | w=20um . l = 1u . . .
* | . . . .
* 100uA |.......................................960mV....
* | . . 960mV .
* | . 960mV . 840mV .
* | . . 840mV .
* 10uA |.....................840mV......................
* | 960mV . . .
* | . . . 720mV .
* | 840mV 720mV 720mV .
* 1uA |................................................
* | . . . .
* |960mV 720mV . . .
* |840mV . . . 600mV .
* 100nA |.....................600mV......600mV...........
* | . . . .
* |720mV 600mV . . .
* | . . . 480mV .
* 10nA |................................480mV...........
* | . 480mV . .
* |600mV 480mV . . .
* | . . . .
* 1nA |.......................................360mV....
* | . . 360mV .
* | . 360mV . .
* | . . . .
* 100pA |480mV.....360mV........................240mV....
* | . . . .
* | . . 240mV .
* | . 240mV . .
* 10pA |360mV..................................120mV....
* | . . . .
* | 240mV . . .
* | . . . .
* 1pA |..240mV..............120mV......120mV...0mV.....
* | . . . .
* | 120mV . 0mV .
* | . . . .
* 100fA |__120mV__________________0mV___________________.
* 1mV 10mV 100mV 1V 10V
*
* Drain Voltage
===========Extract_and_Remake========================
Title: Extract_Reconstruct
Name: spect162 (Spectrum)
Date: Tue Jan 19 16:51:54 2010
frequency : frequency, real, 500 long [default scale]
v(vin) : voltage, complex, 500 long
Extract_Reconstruct
Spectrum Tue Jan 19 16:51:54 2010
--------------------------------------------------------------------------------
Index freq spr spi
--------------------------------------------------------------------------------
0 0.00000e+00 0.00000e+00 0.00000e+00
1 1.00000e+00 -6.36410e-01 -2.00000e-02
2 2.00000e+00 1.33214e-12 8.52651e-17
3 3.00000e+00 2.11578e-01 2.00000e-02
4 4.00000e+00 -1.33230e-12 -7.92700e-17
5 5.00000e+00 -1.26275e-01 -2.00000e-02
6 6.00000e+00 1.33192e-12 2.06073e-16
7 7.00000e+00 8.94749e-02 2.00000e-02
8 8.00000e+00 -1.33176e-12 -1.06119e-16
9 9.00000e+00 -6.88405e-02 -2.00000e-02
10 0.00000e+00 0.00000e+00 0.00000e+00
===========Copy_Paste_Text_Below_And_Simulate=========
Extract_Reconstruct
* dsauersanjose@aol.com 1/18/20
* www.idea2ic.com replace(OPT-SPACE)=>SPACE
* ___
* |VIN|
* |___|
* _|_
* /_ \
* // \ \
* \ \//
* \___/
* _|_
* ///
*
*=========Input_Signal=========================
*V_PULSE# NODE_P NODE_N PULSE( VINIT VPULSE TDELAY TRISE TFALL PWIDTH PERIOD )
VIN VIN 0 PULSE( 0 1 .25 1u 1u .5 1 )
*=========Resconstruction_Circuit=========================
VT VT 0 PWL( 0 0 2 2 ) DC 0
VP VP 0 DC 3.141592653589793
V2P V2P 0 DC 6.283185307179586
V1C V1C 0 DC 0
V1S V1S 0 DC 0
V2C V2C 0 DC 0
V2S V2S 0 DC 0
V3C V3C 0 DC 0
V3S V3S 0 DC 0
V4C V4C 0 DC 0
V4S V4S 0 DC 0
V5C V5C 0 DC 0
V5S V5S 0 DC 0
V6C V6C 0 DC 0
V6S V6S 0 DC 0
V7C V7C 0 DC 0
V7S V7S 0 DC 0
V8C V8C 0 DC 0
V8S V8S 0 DC 0
V9C V9C 0 DC 0
V9S V9S 0 DC 0
B1 V1 0 V = v(V1C)*cos( v(V2P)*1*v(VT)) + v(V1S)*sin( v(V2P)*1*v(VT))
B2 V2 0 V = v(V2C)*cos( v(V2P)*2*v(VT)) + v(V2S)*sin( v(V2P)*2*v(VT))
B3 V3 0 V = v(V3C)*cos( v(V2P)*3*v(VT)) + v(V3S)*sin( v(V2P)*3*v(VT))
B4 V4 0 V = v(V4C)*cos( v(V2P)*4*v(VT)) + v(V4S)*sin( v(V2P)*4*v(VT))
B5 V5 0 V = v(V5C)*cos( v(V2P)*5*v(VT)) + v(V5S)*sin( v(V2P)*5*v(VT))
B6 V6 0 V = v(V6C)*cos( v(V2P)*6*v(VT)) + v(V6S)*sin( v(V2P)*6*v(VT))
B7 V7 0 V = v(V7C)*cos( v(V2P)*7*v(VT)) + v(V7S)*sin( v(V2P)*7*v(VT))
B8 V8 0 V = v(V8C)*cos( v(V2P)*8*v(VT)) + v(V8S)*sin( v(V2P)*8*v(VT))
B9 V9 0 V = v(V9C)*cos( v(V2P)*9*v(VT)) + v(V9S)*sin( v(V2P)*9*v(VT))
BFULL VFULL 0 V = v(V1)+v(V2)+v(V3)+v(V4)+v(V5)+v(V6)+v(V7)+v(V8)+v(V9)
*=========Find_Spectrum=========================
.control
set pensize = 2
*TRAN TSTEP TSTOP TSTART TMAX ?UIC?
tran 10m 10 0 10m
*plot vin
*=========Find_Spectrum=========================
linearize
set specwindow = "rectangular"
*SPEC FSTART FSTOP FSTEP VECTOR
spec .1 50 .1 v(vin)
plot mag(real(v(vin))) mag(imag(v(vin))) loglog
display
*=========Create_Arrays============================================
compose freq start= 0 stop= 10 step = 1
compose spr start= 0 stop= 10 step = 1
compose spi start= 0 stop= 10 step = 1
let i = 1
let f = 0
let vr = 0
let vi = 0
*=========Extract_Harmonics========================================
repeat 9
let f = frequency[10*i-1]
let vr = real(vin[10*i-1])
let vi = imag(vin[10*i-1])
let spr[i] = real(vin[10*i-1])
let spi[i] = imag(vin[10*i-1])
*echo index = $&i freq = $&f real = $&vr imag = $&vi
let i = i +1
endrepeat
*=========Print_Harmonics========================================
print freq spr spi
*=========Transfer_Harmonics========================================
let val = spr[1]
alter V1C dc = $&val
let val = spi[1]
alter V1S dc = $&val
let val = spr[2]
alter V2C dc = $&val
let val = spi[2]
alter V2S dc = $&val
let val = spr[3]
alter V3C dc = $&val
let val = spi[3]
alter V3S dc = $&val
let val = spr[4]
alter V4C dc = $&val
let val = spi[4]
alter V4S dc = $&val
let val = spr[5]
alter V5C dc = $&val
let val = spi[5]
alter V5S dc = $&val
let val = spr[6]
alter V6C dc = $&val
let val = spi[6]
alter V6S dc = $&val
let val = spr[7]
alter V7C dc = $&val
let val = spi[7]
alter V7S dc = $&val
let val = spr[8]
alter V8C dc = $&val
let val = spi[8]
alter V8S dc = $&val
let val = spr[9]
alter V9C dc = $&val
let val = spi[9]
alter V9S dc = $&val
*=========Resimulate========================================
*TRAN TSTEP TSTOP TSTART TMAX ?UIC?
tran 10m 2 0 10m
*plot v1 v2 v3 v4 v5 v6 v7 v8 v9
plot vfull vin
.endc
.end
===========Spectrum_2_Jitter========================
VAM1C spectrum
freq = 7 real = -0.000317892 imag = 0.000313487
freq = 8 real = -0.000934059 imag = 3.26567E-16
freq = 9 real = -0.000922559 imag = -0.000909774
freq = 10 real = 0.63641 imag = -0.0089576
freq = 11 real = 0.000922559 imag = -0.000909774
freq = 12 real = 0.000934059 imag = 1.81964E-16
freq = 13 real = 0.000317892 imag = 0.000313487
freq = 27 real = 0.000317892 imag = -0.000313487
freq = 28 real = 0.000934059 imag = -1.23168E-16
freq = 29 real = 0.000922559 imag = 0.000909774
freq = 30 real = -0.211578 imag = 0.0089576
freq = 31 real = -0.000922559 imag = 0.000909774
freq = 32 real = -0.000934059 imag = -1.06597E-16
freq = 33 real = -0.000317892 imag = -0.000313487
VPM1C spectrum
freq = 7 real = -0.006182 imag = 2.00053E-05
freq = 8 real = 0.0222551 imag = 0.000795149
freq = 9 real = -0.169581 imag = -0.00432768
freq = 10 real = 0.588574 imag = 0.00465371
freq = 11 real = 0.169411 imag = -0.00159775
freq = 12 real = 0.0228895 imag = -0.000504505
freq = 13 real = 0.00615656 imag = -0.00138071
freq = 27 real = 0.0191664 imag = -0.00122994
freq = 28 real = -0.0545755 imag = -0.00391036
freq = 29 real = 0.122932 imag = 0.00498121
freq = 30 real = -0.0883851 imag = -0.00212563
freq = 31 real = -0.122439 imag = -0.000553325
freq = 32 real = -0.0551172 imag = -1.15229E-05
freq = 33 real = -0.0189418 imag = 0.00121807
===========Copy_Paste_Text_Below_And_Simulate=========
Spectrum_2_Jitter
* dsauersanjose@aol.com 1/18/20
* www.idea2ic.com replace(OPT-SPACE)=>SPACE
* ___
* |OUT| .5sidebands should product +/- 1.0radians PM
* |___| .3sidebands should product +/- 0.6radians PM
* _|_ +/- (.6/6.28318)*100ms = +/- 9.5msec
* /_ \
* // \ \
* \ \//
* \___/
* _|_
* ///
*
*V_PULSE# NODE_P NODE_N PULSE( VINIT VPULSE TDELAY TRISE TFALL PWIDTH PERIOD )
VIN VIN 0 PULSE( 0 1 .25 1u 1u .5 1 )
*=========The_SideBand_Tests=========================
VT VT 0 PWL( 0 0 2 2 ) DC 0
VP VP 0 DC 3.141592653589793
V2P V2P 0 DC 6.283185307179586
BREF VREF 0 V = cos( v(V2P)*10*v(VT))
BAM1 VAM1 0 V = cos( v(V2P)*10*v(VT)) +.4*cos( v(V2P)*9*v(VT)) +.4*cos( v(V2P)*11*v(VT))
BAM2 VAM2 0 V = cos( v(V2P)*10*v(VT)) -.4*sin( v(V2P)*9*v(VT)) +.4*sin( v(V2P)*11*v(VT))
BPM1 VPM1 0 V = cos( v(V2P)*10*v(VT)) -.3*cos( v(V2P)*9*v(VT)) +.3*cos( v(V2P)*11*v(VT))
BPM2 VPM2 0 V = cos( v(V2P)*10*v(VT)) +.3*sin( v(V2P)*9*v(VT)) +.3*sin( v(V2P)*11*v(VT))
*=========Clipping_Circuit=========================
BREFC VREFC 0 V = u( v(VREF))-.5
BAM1C VAM1C 0 V = u( v(VAM1))-.5
BAM2C VAM2C 0 V = u( v(VAM2))-.5
BPM1C VPM1C 0 V = u( v(VPM1))-.5
BPM2C VPM2C 0 V = u( v(VPM2))-.5
*=========Run_Sim=========================
.control
set pensize = 2
*TRAN TSTEP TSTOP TSTART TMAX ?UIC?
tran 1m 2 0 1m
*=========Create_Arrays============================================
compose rdelay start = 0 stop = 37 step =1
compose a1delay start = 0 stop = 37 step =1
compose a2delay start = 0 stop = 37 step =1
compose p1delay start = 0 stop = 37 step =1
compose p2delay start = 0 stop = 37 step =1
compose rtp start = 0 stop = 37 step =1
*=========Find_Ref_Delay============================================
let i = 0
let tr = 0
let td = 0
let n = 0
repeat 2000
let i = i +1
let t = time[i-1]
if ((tr + .000125 )< t)
let tr = tr + .025
*echo ref= $&tr
endif
if ( vrefc[i] > 0 & vrefc[i+1] < 0)
let td = t - tr
let rtp[n]= tr
let rdelay[n]= td
let n = n +1
*echo n= $&n out_fall= $&t ref= $&tr delay= $&td
endif
if ( vrefc[i] < 0 & vrefc[i+1] > 0)
let td = t - tr
let rtp[n]= tr
let rdelay[n]= td
let n = n +1
*echo n= $&n out_rise= $&t ref= $&tr delay= $&td
endif
endrepeat
*=========Find_PM1_Delay============================================
let i = 0
let tr = 0
let td = 0
let n = 0
repeat 2000
let i = i +1
let t = time[i-1]
if ((tr + .0125 )< t)
let tr = tr + .025
*echo ref= $&tr
endif
if ( vpm1c[i] > 0 & vpm1c[i+1] < 0)
let td = t - tr
let rtp[n]= tr
let p1delay[n]= td
let n = n +1
*echo n= $&n out_fall= $&t ref= $&tr delay= $&td
end
if ( vpm1c[i] < 0 & vpm1c[i+1] > 0)
let td = t - tr
let rtp[n]= tr
let p1delay[n]= td
let n = n +1
*echo n= $&n out_rise= $&t ref= $&tr delay= $&td
end
endrepeat
*=========Find_PM2_Delay============================================
let i = 0
let tr = 0
let td = 0
let n = 0
repeat 2000
let i = i +1
let t = time[i-1]
if ((tr + .0125 )< t)
let tr = tr + .025
*echo ref= $&tr
endif
if ( vpm2c[i] > 0 & vpm2c[i+1] < 0)
let td = t - tr
let rtp[n]= tr
let p2delay[n]= td
let n = n +1
*echo n= $&n out_fall= $&t ref= $&tr delay= $&td
end
if ( vpm2c[i] < 0 & vpm2c[i+1] > 0)
let td = t - tr
let rtp[n]= tr
let p2delay[n]= td
let n = n +1
*echo n= $&n out_rise= $&t ref= $&tr delay= $&td
end
endrepeat
*=========Find_AM1_Delay============================================
let i = 0
let tr = 0
let td = 0
let n = 0
repeat 2000
let i = i +1
let t = time[i-1]
if ((tr + .0125 )< t)
let tr = tr + .025
*echo ref= $&tr
endif
if ( vam1c[i] > 0 & vam1c[i+1] < 0)
let td = t - tr
let rtp[n]= tr
let a1delay[n]= td
let n = n +1
*echo n= $&n out_fall= $&t ref= $&tr delay= $&td
end
if ( vam1c[i] < 0 & vam1c[i+1] > 0)
let td = t - tr
let rtp[n]= tr
let a1delay[n]= td
let n = n +1
*echo n= $&n out_rise= $&t ref= $&tr delay= $&td
end
endrepeat
*=========Find_AM2_Delay============================================
let i = 0
let tr = 0
let td = 0
let n = 0
repeat 2000
let i = i +1
let t = time[i-1]
if ((tr + .0125 )< t)
let tr = tr + .025
*echo ref= $&tr
endif
if ( vam2c[i] > 0 & vam2c[i+1] < 0)
let td = t - tr
let rtp[n]= tr
let a2delay[n]= td
let n = n +1
*echo n= $&n out_fall= $&t ref= $&tr delay= $&td
end
if ( vam2c[i] < 0 & vam2c[i+1] > 0)
let td = t - tr
let rtp[n]= tr
let a2delay[n]= td
let n = n +1
*echo n= $&n out_rise= $&t ref= $&tr delay= $&td
end
endrepeat
*============PlotResults============================================
plot vam1 vam2
plot vpm1 vref xlimit 0 1
plot p1delay p2delay rdelay vs rtp
plot vrefc vam1c vam2c xlimit 0 1
plot vrefc vpm1c xlimit 0 1
*============Find_Spectrum_VAM1C=========================
linearize
set specwindow = "rectangular"
*SPEC FSTART FSTOP FSTEP VECTOR
spec .5 500 .5 v(VAM1C)
display
plot mag(real(v(VAM1C))) mag(imag(v(VAM1C))) loglog ylimit 1u 1
*============Printout_Spectrum_VAM1C=========================
echo VAM1C spectrum
foreach ii 7 8 9 10 11 12 13 27 28 29 30 31 32 33
let i = $ii
let fr = frequency[2*i-1]
let vfftr = real(v(VAM1C)[2*i-1])
let vffti = imag(v(VAM1C)[2*i-1])
echo freq= $&fr real= $&vfftr imag= $&vffti
end
*============ReRun_Simulation=========================
*TRAN TSTEP TSTOP TSTART TMAX ?UIC?
tran 1m 2 0 1m
*============Find_Spectrum_VPM1C=========================
linearize
set specwindow = "rectangular"
*SPEC FSTART FSTOP FSTEP VECTOR
spec .5 500 .5 v(VPM1C)
display
plot mag(real(v(VPM1C))) mag(imag(v(VPM1C))) loglog ylimit 1u 1
*============Printout_Spectrum_VPM1C=========================
echo VPM1C spectrum
foreach ii 7 8 9 10 11 12 13 27 28 29 30 31 32 33
let i = $ii
let fr= frequency[2*i-1]
let vfftr = real(v(VPM1C)[2*i-1])
let vffti = imag(v(VPM1C)[2*i-1])
echo freq= $&fr real= $&vfftr imag= $&vffti
end
.endc
.end
===========Clipping_White_Noise========================
Apply 10Vpk sine wave RMS OF peak Values of noise = 1.29753
Apply 10Vpk sine wave RMS OF peak values of signal = 9.91053
Apply 10Vpk square wave RMS OF peak Values of noise = 2.76266
Apply 10Vpk square wave RMS OF peak values of signal = 13.6373
mag(voutc[49]) = 1.26370e+01
===========Copy_Paste_Text_Below_And_Simulate=========
Clipping_White_Noise
* www.idea2ic.com
* dsauersanjose@aol.com 1/20/10 replace(OPT-SPACE)=>SPACE
* OUT Rload
* _____/\ __ Apply 1vrms noise to +/-10V sinewave
* _|_ \/ | signal measures 10 peak
* / \ | noise rms measures 1.29
* /VpwlT\ |
* \ / _|_ Apply 1vrms noise to +/-10V squarewave
* \___/ /// signal measures 10 rms
* | Gnd noise rms measures 2.76
* _|_
* /// the squarewave should be 14.14vrms
* Gnd
*===========Circuit_Netlist=========================
.include PWL_File.inc
Rload OUT 0 1k
*V_SIN# NODE_P NODE_N SIN( V_DC AC_MAG FREQ DELAY FDamp)
VIN VIN 0 SIN( 0 10 50 5m )
BOUT VOUT 0 V = v(OUT) + v(VIN)
BOUTC VOUTC 0 V = 20*u(v(VOUT)) -10
*TRAN TSTEP TSTOP TSTART TMAX ?UIC?
.tran .05m 1 0 .05m UIC
*===========Run_Transient=========================
.control
run
set pensize = 2
plot OUT ylimit -3 +3
plot VOUT
*===========Find_Spectrum_VOUT=========================
linearize
set specwindow = "rectangular"
*SPEC FSTART FSTOP FSTEP VECTOR
spec 1 10k 1 v(VOUT)
display
plot mag(real(v(VOUT))) mag(imag(v(VOUT))) loglog
*===========Find_Spectrum_Signal_Noise=========================
let i = 0
let vpwr = 0
repeat 1000
let i = i +1
let tr = 0
let ngo = 0
if (i = 49 )
let ngo = 1
endif
if (ngo < 1 )
let vpwr = vpwr + mag(VOUT[i])* mag(VOUT[i])
endif
endrepeat
let vrms = sqrt(vpwr)
echo Apply 10Vpk sin wave, RMS OF peak Values of noise = $&vrms
*===========View_Spectrum=========================
let vperHz = vrms/sqrt(1000)
set pensize = 2
plot mag(v(VOUT)) vperHz loglog
*===========Find_RMS_of_Vpk_SineWave=========================
let vrms = mag(VOUT[49])
echo Apply 10Vpk sine wave, RMS OF peak values signal = $&vrms
*===========Find_Spectrum_VOUTC=========================
run
plot VOUTC
linearize
set specwindow = "rectangular"
*SPEC FSTART FSTOP FSTEP VECTOR
spec 1 10k 1 v(VOUTC)
display
plot mag(real(v(VOUTC))) mag(imag(v(VOUTC))) loglog
*===========Find_Spectrum_Noise=========================
let i = 0
let vpwr = 0
repeat 1000
let i = i +1
let tr = 0
let ngo = 0
if (i = 49 | i = 149 | i = 249 | i = 349 )
let ngo = 1
endif
if (i = 449 | i = 549 | i = 649 | i = 749 )
let ngo = 1
endif
if (i = 849 | i = 949 | i = 1049 | i = 1149 )
let ngo = 1
endif
if (ngo < 1 )
let vpwr = vpwr + mag(VOUTC[i])* mag(VOUTC[i])
endif
endrepeat
let vrms = sqrt(vpwr)
echo Apply 10Vpk square wave, RMS OF peak Values of noise = $&vrms
*===========View_Spectrum=========================
let vperHz = vrms/sqrt(1000)
set pensize = 2
plot mag(v(VOUTC)) vperHz loglog
*===========Find_RMS_of_Vpk_SquareWave=========================
let vpwr = 0
let vpwr = vpwr + mag(VOUTC[ 49])* mag(VOUTC[ 49])
let vpwr = vpwr + mag(VOUTC[149])* mag(VOUTC[149])
let vpwr = vpwr + mag(VOUTC[249])* mag(VOUTC[249])
let vpwr = vpwr + mag(VOUTC[349])* mag(VOUTC[349])
let vpwr = vpwr + mag(VOUTC[449])* mag(VOUTC[449])
let vrms = sqrt(vpwr)
echo Apply 10Vpk square wave, RMS OF peak values signal = $&vrms
.endc
.end
===========Inverter_Modeling========================
===========Copy_Paste_Text_Below_And_Simulate=========
Behavior_Modeling_Invertor
* www.idea2ic.com
* dsauersanjose@aol.com 1/20/10 replace(OPT-SPACE)=>SPACE
* XINVR1 BR2 BR3
* ___ |\ ___ |\ ___ |\ ___
* |VIN|_| \/\_|VR2|_| \/\_|VR3|_| \/\_|VR3|
* |___| | /\/ |___| | /\/ |___| | /\/ |___|
* | |/ |/ |/
* | BB1 BB2
* _|_ |\ ___ |\ ___ |\ BB3 ___
* |VIN|_| \/\_|VB2|_| \/\_|VB3|_| \/\_|VB4|
* |___| | /\/ |___| | /\/ |___| | /\/ |___|
* | |/ |/ |/
* _|_
* /_ \ _|_
* // \ \ /VCC\
* \ \// \___/
* \___/ _|_
* _|_ ///
* ///
*=========Test_Circuit=========================
VCC VCC 0 DC 5V
VIN VIN 0 DC PULSE( 0 5 1p 5p 5p 1n 2n )
*=========Real_Inverters=========================
XINVR1 VIN VR2 VCC INV_R
XINVR2 VR2 VR3 VCC INV_R
XINVR3 VR3 VR4 VCC INV_R
XINVR4 VR4 VR5 VCC INV_R
XINVR5 VR5 VR6 VCC INV_R
XINVR6 VR6 VR7 VCC INV_R
XINVR7 VR7 VR8 VCC INV_R
*=========Model_Inverters=========================
XINVB1 VIN VB2 VCC INV_B
XINVB2 VB2 VB3 VCC INV_B
XINVB3 VB3 VB4 VCC INV_B
XINVB4 VB4 VB5 VCC INV_B
XINVB5 VB5 VB6 VCC INV_B
XINVB6 VB6 VB7 VCC INV_B
XINVB7 VB7 VB8 VCC INV_B
*=========Run_Sim=========================
.control
tran 1p 5n 0
plot vr2 vr8 vb2 vb8
.endc
*=========Real_Subcircuit=========================
*
* ^
* INV_R /_\ VCC
* |
* <-
* ||___ 480ps at 6 stages
* __||
* ___ | ||_ MP1
* |VIN|__| | ___
* |___| | |__|VOUT
* | _| |___|
* |__||
* ||___ MN1
* ||->
* _|_
* ///
*
.SUBCKT INV_R IN OUT VCC
MN1 OUT IN 0 0 NMOSC W=1u L=1u
MP1 OUT IN VCC VCC PMOSC W=3u L=1u
.ENDS INV_R
*=========Model_Subcircuit=========================
*
* VOUT
* ___ |\ ___
* |IN |_| \/\__/\ /\ /\_|OUT| R0UT=600 @5V , 900@3V
* |___| | /\/ \/ \/ |___| 480ps at 6 stages
* _|_ |/ ROUT _|_ 80ps
* ___ ___ rc=114 -3dBof RC
* _|_ CIN COUT _|_
* /// ///
*
.SUBCKT INV_B IN OUT VCC
BGain Gain 0 V = 42/(V(VCC)-1.5)
Boff Off 0 V = (V(VCC)-4)/80
BINV VOUT 0 V = .5*V(VCC)*tanh(-V(Gain)*(V(IN)-(.5+V(Off))*V(VCC))) +.5*V(VCC)
ROUT VOUT OUT 600
CIN IN 0 1f
COUT OUT 0 190f
.ENDS INV_B
*==================CMOS_Models=========================
.model NMOSC NMOS(
+ Level= 8 Tnom=27.0
*------------------Process-----------------------------------------------
+ tox=160e-10 xj=0.25e-06 nch=0.5e+17
*------------------V_threshold-------------------------------------------
+ vth0=0.72 nlx=0.12e-06
*------------------Bulk--------------------------------------------------
+ k1=1.04 k2=-1.209E-01
+ cdsc=-2.4E-4 cdscd=-1.506E-04 cdscb=-2.219E-04
*------------------mobility----------------------------------------------
+ u0=678 ua=8.964e-10
+ ub=1.472e-18 uc=-4.441E-17 vsat=86000
*------------------Subthresshold-----------------------------------------
+ nfactor=1.8
+ cit=-5.0E-04 voff=-7.862E-02
+ eta0=4.441e-16 etab=-2.E-01 dsub=0.7
*------------------Hot electrons-----------------------------------------
* alpha0=1.61e-05 beta0=36.68
*------------------VAF---------------------------------------------------
+ lint=.12e-06 pclm=.19 pscbe1=3.79e+08 pscbe2=9.4e-05
+ delta=0.01655 pvag=0.4484
*------------------Bulk_diode--------------------------------------------
+ js=5.858e-08
*------------------Resistance--------------------------------------------
+ rsh=70 rdsw=375
+ wr=0.7586 prwb=0 prwg=-4.441E-17
*------------------Capacitance-------------------------------------------
+ cj=0.0002424 cjsw=2.73e-10 mj=0.3551 mjsw=0.3873
+ cgso=9e-13 cgdo=9e-13 cgbo=7e-10
+ pb=0.5614 pbsw=0.8 xpart=0
+ dlc=5e-08 dwc=1.5e-07
*------------------BulkChargeEffect--------------------------------------
* a0=0.7 a1=0 a2=1 ags=0.05583
* b0=6.305e-08 b1=6.579e-08 keta=-1.531E-02
*------------------ShortChannel------------------------------------------
+ dvt0=2.2 dvt1=0.53 dvt2=-1.521E-01 drout=0.76
+ pdiblcb=.4 pdiblc1=0.00886 pdiblc2=0.00029
*------------------NarrowChannel-----------------------------------------
+ w0=2.6e-04 wint=0.16e-06
+ ww=-9.525E-14 wwn=1.0
+ dvt0w=0 dvt1w=5.3e6 dvt2w=-1.E-01
+ k3=2.53 k3b=-5 dwg=0 dwb=0
*------------------Noise-------------------------------------------------
* af=1 kf=1e-28 ef=0.95
*------------------Temperature-------------------------------------------
* pvsat=0 ute=-1.258E+00 kt1=-3.85E-01
* kt1l=0 kt2=-3.098E-02 ua1=5.705e-09
* ub1=-1.147E-17 uc1=-1.302E-01 at=20380
* prt=-3.287E+02 lk1=0 lk2=0
* lvsat=0 la0=0 lags=0 lute=0
+ luc=0 )
.model PMOSC PMOS(
+ Level= 8 Tnom=27.0
*------------------Process-----------------------------------------------
+ tox=1.725e-08 xj=2e-07 nch=1e+17
*------------------V_threshold-------------------------------------------
+ vth0=-0.90 nlx=1.84e-08
*------------------Bulk--------------------------------------------------
+ k1=0.3969 k2=0.03536
*------------------mobility----------------------------------------------
+ u0=268 ua=4.124e-09
* ub=-3.8E-19 uc=-1.512E-02 vsat=140000
*------------------Subthresshold-----------------------------------------
+ nfactor=.5016
* cit=0.0001 voff=-0.08 nfactor=1.0016 vth0=-0.94
* eta0=0.038 etab=-1.057E-02 dsub=0.3501
*------------------Hot electrons-----------------------------------------
+ alpha0=2.5e-08 beta0=28.92
*------------------VAF---------------------------------------------------
+ lint=.1e-06 pclm=3.2 pscbe1=5e+08 pscbe2=1e-05
* delta=0.009 pvag=4
*------------------Bulk_diode--------------------------------------------
+ js=3.95e-08
*------------------Resistance--------------------------------------------
+ rsh=135 rdsw=2500
* prwg=-7.2E-02 prwb=0.06 wr=0.8625
*------------------Capacitance-------------------------------------------
+ cj=0.0002424 cjsw=2.73e-10 mj=0.3551 mjsw=0.3873
+ cgso=9e-13 cgdo=9e-13 cgbo=7e-10
* cdsc=-2.4E-4 cdscd=-1.506E-01 cdscb=-2.219E-04
* pb=0.85 pbsw=0.88 xpart=0
* dlc=5e-08 dwc=1.5e-07
*------------------BulkChargeEffect--------------------------------------
* a0=1 a1=0 a2=2 ags=0.268
* b0=5e-07 b1=1e-07 keta=-1.0E-02
*------------------ShortChannel------------------------------------------
* dvt0=2.9 dvt1=0.2 dvt2=-1.521E-01 drout=0.175
* pdiblcb=0 pdiblc1- pdiblc2=0.001
*------------------NarrowChannel-----------------------------------------
+ w0=2.6e-04 wint=0.16e-06
+ ww=-3.1E-19 wwn=1.9
* dvt0w=0.68 dvt1w=5.3e6 dvt2w=0.051
* k3=56 k3b=-3 dwg=0 dwb=1e-08
*------------------Noise-------------------------------------------------
+ af=0.8 kf=1.50e-30 ef=0.95
*------------------Temperature-------------------------------------------
* ldelta=0.02282 lpdiblc1=0.01877 ute=-1.500E+00
* cgsl=1.5e-10 cgdl=1.5e-10 ckappa=0.2463 cf=0
* kt1=-4.684E-01 kt1l=-2.0E-08 kt2=-2.818E-02
* ua1=-2.E-10 ub1=-4.5E-18 uc1=-2.000E-02
+ at=-1.5E+05 prt=1400 )
.end
===========Root_Locus========================
Circuit: RootLocus*
k_4rl = 3.000000e-01
pz.pole(1) = -1.00044e+01,0.000000e+00
pz.pole(2) = -3.01542e+00,0.000000e+00
pz.pole(3) = -1.10494e-01,0.000000e+00
k_4rl = 3.000000e+00
pz.pole(1) = -1.00435e+01,0.000000e+00
pz.pole(2) = -2.87711e+00,0.000000e+00
pz.pole(3) = -2.09738e-01,0.000000e+00
k_4rl = 9.486833e+00
pz.pole(1) = -1.01344e+01,0.000000e+00
pz.pole(2) = -2.49756e+00,0.000000e+00
pz.pole(3) = -4.98312e-01,0.000000e+00
k_4rl = 1.194322e+01
pz.pole(1) = -1.01679e+01,0.000000e+00
pz.pole(2) = -2.32353e+00,0.000000e+00
pz.pole(3) = -6.38897e-01,0.000000e+00
k_4rl = 1.892872e+01
pz.pole(1) = -1.02603e+01,0.000000e+00
pz.pole(2) = -1.43501e+00,3.155547e-01
pz.pole(3) = -1.43501e+00,-3.15555e-01
k_4rl = 3.000000e+01
pz.pole(1) = -1.03993e+01,0.000000e+00
pz.pole(2) = -1.36551e+00,1.157896e+00
pz.pole(3) = -1.36551e+00,-1.15790e+00
k_4rl = 9.486833e+01
pz.pole(1) = -1.10834e+01,0.000000e+00
pz.pole(2) = -1.02345e+00,2.805694e+00
pz.pole(3) = -1.02345e+00,-2.80569e+00
k_4rl = 4.754680e+02
pz.pole(1) = -1.34516e+01,0.000000e+00
pz.pole(2) = 1.606726e-01,5.991900e+00
pz.pole(3) = 1.606726e-01,-5.99190e+00
===========Copy_Paste_Text_Below_And_Simulate=========
RootLocus
* www.idea2ic.com
* dsauersanjose@aol.com 1/20/10 replace(OPT-SPACE)=>SPACE
*
* VIN V00 R0 V0 R1 V1 R2 V2
* _____ __/\ /\ /\_ __/\ /\ /\_ __/\ /\ /\
* _|_ | _|_ \/ \/ | _|_ \/ \/ | _|_ \/ \/ | P1 = .1/(s+.1) s in jw (2PI*F) format
* / \ |_ / \ ____|_ / \ ____|_ / \ ____| P2 = 3/(s+3)
* |EGN0 | |EGain| _|_ |EGN0 | _|_ |EGN1 | _|_ | P3 = 10/(s+10)
* | | _| | ___ C0 _| | ___C1 _| | ___ |
* \___/ | \___/ _|_ \___/ _|_ | \___/ _|_ | Transfer_V00->V2 = 3/((s+.1)*(s+.3)*(s+10)
* _|_ | _|_ /// _|_ /// _|_ _|_ /// | Root Locus needs this format
* /// | /// /// /// /// | K*(s+z0)(s+z1)../(s+p0)(s+p1)
* |__________________________________________________| K_4_rootlocus = 3*Egain
*
*
*==================CMOS_Models=========================
VIN VIN 0 1.00 AC 1
EGain V00 0 VIN V2 1
R0 V00 V0 1.0
C0 V0 0 10.0
EGN0 VEG0 0 V0 0 1
R1 VEG0 V1 1.0
C1 V1 0 0.33
EGN1 VEG1 0 V1 0 1
R2 VEG1 V2 1.0
C2 V2 0 0.1
*==================CMOS_Models=========================
.control
#.PZ NODE1 NODE2 NODE3 NODE4 CUR/VOL POL/ZER/PZ
pz vin 0 v2 0 vol pol
*==================Create_Arrays=========================
setplot new
set NameList = ( RPlot IPlot )
compose GVals values (-1) 0 .5 .6 .8 1 1.5 2.2
settype current GVals
let NoOfG = length(GVals)
begin
unset interrupt
set thisName = $NameList[1]
let RPlot = 0*vector(40)
set thisName = $NameList[2]
let IPlot = 0*vector(40)
* =================Loop_K_Gain============
let k = 1
while ( k <= NoOfG )
let gainn = 10^GVals[k-1]
alter egain gain = $&gainn
let K_4RL = 3*gainn
print K_4RL
#.PZ NODE1 NODE2 NODE3 NODE4 CUR/VOL POL/ZER/PZ
pz vin 0 v2 0 vol pol
print pz.pole(1)
let pr = real(pz.pole(1))
let pi = imag(pz.pole(1))
let unknown.RPlot[unknown.k-1] = pr
let unknown.IPlot[unknown.k-1] = pi
* =================find_second_Pole============
let offset = 10
print pz.pole(2)
let pr = real(pz.pole(2))
let pi = imag(pz.pole(2))
let unknown.RPlot[offset + unknown.k-1] = pr
let unknown.IPlot[offset + unknown.k-1] = pi
* =================find_third_Pole============
let offset = 20
print pz.pole(3)
let pr = real(pz.pole(3))
let pi = imag(pz.pole(3))
let unknown.RPlot[offset + unknown.k-1] = pr
let unknown.IPlot[offset + unknown.k-1] = pi
destroy
let k = k + 1
* =================Bail_Out============
if ($?interrupt)
goto bail
endif
endwhile
* =================Plot============
settype notype IPlot
settype notype RPlot
setscale GVals
set pensize = 1
plot IPlot vs RPlot pointplot
label bail
echo "Done."
end
.endc
.end
===========Pole_Zero_Extraction========================
pz.pole(1) = (-1.00000e+08, 0.00000e+00 )
pz.pole(2) = (-1.00000e+06, 0.00000e+00 )
pz.pole(3) = (-1.00000e+00, 0.00000e+00 )
===========Copy_Paste_Text_Below_And_Simulate=========
Pole_Zero
* www.idea2ic.com
* dsauersanjose@aol.com 1/20/10 replace(OPT-SPACE)=>SPACE
* VIN R0 V0 R1 V1 R2 V2
* __/\ /\ /\_ __/\ /\ /\_ __/\ /\ /\_ __ VEG2 1F/1OHM = .159HZ
* _|_ \/ \/ | _|_ \/ \/ | _|_ \/ \/ | _|_ 1nF/1k = 159kHz
* / \ ____|_ / \ ____|_ / \ ____|_ / \ 10pF/1k = 15.9MHz
* | VIN | _|_ |EGN0 | _|_ |EGN1 | _|_ |EGN2 |
* | | ___ C0 _| | ___C1 _| | ___ C2 _| |
* \___/ _|_ | \___/ _|_ | \___/ _|_ | \___/
* _|_ /// _|_ _|_ /// _|_ _|_ /// _|_ _|_
* /// /// /// /// /// /// ///
*
VIN VIN 0 1.00 AC 1
R0 VIN V0 1.0
C0 V0 0 1.0
EGN0 VEG0 0 V0 0 1
R1 VEG0 V1 1.0k
C1 V1 0 1.0n
EGN1 VEG1 0 V1 0 1
R2 VEG1 V2 1.0k
C2 V2 0 10p
EGN2 VEG2 0 V2 0 1
.control
*.PZ NODE1 NODE2 NODE3 NODE4 CUR/VOL POL/ZER/PZ
pz vin 0 veg2 0 vol pol
foreach j 1 2 3
print pz.pole($j)
end
.endc
.end
===========OpAmp_Corner_Tester========================
OpampCornerTester
=============================PROCESS_CHANGE=================================
npnbf=150 npnvaf=200 pnpbf=150 pnpvaf=200 Ressq=1000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~CONDITION_CHANGE~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Temp_C= -45 Vcc=5 Vcm=1.5 Vout=1.5005 Iout=5.00499E-05 Is=0.00028979
vos = -0.000462471 Iin =4.30376E-08 Ioff=1.00231E-09 Cmrr_dB=116.067 Psrr_dB=98.4266
Avol_dB=107.16 Ioutn = 0.00243266 Ioutp = -0.00294994
GBW_MHz = 6.12654 Pmarg_deg = 23.4236
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~CONDITION_CHANGE~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Temp_C= -45 Vcc=10 Vcm=1.5 Vout=1.50036 Iout=5.00364E-05 Is=0.000304426
vos = -0.000405388 Iin =4.50844E-08 Ioff=9.20386E-10 Cmrr_dB=116.834 Psrr_dB=99.2742
Avol_dB=107.16 Ioutn = 0.00243266 Ioutp = -0.00294994
GBW_MHz = 6.12654 Pmarg_deg = 23.4236
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~CONDITION_CHANGE~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Temp_C= 27 Vcc=5 Vcm=1.5 Vout=1.49981 Iout=4.99805E-05 Is=0.00036123
vos = -5.86116E-05 Iin =3.11517E-08 Ioff=6.989E-11 Cmrr_dB=121.108 Psrr_dB=105.609
Avol_dB=116.497 Ioutn = 0.00304997 Ioutp = -0.00295002
GBW_MHz = 5.81899 Pmarg_deg = 22.1154
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~CONDITION_CHANGE~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Temp_C= 27 Vcc=10 Vcm=1.5 Vout=1.49974 Iout=4.9974E-05 Is=0.000379897
vos = -3.35433E-05 Iin =3.26127E-08 Ioff=4.1872E-11 Cmrr_dB=121.768 Psrr_dB=106.386
Avol_dB=116.497 Ioutn = 0.00304997 Ioutp = -0.00295002
GBW_MHz = 5.81899 Pmarg_deg = 22.1154
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~CONDITION_CHANGE~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Temp_C= 127 Vcc=5 Vcm=1.5 Vout=1.49927 Iout=4.99275E-05 Is=0.000436461
vos = 0.000255447 Iin =2.12736E-08 Ioff=1.56226E-10 Cmrr_dB=87.8709 Psrr_dB=85.1946
spec failure #########################################################
Avol_dB=87.9893 Ioutn = 0.00304992 Ioutp = -0.00295007
GBW_MHz = 5.39699 Pmarg_deg = 20.8221
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~CONDITION_CHANGE~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Temp_C= 127 Vcc=10 Vcm=1.5 Vout=1.49913 Iout=4.99126E-05 Is=0.000459375
vos = 0.000324528 Iin =2.22616E-08 Ioff=2.07648E-10 Cmrr_dB=104.686 Psrr_dB=95.3738
Avol_dB=87.9893 Ioutn = 0.00304992 Ioutp = -0.00295007
GBW_MHz = 5.39699 Pmarg_deg = 20.8221
=============================PROCESS_CHANGE=================================
npnbf=150 npnvaf=200 pnpbf=150 pnpvaf=200 Ressq=1200
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~CONDITION_CHANGE~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Temp_C= -45 Vcc=5 Vcm=1.5 Vout=1.50056 Iout=5.00559E-05 Is=0.000245686
vos = -0.000457434 Iin =3.58542E-08 Ioff=8.25919E-10 Cmrr_dB=118.686 Psrr_dB=98.4782
Avol_dB=105.732 Ioutn = 0.00222604 Ioutp = -0.00294993
GBW_MHz = 5.11669 Pmarg_deg = 19.9897
etc.....
===========Copy_Paste_Text_Below_And_Simulate=========
Auto_Corner_Checker
* www.idea2ic.com
* dsauersanjose@aol.com 1/20/10 replace(OPT-SPACE)=>SPACE
*
* ^
* /_\
* _____________________| ____/\RL___
* | | _|_ _|_ 10K\/ |
* -> <- /VCC\ /VL \ |
* q13`|____|'q12 \___/ \___/ |
* _ '| | |`_ | | |
* | | | | R1 60u/1u @ 1k/sq _|_ |
* |vbq15 |____| _|_ R2 60u/1u @ 1k/sq /// |
* |_____ |vbq12 /// R3 60u/1u @ 1k/sq |
* | | |________ R4 6u/1u @ 1k/sq |
* |_ | _| | |
* q15 `|__|__|'q16 |______________________ |
* <-'| |`-> 10X | | ^ |
* | | | | /_\ |
* |_____/\r4__| ___/|\____________________/|\_____|VCC |
* | 6K \/ | | | | | |
* |_ veq16 -> | -> | | |
* /// q0`|_| q11`|_| | |
* _ '| _ '| | |
* ___ | | | |
* _____________|INP|_________/|\_______________ | | |
* | |___| ____|__________ | | vbq9 | |
* | | vcq0 | | |_______ | |
* | ___ <- -> | | _| | _| |
* | ____ |INN|_|'q1 q2`|_| |_|'q7 |_|'q9 10X |
* | _|_ | |___| |`_ _ '| |`-> |`-> _|_
* | /VAC\ | | | |_______||__ |veq7 |_____|OUT|
* | \___/ | | | | ||c1| <- | |___|
* | _|_ | | | | ^ |_|'q8 <- |
* | /VIN\ | | |vcq1 vcq2 | /_\ | |`_ _|'q10 |
* | \___/ | | |_____ | _| |____|_| |`_ 10X |
* |___| | | | | |__|'q5 | | |
* _|_ | | |_ | _| |`-> _| vbq10 | |
* /VCM\ | | q3 `|__|_______|'q4 |__|'q6 | |
* \___/ | | <-'| |`-> vbq6| |`-> | |
* | | | | | | |___________| |
* | | | |__/\r1____/\r2__| |/\r3_| |
* _|_ | | 60K \/ |60K \/ 60K \/ | |
* /// | | veq3 |_ veq4 _|_ |
* | | /// /// |
* | | |
* |_/\r5_|_____________/\r6_____________________________________|
* 10K\/ 10K \/
*
*==============================NETLIST=============================================
.OPTIONS GMIN=1e-15 METHOD=gear ABSTOL=1e-15 TEMP=27 srcsteps = 1 gminsteps = 1
*======== ====== ====== ====== ====== ====== ======
*V_DC_NUM NODE_P NODE_N DC VALUE
*======== ====== ====== ====== ====== ====== ======
VCC VCC 0 DC 5
VCM INP 0 DC 1.5
VIN VIN INP DC 1u
VAC VAC VIN AC 1m DC 0
VL VL 0 DC 1
*======== ====== ====== ====== ====== ====== ====== ====== ======
*Q_NUMB NCOL NBASE NEMIT NSUB MODEL AREA
*======== ====== ====== ====== ====== ====== ====== ====== ======
q13 vbq15 vbq12 Vcc pnpl 1
q12 vbq12 vbq12 Vcc pnpl 1
q15 vbq15 vbq15 0 npnv 1
q16 vbq12 vbq15 veq16 npnv 10
q0 vcq0 vbq12 Vcc pnpl 1
q11 vbq9 vbq12 Vcc pnpl 3
q1 vcq1 INN vcq0 pnpl 1
q2 vcq2 INP vcq0 pnpl 1
q3 vcq1 vcq1 veq3 npnv 1
q4 vcq2 vcq1 veq4 npnv 1
q5 Vcc vcq2 vbq6 npnv 1
q6 vbq10 vbq6 0 npnv 3
q7 vbq9 vbq9 veq7 npnv 1
q9 Vcc vbq9 OUT npnv 10
q8 vbq10 vbq10 veq7 pnpl 1
q10 0 vbq10 OUT pnpl 10
*======== ====== ====== ====== ====== ====== ====== ====== ======
*R_NUMB NODE1 NODE2 RVALUE MODEL L=VAL W=VAL
*======== ====== ====== ====== ====== ====== ====== ====== ======
r1 veq3 0 RMODEL L=60u W=1u
r2 veq4 0 RMODEL L=60u W=1u
r3 vbq6 0 RMODEL L=60u W=1u
r4 veq16 0 RMODEL L=6u W=1u
c1 vcq1 vbq10 5p
r5 VAC INN 10k
r6 OUT INN 10k
rl OUT VL 10k
*=======================SIMULATION=====================================================
* 2 SupplyVoltages X 3 Temperatures X 2 PNPL_beta X 2 ResOhmperSq = 24 Datasheet tests
*======================================================================================
.control
set outfile = "OpAmpCorners.txt"
echo "OpampCornerTester" > $outfile
foreach processval 1 2 3
echo "=============================PROCESS_CHANGE========================" >> $outfile
if ( $processval = 2 )
altermod @rmodel[rsh] = 1200
end ***<-- if $processval
if ( $processval = 3 )
altermod @pnpl[bf] = 120
end ***<-- if $processval
let npnbf = @npnv[bf]
let npnvaf = @npnv[vaf]
let pnpbf = @pnpl[bf]
let pnpvaf = @pnpl[vaf]
let resq = @rmodel[rsh]
echo "npnbf=$&npnbf npnvaf=$&npnvaf pnpbf=$&pnpbf pnpvaf=$&pnpvaf Ressq=$&resq" >> $outfile
foreach tempval -45 27 127
set temp = $tempval
foreach vsval 1 2
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~CONDITION_CHANGE~~~~~~~~~~~~~~~~~~~~" >> $outfile
if ( $vsval = 1 )
*DC SOURC1 VSTART VSTOP VSTEP SOURC2 START2 STOP2 STEP2
*======== ====== ====== ====== ====== ====== ====== ====== ======
dc vcm 1.5 1.501 .001 vcc 5 5.001 .001
end ***<-- if $vsval
if ( $vsval = 2 )
dc vcm 1.5 1.501 .001 vcc 10 10.001 .001
end ***<-- if $vsval
let TT = @q1[temp]
let Vs = VCC[0]
let Vcmm = INP[0]
let Vout = OUT[0]
let Is = -vcc#branch[0]
let Iin = (@q1[ib] + @q2[ib])/2
let Ioff = abs(@q2[ib]-@q1[ib])
let vos = INP[0]-INN[0]
let avos = abs(INP[0]-INN[0])
let Cmrr = -db(abs(INP[0]-INN[0]-INP[1]+INN[1]))-60
let Psrr = -db(abs(INP[0]-INN[0]-INP[2]+INN[2]))-60
let Iout = (OUT[0]-VL[0])/10000
echo "Temp_C= $&TT Vcc=$&Vs Vcm=$&Vcmm Vout=$&Vout Iout=$&Iout Is=$&Is" >> $outfile
echo "vos = $&vos Iin =$&Iin Ioff=$&Ioff Cmrr_dB=$&Cmrr Psrr_dB=$&Psrr " >> $outfile
if ( avos >1m or Iin >1u or Ioff > 1u or cmrr < 90 or psrr < 90 )
echo "spec failure #########################################################" >> $outfile
end ***<-- if avos >1m etc....
*DC SOURC1 VSTART VSTOP VSTEP SOURC2 START2 STOP2 STEP2
*======== ====== ====== ====== ====== ====== ====== ====== ======
dc vin 1u 1001u .001 vl -29 31 30
let Avol = -db(abs(INP[2]-INN[2]-INP[3]+INN[3]))-60
let Ioutn = (OUT[0]-VL[0])/10000
let Ioutp = (OUT[4]-VL[4])/10000
echo "Avol_dB=$&Avol Ioutn = $&Ioutn Ioutp = $&Ioutp" >> $outfile
if ( Avol < 80 or Ioutn < 2m or Ioutp > -2m )
echo "spec failure #########################################################" >> $outfile
end ***<-- if Avol < 80u etc....
*AC DECADE NUMDEC FSTART FSTOP
*======== ====== ====== ====== ====== ====== ====== ====== ======
ac dec 2 .1Meg 10Meg
let GBW = mag(out[0]/inn[0])/10
let Pmarg = phase(inn[2]) -phase(out[2])
echo "GBW_MHz = $&GBW Pmarg_deg = $&Pmarg " >> $outfile
end **** <--foreach vsval
end **** <--foreach tempval
end **** <--foreach processval
echo "done"
.endc
*=======================MODELS=========================================================
.model RMODEL R (RSH=1000 TC1= 0.00138 TC2=0.0000000078 )
.model npnv npn (
+IS=1E-15 NF=1.0 BF=150 VAF=200 IKF=6e-03
+CJE=1.7E-13 CJC=1.8E-13 CJS=2.9E-12 TF=1.6E-9
+XTB=2 EG=1.11 XTI=10 TNOM=25
.model pnpl pnp (
+IS=7.91E-17 NF=1.01 BF=150 VAF=200 IKF=0.002
+CJE=1.7E-13 CJC=1.8E-13 CJS=2.9E-12 TF=1.6E-9
+XTB=2 EG=1.11 XTI=7 TNOM=25 )
.end
===========Self_Heating_NPN========================
===========Copy_Paste_Text_Below_And_Simulate=========
Self_Heating_NPN
* www.idea2ic.com
* dsauersanjose@aol.com 1/20/10 replace(OPT-SPACE)=>SPACE
*
* / H /
* ____/__________________________________________/______
* /...................................................../
* /.................oxide.............................../
* ___ /....___________________________________________....../
* /..../ n40x5x1 /...../
* /..../ ________________________ /...../
* /..../ / ________ _________ / ________ /...../
* W /..../ / /____ B / /____ E / / /____ C / /...../
* /..../ / //___/| / //___/| / / //___/| / /...../
* /..../ / / |___|// / |___|/ / / / |___|// /...../
* __/____/_/_/_______/___/________/_/____/_______/__/_____/___
* |....| | | p+imp | | n+imp | | | n+imp | |.....|
* |....| \ \_____/base\_____ _/ / \_____/ |.....|
* |....| \____________________/ |.....| D
* |....| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |.....|
* |....|/ N BURIED LAYER \|.....|
* |.....\________________________________________/......|___
* |.....................................................|
* |................oxide................................| T
* |_____________________________________________________|___
*
* H = 81u W = 36u D = 4u T = 1u
*
* Therm_Conduct_SiO2 1/Rho = 1.4 W/(m*K)
* Spec_heat Silicon Cv = 760 J/Kg-K
* Density Silicon = 2.42 gm/cm3
*
* Rth_calc = 170degC/W
* Cth_calc = 21e-9 J/K
*
* ___________ BPWR
* | VCC |
* | 10V | I = (v(vcc)-v(ve))*i(ve)
* _|_ |
* /VCC\ | BPWR VTEMP RTH
* \___/ B _| C _________/\ /\ /\_
* | ____|'QN1 _|_ | \/ \/ |
* _|_ | |`-> EM / _ \ _|_ _|_
* \\\ | _|_ \/ \/ ___ CTH ///
* | / \ /\_/\ |
* _|_ | VE | \___/ _|_
* /VIN\ \___/ | \\\
* \___/ _|_ EM2 _|_
* | / \ \\\
* _|_ | BTH | BTH
* \\\ \___/ OUT ___
* |_______|OUT| v = -2.2m*VTEMP
* | |___|
* | 100 LabMeasured 47mVpk @18uS tau
* |____/\ ______ (Rth, Cth adjusted to data)
* \/ _|_
* 0->1.6V ///
*
*======== ====== ====== ====== ====== ====== ====== ====== ======
VCC VCC 0 DC 10
VIN VIN 0 PULSE( 0 2.8 1n 1n 1n 100u 200u )
Q1 VCC VIN EM npnv 1
VE EM EM2 DC 0
BTH EM2 OUT v = 2.2m*v(VTEMP)
R1 OUT 0 100
BPWR VTEMP 0 i = (v(VCC) -v(OUT))*i(VE)
RTH VTEMP 0 160
CTH VTEMP 0 60n
*TRAN TSTEP TSTOP TSTART TMAX ?UIC?
.TRAN 1u 200u 0 1u
.control
set pensize = 2
run
plot out em2 ylimit 1.55 1.65
plot -vtemp
.endc
.model npnv npn (
*==========================================================
+IS=1.1E-16 NF=1.0 BF=120 VAF=30 IKF=6e-03
+ NR=1.0 BR=0.5 VAR=4 IKR=3e-04
+ISE=9E-17 NE=2
+ISC=1E-21 NC=2
+RB=150 RBM=150 IRB=8E-04
+RE=17 RC=110
*==========================================================
+CJE=2E-14 VJE=0.65 MJE=0.3
+CJC=2E-14 VJC=0.65 MJC=0.3
+CJS=3E-14 VJS=0.35 MJS=0.19 XCJC=0.42
+TF=2E-11 XTF=1.25 VTF=1 ITF=0.0035
+TR=6E-09 FC=0.9 PTF=210
*==========================================================
+KF=1.0E-16 AF=1
+XTB=1.4 EG=1.11 XTI=8 TNOM=25
.end
===========Lissajous========================
===========Copy_Paste_Text_Below_And_Simulate=========
X-Y Plot example (CDHW Version)
vin 1 0 pulse 0 1 10u
r1 1 2 10
c1 2 3 1u
l1 3 0 1m
.control
tran 1u 1000u
plot v(3)
plot i(vin)
plot i(vin) vs v(3)
plot i(vin) vs v(3) pointplot
.endc
.end
===========Pinch_Resistor========================
===========Copy_Paste_Text_Below_And_Simulate=========
PINCH_RESISTOR
* www.idea2ic.com
* dsauersanjose@aol.com 1/20/10 replace(OPT-SPACE)=>SPACE
*
* XRpinch
* Vtest ________
* _____|_/\ /\ /\_
* _|__ \/ \/ _|_
* /_ \ : ///
* // \ \ :
* \ \_// : Rset
* \____/ :./\ /\ /\_
* _|_ \/ \/ _|_
* /// VRset ///
* Vramp
*======== ====== ====== ====== ====== ====== ====== ====== ======
Vramp Vtest 0 PWL( 0 0.1 5 5.0)
XRpinch Vtest 0 VRset Rpinch
Rset VRset 0 1k
.tran 100m 5 0 100m
.control
run
plot -vramp#branch vs Vtest
dump
.endc
* ___ ___ .SUBCKT Rpinch INP INN VRS
* |INP|_______ |VRS|
* |___| | _|_ |___| ___ ________ ___
* |_ / \ _|_ ==> |INP|_|_/\ /\ /\_|INN|
* |Bpinc| / _ \ |___| \/ \/ |___|
* __| | \/ \/ _:_
* | \___/ /\_/\ |VRS|
* | | \___/Isen |___|
* ___ | | _|_
* |INN|__|____| ///
* |___|
*
*======== ====== ====== ====== ====== ====== ====== ====== ======
.SUBCKT Rpinch INP INN VRS
Isen VRS 0 -1u
Bpinc INP INN I = .000001*(v(INP) - v(INN))/(v(VRS)*(1+1*(v(INP) - v(INN))))
.ENDS Rpinch
*
* Attach Pin 2 to highest voltage
*
* ________________________________________________________
* / _____________________ Nepi /
* / ____________ /..................../_______________ /
* / / ________ / / ________ / /
* / / /____ 1 / / 2 / /____ 3 / / /
* / / //___/| / / / //___/| / / /
* / / / |___|// / / / |___|// / /
* _/_/_/_______/___/____________________/_____/_______/_/__/___
* | | | p+imp | | n+imp | | p+imp | | |
* | \ \_____/ \___________________/ base \_____/ / |
* | \______________________________________________/ | Psub
* | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
* |/ N BURIED LAYER \|
* \ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /
* P-Substrate
*
.end
===========Sanity_Test_NPN_TC========================
Circuit: Test Match NPN TC to Silicon
Temp = -55 C_deg Vbe = 0.823219 Beta = 62.345
Temp = -35 C_deg Vbe = 0.782302 Beta = 71.2528
Temp = -15 C_deg Vbe = 0.740177 Beta = 80.6773
Temp = 5 C_deg Vbe = 0.696933 Beta = 90.6231
Temp = 25 C_deg Vbe = 0.652636 Beta = 101.095
Temp = 45 C_deg Vbe = 0.607372 Beta = 112.1
Temp = 65 C_deg Vbe = 0.561192 Beta = 123.644
Temp = 85 C_deg Vbe = 0.514146 Beta = 135.734
Temp = 105 C_deg Vbe = 0.466281 Beta = 148.378
Temp = 125 C_deg Vbe = 0.417638 Beta = 161.583
===========Copy_Paste_Text_Below_And_Simulate=========
Test Match NPN TC to Silicon
* www.idea2ic.com
* dsauersanjose@aol.com 1/20/10 replace(OPT-SPACE)=>SPACE
* _____
* | 0| Use this to simulate Vbe and Beta over temp.
* | _|_ Tweek the model terms IS, XTB, and XTI.
* | / _ \ Repeat until simulations match actual silicon.
* _|_ \/ \/ Different simulators often give different results!
* /// /\_/\ I1
* \___/ V2 R2
* | __/\ /\ /\__
* _______|_________ C _|_ \/ \/ _|_
* | |C ____ / \ ///
* | R1 _| |EGbas|
* |___/\ /\ /\_|' npn ____| |
* \/ \/ |`-> B \___/
* B | _|_
* _|_ ///
* ///
*======== ====== ====== ====== ====== ====== ====== ====== ======
I1 0 C DC 1e-6
R1 C B 1
R2 V2 0 1k
Q1 C B 0 npnv 1
EGbas V2 0 C B 1
.control
foreach tempval -55 -35 -15 5 25 45 65 85 105 125
set temp = $tempval
op
let beta = mag(1e-6/v2)
let vbe = mag(b)
echo Temp = $temp C_deg Vbe = $&vbe Beta = $&beta
end
.endc
.model npnv npn (
*==========================================================
+IS=1.1E-17 NF=1.0 BF=120 VAF=30 IKF=6e-03
+ NR=1.0 BR=0.5 VAR=4 IKR=3e-04
+ISE=9E-17 NE=2
+ISC=1E-21 NC=2
+RB=750 RBM=450 IRB=8E-04
+RE=17 RC=110
*==========================================================
+CJE=2E-14 VJE=0.65 MJE=0.3
+CJC=2E-14 VJC=0.65 MJC=0.3
+CJS=3E-14 VJS=0.35 MJS=0.19 XCJC=0.42
+TF=2E-11 XTF=1.25 VTF=1 ITF=0.0035
+TR=6E-09 FC=0.9 PTF=210
*==========================================================
+KF=1.0E-16 AF=1
+XTB=1.4 EG=1.11 XTI=8 TNOM=25
.end
*********Actual Silicon DATA***********************
** Temp NPN_1uA Beta
** -55 8.23E-01 67%
** -35 7.87E-01
** -15 7.43E-01 75%
** 5 6.96E-01
** 25 6.53E-01 100%
** 45 6.09E-01
** 65 5.64E-01 125%
** 85 5.19E-01
** 105 4.74E-01
** 125 4.17E-01 160%
** tweek XTI & IS XTB
===========Simple_ADC_2_DAC========================
===========Copy_Paste_Text_Below_And_Simulate=========
SimpleADC2DAC
* dsauersanjose@aol.com 5/20/08
* www.idea2ic.com
VT Vtime 0 PWL ( 0 0 1 1 )
B0 A 0 V = u(-1000*sin( 3.142*2*v(Vtime)+1u)) -.0044
B1 B 0 V = u(-1000*sin( 3.142*4*v(Vtime)+1u)) -.0088
B2 C 0 V = u(-1000*sin( 3.142*8*v(Vtime)+1u)) -.0132
B3 D 0 V = u(-1000*sin( 3.142*16*v(Vtime)+1u)) -.016
B4 OUT 0 V = .5*v(A)+ .25*v(B)+.125*v(C) +.0625*v(D)
.control
set pensize = 2
tran 100u 1 0 100u
plot v(a) v(b) v(c) v(d) v(out) v(vtime)
plot v(out) v(vtime)
.endc
.end
===========BSIM_MOS_CAPS========================
Circuit: BSIM_NMOS_Caps
3dB point f = 4.7863E+09 Hz cg = 3.3269E-15
3dB point f = 1.31826E+09 Hz cb = 1.20793E-14
3dB point f = 1.7378E+09 Hz cds = 9.16306E-15
cbs = cbd = 4.58153E-15
cgs = cgd = 2.0535E-16
cgb = 2.9162E-15
===========Copy_Paste_Text_Below_And_Simulate=========
BSIM_NMOS_Caps
* dsauersanjose@aol.com 5/20/08
* www.idea2ic.com
* IN
* ___________/\ /\ /\___________________________________
* | RG 10K \/ \/ |
* |__________/\ /\ /\_____________ |
* | RDS 10K \/ \/ | |
* |__________/\ /\ /\__ | 9.1fF |
* | RB 10K \/ \/ | | |
* | |B |DS G | 3.3fF
* | |12fF | |
* _|__ VIN MB | MDS | MG |
* /_ \ _________| ___| ___ |
* // \ \ | |_ | | |_ | |_ |
* \ \_// | ||__| | ||_ | ||__|
* \____/ __/|\____|| __/|\____|| | _/|\____||
* _|_ | | <-|| | | <-|| | | | <-||
* /// | |___| | |___| | | |___|
* | | | | |
* |________________|____________|___|______|
* _|_
* ///
*
.OPTIONS GMIN=1e-15 METHOD=gear ABSTOL=1e-15 temp=27
VIN IN 0 DC 0V AC 1V
RG G IN 10k
RDS DS IN 10k
RB B IN 10k
MB B B B 0 NMOSC W=3u L=1u AD=7p AS=7p PD=10u PS=10u
MDS DS 0 DS 0 NMOSC W=3u L=1u AD=7p AS=7p PD=10u PS=10u
MG 0 G 0 0 NMOSC W=3u L=1u AD=7p AS=7p PD=10u PS=10u
.control
run
ac dec 50 100Meg 10ghz
plot db(v(g)) db(v(b)) db(v(ds)) ylimit -3 0
let gain = (db(g))
let f = mag(frequency[ sortorder( abs(gain+3.0) )[0] ] )
let cg = 1/(6.28e4*f)
echo "3dB point f = $&f Hz cg = $&cg"
let gain = (db(b))
let f = mag(frequency[ sortorder( abs(gain+3.0) )[0] ] )
let cb = 1/(6.28e4*f)
echo "3dB point f = $&f Hz cb = $&cb"
let gain = (db(ds))
let f = mag(frequency[ sortorder( abs(gain+3.0) )[0] ] )
let cds = 1/(6.28e4*f)
echo "3dB point f = $&f Hz cds = $&cds"
let cbs = cds/2
let cgb = cb - cds
let cgs = (cg - cgb)/2
echo "cbs = cbd = $&cbs"
echo "cgs = cgd = $&cgs"
echo "cgb = $&cgb"
.endc
.model NMOSC NMOS
+ Level= 8 Tnom=27.0
*------------------Process-----------------------------------------------
+ tox=160e-10 xj=0.25e-06 nch=0.5e+17
*------------------V_threshold-------------------------------------------
+ vth0=0.72 nlx=0.12e-06
*------------------Bulk--------------------------------------------------
+ k1=1.04 k2=-1.209E-01
*------------------mobility----------------------------------------------
+ u0=678 ua=8.964e-10
+ ub=1.472e-18 uc=-4.441E-17 vsat=86000
*------------------Subthresshold-----------------------------------------
+ nfactor=1.8
+ cit=-5.0E-04 voff=-7.862E-02
+ eta0=4.441e-16 etab=-2.E-01 dsub=0.7
*------------------Hot electrons-----------------------------------------
+ alpha0=1.61e-05 beta0=36.68
*------------------VAF---------------------------------------------------
+ lint=.12e-06 pclm=.19 pscbe1=3.79e+08 pscbe2=9.4e-05
+ delta=0.01655 pvag=0.4484
*------------------Bulk_diode--------------------------------------------
+ js=5.858e-08
*------------------Resistance--------------------------------------------
+ rsh=70 rdsw=375
+ wr=0.7586 prwb=0 prwg=-4.441E-17
*------------------Capacitance-------------------------------------------
+ cj=0.0002424 cjsw=2.73e-10 mj=0.3551 mjsw=0.3873
+ cgso=9e-13 cgdo=9e-13 cgbo=7e-10
+ cdsc=-2.4E-4 cdscd=-1.506E-01 cdscb=-2.219E-04
+ pb=0.5614 pbsw=0.8 xpart=0
+ dlc=5e-08 dwc=1.5e-07
*------------------BulkChargeEffect--------------------------------------
* a0=0.7 a1=0 a2=1 ags=0.05583
* b0=6.305e-08 b1=6.579e-08 keta=-1.531E-02
*------------------ShortChannel------------------------------------------
+ dvt0=2.2 dvt1=0.53 dvt2=-1.521E-01 drout=0.76
+ pdiblcb=.4 pdiblc1=0.00886 pdiblc2=0.00029
*------------------NarrowChannel-----------------------------------------
+ w0=2.6e-04 wint=0.16e-06
+ ww=-9.525E-14 wwn=1.0
+ dvt0w=0 dvt1w=5.3e6 dvt2w=-1.E-01
+ k3=2.53 k3b=-5 dwg=0 dwb=0
*------------------Noise-------------------------------------------------
* af=1 kf=1e-28 ef=0.95
*------------------Temperature-------------------------------------------
* pvsat=0 ute=-1.258E+00 kt1=-3.85E-01
* kt1l=0 kt2=-3.098E-02 ua1=5.705e-09
* ub1=-1.147E-17 uc1=-1.302E-01 at=20380
* prt=-3.287E+02 lk1=0 lk2=0
* lvsat=0 la0=0 lags=0 lute=0
* luc=0
.end
===========Bsim_MOS_Gate_Cap========================
=>Vtest Cgate=
0 8.61735E-15
0.25 8.61735E-15
0.5 8.61735E-15
0.75 8.61735E-15
1 7.98069E-15
1.25 4.66345E-15
1.5 4.66345E-15
1.75 5.03547E-15
2 5.43718E-15
2.25 5.87093E-15
2.5 6.33929E-15
2.75 7.39107E-15
3 7.98069E-15
3.25 8.61735E-15
3.5 8.61735E-15
3.75 8.61735E-15
4 8.61735E-15
===========Copy_Paste_Text_Below_And_Simulate=========
BSIM_NMOS_Gate_Cap
* dsauersanjose@aol.com 5/20/08
* www.idea2ic.com
*
* IN RG ____
* __________/\ /\ /\__ | |
* | 10K \/ \/ | | _|_
* _|__ VIN | A | /VG \
* /_ \ ___ | | \___/
* // \ \ | |_ | | |2
* \ \_// | ||__| | _|_
* \____/ |_____|| | /VG2\
* _|_ | <-|| | \___/
* /// |___|__________| _|_
* B ///
*
*
.OPTIONS GMIN=1e-15 METHOD=gear ABSTOL=1e-15 temp=27
VIN IN 0 DC 0V AC 1mV
RG IN A 10k
VG B 2 DC 5V
VG2 2 0 DC -2V
MG B A B B NMOSC W=3u L=1u AD=7p AS=7p PD=10u PS=10u
.control
setplot new
compose VbiasVals values 0 .25 .5 .75 1 1.25 1.5 1.75 2 2.25 2.5 2.75 3 3.25 3.5 3.75 4
settype voltage VbiasVals
let NoOfVbias = length(VbiasVals)
* ==================Loop_Vbias==============
echo "=>Vtest = Cgate="
set thisName = CV_NMOS_F
let $thisName = 0 * vector(NoOfVbias)
let k = 1
repeat 17
let Vbias = VbiasVals[k-1]
alter VG dc = $&Vbias
ac dec 30 .0001GHz 100GHz
let g = (db(a)+60)
let f = mag(frequency[ sortorder( abs(g+3.0) )[0] ] )
let cg = 1/(6.28e4*f)
echo "$&unknown.Vbias $&cg"
let unknown.{$thisName}[unknown.k-1] = cg
destroy
let k = k + 1
endrepeat
settype notype unknown.{$thisName}
let Vgate = VbiasVals -2
setscale Vgate
plot $thisName title "CV_Curve_Nmos"
echo "Done."
.endc
.model NMOSC NMOS
+ Level= 8 Tnom=27.0
*------------------Process-----------------------------------------------
+ tox=160e-10 xj=0.25e-06 nch=0.5e+17
*------------------V_threshold-------------------------------------------
+ vth0=0.72 nlx=0.12e-06
*------------------Bulk--------------------------------------------------
+ k1=1.04 k2=-1.209E-01
*------------------mobility----------------------------------------------
+ u0=678 ua=8.964e-10
+ ub=1.472e-18 uc=-4.441E-17 vsat=86000
------------------Subthresshold-----------------------------------------
+ nfactor=1.8
+ cit=-5.0E-04 voff=-7.862E-02
+ eta0=4.441e-16 etab=-2.E-01 dsub=0.7
*------------------Hot electrons-----------------------------------------
+ alpha0=1.61e-05 beta0=36.68
*------------------VAF---------------------------------------------------
+ lint=.12e-06 pclm=.19 pscbe1=3.79e+08 pscbe2=9.4e-05
+ delta=0.01655 pvag=0.4484
*------------------Bulk_diode--------------------------------------------
+ js=5.858e-08
*------------------Resistance--------------------------------------------
+ rsh=70 rdsw=375
+ wr=0.7586 prwb=0 prwg=-4.441E-17
*------------------Capacitance-------------------------------------------
+ cj=0.0002424 cjsw=2.73e-10 mj=0.3551 mjsw=0.3873
+ cgso=9e-13 cgdo=9e-13 cgbo=7e-10
+ cdsc=-2.4E-4 cdscd=-1.506E-01 cdscb=-2.219E-04
+ pb=0.5614 pbsw=0.8 xpart=0
+ dlc=5e-08 dwc=1.5e-07
*------------------BulkChargeEffect--------------------------------------
* a0=0.7 a1=0 a2=1 ags=0.05583
* b0=6.305e-08 b1=6.579e-08 keta=-1.531E-02
*------------------ShortChannel------------------------------------------
+ dvt0=2.2 dvt1=0.53 dvt2=-1.521E-01 drout=0.76
+ pdiblcb=.4 pdiblc1=0.00886 pdiblc2=0.00029
*------------------NarrowChannel-----------------------------------------
+ w0=2.6e-04 wint=0.16e-06
+ ww=-9.525E-14 wwn=1.0
+ dvt0w=0 dvt1w=5.3e6 dvt2w=-1.E-01
+ k3=2.53 k3b=-5 dwg=0 dwb=0
*------------------Noise-------------------------------------------------
* af=1 kf=1e-28 ef=0.95
*------------------Temperature-------------------------------------------
* pvsat=0 ute=-1.258E+00 kt1=-3.85E-01
* kt1l=0 kt2=-3.098E-02 ua1=5.705e-09
* ub1=-1.147E-17 uc1=-1.302E-01 at=20380
* prt=-3.287E+02 lk1=0 lk2=0
* lvsat=0 la0=0 lags=0 lute=0
* luc=0
.end
===========Control_Loops========================
while condition //an arbitrary algebraic expression, is true, execute the statements
end //may be terminated with 'endwhile'
repeat [ number ] //Execute the statements number times, or forever if no argument is given
end //may be terminated with 'endrepeat'
dowhile condition
end //condition is tested after the statements are executed can use 'enddowhile'
foreach var value ... //executed once each values setting value to current one
end //may be terminated with 'endforeach'
if condition //If condition non-zero executed first, otherwise second set
else
end //may be terminated with 'endif',
set pensize = N' where 0<N≤10 is measured in points.
============Vector_Types========================
settype voltage vout
notype
time (s)
frequency (Hz
voltage (V)
current (A)
onoise-spectrum (X/Hz)
onoise-integrated (X)
inoise-spectrum (X/Hz)
inoise-integrated (X)
pole (Hz) zero (Hz)
s-param
angle
impedance (ohm)
admittance (S)
power (W)
decibel (dB)
temperature (°C)
============Functions========================
define max(x,y) (x > y) * x + (x <= y) * y
define min(x,y) (x < y) * x + (x >= y) * y
============Variable_Array_Details========================
k and j are stored in 'unknown' plot created by the 'setplot new' command near the top of the file.
tran, linearize and spec commands each create their own plots
one destroy removes the "spec" plot leaving the linearized plot as the current plot.
to get back to the 'unknown' plot.
repeat 3
destroy
end
let sig = mag(VOUTC[49])
print sig
let VOUTC[50] = (1e-6,1e-6)
let sig = mag(VOUTC[50])
print sig
can refer to variables in non-current plots by specify the plot when referring to them.
e.g. let unknown.k = unknown.k + 1 refers to k in the most recent unknown plot.
$varname values of variables =
$$ and $< special variables refer to process ID program and line of input which is read from terminal
when the variable is evaluated, respectively.
$&word variable name considered a vector (see above)
If $foo is list, then the expression $foo[low-high] represents a range of elements.
Either the upper index or the lower may be left out,
reverse of a list may be obtained with $foo[len-1].
$?foo evaluates to 1 if the variable foo is defined, 0 otherwise, and
$#foo evaluates to number of elements in foo if a list, 1 if a number or string, and 0 if boolean variable.
define max(x,y) (x > y) * x + (x <= y) * y
define min(x,y) (x < y) * x + (x >= y) * y
============Show_Details========================
show devices [ : parameters ] , ... //List device state
show -v @device [ [ name ] ] //Old form:
showmod models [ : parameters ] , ... //List model parameter values
"letter:subckt:", "#modelname", ":subckt:#modelname", or "letter:subcircuit:#modelname".
display Here are the vectors currently active:
show qn1 Show OP parameters
showmod Show model
dump Show node stated
listing
============Devices_Details========================
R Semiconductor resistor model
C Semiconductor capacitor model
SW Voltage controlled switch
CSW Current controlled switch
URC Uniform distributed RC model
LTRA Lossy transmission line model
D Diode model
NPN NPN BJT model
PNP PNP BJT model
NJF N-channel JFET model
PJF P-channel JFET model
NMOS N-channel MOSFET model
PMOS P-channel MOSFET model
NMF N-channel MESFET model
PMF P-channel MESFET model
Model Cards
*======== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ======
.MODEL MNAME TYPE( PNAME1=PVAL1 PNAME2=PVAL2 ... )
.MODEL MOD1 NPN ( BF= 50 IS= 1E-13 VBF= 50)
.MODEL SW SW( VT=2.6 VH=.2 RON=10 ROFF=1MEG)
.model RMODEL R( RSH=1000 TC1= 0.00138 TC2=0.0000000078 )
Resistor
*======== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ======
RXXXXXXX N1 N2 VALUE MNAME LEN WID TEMP
RLOAD 2 10 10K
Semiconductor Resistor
*======== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ======
RXXXXXXX N1 N2 MNAME LEN WID TEMP
RMOD 3 7 RMODEL L=10u W=1u
.model RMODEL R (RSH=1000 TC1= 0.00138 TC2=0.0000000078 )
Name Parameter
TC1 First order temperature coeff.
TC2 Second order temperature coeff.
RSH Sheet resistance
DEFW Default width
NARROW Narrowing due to side etching
TNOM Parameter measurement temperature
Capacitors
*======== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ======
CXXXXXXX N+ N- VALUE IC=INCOND
CBYP 13 0 1UF
COSC 17 23 10U IC=3V
Semiconductor Capacitors
*======== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ======
CXXXXXXX N+ N- MNAME L=LEN W=WID IC=VAL
CMOD 3 7 CMODEL L=10u W=1u
Name Parameter Units Default Example
CJ Junction bottom capacitance
CJSW Junction sidewall capacitance
DEFW Default device width
NARROW Narrowing due to side etching
Inductors
*======== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ======
LYYYYYYY N+ N- VALUE <IC=INCOND>
LLINK 42 69 1UH
LSHUNT 23 51 10U IC=15.7MA
Coupled Mutual Inductors
KXXXXXXX LYYYYY LZZZ VALUE
K43 LAA LBB 0.999
KXFRMR L1 L2 0.87
LYYYYYYY and LZZZ names of coupled inductors,
VALUE K coupling coefficient 0 -> 1.'dot'convention, place 'dot' on first node of each inductor.
Switches
*======== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ======
SXXXXXXX N+ N- NC+ NC- MODEL <ON><OFF>
s1 1 2 3 4 switch1 ON
s2 5 6 3 0 sm2 off
Switch1 1 2 10 0 smodel1
WYYYYYYY N+ N- VNAM MODEL <ON><OFF>
w1 1 2 vclock switchmod1
W2 3 0 vramp sm1 ON
wreset 5 6 vclck lossyswitch OFF
.MODEL SW SW( VT=2.6 VH=.2 RON=10 ROFF=1MEG)
Switch Model (SW/CSW)
Name Parameter Units Default Switch
VT Threshold voltage V 0.0 S
VH Hysteresis voltage V 0.0 S
IT Threshold current A 0.0 W
IH Hysteresis current A 0.0 W
RON On resistance Ω 1.0 both
ROFF Off resistance Ω 1/GMIN* both
Junction Diodes
*======== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ======
DXXXXXXX N+ N- MNAME AREA IC=VD TEMP=T
DBRIDGE 2 10 DIODE1
DCLMP 3 7 DMOD 3.0 IC=0.2
1 IS Saturation current
2 RS Ohmic resistance
3 N Emission coefficient
4 TT Transit-time sec
5 CJO Zero-bias junction capacitance
6 VJ Junction potential
7 M Grading coefficient
8 EG Activation energy
9 XTI Saturation-current temp. exp
10 KF Flicker noise coefficient
11 AF Flicker noise exponent 1
12 FC Coefficient for forward-bias depletion capacitance formula
13 BV Reverse breakdown voltage
14 IBV Current at breakdown voltage
15 TNOM Parameter measurement temperature
Field-Effect Transistors (JFETs)
*======== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ======
JXXXXXXX ND NG NS MNAME AREA <OFF> IC=VDS,VGS TEMP=T>
J1 7 2 3 JM1 OFF
OFF indicates an (optional) initial condition on the device for dc analysis.
LEVEL=1 Shichman-Hodges (described below)
LEVEL=2 Parker-Skellern jfet mesfet model (refer to the Macquairie University website)
*======== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ======
Name Parameter Units Default
VTO Threshold voltage V -2.0
BETA Transconductance parameter A V?2 1.0e-4
LAMBDA Channel-length modulation parame V?1 0
RD Drain ohmic resistance ohm 0
RS Source ohmic resistance ohm 0
CGS Zero-bias G-S junction capacitance F 0
CGD Zero-bias G-D junction capacitance F 0
PB Gate junction potential V 1
IS Gate junction saturation current A 1.0e-14
B Doping tail parameter - 1
KF Flicker noise coefficient - 0
AF Flicker noise exponent - 1
FC Coef forward-bias deple capac f - 0.5
TNOM Parameter measurement temper °C 27
*==========Bipolar Junction Transistors (BJTs)=============
QXXXXXXX NC NB NE NS MNAME AREA <OFF> IC=VBE, VCE TEMP=T
Q23 10 24 13 QMOD IC=0.6, 5.0
Q50A 11 26 4 20 MOD1 10
*==========Vertical_NPN=========================================
.MODEL NPNV NPN(
* ===========================================================
+ IS=15.51E-18 NF=1.005 BF=110 VAF=130.2 IKF=0.0001
+ NR=1.006 BR=0.4822 VAR=4.286 IKR=0.0002472
* ===========================================================
+ ISE=9.15E-17 NE=2
+ ISC=1E-21 NC=2
* ===========================================================
+ RB=732 RBM=441.2 IRB=7.5E-04
+ RE=15.33 RC=109.1
* ===========================================================
+ CJE=1.727E-14 VJE=0.6408 MJE=0.2563
+ CJC=1.826E-14 VJC=0.6399 MJC=0.3531
+ CJS=2.939E-14 VJS=0.3488 MJS=0.1813 XCJC=0.4201
* ===========================================================
+ TF=4.65E-12 XTF=1.25 VTF=1 ITF=0.009532
+ TR=6E-09 FC=0.88 PTF=205
* ===========================================================
+ KF=1.000E-16 AF=1
* ===========================================================
+ XTB=2 EG=1.11 XTI=5 TNOM=25 )
* _______________________________________
* / _______________________ /
* / / ________ ________ / ________ /
* / / /____ B / /____ E / / /____ C / /
* / / //___/| / //___/| / / //___/| / /
* / / / |___|// / |___|// / / |___|// /
* _/_/_/_______/__/_______/_/__/_______/__/______________
* | | | p+imp | | n+imp | | | n+imp | | P+Field |
* | \ \_____/Base\_____/ / \_____/ | |
* | \__________________/NWELL| CapI| | PWELL |
* | _ _ _ _ _ _ _ _ _ _ _ _ _ | |_ | _ _ _ _ _ _ |
* |/ N BURIED LAYER \ _ / \|/ P buryLay \|
* \ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ / \ _ _ _ _ _ _/
*
* ___
* |(C)| NPN
* SPICE MODEL |___|
* <actual_behavior> |
* <varies from spice model !> / RC 110ohms VAF=215
* \
* / 4fF
* ________________________|_____________________
* | | | | | | _|_ _|_Cjs
* | |12fF | | |Ir/BR |Irn / _ \ ___
* | | | / _|_ _|_ \/ \/ |gnd!
* _|_Cjcx _|_Cjc _|_Cdc \ ^ ^ /\_/\ _|_
* ___ ___ ___ / /_\ /_\ \___/ \sub/
* ___ | Rbb'| | gmin \ | | Ic | \ /
* |(B)|_|_/\ __|______|______|____|______| | | V
* |___| \/ | | | _|_ _|_ | V (hidden)
* 600ohms _|_Cje _|_Cde \ \ / \ / |
* BF=116 ___ ___ / _v_ _v_ |
* |20fF | gmin \ |If/Bf |Ifn |
* |______|______|____|______|______|
* |
* TF=8ps / RE 15ohms
* \
* /
* _|_
* |(E)|
* |___|
*
*===========Lateral_PNP==========================================
.MODEL PNPL PNP(
+ IS=7.91E-17 NF=1.01 BF=50 VAF=20 IKF=0.002
+ NR=1.01 BR=2 VAR=5 IKR=0.0002
+ ISE=2.95E-16 NE=2
+ ISC=1E-21 NC=2
+ RB=400 RBM=300 IRB=1E-03
+ RE=5 RC=700
+ CJE=10E-15 VJE=0.6408 MJE=0.2563
+ CJC=40E-15 VJC=0.6399 MJC=0.3531
+ CJS=90E-15 VJS=0.3488 MJS=0.1813 XCJC=0.4201
+ TF=20E-12 XTF=1.25 VTF=1 ITF=0.003532
+ TR=6E-09 FC=0.88 PTF=205
+ KF=1.000E-16 AF=1
+ XTB=2 EG=1.11 XTI=5 TNOM=25 )
*
* Poly is shorted to Emitter
* ________________________________________________
* / NWELL /
* / ______________________________ ______ /
* / /____ C / / / /
* / //___/| ____POLY P+ / / / /
* / / |___|/ /___/|_ / / / /
* / / ______/|___|//| / / N+ / /
* / / / ________ / / / / / /
* / / / /|______/ / / / / / /
* / / / / /___E / / / / /____B / /
* / / / / /___/|/ / / / //___/| / /
* / / /__/ /|___|/__/ / / / |___|// /
* _/___/_______|__|/______|__|/______/_/_______/__/____
* | | P+ | | P+ | | P+ | | N+ | |
* | \_____/ \_____/ \_____/ \_____/ |
* | Base NWELL |
* | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | _ ______
* |/ N BURIED LAYER \|/
* \ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _/ \ _ tor in
*
* ___
* <Substrate_hidden = gnd!> |(E)| SPICE MODEL
* ___ |___| Lateral
* | _|_ |
* | \(S)/ / RE 5ohms
* | \ / \
* | V /
* | ________________|_______________
* | | | | | | _|_
* 79fF | | | | |If/Bf |Ifn / _ \
* _|_Cjs |5fF | / _|_ _|_ \/ \/
* ___ _|_Cje _|_Cde \ \ / \ / /\_/\
* | ___ ___ / _v_ _v_ \___/
* ___ | Rbb'| | 1E12 \ | | Ic |
* |(B)|_|_/\ __|______|______|____|______| | |
* |___| | \/ | | | _|_ _|_ V |
* _|_Cjcx _|_Cjc _|_Cdc \ ^ ^ |
* ___ ___ ___ / /_\ /_\ |
* | |41fF | 1E12 \ |Ir/BR |Irn |
* |_______|______|______|____|______|______|
* |
* BF=175 / RC 700 ohms
* VA 30 \
* personal /
* data _|_
* |(C)|
* |___|
******************************************************************************
IS = transport saturation current
NF = forward current emission coefficient
NR = reverse current emission coefficient
BF = ideal maximum forward beta
BR = ideal maximum reverse beta
VAF = forward Early voltage
VAR = reverse Early voltage
IKF = corner for forward beta high current roll-off
IKR = corner for reverse beta high current roll-off
ISE = B-E leakage saturation current
ISC = B-C leakage saturation current
NE = B-E leakage emission coefficient
NC = B-C leakage emission coefficient
RB = zero bias base resistance
RBM = minimum base resistance at high currents
IRB = current where base resistance falls halfway to its min value
RE = emitter resistance
RC = collector resistance
CJE = B-E zero-bias depletion capacitance
CJC = B-C zero-bias depletion capacitance
CJS = zero-bias collector-substrate capacitance
VJE = B-E built-in potential
VJC = B-C built-in potential
VJS = substrate junction built-in potential
MJE = B-E junction exponential factor
MJC = B-C junction exponential factor
MJS = substrate junction exponential factor
XCJC = fraction of B-C depletion capacitance connected to internal base node
TF = ideal forward transit time
TR = ideal reverse transit time
XTF = coefficient for bias dependence of TF
VTF = voltage describing VBC dependence of TF
ITF = high-current parameter for effect on TF
FC = coefficient for forward-bias depletion capacitance formula
PTF = excess phase at freq=1.0/(TF*2PI)Hz
KF = AF = flicker-noise exponent
XTB = forward and reverse beta temperature exponent
EG = energy gap for temperature effect on IS
XTI = temperature exponent for effect on IS
TNOM = 300.15
*==========MOSFET_(CMOS)==================
MXXXXXXX ND NG NS NB MNAME L=VAL W=VAL AD=VAL AS=VAL PD=VAL PS=VAL IC=VDS,VGS,VBS TEMP=T
M1 24 2 0 20 TYPE1
M31 2 17 6 10 MODM L=5U W=2U
M1 2 9 3 0 MOD1 L=10U W=5U AD=100P AS=100P PD=40U PS=40U
AD,AS areas of the drain and source diffusions, in meter2 .
PD,PS perimeters of the drain and source junctions, in meters.
NRD,NRS number of squares of the drain and source diffusions;
MOSFET Models (NMOS/PMOS)
LEVEL=1 Shichman-Hodges
LEVEL=2 MOS2 (as described in [1])
LEVEL=3 MOS3, a semi-empirical model (see [1])
LEVEL=4 BSIM (as described in [3])
LEVEL=5 New BSIM (BSIM2; as described in [5])
LEVEL=6 MOS6 (as described in [2])
MacSpice provides additional mosfet devices.
level 1 through level 3 MOSFETs are defined by the device parameters VTO, KP, LAMBDA, PHI and GAMMA.
*=============NMOS==================================================
.model NMOSC NMOS
+ Level= 8 Tnom=27.0
*------------------Process-----------------------------------------------
+ tox=160e-10 xj=0.25e-06 nch=0.5e+17
*------------------V_threshold-------------------------------------------
+ vth0=0.72 nlx=0.12e-06
*------------------Bulk--------------------------------------------------
+ k1=1.04 k2=-1.209E-01
*------------------mobility----------------------------------------------
+ u0=678 ua=8.964e-10
+ ub=1.472e-18 uc=-4.441E-17 vsat=86000
------------------Subthresshold-----------------------------------------
+ nfactor=1.8
+ cit=-5.0E-04 voff=-7.862E-02
+ eta0=4.441e-16 etab=-2.E-01 dsub=0.7
*------------------Hot electrons-----------------------------------------
+ alpha0=1.61e-05 beta0=36.68
*------------------VAF---------------------------------------------------
+ lint=.12e-06 pclm=.19 pscbe1=3.79e+08 pscbe2=9.4e-05
+ delta=0.01655 pvag=0.4484
*------------------Bulk_diode--------------------------------------------
+ js=5.858e-08
*------------------Resistance--------------------------------------------
+ rsh=70 rdsw=375
+ wr=0.7586 prwb=0 prwg=-4.441E-17
*------------------Capacitance-------------------------------------------
+ cj=0.0002424 cjsw=2.73e-10 mj=0.3551 mjsw=0.3873
+ cgso=9e-13 cgdo=9e-13 cgbo=7e-10
+ cdsc=-2.4E-4 cdscd=-1.506E-01 cdscb=-2.219E-04
+ pb=0.5614 pbsw=0.8 xpart=0
+ dlc=5e-08 dwc=1.5e-07
*------------------BulkChargeEffect--------------------------------------
* a0=0.7 a1=0 a2=1 ags=0.05583
* b0=6.305e-08 b1=6.579e-08 keta=-1.531E-02
*------------------ShortChannel------------------------------------------
+ dvt0=2.2 dvt1=0.53 dvt2=-1.521E-01 drout=0.76
+ pdiblcb=.4 pdiblc1=0.00886 pdiblc2=0.00029
*------------------NarrowChannel-----------------------------------------
+ w0=2.6e-04 wint=0.16e-06
+ ww=-9.525E-14 wwn=1.0
+ dvt0w=0 dvt1w=5.3e6 dvt2w=-1.E-01
+ k3=2.53 k3b=-5 dwg=0 dwb=0
*------------------Noise-------------------------------------------------
* af=1 kf=1e-28 ef=0.95
*------------------Temperature-------------------------------------------
* pvsat=0 ute=-1.258E+00 kt1=-3.85E-01
* kt1l=0 kt2=-3.098E-02 ua1=5.705e-09
* ub1=-1.147E-17 uc1=-1.302E-01 at=20380
* prt=-3.287E+02 lk1=0 lk2=0
* lvsat=0 la0=0 lags=0 lute=0
* luc=0
* _______
* / /| ________
* / / Poly //| / / /
* / _______/ ///________ /____ / /
* / /____ / /// ____ / // /| / /
* / // /|/ (G) /// / /| / // // / /
* / //(S)///___|__/// /(D)// / //(B)// / /
* / //_|_// |______|/ /_|_// / //_|_// / /
* _/_/_|___|__|______|__|___|_/__/_|___|_/__/______
* |++| N+ |----> | N+ |++| P+ |++| NWELL
* | \______/ \ _____/ \_____/ |
* / SUBSTRATE \______
*
*
*
* SPICE MODEL ___
* __/\ ______|(D)| Drain
* CGD | \/ RD |___|
* .06fF _____________|__________
* _|_ _|_ _|_ _|_
* Gate ___ / _ \ I_ds ^ ___ CBD
* ___ | \/ \/ /_\ | 4.5fF <- (Caps for L/W 1u/2.6u)
* |(G)|__| /\_/\ | |_____| ___
* |___| |___ \___/ V ___| |_________| | Bulk
* | | | | _|_ _|_ 4.5fF |___|
* _|_ |__/|\__||_| \ / ___ _|_
* .06fF ___ |2fF|| _V_ | CBS \(B)/SUB=gnd!
* |_______|__________|_____| \ /
* CGS CGS | ___ V
* |__/\ ______|(S)|
* \/ RS |___| Source
*
*
*=============PMOS=============================================
.model PMOSC PMOS(
+ Level= 8 Tnom=27.0
*------------------Process-----------------------------------------------
+ tox=1.725e-08 xj=2e-07 nch=1e+17
*------------------V_threshold-------------------------------------------
+ vth0=-0.90 nlx=1.84e-08
*------------------Bulk--------------------------------------------------
+ k1=0.3969 k2=0.03536
*------------------mobility----------------------------------------------
+ u0=268 ua=4.124e-09
* ub=-3.8E-19 uc=-1.512E-02 vsat=140000
*------------------Subthresshold-----------------------------------------
+ nfactor=.5016
* cit=0.0001 voff=-0.08 nfactor=1.0016 vth0=-0.94
* eta0=0.038 etab=-1.057E-02 dsub=0.3501
*------------------Hot electrons-----------------------------------------
+ alpha0=2.5e-08 beta0=28.92
*------------------VAF---------------------------------------------------
+ lint=.1e-06 pclm=3.2 pscbe1=5e+08 pscbe2=1e-05
* delta=0.009 pvag=4
*------------------Bulk_diode--------------------------------------------
+ js=3.95e-08
*------------------Resistance--------------------------------------------
+ rsh=135 rdsw=2500
* prwg=-7.2E-02 prwb=0.06 wr=0.8625
*------------------Capacitance-------------------------------------------
+ cj=0.0002424 cjsw=2.73e-10 mj=0.3551 mjsw=0.3873
+ cgso=9e-13 cgdo=9e-13 cgbo=7e-10
* cdsc=-2.4E-4 cdscd=-1.506E-01 cdscb=-2.219E-04
* pb=0.85 pbsw=0.88 xpart=0
* dlc=5e-08 dwc=1.5e-07
*------------------BulkChargeEffect--------------------------------------
* a0=1 a1=0 a2=2 ags=0.268
* b0=5e-07 b1=1e-07 keta=-1.0E-02
*------------------ShortChannel------------------------------------------
* dvt0=2.9 dvt1=0.2 dvt2=-1.521E-01 drout=0.175
* pdiblcb=0 pdiblc1- pdiblc2=0.001
*------------------NarrowChannel-----------------------------------------
+ w0=2.6e-04 wint=0.16e-06
+ ww=-3.1E-19 wwn=1.9
* dvt0w=0.68 dvt1w=5.3e6 dvt2w=0.051
* k3=56 k3b=-3 dwg=0 dwb=1e-08
*------------------Noise-------------------------------------------------
+ af=0.8 kf=1.50e-30 ef=0.95
*------------------Temperature-------------------------------------------
* ldelta=0.02282 lpdiblc1=0.01877 ute=-1.500E+00
* cgsl=1.5e-10 cgdl=1.5e-10 ckappa=0.2463 cf=0
* kt1=-4.684E-01 kt1l=-2.0E-08 kt2=-2.818E-02
* ua1=-2.E-10 ub1=-4.5E-18 uc1=-2.000E-02
+ at=-1.5E+05 prt=1400 )
*
* SUBSTRATE
* _________________________________________
* / _______ /
* / / /| ________ /
* / / //| / / /
* / ______/ ///________ /____ / /
* / /____ / /// ____ / // /| / /
* / // /|/ (G) /// / /| / // // / /
* / //(S)///___|__/// /(D)// / //(B)// / /
* / //_|_// |______|/ /_|_// / //_|_// / /
* _/_/_|___|__|______|__|___|_/__/_|___|_/__/______
* |--| P+ |----> | P+ |--| N+ |--|
* | \_____/ NWELL \ _____/ \_____/ |
* \ /
* \____________________________________/
*
* SPICE MODEL ___
* __/\ ______| | Source
* CGS | \/ RS |___|
* _____________|__________
* _|_ _|_ _|_ _|_
* Gate ___ / _ \ I_ds \ / ___ CBS 6fF<- (Caps for L/W 1u/2.6u)
* ___ | \/ \/ _V_ |
* | |__| /\_/\ | |_____| ___
* |___| |___ \___/ V ___| |____| | Bulk
* | | | | _|_ _|_ |___|
* _|_ |__/|\__||_| ^ ___ |__..no..__
* ___ |2fF|| /_\ | CBD _|_
* |_______|__________|_____| 6fF ^
* CGD CGD | ___ /_\
* |__/\ ______| | Drain _|_
* \/ RD |___| \sub/
* \ /
* <Bulk_hidden = gnd!> V
*
******************************************************************************
* Term Description Defaults
* tox Gate oxide thickness 1.5e-8 m
* xj Junction Depth 1.5e-7 m
* nch Channel doping concentration 1.7e17/cm3
* nsub Substrate doping concentration 6e16/cm3
* vth0 Threshold @Vbs=0 for Large L 0.7 NMOS -0.7 PMOS
* nlx Lateral non-uniform doping Ldd => higher vt 1.74e-7m
* ********define by process******************
*
* k1 First order body effect coefficient 0.5/v^1/2
* k2 Second order body effect coef-ficient 0.0
* ******measure Vth vs Vbulk*******
*
* u0 Mobility at Temp = Tnom 670 cm2/V-s 250 PMOS
* ua 1st-order mobility degradation coeff 2.25E-9 m/V
* *********Measure Curve tracer**************
* ub 2nd-order mobility degradation coeff 5.87E-19 (m/V)2
* uc Body-effect mobility degrad coef
* mobmod =1,2: -4.65e-11m/V2
* mobmod =3: -0.046/V
* vsat Saturation velocity at Temp = Tnom 8.0E4m/sec
*
* nfactor Subthreshold swing factor **** if 120mv/dec n=2 ***** 1.0
* cit Interface trap capacitance 0.0F/m2
* voff Offset voltage in subthres reg large W and L -0.08V
* eta0 DIBL coefficient in subthreshold region 0.08
* etab Body-bias coefficient for the subthreshold DIBL effect -0.07/V
* dsub DIBL coefficient exponent in subthreshold region drout
*
* alpha0 first parameter impact ionization current 0 m/V
* beta0 second parameter impact ionization current 30V
* *********measure substate leakage**************
*
* lint Length offset ******measure L vs VAF*************** 0.0m
* pclm Channel length modulation parameter 1.3
* pvag Gate dependence of Early voltage 0.0
* delta Effective Vds parameter ***corner Lin to sat***** 0.01
* pscbe1 First sub current bodyeffect parameter 4.24E8V/m
* pscbe2 Second sub current bodyeffect parameter 1.0E-5m/V
* *************** measure VAF @ 5V*********************
*
* js Source drain junc sat current per area 1.E-4A/m2
* jssw Side wall saturation current density 0 A/m
* *****measure source/bulk diode voltage******
* xti Junction current temperature exponent coefficient 3.0
* nj Emission coefficient of junction 1 none
*
* rsh Source drain sheet resistance 0.0 ohm/sq
* rdsw Parasitic resistance per unit width ***Switch RON*** 0.0 ohm-um
* prwb Body effect coefficient of Rdsw 0 V^-1/2
* prwg Gate bias effect coefficient of Rdsw 0 1/V
* wr Width Offset from Weff for Rds calc 1.0
*
* cj Bottom junction per unit area 5e-4 F/m2
* cjsw Source/Drain side junction capacitance pe area 5.E-10 F/m
* mj Bottom junction capacitance grating coefficient 0.5
* mjsw Source/Drain side junction capacitance grading coeffi-cient 0.33
* cgso Non LDD region g/s overlap cap per length F/m nC-1
* cgdo Non LDD region d/gate overlap cap/ per length F/m nC-2
* cgbo Gate bulk overlap capacitance per unit channel length 0.0 F/m
* *******Measure Speed in Silicon**********
*
* cdsc Drain/Source coupling capacitance 2.4E-4F/m2
* cdscb Body-bias sensitivity of Cdsc 0.0F/Vm2
* cdscd Drain-bias sensitivity of Cdsc
* cjswg Source/drain gate sidwall junc capac grad coef Cjsw F/m
* mjswg Source/drain gate sidewall junction capac coeff Mjsw
* pb Bottom built-in potential 1.0 V
* pbswg Source/Drain gate sidewall junction built-in potential Pbsw V
* pbsw Source/drain side junction built-in potential 1.0V
* xpart Charge partitioning rate flag 0
* dlc Length offset fitting parame-ter from C-V lint m
* dwc Width offset fitting parameter from C-V wint m
* cgs1 Light doped source-gate region overlap capacitance 0.0F/m
* cgd1 Light doped drain-gate region overlap capacitance 0.0F/m
* ckappa Coef lightly doped overlap cap Fringfield cap 0.6 F/m 0.0 F/Vm2
* cf fringing field capacitance calculated F/m nC-3
*
* a0 Bulk charge coeff {when xj varies along channel} 1.0
* a1 First non-saturation effect parameter 0.0/V
* a2 Second non-saturation factor 1.0
* ags gate bias coefficient of Abulk 0.0
* b0 Bulk charge effect coeff for width 0.0
* b1 Bulk charge effect width offset 0.0m
* keta Body-bias coeff of bulk charge effect -0.047/V
* vbm Max applied body V in Vth calculation -3.0V
*
* dvt0 1st coeff shortchannel on Vth ***measure Vt vs length*** 2.2
* dvt1 2nd coeff short channel on Vth 0.53
* dvt2 Body-bias coeff shortchannel on Vth -0.032/V
* drout L dependence coef DIBL correction parameter inRout 0.56
* pdiblc1 1st_out_resisDrainInducBarrierLower correct@strong inversion 0.39
* pdiblc2 2nd output resistance DIBL effect correction parameter 0.0086
* pdiblcb Body effect coefficient of DIBL correction parameters 0/V
* lln Power of length dependence for length offset 1.0
* lwn Power of width dependence for length offset 1.0
* ll Coefficient of length dependence for length offset 0.0m
* lw Coefficient of width depen-dence for length offset 0.0m
* lwl Coef length and width cross term for length offset 0.0m
* Lmin lmin Minimum channel length 0.0m
* Lmax lmax Maximum channel length 1.0m
* clc Constant term for the short channel model 0.1E-6m
* cle Exponential term for the short channel model 0.6
*
* w0 Narrow width parameter ***measure match vs Width**** 2.5e-6m
* wint Width offset fit paramefrom I-V nonbias 0.0m
* wl Coeff length depend for width offset 0.0m
* ww Coeff width depend for width offset ******Ids@ w=1u****** 0.0m
* wwl Coeff length and width for width offset 0.0m
* wln Power of length depend width offset 1.0
* wwn Power width depend of width offset 1.0
* dvt0w 1st coeff narrow width Vth small length 0/m
* dvt1w 2nd coeff narrow width Vth small length 5.3e6/m
* dvt2w Body-bias coef narrow width small length -0.032/V
* k3 Narrow width coefficient 80.0
* k3b Body effect coefficient of k3 0.0/V
* dwg Coeff Wef gate dependence 0.0m/V
* dwb Coeff Weff substrate body bias depend 0.0m/V^(1/2)
* Wmin wmin Minimum channel width 0.0m
* Wmax wmax Maximum channel width 1.0m
*
* vfb Flat-band voltage parameter (for capmod=0 only) -1 V
* elm Elmore constant of the channel
* binunit Bin unit scale selector 1
* ngate poly gate doping concentration 0 cm^-3
* gamma1 Body-effect coefficient near the surface lated calcu- V 1/2 nI-4
* gamma2 Body-effect coefficient in the bulk calcu-lated V 1/2 nI-5
* vbx Vbs at which depletion region width equals xtcalcu-lated V nI-6
* xt Doping depth 1.55e-7 m
*
* noia Noise parameter A NMOS) 1e20 PMOS) 9.9e18
* noib Noise parameter B NMOS) 5e4 PMOS) 2.4e3
* noic Noise parameter C NMOS) -1.4e-12 PMOS) 1.4e-12
* em Saturation field 4.1e7 V/m
* af Frequency exponent 1
* ef Flicker exponent 1
* kf Flicker noise parameter 0
*
* tnom Temperature at which ters are extracted parame 27 C
* ute Mobility temperature exponent -1.5
* kt1 Temperature coefficient for threshold voltage -0.11 V
* kt1l Channel length depen o tempcoef vth 0.0 V*m
* kt2 Body-bias coefficient of Vth temperature effect 0.022
* ua1 Temperature coefficient for Ua 4.31E-9 m/V
* ub1 Temperature coefficient for Ub -7.61E-18 (m/V)2
* uc1 Temperature coefficient for Uc
* mob-mod= 1, 2: -5.6E-11 m/V^2
* mob-mod= 3: -0.056 1/V
* at Temperature coefficient for saturation velocity 3.3E4 m/sec
* prt Temperature coefficient for Rdsw 0 ohm-um
*