*sets innerstart, innerstep, innerstop,... from the advanced dialog entries #setsweep #noprint set rewind set noecho * do a reference simulation in case the user wants to play with it * and use the reference results at the end to feed back into the * measurement results data storage #simulation sweep -i set printmode = save nameplot ref #mprint SET COLWIDTH=22 SET SPICEDIGITS=5 pltype = 0 constants.numinner = 1 + floor(constants.innerstop/constants.innerstep - constants.innerstart/constants.innerstep) constants.numouter = 1 + floor(constants.outerstop/constants.outerstep - constants.outerstart/constants.outerstep) constants.sweepdef = vector(constants.numinner * constants.numouter) newplot sweep sweepdef sweep.outer = sweepdef sweep.ramp = sweepdef constants.index = 0 constants.outerindex = 0 constants.outer = constants.outerstart * *** enumerate the outer loop while constants.outerindex < constants.numouter printstatus -t "outer " printstatus -v constants.outer constants.inner = constants.innerstart constants.innerindex = 0 * *** enumerate the inner loop while constants.innerindex < constants.numinner printstatus -t "inner " printstatus -v constants.inner * **** evaluates the sweep parameters sweep constants.outer constants.inner * **** perform the simulation and save measurements #simulation #mprint * **** build the default and parametric vectors * **** now go through all the vectors of length 1 in this * **** plot and stick them into the appropriate sweep vector sweep.outer[constants.index] = constants.outer if constants.numinner > 1 sweep.default[constants.index] = constants.inner else sweep.default[constants.index] = constants.outer end nv = nextvector(null) while nv <> null if length(nv) = 1 if constants.index = 0 sweep.nv = vector(constants.numinner * constants.numouter) end if constants.index < length(sweep.nv) sweep.nv[constants.index] = nv end end nv = nextvector(nv) end constants.index = constants.index +1 * **** the following tags the simulations for later access pltype = 1 paramdata = unitvec(2) paramindex = unitvec(2) paramdata[0] = constants.inner paramdata[1] = constants.outer paramindex[0] = constants.index paramindex[1] = constants.outerindex constants.inner = constants.inner + constants.innerstep constants.innerindex = constants.innerindex + 1 end constants.outer = constants.outer + constants.outerstep constants.outerindex = constants.outerindex + 1 end * print the sweep vectors to the output file set printmode = print setplot sweep nv = nextvector(null) while nv <> null if length(nv) > 2 & nv != default printtext printtext printname nv printvector nv end nv = nextvector(nv) end * values to read back into the current measurements setplot ref #mprint