How to select and plot individual results of parametric simulation

Discussion in 'Cadence' started by spectrallypure, Jan 20, 2008.

  1. Hi all!.

    I believe this has been somewhat (attempted to be) addressed in the
    past (see e.g.
    http://groups.google.com/group/comp...=gst&q=parametric+plot+skill#1d3bedcf15f2babb),
    but after reading the documentation and searching through the forum I
    haven't been able to figure out the Skill /Ocean code needed to 'grab'
    and plot individual results from a parametric analysis.

    Please consider the following sample code:

    ; =====================================
    ; Sample_simulation_individual_steps.il
    ; =====================================
    ocnWaveformTool( 'wavescan )
    simulator( 'spectre )
    design( "/home/cdsmgr/cds/tesis/Sim/GIAPRI/spectre/schematic/netlist/
    netlist")
    resultsDir( "/home/cdsmgr/cds/tesis/Sim/GIAPRI/spectre/schematic" )
    modelFile( '("/programs/cadence/DESIGN_KITS/ams_v3.70/spectre/c35/
    mcparams.scs" "")
    '("/programs/cadence/DESIGN_KITS/ams_v3.70/spectre/c35/cmos53.scs"
    "cmostm") )

    analysis( 'dc ?param "IAPR_cero" ?start "0" ?stop "1" )
    load("Cargar_Variables_Diseno_Tesis.il")
    desVar( "IINTs_menos1" 0.5 )
    desVar( "IAPR_cero" 0.5 )
    temp( 27 )

    save( 'i "/DUT/IAPRI_uno" "/DUT/IAPRI_cero" )

    paramAnalysis( "IINTs_menos1" ?values '(0.01 0.5 0.99 ) ?sweepType
    'paramset )
    paramRun()

    ;Selection of an individual (first) step of the parametric set
    selectResult( 'dc car(sweepValues()) )

    ; Signal IAPRI_cero
    pIAPRI_cero = (IDC("/DUT/IAPRI_cero") / (IDC("/DUT/IAPRI_cero") +
    IDC("/DUT/IAPRI_uno")))
    plot( pIAPRI_cero ?expr '( "pIAPRI_cero" ) )
    addSubwindowTitle( "IAPRI_cero" )

    ; Signal IAPRI_uno
    pIAPRI_uno = (IDC("/DUT/IAPRI_uno") / (IDC("/DUT/IAPRI_cero") + IDC("/
    DUT/IAPRI_uno")))
    plot( pIAPRI_uno ?expr '( "pIAPRI_uno" ) )
    addSubwindowTitle( "IAPRI_uno" )

    ;end.

    Without the "selectResult" line, it runs fine but plots the entire
    curve families for both generated signals. When I add the
    "selectResult" line, which I took from CH7 in the Ocean Ref. manual -
    under the description for this command (BTW: the line there seems to
    be mistyped, as it reads "selectResult(( 'tran car( sweepValues() )" -
    parentheses mismatch), not only don't I get the desired result but it
    also throws me the following error (I guess it's sweepValues
    complaining):

    \o You must do openResults() and selectResults() before using
    \o this command. Make sure your openResults() and
    \o selectResults() commands worked. Use ocnHelp('openResults)
    \o and ocnHelp('selectResults) for more information.

    I have tried including lines like "selectResult('dc)" or using the
    openResults command before the aforementioned line, but with no luck.

    I would be really grateful if someone could please give me a hint on
    how to figure this out. Thanks in advance for any help/ideas/
    comments! :)

    Regards,

    Jorge Luis.
     
    spectrallypure, Jan 20, 2008
    #1
  2. Oh, I forgot to add that the above code is just an example: in reality
    I plan (need) to grab all and each the individual results of the
    parametric run and process (plot) them individually. I was thinking of
    doing this resorting somehow to the sweepValues() command together
    with either nth() or some list manipulation commands (car, cdr, etc),
    in order to parse all the sweep step values.

    Well, thanks for any ideas!
     
    spectrallypure, Jan 20, 2008
    #2
  3. ..
     
    spectrallypure, Jan 23, 2008
    #3
  4. Have a look at the fam* SKILL commands. They are nice helpers to pick
    particular waveforms from families of waveforms.
     
    Svenn Are Bjerkem, Jan 24, 2008
    #4
  5. Still any luck trying to figure out this OCEAN problem... any help is
    really welcome!!! :O

    Regards,

    Jorge Luis.
     
    spectrallypure, Jan 28, 2008
    #5
  6. ....Still no luck trying to figure out this problem using OCEAN... any
    help is
    really welcome!!! :O

    Regards,

    Jorge Luis.
     
    spectrallypure, Jan 28, 2008
    #6
  7.  
    spectrallypure, Feb 1, 2008
    #7
  8. spectrallypure

    S. Badel Guest

    Still any luck trying to figure out this OCEAN problem... any help is
    As Svenn mentionned, the fam* functions are here to help you access families of waveforms.

    so you do

    foreach( sweepVal famGetSweepValues( yourFam )
    yourWave = famValue( yourFam sweepVal )
    ....
    )

    Isn't that what you're trying to do ?


    Cheers,

    Stéphane
     
    S. Badel, Feb 1, 2008
    #8
  9. Hi Stéphane!

    Thanks a lot for your reply, I finally got it working! I decided to
    totally forget about the previous approach and use the fam* functions
    as pointed out. My (rather silly) problem was that I really didn't
    know what objects I should treat as my families of waveforms. After
    some guessing I came up with the following code (which I include for
    the sake of completeness):

    (...previous code as in first post, excluding only the
    "selectResult( 'dc car(sweepValues()) )" line...)

    my_fam1 = pIAPRI_cero
    my_fam2 = pIAPRI_uno

    newWindow()
    foreach( sweepValue famGetSweepValues( my_fam1 )
    my_wave1 = famValue( my_fam1 sweepValue )
    my_wave2 = famValue( my_fam2 sweepValue )
    plot( my_wave1 ?expr '( "pIAPRI_cero" ) )
    plot( my_wave2 ?expr '( "pIAPRI_uno" ))

    addSubwindowTitle( strcat( cadr(sweepNames( my_fam1 )) "="
    sprintf(nil "%3.2f" sweepValue) ) )

    if( sweepValue != nth( length(famGetSweepValues(my_fam1))-1
    famGetSweepValues(my_fam1) ) then
    addSubwindow()
    )
    )

    This solves the problem of grabbing the individual waveforms. However,
    I didn't realize until the very end that what I am using as titles,
    i.e., the values returned by the "famGetSweepValues" function, are not
    the actual values of the swept parameter, but merely indexes. In fact,
    famGetSweepValues( my_fam1 ) returns the index list (1.0 2.0 3.0)
    rather than the actual parameter values (0.01 0.5 0.99) which I need
    for generating the individual plot titles. The same happens if I use
    the "sweepValues" function instead.

    ...Do you happen know of any method for accessing the individual
    values of the swept parameter in a parametric simulation?

    Thanks again for the help!

    Regards,

    Jorge.
     
    spectrallypure, Feb 1, 2008
    #9
  10. ..
     
    spectrallypure, Feb 5, 2008
    #10
  11. spectrallypure

    andrewb Guest

    There's the sweepValues() function to go along with the sweepNames()
    function. Did you try that?

    Also, if you use the dr.* functions for a family, the x-axis values
    are the values of the swept variable, and each y-axis value is a
    waveform (or family) for that particular point in the sweep.

    Regards,

    Andrew.
     
    andrewb, Feb 6, 2008
    #11
  12. spectrallypure

    S. Badel Guest

    This solves the problem of grabbing the individual waveforms. However,
    That's strange because when I do it, I get the sweep values. I'm not very used to using these
    functions, so I don't know where the difference may come from (simulator, type of sweep, version
    (IC5141+MMSIM61 here), whatever...).

    I know that doesn't help. Sorry.

    Stéphane
     
    S. Badel, Feb 6, 2008
    #12
  13. S. Badel wrote, on 02/06/08 16:06:
    That's what I would have thought too.

    If you do monte-carlo and possibly corner runs you probably just get
    an index - it will hide the fact that the corner corresponds to a
    set of parameter values.

    Although it's late in the day, and my memory is fading a little, so I
    probably _should_ try it to check...

    Andrew.
     
    Andrew Beckett, Feb 6, 2008
    #13
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.