• 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 SKILL
  3. Ocean script for Montecarlo/AMS technology

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 143
  • Views 3230
  • 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

Ocean script for Montecarlo/AMS technology

LucaPico
LucaPico over 14 years ago

 Hy everyone,

i am through this issue: i have to run montecarlo simulations with a trimming process: each montecarlo simulation must run at least twice in order to verified the results after trimming.

I could not find how to run just the ith montecarlo simulation

The script flow should be as folows:

run ith montecarlo sim

set the trimmed parameter

re-run ith montecarlo sim

check the results

I did it with another design kit but with AMS technology (Austriamicrosystems) i don't know how to do it.

I am using IC5.10.41.

Thanks a lot.

Luca 

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago

    In OCEAN, you'd use the monteCarlo(?numIters 1 ?startIter N) function, where N is the iteration number. So, something like this:

    for(N 1 100
      monteCarlo(?numIters 1 ?startIter N)
      monteRun()
      ; analyze the results and then do your trimming:
      desVar("..." ...)
      monteRun()
      ;analyze the results again and collect the final data
    )

    In IC615 (in IC614 as an engineering feature) we have a new capability called "pre run scripts" in ADE XL which allow you to do this directly in ADE XL during monte carlo.

    Best Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • LucaPico
    LucaPico over 14 years ago

     Thanks Andrew,

     it works percfectly. 

    Best regards.

    Luca

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • LucaPico
    LucaPico over 14 years ago

    Hy Andrew,

    the script i wrote works fine but i get these warnings:

    *WARNING* hiCreateForm: ** phase_margin_25_upper ** illegal duplicate field symbol in list of fields*WARNING* hiCreateForm: ** phase_margin_25_lower ** illegal duplicate field symbol in list of fields*WARNING* hiCreateForm: ** phase_margin_25_limits ** illegal duplicate field symbol in list of fields*WARNING* hiCreateForm: ** phase_margin_25 ** illegal duplicate field symbol in list of fields

    the number they are printed on the screen increase every montecarlo.

    it is just curiosity: what they are saying ?

     thanks a lot

    Best regards

    Luca

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

    Hi Luca,

    You're probably seeing the same issue as solution 11487734 that I wrote a while back. You're probably redefining the monteExpr() inside your loop, and each time you call monteExpr it adds to the previous expressions, and does not replace them. You'd also see this replication if you call monteResults() after the simulation. So either do not define the monteExpr inside the loop, or use delete('monteExpr) before you define them each time.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • LucaPico
    LucaPico over 14 years ago

     Hy Andrew,

     

    your solution works fine. Many thanks.

    I have another issue on the same script.

    It happened that some montecarlo simulations do not converge and the script does not proced because of error in the fprintf data type.

    when this happens it writes in the log file ERROR

    To prevent the script from stopping, I am doing this way (i found it the easiest way):

     while((check !="ERROR")  || (check != "EOF")

    fscanf(file_port "%s" check)

    )

    if(check == "ERROR")

    doing this

    else

    doing that

    )

    but when i put the (check != "EOF") statement in the while loop it goes in infinte loop (because in the first montecarlo simulation i run, there is no error).

    i think the log file i am pointing to is not closed or i am putting the wrong string for detecting the end of the file.

    Thanks a lot again

    Best regards

    Luca

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • LucaPico
    LucaPico over 14 years ago

     Hy Andrew,

    i have another issue with montecarlo simulations

    if I am running for example for(mc_index 1 5....
    and find some problems in the 4th simulation
    Then I write for(mc_index 4 5... to run just the 4th and the 5th
    but i got different results for the 4th run

    probably different seeds have been taken 

    i also set the random seed with srandom() but never changed.

    Thanks 

    Best regards

    Luca 

     

    • 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