Home > Community > Forums > Custom IC SKILL > Ocean script for Montecarlo/AMS technology

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Ocean script for Montecarlo/AMS technology 

Last post Thu, Feb 3 2011 12:52 AM by LucaPico. 6 replies.
Started by LucaPico 27 Jan 2011 01:44 AM. Topic has 6 replies and 3229 views
Page 1 of 1 (7 items)
Sort Posts:
  • Thu, Jan 27 2011 1:44 AM

    • LucaPico
    • Not Ranked
    • Joined on Wed, Jan 26 2011
    • Pavia, Pavia
    • Posts 6
    • Points 60
    Ocean script for Montecarlo/AMS technology Reply

     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 

    • Post Points: 20
  • Thu, Jan 27 2011 10:38 PM

    Re: Ocean script for Montecarlo/AMS technology Reply

    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.

    • Post Points: 35
  • Fri, Jan 28 2011 12:20 AM

    • LucaPico
    • Not Ranked
    • Joined on Wed, Jan 26 2011
    • Pavia, Pavia
    • Posts 6
    • Points 60
    Re: Ocean script for Montecarlo/AMS technology Reply

     Thanks Andrew,

     it works percfectly. 

    Best regards.

    Luca

    • Post Points: 5
  • Fri, Jan 28 2011 2:31 AM

    • LucaPico
    • Not Ranked
    • Joined on Wed, Jan 26 2011
    • Pavia, Pavia
    • Posts 6
    • Points 60
    Re: Ocean script for Montecarlo/AMS technology Reply

    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

    • Post Points: 20
  • Fri, Jan 28 2011 6:17 AM

    Re: Ocean script for Montecarlo/AMS technology Reply

    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.

    • Post Points: 35
  • Fri, Jan 28 2011 7:15 AM

    • LucaPico
    • Not Ranked
    • Joined on Wed, Jan 26 2011
    • Pavia, Pavia
    • Posts 6
    • Points 60
    Re: Ocean script for Montecarlo/AMS technology Reply

     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

    • Post Points: 5
  • Thu, Feb 3 2011 12:52 AM

    • LucaPico
    • Not Ranked
    • Joined on Wed, Jan 26 2011
    • Pavia, Pavia
    • Posts 6
    • Points 60
    Re: Ocean script for Montecarlo/AMS technology Reply

     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 

     

    • Post Points: 5
Page 1 of 1 (7 items)
Sort Posts:
Started by LucaPico at 27 Jan 2011 01:44 AM. Topic has 6 replies.