MC_ring_ts.sp, some updates
This commit is contained in:
parent
d635ee653e
commit
b72d78dae0
|
|
@ -29,13 +29,15 @@ begin
|
||||||
|
|
||||||
echo source the input file
|
echo source the input file
|
||||||
* Path of your circuit file and library file here
|
* Path of your circuit file and library file here
|
||||||
* set sourcepath = ( D:\Spice_general\tests\lib-test\jts\ D:\Spice_general\tests\lib-test\ts14\ D:\Spice_general\tests\lib-test\x-fab\orig\xh018\lpmos )
|
|
||||||
set sourcepath = ( D:\Spice_general\ngspice\examples\Monte_Carlo )
|
set sourcepath = ( D:\Spice_general\ngspice\examples\Monte_Carlo )
|
||||||
* source with file name of your circuit file
|
* source with file name of your circuit file
|
||||||
source mc_ring_circ.net
|
source mc_ring_circ.net
|
||||||
|
|
||||||
save buf $ we just need buf, save memory by more than 10x
|
save buf $ we just need buf, save memory by more than 10x
|
||||||
|
|
||||||
|
* Output path (directory has already to be there)
|
||||||
|
set outputpath = 'D:\Spice_general\ngspice\examples\Monte_Carlo\out'
|
||||||
|
|
||||||
* run the simulation loop
|
* run the simulation loop
|
||||||
|
|
||||||
* We have to figure out what to do if a single simulation will not converge.
|
* We have to figure out what to do if a single simulation will not converge.
|
||||||
|
|
@ -99,6 +101,7 @@ begin
|
||||||
let frequency={$dt2}.frequency
|
let frequency={$dt2}.frequency
|
||||||
end
|
end
|
||||||
let fft{$run}={$dt2}.buf $ store the output vector to plot 'plot_fft'
|
let fft{$run}={$dt2}.buf $ store the output vector to plot 'plot_fft'
|
||||||
|
settype decibel fft{$run}
|
||||||
* store the measured value
|
* store the measured value
|
||||||
setplot $max_fft $ make 'max_fft' the active plot
|
setplot $max_fft $ make 'max_fft' the active plot
|
||||||
let maxffts[{$run}]={$dt2}.fft_max
|
let maxffts[{$run}]={$dt2}.fft_max
|
||||||
|
|
@ -119,13 +122,13 @@ if $?batchmode
|
||||||
rusage
|
rusage
|
||||||
quit
|
quit
|
||||||
else
|
else
|
||||||
if $?sharedmode
|
if $?sharedmode or $?win_console
|
||||||
gnuplot np_pl1 {$plot_out}.vout0 $ just plot the tran output with nominal parameters
|
gnuplot np_pl1 {$plot_out}.vout0 $ just plot the tran output with nominal parameters
|
||||||
else
|
else
|
||||||
plot {$plot_out}.vout0 $ just plot the tran output with nominal parameters
|
plot {$plot_out}.vout0 $ just plot the tran output with nominal parameters
|
||||||
end
|
end
|
||||||
setplot $plot_fft
|
setplot $plot_fft
|
||||||
if $?sharedmode
|
if $?sharedmode or $?win_console
|
||||||
gnuplot np_pl2 db(mag(ally)) xlimit 0 1G ylimit -80 10
|
gnuplot np_pl2 db(mag(ally)) xlimit 0 1G ylimit -80 10
|
||||||
else
|
else
|
||||||
plot db(mag(ally)) xlimit 0 1G ylimit -80 10
|
plot db(mag(ally)) xlimit 0 1G ylimit -80 10
|
||||||
|
|
@ -161,7 +164,7 @@ else
|
||||||
* plot the histogram
|
* plot the histogram
|
||||||
set plotstyle=combplot
|
set plotstyle=combplot
|
||||||
let count = yvec - 1 $ subtract 1 because we started with unitvec containing ones
|
let count = yvec - 1 $ subtract 1 because we started with unitvec containing ones
|
||||||
if $?sharedmode
|
if $?sharedmode or $?win_console
|
||||||
gnuplot np_pl3 count vs osc_frequ
|
gnuplot np_pl3 count vs osc_frequ
|
||||||
else
|
else
|
||||||
plot count vs osc_frequ
|
plot count vs osc_frequ
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue