• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC Design
  3. Sweeping variable values within Monte Carlo Simulation

Stats

  • Locked Locked
  • Replies 0
  • Subscribers 125
  • Views 13456
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Sweeping variable values within Monte Carlo Simulation

Sirrius
Sirrius over 16 years ago

Hello All,

 I am trying to sweep the value of a variable "sh_delay_time" within monte-carlo run. The idea is that for every "instance" of the circuit created during monte-carlo run, (the parameter to be statistically varied is threshold voltage here ), I wish to sweep  a design variable.

So, if the design variable can take 10 different values, the monte-carlo simulation will essentially run 10 simulations with a particular value of threshold voltage, and repeat the simulations for the number of runs defined by ?numIters value. Therefore, I will get 10 results for every monte-carlo run. I tried this with the script:

 ocnWaveformTool( 'wavescan )
simulator('spectre)
design(     "/var/home/dr3sg/scratch/Braun_Multiplier/spectre/extracted/netlist/netlist")
resultsDir( "/var/home/dr3sg/scratch/Braun_Multiplier/spectre/extracted" )
modelFile(
    '("/var/home/dr3sg/Virtuoso_WithoutPads/ami06P.m" "")
    '("/var/home/dr3sg/Virtuoso_WithoutPads/ami06N.m" "")
)
stimulusFile( ?xlate nil
    "/var/home/dr3sg/scratch/Braun_Multiplier/spectre/extracted/netlist/_graphical_stimuli.scs")
analysis( 'tran ?stop "300n" ?errpreset "moderate")
skewstep_size_list = " 10.35n 10.4n "
temp(27)
option(    'temp  "27.0" )
envOption(
    'firstRun  nil
)
monteCarlo( ?numIters "5" ?startIter "1"
    ?analysisVariation 'processAndMismatch ?sweptParam "skew_step_size"
    ?sweptParamVals skewstep_size_list ?saveData t
    ?nomRun "yes" ?append nil
    ?saveProcessParams t
)
desVar(      "sh_delay_time" (31 - skew_step_size)*1n    )

monteExpr( "value_cmp0" "value(VT(\"/cmp_out<0>\") 3e-07)" )
monteExpr( "value_cmp1" "value(VT(\"/cmp_out<1>\") 3e-07)" )
monteExpr( "value_cmp2" "value(VT(\"/cmp_out<2>\") 3e-07)" )
monteExpr( "value_cmp3" "value(VT(\"/cmp_out<3>\") 3e-07)" )
monteExpr( "value_cmp4" "value(VT(\"/cmp_out<4>\") 3e-07)" )
monteExpr( "value_cmp5" "value(VT(\"/cmp_out<5>\") 3e-07)" )
monteExpr( "value_cmp6" "value(VT(\"/cmp_out<6>\") 3e-07)" )
monteExpr( "value_cmp7" "value(VT(\"/cmp_out<7>\") 3e-07)" )
monteExpr( "value_cmp8" "value(VT(\"/cmp_out<8>\") 3e-07)" )
monteExpr( "value_cmp9" "value(VT(\"/cmp_out<9>\") 3e-07)" )
monteExpr( "value_cmp10" "value(VT(\"/cmp_out<10>\") 3e-07)" )
monteExpr( "value_cmp11" "value(VT(\"/cmp_out<11>\") 3e-07)" )
monteExpr( "value_cmp12" "value(VT(\"/cmp_out<12>\") 3e-07)" )
monteExpr( "value_cmp13" "value(VT(\"/cmp_out<13>\") 3e-07)" )
monteExpr( "value_cmp14" "value(VT(\"/cmp_out<14>\") 3e-07)" )
monteExpr( "value_cmp15" "value(VT(\"/cmp_out<15>\") 3e-07)" )
monteRun()
delete('monteExpr)
delete('monteCarlo)

I get an error message: [Default-writer-method] generic: amcSetParamVals class: List

 

I also tried this script:

ocnWaveformTool( 'wavescan )
;setup the simulator
simulator('spectre)
;Point to the correct netlist
design(     "/var/home/dr3sg/scratch/Braun_Multiplier/spectre/extracted/netlist/netlist")

;setup the results directory
resultsDir( "/var/home/dr3sg/scratch/Braun_Multiplier/spectre/extracted" )

;set the model file
modelFile(
    '("/var/home/dr3sg/Virtuoso_WithoutPads/ami06P.m" "")
    '("/var/home/dr3sg/Virtuoso_WithoutPads/ami06N.m" "")
)

;set the stimulus file
stimulusFile( ?xlate nil
    "/var/home/dr3sg/scratch/Braun_Multiplier/spectre/extracted/netlist/_graphical_stimuli.scs")

;run analysis
analysis( 'tran ?stop "300n" ?errpreset "moderate")

;create a list containing the design variable: This is the variable to be swept

skewstep_list = " 7.85n 7.9n 7.95n 8n 8.05n 8.1n 8.15n 8.2n 8.25n 8.3n 8.35n 8.4n 8.45n 8.5n 8.55n 8.6n 8.65n 8.7n 8.75n 8.8n 8.85n 8.9n 8.95n 9n 9.05n 9.1n 9.15n 9.2n 9.25n 9.3n 9.35n 9.4n 9.45n 9.5n 9.55n 9.6n 9.65n 9.7n 9.75n 9.8n 9.85n 9.9n 10n 10.05n 10.1n 10.15n 10.2n 10.25n 10.3n 10.35n 10.4n 10.45n 10.5n 10.55n 10.6n 10.65n 10.7n 10.75n 10.8n 10.85n 10.9n 10.95n 11n "
;run the simulation for all the elements in the list

;copy the entire list again

desVar(      "sh_delay_time" "\" 7.85n 7.9n 7.95n 8n 8.05n 8.1n 8.15n 8.2n 8.25n 8.3n 8.35n 8.4n 8.45n 8.5n 8.55n 8.6n 8.65n 8.7n 8.75n 8.8n 8.85n 8.9n 8.95n 9n 9.05n 9.1n 9.15n 9.2n 9.25n 9.3n 9.35n 9.4n 9.45n 9.5n 9.55n 9.6n 9.65n 9.7n 9.75n 9.8n 9.85n 9.9n 10n 10.05n 10.1n 10.15n 10.2n 10.25n 10.3n 10.35n 10.4n 10.45n 10.5n 10.55n 10.6n 10.65n 10.7n 10.75n 10.8n 10.85n 10.9n 10.95n 11n \""    )

;set temperature
temp(27)
option(    'temp  "27.0" )

envOption(
    'firstRun  nil
)

;MonteCarlo
monteCarlo( ?numIters "50" ?startIter "1"
    ?analysisVariation 'processAndMismatch ?sweptParam "sh_delay_time"
    ?sweptParamVals skewstep_list ?saveData t
    ?nomRun "yes" ?append nil
    ?saveProcessParams t
)
monteExpr( "value_cmp0" "value(VT(\"/cmp_out<0>\") 300n)" )
monteExpr( "value_cmp1" "value(VT(\"/cmp_out<1>\") 300n)" )
monteExpr( "value_cmp2" "value(VT(\"/cmp_out<2>\") 300n)" )
monteExpr( "value_cmp3" "value(VT(\"/cmp_out<3>\") 300n)" )
monteExpr( "value_cmp4" "value(VT(\"/cmp_out<4>\") 300n)" )
monteExpr( "value_cmp5" "value(VT(\"/cmp_out<5>\") 300n)" )
monteExpr( "value_cmp6" "value(VT(\"/cmp_out<6>\") 300n)" )
monteExpr( "value_cmp7" "value(VT(\"/cmp_out<7>\") 300n)" )
monteExpr( "value_cmp8" "value(VT(\"/cmp_out<8>\") 300n)" )
monteExpr( "value_cmp9" "value(VT(\"/cmp_out<9>\") 300n)" )
monteExpr( "value_cmp10" "value(VT(\"/cmp_out<10>\") 300n)" )
monteExpr( "value_cmp11" "value(VT(\"/cmp_out<11>\") 300n)" )
monteExpr( "value_cmp12" "value(VT(\"/cmp_out<12>\") 300n)" )
monteExpr( "value_cmp13" "value(VT(\"/cmp_out<13>\") 300n)" )
monteExpr( "value_cmp14" "value(VT(\"/cmp_out<14>\") 300n)" )
monteExpr( "value_cmp15" "value(VT(\"/cmp_out<15>\") 300n)" )
monteRun()

cmp_out is a bus, and I am interested in knowing its volage at 300ns.

The above script runs without warnings or errors, but the results that I get are incorrect.

 Just to complete the information, the script below works and it was generated from the tool itself. It does not however sweep the variable within each monte-carlo run.

ocnWaveformTool( 'wavescan )
simulator( 'spectre )
design(     "/net/plato/scratch/dr3sg/Braun_Multiplier/spectre/extracted/netlist/netlist")
resultsDir( "/net/plato/scratch/dr3sg/Braun_Multiplier/spectre/extracted" )
modelFile(
    '("/homenfs/class3u/dr3sg/Virtuoso_WithoutPads/ami06P.m" "")
    '("/homenfs/class3u/dr3sg/Virtuoso_WithoutPads/ami06N.m" "")
)
stimulusFile( ?xlate nil
    "/net/plato/scratch/dr3sg/Braun_Multiplier/spectre/extracted/netlist/_graphical_stimuli.scs")
analysis('tran ?stop "300n"  ?errpreset "moderate"  )
desVar(      "sh_delay_time" 20.65n    )
envOption(
    'firstRun  nil
)
option(    'temp  "27.0"
)
temp( 27.0 )
monteCarlo( ?numIters "5" ?startIter "1"
    ?analysisVariation 'processAndMismatch ?sweptParam "None"
    ?sweptParamVals "27" ?saveData nil
    ?nomRun "yes" ?append nil
    ?saveProcessParams t
)
monteExpr( "value_cmp15" "value(VT(\"/cmp_out<15>\") 3e-07)" )
monteExpr( "value_cmp14" "value(VT(\"/cmp_out<14>\") 3e-07)" )
monteRun()

 

 Can someone please help?

 Thank you very much!

 Regards


Sirrius






 

 

  • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information