4 changed files with 0 additions and 257 deletions
@ -1,15 +0,0 @@ |
|||
* func_cap.sp |
|||
|
|||
|
|||
.func icap_calc(A,B,C,D) '2*A*sqrt(B*C*D)' |
|||
|
|||
.param cap_val = 'max(icap_calc(1,2,3,4))' |
|||
VDD 1 0 DC 1 |
|||
C1 1 0 'cap_val' |
|||
|
|||
.measure tran capacitance param='cap_val' |
|||
.measure tran capac2 param='max(icap_calc(1,2,3,4))' |
|||
|
|||
.tran 1ps 100ps |
|||
|
|||
.end |
|||
@ -1,99 +0,0 @@ |
|||
Inverter example circuit |
|||
* This netlist demonstrates the following: |
|||
* global nodes (vdd, gnd) |
|||
* autostop (.tran defines simulation end as 4ns but simulation stops at |
|||
* 142.5ps when .measure statements are evaluated) |
|||
* scale (all device units are in microns) |
|||
* model binning (look in device.values file for which bin chosen) |
|||
* |
|||
* m.x1.mn: |
|||
* model = nch.2 |
|||
* |
|||
* m.x1.mp: |
|||
* model = pch.2 |
|||
* |
|||
* parameters |
|||
* parameterized subckt |
|||
* vsrc with repeat |
|||
* .measure statements for delay and an example ternary operator |
|||
* device listing and parameter listing |
|||
* You can run the example circuit with this command: |
|||
* |
|||
* ngspice inverter.sp |
|||
|
|||
|
|||
* global nodes |
|||
.global vdd gnd |
|||
|
|||
* autostop -- stop simulation early if .measure statements done |
|||
* scale -- define scale factor for mosfet device parameters (l,w,area,perimeter) |
|||
.option autostop |
|||
.option scale = 1e-6 |
|||
|
|||
* model binning |
|||
.model nch.1 nmos ( version=4.4 level=54 lmin=0.1u lmax=20u wmin=0.1u wmax=10u ) |
|||
.model nch.2 nmos ( version=4.4 level=54 lmin=0.1u lmax=20u wmin=10u wmax=100u ) |
|||
.model pch.1 pmos ( version=4.4 level=54 lmin=0.1u lmax=20u wmin=0.1u wmax=10u ) |
|||
.model pch.2 pmos ( version=4.4 level=54 lmin=0.1u lmax=20u wmin=10u wmax=100u ) |
|||
|
|||
* parameters |
|||
.param vp = 1.0v |
|||
.param lmin = 0.10 |
|||
.param wmin = 0.12 |
|||
.param plmin = 'lmin' |
|||
.param nlmin = 'lmin' |
|||
.param wpmin = 'wmin' |
|||
.param wnmin = 'wmin' |
|||
.param drise = 400ps |
|||
.param dfall = 100ps |
|||
.param trise = 100ps |
|||
.param tfall = 100ps |
|||
.param period = 1ns |
|||
.param skew_meas = 'vp/2' |
|||
|
|||
* parameterized subckt |
|||
.subckt inv in out pw='wpmin' pl='plmin' nw='wnmin' nl='nlmin' |
|||
mp out in vdd vdd pch w='pw' l='pl' |
|||
mn out in gnd gnd nch w='nw' l='nl' |
|||
.ends |
|||
|
|||
v0 vdd gnd 'vp' |
|||
|
|||
* vsrc with repeat |
|||
v1 in gnd pwl |
|||
+ 0ns 'vp' |
|||
+ 'dfall-0.8*tfall' 'vp' |
|||
+ 'dfall-0.4*tfall' '0.9*vp' |
|||
+ 'dfall+0.4*tfall' '0.1*vp' |
|||
+ 'dfall+0.8*tfall' 0v |
|||
+ 'drise-0.8*trise' 0v |
|||
+ 'drise-0.4*trise' '0.1*vp' |
|||
+ 'drise+0.4*trise' '0.9*vp' |
|||
+ 'drise+0.8*trise' 'vp' |
|||
+ 'period+dfall-0.8*tfall' 'vp' |
|||
+ r='dfall-0.8*tfall' |
|||
|
|||
x1 in out inv pw=60 nw=20 |
|||
c1 out gnd 220fF |
|||
|
|||
.tran 1ps 4ns |
|||
|
|||
.meas tran inv_delay trig v(in) val='vp/2' fall=1 targ v(out) val='vp/2' rise=1 |
|||
*.meas tran test_data1 trig AT = 1n targ v(out) val='vp/2' rise=3 |
|||
*not yet implemented |
|||
*.meas tran test_data2 trig v(in) val='vp/2' fall=1 targ AT = 2n |
|||
.meas tran out_slew trig v(out) val='0.2*vp' rise=2 targ v(out) val='0.8*vp' rise=2 |
|||
.meas tran delay_chk param='(inv_delay < 100ps) ? 1 : 0' |
|||
.meas tran skew when v(out)=0.6 |
|||
.meas tran skew2 when v(out)=skew_meas |
|||
*.meas tran skew3 when v(out)=skew_meas fall=2 |
|||
*.meas tran skew4 FIND v(out) AT=2n |
|||
|
|||
.control |
|||
run |
|||
show * > device.values |
|||
listing param > param.values |
|||
.endc |
|||
|
|||
.end |
|||
|
|||
@ -1,97 +0,0 @@ |
|||
Inverter example circuit |
|||
* This netlist demonstrates the following: |
|||
* global nodes (vdd, gnd) |
|||
* autostop (.tran defines simulation end as 4ns but simulation stops at |
|||
* 142.5ps when .measure statements are evaluated) |
|||
* scale (all device units are in microns) |
|||
* model binning (look in device.values file for which bin chosen) |
|||
* |
|||
* m.x1.mn: |
|||
* model = nch.2 |
|||
* |
|||
* m.x1.mp: |
|||
* model = pch.2 |
|||
* |
|||
* parameters |
|||
* parameterized subckt |
|||
* vsrc with repeat |
|||
* .measure statements for delay and an example ternary operator |
|||
* Additional .measure statements to the previous example |
|||
* to measure the min, avg, rms and integ values for the VDD voltage |
|||
* source. These .measure statements disable 'autostop'. |
|||
* device listing and parameter listing |
|||
* You can run the example circuit with this command: |
|||
* |
|||
* ngspice inverter2.sp |
|||
|
|||
|
|||
* global nodes |
|||
.global vdd gnd |
|||
|
|||
* autostop -- stop simulation early if .measure statements done |
|||
* scale -- define scale factor for mosfet device parameters (l,w,area,perimeter) |
|||
.option autostop |
|||
.option scale = 1e-6 |
|||
|
|||
* model binning |
|||
.model nch.1 nmos ( version=4.4 level=54 lmin=0.1u lmax=20u wmin=0.1u wmax=10u ) |
|||
.model nch.2 nmos ( version=4.4 level=54 lmin=0.1u lmax=20u wmin=10u wmax=100u ) |
|||
.model pch.1 pmos ( version=4.4 level=54 lmin=0.1u lmax=20u wmin=0.1u wmax=10u ) |
|||
.model pch.2 pmos ( version=4.4 level=54 lmin=0.1u lmax=20u wmin=10u wmax=100u ) |
|||
|
|||
* parameters |
|||
.param vp = 1.0v |
|||
.param lmin = 0.10 |
|||
.param wmin = 0.12 |
|||
.param plmin = 'lmin' |
|||
.param nlmin = 'lmin' |
|||
.param wpmin = 'wmin' |
|||
.param wnmin = 'wmin' |
|||
.param drise = 400ps |
|||
.param dfall = 100ps |
|||
.param trise = 100ps |
|||
.param tfall = 100ps |
|||
.param period = 1ns |
|||
|
|||
* parameterized subckt |
|||
.subckt inv in out pw='wpmin' pl='plmin' nw='wnmin' nl='nlmin' |
|||
mp out in vdd vdd pch w='pw' l='pl' |
|||
mn out in gnd gnd nch w='nw' l='nl' |
|||
.ends |
|||
|
|||
v0 vdd gnd 'vp' |
|||
|
|||
* vsrc with repeat |
|||
v1 in gnd pwl |
|||
+ 0ns 'vp' |
|||
+ 'dfall-0.8*tfall' 'vp' |
|||
+ 'dfall-0.4*tfall' '0.9*vp' |
|||
+ 'dfall+0.4*tfall' '0.1*vp' |
|||
+ 'dfall+0.8*tfall' 0v |
|||
+ 'drise-0.8*trise' 0v |
|||
+ 'drise-0.4*trise' '0.1*vp' |
|||
+ 'drise+0.4*trise' '0.9*vp' |
|||
+ 'drise+0.8*trise' 'vp' |
|||
+ 'period+dfall-0.8*tfall' 'vp' |
|||
+ r='dfall-0.8*tfall' |
|||
|
|||
x1 in out inv pw=60 nw=20 |
|||
c1 out gnd 220fF |
|||
|
|||
.tran 1ps 4ns |
|||
|
|||
.measure tran inv_delay trig v(in) val='vp/2' fall=1 targ v(out) val='vp/2' rise=1 |
|||
.measure tran out_slew trig v(out) val='0.2*vp' rise=1 targ v(out) val='0.8*vp' rise=1 |
|||
.measure tran delay_chk param='(inv_delay < 100ps) ? 1 : 0' |
|||
.measure tran v0_min min i(v0) from='dfall' to='dfall+period' |
|||
.measure tran v0_avg avg i(v0) from='dfall' to='dfall+period' |
|||
.measure tran v0_integ integ i(v0) from='dfall' to='dfall+period' |
|||
.measure tran v0_rms rms i(v0) from='dfall' to='dfall+period' |
|||
|
|||
.control |
|||
run |
|||
show * > device.values |
|||
listing param > param.values |
|||
.endc |
|||
|
|||
.end |
|||
@ -1,46 +0,0 @@ |
|||
RC band pass example circuit |
|||
* This netlist demonstrates the following: |
|||
* global nodes (vdd, gnd) |
|||
|
|||
* .measure statements for delay and an example ternary operator |
|||
|
|||
* You can run the example circuit with this command: |
|||
* |
|||
* ngspice rc-meas-ac.sp |
|||
|
|||
|
|||
* global nodes |
|||
.global vdd gnd |
|||
|
|||
* autostop -- stop simulation early if .measure statements done |
|||
*.option autostop |
|||
|
|||
vin in gnd dc 0 ac 1 |
|||
|
|||
R1 in mid1 1k |
|||
c1 mid1 gnd 1n |
|||
C2 mid1 out 500p |
|||
R2 out gnd 1k |
|||
|
|||
.ac DEC 10 1k 10MEG |
|||
|
|||
.meas ac vout_at FIND v(out) AT=1MEG |
|||
.meas ac vout_max max v(out) from=1k to=10MEG |
|||
.meas ac freq_at when v(out)=0.1 |
|||
.meas ac vout_diff trig v(out) val=0.1 rise=1 targ v(out) val=0.1 fall=1 |
|||
.meas ac fixed_diff trig AT = 10k targ v(out) val=0.1 rise=1 |
|||
.meas ac vout_avg avg v(out) from=10k to=1MEG |
|||
.meas ac vout_integ integ v(out) from=20k to=500k |
|||
.meas ac freq_at2 when v(out)=0.1 fall=LAST |
|||
.meas ac bw_chk param='(vout_diff < 100k) ? 1 : 0' |
|||
.meas ac bw_chk2 param='(vout_diff > 500k) ? 1 : 0' |
|||
.meas ac vout_rms rms v(out) from=10 to=1G |
|||
|
|||
.control |
|||
run |
|||
*rusage all |
|||
plot v(out) |
|||
.endc |
|||
|
|||
.end |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue