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.
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?RegardsJuan
Yes, the functions are a little more geared up for use in OCEAN scripts rather than in ADE.
To use them, you'd do:
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.
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?
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...