update to Monte Carlo examples
This commit is contained in:
parent
932665124f
commit
975745fa3c
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue