CommunityForums Custom IC SKILL Multiple variable MonteCarlo simulation in OCEAN

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 132
  • Views 40234
  • 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 8 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
  • Andrew Beckett
    Andrew Beckett over 8 years ago

     Alexsandr,

    Unfortunately you didn't mention which version you're using, but my guess from how you have phrased your question that it's IC5141?

    There's no reason in spectre why you can't sweep any number of variables outside of the monte carlo analysis - but ADE (and OCEAN) limit what is directly supported. That said, there is nothing to prevent you doing:

    foreach(temp list(-40 27 80)
      foreach(vdd list(1.6 1.8 2.0)
        desVar("temp" temp)
        desVar("vdd" vdd)
        monteRun(...)
        ... process monte carlo results ...
      )
    )

    That will work fine. Given that the monte carlo run itself would normally dominate, the cost of the overhead running several separate simulations for sweeping the other variables is low.

    Regards,

    Andrew.

    • Cancel
    • Up 0 Down
    • Cancel
  • pranucci
    pranucci over 8 years ago

    Andrew,

    I'm trying something similar in IC5141. I just want to run monte carlo inside of a paramter sweep. I have the following code:

    VIN_List='("5.0")
    temp_List='("25" "125")
    BG_code_List='("6")
    CL_code_List='("0")

    number = 0

    fprintf(myPort "number,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 t
                        ?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()


    number=number+1

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

    Right now I am just simply trying to run two different temperatures and the issue is that I WILL get 10 monte carlo runs, however, the mcdata file I get has identical results for the first 5 runs and the second 5 runs which I believe means that the monte carlo sweeps are ignoring my attempt to set the 'temp' variable. I have the same issue trying to set any other variable in the sweep - every monte carlo run appears to be the same regardless of the desVar statement.

    Here's the mcdata file for this run:

    1.23223 0.405017 0.000328546 0.504977 1.23223 0.405017 0.000328546 0.504977    
    1.21931 0.401064 0.000453496 0.492068 1.21931 0.401064 0.000453496 0.492068    
    1.22453 0.402812 -0.000109186 0.523377 1.22453 0.402812 -0.000109186 0.523377    
    1.22864 0.404161 0.000559947 0.491905 1.22864 0.404161 0.000559947 0.491905    
    1.2225 0.402226 0.000660994 0.487249 1.2225 0.402226 0.000660994 0.487249     

    I'm using 4 monteExpressions and the second 4 columns are identical to the first 4.

    Any idea what's going on?

    Thanks,

    Paul

    • Cancel
    • Up 0 Down
    • Cancel
  • pranucci
    pranucci over 8 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
    • Up 0 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.