From 975745fa3c9cc33ce50d3ceeee0ef3fbfba775b9 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sun, 7 Aug 2016 09:48:44 +0200 Subject: [PATCH] update to Monte Carlo examples --- examples/Monte_Carlo/MC_2_control.sp | 4 ++-- examples/Monte_Carlo/MC_ring.sp | 2 +- examples/Monte_Carlo/mc_ring_circ.net | 2 +- examples/control_structs/repeat3.sp | 2 +- examples/various/agauss_test.cir | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/Monte_Carlo/MC_2_control.sp b/examples/Monte_Carlo/MC_2_control.sp index cf00103dc..8b922b5b9 100644 --- a/examples/Monte_Carlo/MC_2_control.sp +++ b/examples/Monte_Carlo/MC_2_control.sp @@ -1,3 +1,4 @@ +*ng_script * Perform Monte Carlo simulation in ngspice * script for use with 25 stage Ring-Osc. BSIM3 * circuit is in MC_2_circ.sp @@ -5,7 +6,6 @@ * start script by 'ngspice -o MC_2_control.log MC_2_control.sp' * .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 run = 1 $ number of the actual run @@ -19,10 +19,10 @@ dowhile run <= mc_runs * without the reset switch there is some strange drift * towards lower and lower frequencies - reset set run = $&run $ create a variable from the vector setseed $run $ set the rnd seed value to the loop index source MC_2_circ.sp $ load the circuit, including model data + save buf $ we just need output vector buf, save memory by more than 10x 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 diff --git a/examples/Monte_Carlo/MC_ring.sp b/examples/Monte_Carlo/MC_ring.sp index e76fe66c7..9f055d102 100644 --- a/examples/Monte_Carlo/MC_ring.sp +++ b/examples/Monte_Carlo/MC_ring.sp @@ -171,7 +171,7 @@ else * put data into the correct bins let run = 0 dowhile run < mc_runs - set run = "$&run" $ create a variable from the vector + set run = $&run $ create a variable from the vector let val = maxffts[{$run}] let part = 0 * Check if val fits into a bin. If yes, raise bin by 1 diff --git a/examples/Monte_Carlo/mc_ring_circ.net b/examples/Monte_Carlo/mc_ring_circ.net index 00381c3cd..cd058a5eb 100644 --- a/examples/Monte_Carlo/mc_ring_circ.net +++ b/examples/Monte_Carlo/mc_ring_circ.net @@ -4,7 +4,7 @@ Perform Monte Carlo simulation in ngspice * Tested with 3 different commercial HSPICE libraries from 2 vendors. * To be started with script MC_ring_ts.sp -.options noacct +.options noacct seedinfo vin in out dc 0.5 pulse 0.5 0 0.1n 5n 1 1 1 vdd dd 0 dc 3.3 diff --git a/examples/control_structs/repeat3.sp b/examples/control_structs/repeat3.sp index 5650252ab..1ab865b61 100644 --- a/examples/control_structs/repeat3.sp +++ b/examples/control_structs/repeat3.sp @@ -140,7 +140,7 @@ Test sequences for ngspice control structures label starthe echo start $loop let loop = $loop + 1 $ expression needs vector at lhs - set loop = "$&loop" $ convert vector contents to variable + set loop = $&loop $ convert vector contents to variable if $loop < 3 goto starthe end diff --git a/examples/various/agauss_test.cir b/examples/various/agauss_test.cir index c25327518..87a70c0fd 100644 --- a/examples/various/agauss_test.cir +++ b/examples/various/agauss_test.cir @@ -38,7 +38,7 @@ let part = 0 dowhile part < no_buck let value = bucket[part] - 1 - set value = "$&value" + set value = $&value * print the buckets' contents echo $value let part = part + 1