https://open-source-silicon.dev logo
Channels
aa
abcc
activity
adiabatonauts
analog-design
announce
announcements
b2aws
b2aws-tutorial
bag
basebands
beagleboard
bluetooth
board-respin
cadence-genus
cadence-innovus
cadence-spectre
cadence-virtuoso
caravan
caravel
caravel-board
chilechipmakers
chip-yard
chipignite
chipignite2206q_stanford_bringup
chisel
coalition-for-digital-environmental-sustainability
community_denmark_dtu
containers
courses
design-review
design-services
dffram
digital-design
digital-electronics-learners
discord-mods
dynamic-power-estimation
efabless
electric
events
fasoc
fault
foss-asic-tools
fossee-iitb-esim
fossee-iitb-google-sky130
fpga
funding
fuserisc
general
generative-ai-silicon-challenge
genius-vlsi
gf180
gf180mcu
hardware-beginners
help-
ieee-sscs-cac-23
ieee-sscs-dc-21q3
ieee-sscs-dc-22
ieee-sscs-dc-23
ihp-sg13g2
images
infiniband
j-core
japan-region
junk
klayout
latam_vlsi
layouteditor
lvs
lvs-analysis
magic
magical
maker-projects
maker-zone
microwatt
mpw-2-silicon
mpw-one-clean-short
mpw-one-silicon
neuro-mem
nydesign
open_pdks
open-pdk
openadiabaticlogic
openfpga
openhighqualityresonators
openlane
openlane_cloudrunner
openlane-development
openocd
openpositarithmetic
openpower
openram
openroad
opentitan
osu
pa-test-chip
paracells
pd-openlane-and-sky130
picosoc
pll
popy_neel
power
private-shuttle
rad-lab-silicon
radio
rdircd
reram
researchers
rf-mmw-design
rios
riscv
sdram
serdes
shuttle
shuttle-precheck
shuttle-status
silicon-photonics
silicon-validation
silicon-validation-private
sky130
sky130-ci
sky130-pv-workshop
sky65
sky90
skywater
sram
stdcelllib
strive
swerv
system-verilog-learners
tapeout-job
tapeout-pakistan
team-awesome
timing-closure
toysram
travis-ci
uvm-learners
vendor-synopsys
venn
verification-be
verification-fe
verilog-learners
vh2v
vhdl
vhdl-learners
vliw
vlsi_verilog_using_opensource_eda
vlsi_verilog_using_opensoure_eda
vlsi-learners-group
vlsi101
waveform-viewers
xls
xschem
xyce
zettascale
Powered by
Title
j

John Kustin

06/02/2021, 4:59 PM
got an ngspice question: i want to run 400 iterations of a loop. each iteration should run 3 transient simulations (each at a different temperature). each transient simulation should use the same random seed but from loop "n" to loop iteration "n+1", I want different seeds. I really just want to ensure that the 3 transient simulations use the same random variables and that these random variables change after my round of transient sims. i've tried this:
.option SEED=random

.option temp=27
.tran 1n 11u
.option temp=0
.tran 1n 11u
.option temp=70
.tran 1n 11u

.control
  let run=1
  dowhile run <= 400
    let randomseed = $rndseed
    if run > 1
      reset
      set appendwrite
    end
    save all
    run
    write TESTTYPENAMEHERE_mc1_70degc_run_{$&run}.raw vbg randomseed 
    setplot tran2
    write TESTTYPENAMEHERE_mc1_0degc_run_{$&run}.raw vbg randomseed
    setplot tran1
    write TESTTYPENAMEHERE_mc1_27degc_run_{$&run}.raw vbg randomseed
    let run = run + 1
  end
but only the transient sim at 70degC is being run (i always seeĀ 
Doing analysis at TEMP = 70.000000 and TNOM = 27.000000
). edit: this script is still running in ngspice, so i don't know for sure if the 2 other temperatures were not simulated. i'd exepect every
.tran
statement to be run I also tried
.option SEED=random

.control
  let run=1
  option SEED=random
  let indexvec = unitvec(400) * $rndseed
  let randomseedvec = rnd(indexvec)
  dowhile run <= 400

    if run > 1
      reset
      set appendwrite
    end
    save all
    set temp=27
    option SEED=randomseedvec[$&run-1]
    tran 1n 11u
    set temp=0
    option SEED=randomseedvec[$&run-1]
    tran 1n 11u
    set temp=70
    option SEED=randomseedvec[$&run-1]
    tran 1n 11u
    write TESTTYPENAMEHERE_mc1_70degc_run_{$&run}.raw vbg
    setplot tran2
    write TESTTYPENAMEHERE_mc1_0degc_run_{$&run}.raw vbg
    setplot tran1
    write TESTTYPENAMEHERE_mc1_27degc_run_{$&run}.raw vbg
    let run = run + 1
  end
but I realized this is not what I want to achieve since I set the seed 3 times, when I just want it to be set once (also, ngspice complains about setting the seed more than once) edit: could I just pick 1 seed value and use that across 3 separate spice testbenches, where each testbench handles 1 temperature? the ngspice manual does say that setting the seed value will determine a sequence of pseudo random numbers. so if each simulation uses the same numbers in that sequence, then this should achieve what i want?