• 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. Multiple variable MonteCarlo simulation in OCEAN

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 144
  • Views 14129
  • 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

Multiple variable MonteCarlo simulation in OCEAN

Alex Vasjanov
Alex Vasjanov over 11 years ago

Hello,

 I've been wondering, is there any way of doing multiple variable Monte Carlo simulations using OCEAN programming language? Monte Carlo simulations from ADE provide only a singe parameter to be swept, but what about several? Is that even possible?

 

My guess is that it might be impossible due to the specifics of the algorithm that is implemented, but I might be mistaking.

 

 Regards,

Aleksandr

 

  • Cancel
Parents
  • pranucci
    pranucci over 11 years ago

    After reading a bunch of your posts on this i was actually able to solve my problem.

    The mcdata file always appears to erase and then overwrite the previous parametric run with the new data and then keep repeating so instead of relying on that file I just printed the results from each run into my own file using your abstats.il script.

    Here's the code for general interest:

    load("/(directory path)/abStats.il")

    /* standard setup stuff here */

     VIN_List='("5.0" "2.7")
    temp_List='("-40" "125")
    BG_code_List='("6" "7")
    CL_code_List='("0" "1")

    number = 0

    fprintf(myPort "iteration,VIN, BG_code, CL_code, temp, VBG, VREF, Voffset, Iout_DC\n")

    foreach(VIN VIN_List
                desVar("pvdd" VIN)
    foreach(BG_CODE BG_code_List
                desVar(      "BG_code" BG_CODE    )
    foreach(CL_CODE CL_code_List
                desVar(      "CL_code" CL_CODE    )
    foreach(temp temp_List
                    temp(temp)

                    monteCarlo( ?numIters "5" ?startIter "1"
                        ?analysisVariation 'mismatch
                        ?sweptParam "None"
                        ?sweptParamVals "27"  
                        ?saveData nil
                        ?nomRun "yes"
                        ?append nil
                        ?saveProcessParams t
                        )
                    monteExpr( "VBG" "VDC(\"/BG_2036\")" )
                    monteExpr( "VREF" "VDC(\"/VREFA\")" )
                    monteExpr( "Voffset" "(VDC(\"/DRAIN\") - VDC(\"/IREF\"))" )
                    monteExpr( "Iout_dc" "IDC(\"/V17/MINUS\")" )
                    monteRun()

    results=abReadMonteData(strcat(openResults() "/monteCarlo"))
    VBG_results=results->datatab[sprintf(nil "VBG_%s" temp)]
    VREF_results=results->datatab[sprintf(nil "VREF_%s" temp)]
    Voffset_results=results->datatab[sprintf(nil "Voffset_%s" temp)]
    Iout_dc_results=results->datatab[sprintf(nil "Iout_dc_%s" temp)]

    /* right here I had to use the sprintf() expression so that it searches for VBG_25 and not just VBG */

    number=number+1

    printf("***** %d *****\n" number)

    /* match i range up to number of MC iterations */

    for( i 0 results->N - 1
    fprintf(myPort "%d,%s,%s,%s,%s,%5f,%5f,%5e,%5f\n" i+1 VIN BG_CODE CL_CODE temp VBG_results[i] VREF_results[i] Voffset_results[i] Iout_dc_results[i])))

    /* print out i+1 for iteration number to match it up with the actual monte carlo iteration */   

                ))))
    close(myPort)

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • pranucci
    pranucci over 11 years ago

    After reading a bunch of your posts on this i was actually able to solve my problem.

    The mcdata file always appears to erase and then overwrite the previous parametric run with the new data and then keep repeating so instead of relying on that file I just printed the results from each run into my own file using your abstats.il script.

    Here's the code for general interest:

    load("/(directory path)/abStats.il")

    /* standard setup stuff here */

     VIN_List='("5.0" "2.7")
    temp_List='("-40" "125")
    BG_code_List='("6" "7")
    CL_code_List='("0" "1")

    number = 0

    fprintf(myPort "iteration,VIN, BG_code, CL_code, temp, VBG, VREF, Voffset, Iout_DC\n")

    foreach(VIN VIN_List
                desVar("pvdd" VIN)
    foreach(BG_CODE BG_code_List
                desVar(      "BG_code" BG_CODE    )
    foreach(CL_CODE CL_code_List
                desVar(      "CL_code" CL_CODE    )
    foreach(temp temp_List
                    temp(temp)

                    monteCarlo( ?numIters "5" ?startIter "1"
                        ?analysisVariation 'mismatch
                        ?sweptParam "None"
                        ?sweptParamVals "27"  
                        ?saveData nil
                        ?nomRun "yes"
                        ?append nil
                        ?saveProcessParams t
                        )
                    monteExpr( "VBG" "VDC(\"/BG_2036\")" )
                    monteExpr( "VREF" "VDC(\"/VREFA\")" )
                    monteExpr( "Voffset" "(VDC(\"/DRAIN\") - VDC(\"/IREF\"))" )
                    monteExpr( "Iout_dc" "IDC(\"/V17/MINUS\")" )
                    monteRun()

    results=abReadMonteData(strcat(openResults() "/monteCarlo"))
    VBG_results=results->datatab[sprintf(nil "VBG_%s" temp)]
    VREF_results=results->datatab[sprintf(nil "VREF_%s" temp)]
    Voffset_results=results->datatab[sprintf(nil "Voffset_%s" temp)]
    Iout_dc_results=results->datatab[sprintf(nil "Iout_dc_%s" temp)]

    /* right here I had to use the sprintf() expression so that it searches for VBG_25 and not just VBG */

    number=number+1

    printf("***** %d *****\n" number)

    /* match i range up to number of MC iterations */

    for( i 0 results->N - 1
    fprintf(myPort "%d,%s,%s,%s,%s,%5f,%5f,%5e,%5f\n" i+1 VIN BG_CODE CL_CODE temp VBG_results[i] VREF_results[i] Voffset_results[i] Iout_dc_results[i])))

    /* print out i+1 for iteration number to match it up with the actual monte carlo iteration */   

                ))))
    close(myPort)

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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