Monte-Carlo examples using new features: command 'mc_source',

variable 'sim_status' etc.
This commit is contained in:
Holger Vogt 2018-05-26 15:41:32 +02:00
parent 42a86d0ff2
commit 5a825ffabf
2 changed files with 23 additions and 6 deletions

View File

@ -6,7 +6,7 @@
*
.control
save buf $ we just need output vector buf, save memory by more than 10x
let mc_runs = 100 $ number of runs for monte carlo
let mc_runs = 10 $ number of runs for monte carlo
let run = 1 $ number of the actual run
* Where to find the circuit netlist file MC_2_circ.sp
@ -22,7 +22,11 @@
reset
set run ="$&run" $ create a variable from the vector
set rndseed = $run $ set the rnd seed value to the loop index
source MC_2_circ.sp $ load the circuit, including model data
if run = 1
source MC_2_circ.sp $ load the circuit once from file, including model data
else
mc_source $ re-load the circuit from internal storage
end
tran 15p 200n 0
write mc_ring{$run}.out buf $ write each sim output to its own rawfile
linearize buf $ lienarize buf to allow fft

View File

@ -95,11 +95,22 @@ cout buf ss 0.2pF
* close to 8192, which would yield varying number of line length and thus scale for fft.
*
* We have to figure out what to do if a single simulation will not converge.
* Is there a variable which may be set if there is no convergence?
* Then we might skip this run and continue with a new run. It does not exist for now.
* So we have to rely on the robustness of the following steps not leading
* to a seg fault if the tran data are missing.
* There is the variable 'sim_status' which is set to 1 if the simulation
* fails with xx simulation(s) aborted, e.g. because of non-convergence.
* Then we might skip this run and continue with a new run.
*
echo Simulation status $sim_status
let simstat = $sim_status
if simstat = 1
if run = mc_runs
echo go to end
else
echo go to next run
end
destroy $curplot
goto next
end
set run ="$&run" $ create a variable from the vector
set mc_runs ="$&mc_runs" $ create a variable from the vector
echo simulation run no. $run of $mc_runs
@ -136,6 +147,8 @@ cout buf ss 0.2pF
let maxffts[{$run}]={$dt}.fft_max
let halfffts[{$run}]={$dt}.fft_40
let run = run + 1
label next
reset
end
***** plotting **********************************************************
setplot $plot_out