• 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. Statistical values manipulation - Monte Carlo

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 126
  • Views 3555
  • 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

Statistical values manipulation - Monte Carlo

Juan Pablo
Juan Pablo over 16 years ago
Dear,
Using IC5141 with MMSIM70 a have a doubt concerning Monte Carlo simulation.
For a given Histogram is that possible to collect the statistical data (mean and/or standard-deviation) and manipulate this on the ADE Calculator?
For example, if I want to obtain the Coefficient of variation which is defined as the ratio of the standard deviation to the mean (sigma/mu). There exist a way to obtain this value (scalar) from an especial function of the ADE calculator or an option of the Analog Statistical Analisys ?
One way is to get the values from Simulation Directory and treating on MS Office Excel…but I want to stay on Cadence.

Cheers,
juan
  • Cancel
  • Andrew Beckett
    Andrew Beckett over 16 years ago

    A number of customers use the abStats.il code included in my sourcelink.cadence.com solution - number 11026072 (just search for that number).

    This has functions to return the mean, median, min, max, standard deviation, percentiles, and various other useful functions related to the results of monte carlo simulations.

    You might also want to take a look at solution 11474384.

    Best Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Juan Pablo
    Juan Pablo over 16 years ago

    Hi Andrew,

    Thanks a lot for your help.
    I am an analog guy and my programming skills are practically zero.
    So, what’s the manner the use/install this code on my system?
    Do you have any references concerning OCEAN scripts ?
    On IC6 the ADEXL tool I have an option to insert an OCEAN script. Is that the right way?

    Regards
    Juan

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 16 years ago

    Yes, the functions are a little more geared up for use in OCEAN scripts rather than in ADE.

    To use them, you'd do:

    load("abStats.il")

    and then use the functions as described in the comments at the top of the code. For more info on OCEAN, probably best to start with the OCEAN reference manual - <ICinstDir>/doc/oceanref/oceanref.pdf 

    Cadence also has a training class on OCEAN.

    Alternatively, another way you can do things is to use the "save family data" option on the monte carlo form, and then use the same expression you used for your monte carlo scalar expressions in the calculator. This will give you a waveform which has the result of the expression versus the iteration number. Having done that you can use the calculator stddev function to find the standard deviation, or the average function to find the mean. Take note of the second solution number I mention above, as this describes the slight difference you'll get in the mean and standard deviation when doing it this way.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Micka
    Micka over 16 years ago

    Soory, do you maybe have a solution to my problem?

    I cannot manage to save the results of MC iterations?

    The code is:

    ocnWaveformTool( 'wavescan )
    simulator( 'spectre )
    design(  "/home/scard/simulation/CMOSSbox_test_new_htype/spectre/schematic/netlist/netlist")
    resultsDir( "/home/scard/simulation/CMOSSbox_test_new_htype/spectre/schematic" )
    definitionFile(
        "models.scs"
    )
    analysis('tran ?stop "1u" )
    desVar(   "tclk" 1u )
    desVar(   "j" 0 )
    desVar(   "del" 200n )
    option( 'temp  "25.0"
     'iabstol  "1e-14"
     'vabstol  "1e-8"
     'reltol  "1e-6"
    )
    save( 'i "/V4/PLUS" )
    temp( 25.0 )
    MCresults = outfile( "/home/scard/results/SBOX_mc_htypefinal/sbox_mc_results.txt" "w")
    monteCarlo( ?numIters "3" ?startIter "1"
        ?analysisVariation 'mismatch ?sweptParam "None"
        ?sweptParamVals "27" ?saveData t
        ?nomRun "yes" ?append nil)
    monteExpr( "leak" "-average(clip(i(\"/V4/PLUS\" ?result \"tran-tran\") 5e-07 1e-06))" )
    monteRun()
    Imc_mean = average(-average(clip(i("/V4/PLUS" ?result \"tran-tran"\) 5e-07 1e-06)))
    fprintf( MCresults "%3.4f \n" Imc_mean*1e9 );
    close(MCresults);
    MCresults = outfile( "/home/scard/results/SBOX_mc_htypefinal/sbox_mc_results.txt" "a")
    close(MCresults)

    Probably, somewher here is an error.

    Can you help me with this?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 16 years ago

    It's not obvious why this isn't working - you didn't give any error messages that it might have given, or what wasn't working.

    However, what I usually recommend is to use the functions described in sourcelink solution  11026072 - these allow you to read and post-process the scalar results saved in the monte carlo run - so it means you don't have to recompute the expression from the complete family all over again.

    You may also want to use the  "non-aliased" name (this is mentioned in the documentation too). Use i("..." ?result "tran") instead of "tran-tran" - otherwise you can find yourself getting the nominal result rather than the monte-carlo result...

     Best Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • 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