• 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. RF Design
  3. Using Montecarlo simulation for finding Rise and fall tile...

Stats

  • Locked Locked
  • Replies 25
  • Subscribers 63
  • Views 25741
  • 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

Using Montecarlo simulation for finding Rise and fall tile of a SETTLING waveform

RFQuery
RFQuery over 12 years ago

 Dear All,

I want to do MONTE_CARLO simulation for my circuit for finding rise time and fall time.

The output is settling after 800u s.

I have to do some pre-processing before finding the last expression. The expressions I used as below.

But it did NOT work.

Can anybody tell how to find risetime and falltime of the waveform using MONTE-Carlo simulation if one needs some house-keeping processing of the waveform.

 .......

analysis('dc ?saveOppoint t  )
analysis('tran ?stop "1u"  ?errpreset "moderate"  ?maxstep "5p" 
        ?method "euler"  ?strobeperiod "5p"  )
desVar(      "frf" 6G    )
desVar(      "prf" -20    )
desVar(      "frf2" 6.1G    )
desVar(      "w" 20u    )
desVar(   "sigma" 3)
option(    'temp  "27.0"
    'iabstol  "1e-14"
    'vabstol  "1e-4"
)
saveOption( 'currents "selected" )
saveOption( 'save "all" )
temp( 27.0 )
monteCarlo( ?numIters "1" ?startIter "1"
    ?analysisVariation 'processAndMismatch ?sweptParam "None"
    ?sweptParamVals "27" ?saveData nil
    ?nomRun "yes" ?append nil
    ?saveProcessParams t
)
CLOCK_DUTY_PERIOD=2.5e-10
CLIP_START=0.8u
CLIP_END=0.9u

clip_I_P=clip( v("/MIXER_I_P" ?result 'tran) CLIP_START CLIP_END)
plot(clip_I_P)
MIN_VALUE=ymin(clip_I_P) + 0.02
MAX_VALUE=ymax(clip_I_P)- 0.03
UPPER_THRESOLD=MIN_VALUE + ( (MAX_VALUE-MIN_VALUE)*0.9 )
LOWER_THRESHOLD=MIN_VALUE + ( (MAX_VALUE-MIN_VALUE)*0.1 )
RISE_UPPER= cross( clip_I_P UPPER_THRESOLD 2 'rising )
RISE_LOWER= cross( clip_I_P LOWER_THRESHOLD 2 'rising )

monteExpr("RISE_TIME" "abs(RISE_UPPER-RISE_LOWER)")

monteRun()
  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    OK, I just tried it myself with a made up example. I put this in my ~/.artilinit file:

    procedure(MyRiseTime(signal CLIP_START CLIP_END)
      let((clip_I_P MIN_VALUE MAX_VALUE UPPER_THRESHOLD LOWER_THRESHOLD RISE_UPPER RISE_LOWER)
        clip_I_P=clip( signal CLIP_START CLIP_END)
        MIN_VALUE=ymin(clip_I_P) + 0.02
        MAX_VALUE=ymax(clip_I_P)- 0.03
        UPPER_THRESOLD=MIN_VALUE + ( (MAX_VALUE-MIN_VALUE)*0.9 )
        LOWER_THRESHOLD=MIN_VALUE + ( (MAX_VALUE-MIN_VALUE)*0.1 )
        RISE_UPPER= cross( clip_I_P UPPER_THRESOLD 2 'rising )
        RISE_LOWER= cross( clip_I_P LOWER_THRESHOLD 2 'rising )
        abs(RISE_UPPER-RISE_LOWER)
      )
    )

    I then used this as "testmonte.scs" :

    //

    parameters peak=1
    statistics {
        process {
        vary peak dist=gauss std=0.1
        }
    }

    v1 (MIXER_I_P 0) vsource type=sine freq=20M ampl=peak
    r1 (MIXER_I_P 0) resistor r=1k

    simulatorOptions options reltol=1e-3 vabstol=1e-4 iabstol=1e-14 temp=27.0 \
        tnom=27 scalem=1.0 scale=1.0 gmin=1e-12 rforce=1 maxnotes=5 maxwarns=5 \
        digits=5 cols=80 pivrel=1e-3 sensfile="../psf/sens.output" \
        checklimitdest=psf
    mc1 montecarlo numruns=1 seed=1 variations=all donominal=yes \
        scalarfile="../monteCarlo/mcdata" paramfile="../monteCarlo/mcparam" \
        saveprocessparams=yes processparamfile="../monteCarlo/processParam" \
        processscalarfile="../monteCarlo/processData" {
    tran tran stop=1u errpreset=moderate maxstep=5p write="spectre.ic" \
        writefinal="spectre.fc" method=euler annotate=status strobeperiod=5p \
        maxiters=5
    finalTimeOP info what=oppoint where=rawfile
    dcOp dc write="spectre.dc" maxiters=150 maxsteps=10000 annotate=status
    dcOpInfo info what=oppoint where=rawfile
    modelParameter info what=models where=rawfile
    element info what=inst where=rawfile
    outputParameter info what=output where=rawfile
    designParamVals info what=parameters where=rawfile
    primitives info what=primitives where=rawfile
    subckts info what=subckts  where=rawfile
    export RISE_TIME=oceanEval("MyRiseTime(v(\"MIXER_I_P\" ?result 'tran) \
        8e-07 9e-07)")
    }
    save MIXER_Q_M MIXER_Q_P MIXER_I_M MIXER_I_P
    saveOptions options save=selected pwr=none currents=selected

    Essentially it's the same as yours except I removed the leading / from MIXER_I_P because I did not create a schematic for mine, and was running from the UNIX command line.

    The spectre output log I've attached. And the monteCarlo/mcdata file that was produced contained:

     3.59212e-08     0.758089621

    If I ran with numruns=5 I get this:

    3.59212e-08     0.758089621
    3.57765e-08     0.969091674
    3.57113e-08     1.10677017
    3.56817e-08     1.182617678
    3.57873e-08     0.9494422794

    (the second column of numbers is the value of peak in my netlist).

    So it all appears to work.

    Maybe there was a specific issue with your version of spectre? Or maybe something is just wrong with the calculation function. Perhaps you can try my example (just run "spectre testmonte.scs" and see what happens; you should get a result file called monteCarlo/mcdata in the directory you're running spectre).

    Regards,

    Andrew.

    • testmonte.log
    • View
    • Hide
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    OK, I just tried it myself with a made up example. I put this in my ~/.artilinit file:

    procedure(MyRiseTime(signal CLIP_START CLIP_END)
      let((clip_I_P MIN_VALUE MAX_VALUE UPPER_THRESHOLD LOWER_THRESHOLD RISE_UPPER RISE_LOWER)
        clip_I_P=clip( signal CLIP_START CLIP_END)
        MIN_VALUE=ymin(clip_I_P) + 0.02
        MAX_VALUE=ymax(clip_I_P)- 0.03
        UPPER_THRESOLD=MIN_VALUE + ( (MAX_VALUE-MIN_VALUE)*0.9 )
        LOWER_THRESHOLD=MIN_VALUE + ( (MAX_VALUE-MIN_VALUE)*0.1 )
        RISE_UPPER= cross( clip_I_P UPPER_THRESOLD 2 'rising )
        RISE_LOWER= cross( clip_I_P LOWER_THRESHOLD 2 'rising )
        abs(RISE_UPPER-RISE_LOWER)
      )
    )

    I then used this as "testmonte.scs" :

    //

    parameters peak=1
    statistics {
        process {
        vary peak dist=gauss std=0.1
        }
    }

    v1 (MIXER_I_P 0) vsource type=sine freq=20M ampl=peak
    r1 (MIXER_I_P 0) resistor r=1k

    simulatorOptions options reltol=1e-3 vabstol=1e-4 iabstol=1e-14 temp=27.0 \
        tnom=27 scalem=1.0 scale=1.0 gmin=1e-12 rforce=1 maxnotes=5 maxwarns=5 \
        digits=5 cols=80 pivrel=1e-3 sensfile="../psf/sens.output" \
        checklimitdest=psf
    mc1 montecarlo numruns=1 seed=1 variations=all donominal=yes \
        scalarfile="../monteCarlo/mcdata" paramfile="../monteCarlo/mcparam" \
        saveprocessparams=yes processparamfile="../monteCarlo/processParam" \
        processscalarfile="../monteCarlo/processData" {
    tran tran stop=1u errpreset=moderate maxstep=5p write="spectre.ic" \
        writefinal="spectre.fc" method=euler annotate=status strobeperiod=5p \
        maxiters=5
    finalTimeOP info what=oppoint where=rawfile
    dcOp dc write="spectre.dc" maxiters=150 maxsteps=10000 annotate=status
    dcOpInfo info what=oppoint where=rawfile
    modelParameter info what=models where=rawfile
    element info what=inst where=rawfile
    outputParameter info what=output where=rawfile
    designParamVals info what=parameters where=rawfile
    primitives info what=primitives where=rawfile
    subckts info what=subckts  where=rawfile
    export RISE_TIME=oceanEval("MyRiseTime(v(\"MIXER_I_P\" ?result 'tran) \
        8e-07 9e-07)")
    }
    save MIXER_Q_M MIXER_Q_P MIXER_I_M MIXER_I_P
    saveOptions options save=selected pwr=none currents=selected

    Essentially it's the same as yours except I removed the leading / from MIXER_I_P because I did not create a schematic for mine, and was running from the UNIX command line.

    The spectre output log I've attached. And the monteCarlo/mcdata file that was produced contained:

     3.59212e-08     0.758089621

    If I ran with numruns=5 I get this:

    3.59212e-08     0.758089621
    3.57765e-08     0.969091674
    3.57113e-08     1.10677017
    3.56817e-08     1.182617678
    3.57873e-08     0.9494422794

    (the second column of numbers is the value of peak in my netlist).

    So it all appears to work.

    Maybe there was a specific issue with your version of spectre? Or maybe something is just wrong with the calculation function. Perhaps you can try my example (just run "spectre testmonte.scs" and see what happens; you should get a result file called monteCarlo/mcdata in the directory you're running spectre).

    Regards,

    Andrew.

    • testmonte.log
    • View
    • Hide
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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