extracting mean/sigma from monteCarlo run, using ocean

Discussion in 'Cadence' started by AG, Aug 22, 2008.

  1. AG

    AG Guest

    Hi,
    I want to run a script that runs monteCarlo for N number of runs and
    extract the mean/median/sigma of a few parameters in a file.
    I used the skill script (sourcelink ref no.11026072) , as suggested by
    Andrew.
    On ocean prompt, the following syntax returns true:

    ocean> monteExpr( "avgIvdd" "average(clip(IT(\"/V6/MINUS\") 1n 4n))" )
    ocean> t

    and it returns error for

    ocean> monteExpr( "avgi" "average(clip(i("V6:p") 2n 4n))")
    *Error* lineread/read: syntax error encountered in input

    I still use both.

    Then I run the analysis
    ocean > monteRun()

    But once the run is complete, still I get the error as follows:
    --------------------------------------------------------------------------------------------------------------
    mc1-003_tran: time = 4.875 ns (97.5 %), step = 1.076 ps
    (21.5 m%)

    Number of accepted tran steps = 2656.

    Initial condition solution time = 1.9 s.

    Intrinsic tran analysis time = 201.52 s.

    Total time required for tran analysis `mc1-003_tran' was 203.71 s (3m
    23.7s).



    Warning from spectre during transient analysis `mc1-003_tran', during
    Monte
    Carlo analysis `mc1'.
    WARNING (SPECTRE-6006): 12979 warnings suppressed.


    mc1-003_finalTimeOP: writing operating point information to rawfile.

    mc1-003_modelParameter: writing model parameter values to rawfile.

    mc1-003_element: writing instance parameter values to rawfile.

    mc1-003_outputParameter: writing output parameter values to rawfile.

    mc1-003_designParamVals: writing netlist parameters to rawfile.

    mc1-003_primitives: writing primitives to rawfile.

    mc1-003_subckts: writing subcircuits to rawfile.


    Warning from spectre during Monte Carlo analysis `mc1'.
    WARNING (SPECTRE-16002): Monte Carlo iteration 3 terminated
    prematurely
    because of following error(s):

    Error found by spectre during Monte Carlo analysis `mc1'.
    ERROR (SPECTRE-8003): mc1-003_subckts: Error evaluating ocean
    expression
    `avgIvdd=average(clip(IT("/V6/MINUS") 1n 4n))'.
    -------------------------------------------------------------------------------------------------------------

    Then after lots of warnings, following messege appears

    ---------------------------------------------------------------------------------------------------------------

    **** Run Status for Monte Carlo analysis `mc1' ****

    Monte Carlo iteration 3 failed.

    Total time required for montecarlo analysis `mc1' was 207.19 s (3m
    27.2s).



    Warning from spectre.

    WARNING (SPECTRE-6006): 12184 warnings suppressed.



    Aggregate audit (10:20:16 AM, Fri Aug 22, 2008):

    Time used: CPU = 212 s (3m 32.1s), elapsed = 228 s (3m 48.0s), util.
    = 93%.

    Time spent in licensing: elapsed = 20 ms.

    Virtual memory used = 182 Mbytes.

    spectre completes with 1 error, 38306 warnings, and 252 notices.

    reading simulation data...
    ...successful.
    Monte Carlo Simulation completed successfully...
    Loading stats.cxt
    Errors with output expressions found:

    "avgIvdd" does not evaluate properly.

    ---------------------------------------------------------------------------------------------------------------


    Also, I observe that the skill script seems to be changing the
    resultsDir to different path than what I specify in my ocean-script.
    Another interesting thing is that I can plot the waveforms using
    plot(clip(i("V6:p") 1n 4n)))
    but not using
    plot(clip(IT(\"/V6/MINUS\") 1n 4n)))

    Can somebody please help me how to solve the problem.
     
    AG, Aug 22, 2008
    #1
  2. AG

    S. Badel Guest

    There is a problem here :
    "average(clip(i("V6:p") 2n 4n))"

    The inner quotes (") should be escaped as \", because it is inside of a string literal.
    "average(clip(i(\"V6:p\") 2n 4n))"

    conversely you can't do this :
    plot(clip(IT(\"/V6/MINUS\") 1n 4n)))

    you must un-escape the quotes.

    Think of it this way : the valid skill expression is clip(IT("/V6/MINUS") 1n 4n)), and when you
    surround it with quotes (as you do in monteExpr) you must escape all the existing quotes.



    Stéphane
     
    S. Badel, Aug 22, 2008
    #2
  3. AG

    AG Guest




    Thanks a lot Stephane.
    Though I don't get any error on the ocean prompt when I write

    monteExpr( "avginew" "-1.0*average(clip(i(\"V6:p\") 1n 1.3n))")

    But after monteRun, I still get this error as follows:

    Error found by spectre during Monte Carlo analysis `mc1'.
    ERROR (SPECTRE-8003): mc1-003_subckts: Error evaluating ocean
    expression
    `avginew=-1.0*average(clip(i("V6:p") 1n 1.3n))'.

    though I can successfully get average using

    plot(-1.0*average(clip(i("V6:p") 1n 1.3n)))

    Can you throw some more light on it?
     
    AG, Aug 22, 2008
    #3
  4. AG

    S. Badel Guest

    Thanks a lot Stephane.
    I will make a wild guess, I'm too lazy to try it out. But it might be due to the syntax you are
    using in your i() expression.

    First try adding the results type, as in

    i("V6:p" ?result 'tran)


    Any luck ?

    Stéphane
     
    S. Badel, Aug 22, 2008
    #4
  5. AG

    AG Guest


    If you mean saving the result, thats not a problem as I said that I am
    able to plot the current.
    But, still I did try as you said and still no luck :-(
     
    AG, Aug 22, 2008
    #5
  6. AG

    Riad KACED Guest

    Dear AG,

    I do agree with Stéphane, you should escape the " with an \ when your
    stings are within the monteExpr command.
    So the following syntax:
    monteExpr( "avgIvdd" "average(clip(IT(\"/V6/MINUS\") 1n 4n))" )
    should be fine. I don't see any problem with the IT command as well.

    I was checking one of my oceans just now, and did successfully run a
    script containing:
    monteExpr( "avgCurrent" "average(clip(IT(\"/V1/PLUS\") 2e-07
    3e-07))" )
    My MC get at the end with no troubles at all.
    If I dare trying the unescaped syntax as Stéphane mentioned above,
    then my ocean yells at me:
    ;
    ocean> load("/tmp/monteCarlo.ocn")
    monteExpr( "avgCurrent" "average(clip(IT("/V1/PLUS") 2e-07
    3e-07))" )
    ^
    SYNTAX ERROR found at line 19 column 67 of file /tmp/monteCarlo.ocn
    *Error* lineread/read: syntax error encountered in input
    *Error* load: error while loading file - "/tmp/monteCarlo.ocn"
    ;

    Well it did work very fine in my case but you don't care, don't you ?
    I'm suspecting a spectre/ocean bug so far.
    You seem you can get access to the cds SourceLink, so why don't you
    give a look at the SR11297882 to check out your cadence version
    against a similar problem reported in that ticket. Contacting your
    cadence customer support would be the best thing in this case.

    Cheers,
    Riad.
     
    Riad KACED, Aug 26, 2008
    #6
  7. AG

    AG Guest


    Hi Riad,
    Thanks for your reply.
    I'll recheck things and get back to you.

    Regards,
    Anand
     
    AG, Aug 26, 2008
    #7
  8. AG

    AG Guest


    Thanks to all.
    I am able to run my script and get the mean/sigma written down into a
    file.
     
    AG, Aug 26, 2008
    #8
  9. AG

    Riad KACED Guest

    Hi Anand,

    I'm very happy you have managed to make it working !
    What was the broken link then ?

    Cheers,
    Riad.
     
    Riad KACED, Aug 26, 2008
    #9
  10. AG

    AG Guest


    Hi Riad,
    Seems escaping of " using \" applies only inside montExpr as elsewhere
    it was working fine.
    Also, there were other same syntax issues in my few more (around 20)
    montExpr expression.
    I must admit, I was being a bit careless and missed those assuming
    they were right (they had been directly imported form monteCarlo-GUI-
    create-script) and it was not giving them in errors but only the
    average current montExpr was being flagged as error which also, a bit,
    misguided me.
    But yes, with correct syntax, the Skill script to extract the
    statistical properties work just fine.
    I like it.

    Thanks once again to you and Stephane.
     
    AG, Aug 27, 2008
    #10
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.