Home > Community > Forums > Custom IC Design > Printing operating point values to file

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: *

 Printing operating point values to file 

Last post Fri, Apr 26 2013 3:28 AM by Andrew Beckett. 8 replies.
Started by anirbanbob 18 Apr 2013 02:15 AM. Topic has 8 replies and 1335 views
Page 1 of 1 (9 items)
Sort Posts:
  • Thu, Apr 18 2013 2:15 AM

    • anirbanbob
    • Not Ranked
    • Joined on Thu, Apr 18 2013
    • Posts 4
    • Points 65
    Printing operating point values to file Reply

     Hi

     I am a new to ocean scripting and currently I am trying to print operating point parameters(gm,rds,etc) to a file through ocean.The simulation runs fine. I don't want to use ocnprint because it introduces column headers. I want to use frpintf instead. I tried something like:

     gm = OP("/M0","gm")

    fprintf( out "%5.2" gm)

     -> this prints  srrWave:0x1f7c0060 instead of the deciaml value. What is the correct way to do this?

     Cheers

    Anirban

    Filed under:
    • Post Points: 20
  • Thu, Apr 18 2013 4:31 AM

    • berndfi
    • Top 100 Contributor
    • Joined on Tue, Sep 11 2012
    • Neubiberg, Bavaria
    • Posts 67
    • Points 1,255
    Re: Printing operating point values to file Reply

     This is not ocean what you have posted.
    Try this:

    openResults( "<yourResultsPsfDir>")
    selectResults( 'dcOpInfo )
    report( ?output "<yourOutputFile>" ?name "/M0" ?param "gm" )

    And have a look at the "OCEAN Reference" manual.

    • Post Points: 5
  • Thu, Apr 18 2013 4:45 AM

    • berndfi
    • Top 100 Contributor
    • Joined on Tue, Sep 11 2012
    • Neubiberg, Bavaria
    • Posts 67
    • Points 1,255
    Re: Printing operating point values to file Reply

    For rthe initial question, OP usualy should return a float.

    You may test it with "type(gm)", where gm is the varialbe which holds the gm value.

    For the print I would suggest a " fprintf( out "%e" gm )".

    Your post doesnt have a vaild format spec for fprintf, don't know if this is a typo.

     

    • Post Points: 20
  • Thu, Apr 18 2013 4:58 AM

    Re: Printing operating point values to file Reply

    Should be OK using OP, but my guess is that you've done a parametric sweep or something like that? Could that be the case?

    Regards,

    Andrew.

    • Post Points: 20
  • Thu, Apr 18 2013 5:19 AM

    • anirbanbob
    • Not Ranked
    • Joined on Thu, Apr 18 2013
    • Posts 4
    • Points 65
    Re: Printing operating point values to file Reply

    Hi Berndfi ...  Thanks for your reply. Will try them

     

    Hi Andrew.. Thanks for your reply. I am not running parametric sweep. I have a DC-biased NMOS and have simply run a simulation with save DC OP set.What could be wrong?

    • Post Points: 20
  • Thu, Apr 18 2013 5:50 AM

    Re: Printing operating point values to file Reply

    Can you post your whole OCEAN script?

    Andrew.

    • Post Points: 35
  • Thu, Apr 18 2013 5:58 AM

    • anirbanbob
    • Not Ranked
    • Joined on Thu, Apr 18 2013
    • Posts 4
    • Points 65
    Re: Printing operating point values to file Reply

     Here it is:

     ;====================== Set to XL mode =========================================
    ocnSetXLMode()
    ocnxlProjectDir( "**************" )
    ocnxlTargetCellView( "QA" "NMOS" "adexl_anirban" )
    ocnxlResultsLocation( "" )
    ocnxlSimResultsLocation( "*******************" )

    ;====================== Tests setup ============================================

    ;---------- Test "QA:NMOS:1" -------------
    ocnxlBeginTest("QA:NMOS:1")
    simulator( 'spectre )
    design( "QA" "NMOS" "schematic")
    modelFile(
        '("$PDKROOT/models/spectre/MOS.scs" "typ")
        '("$PDKROOT/models/spectre/RES.scs" "typ")
        '("$PDKROOT/models/spectre/CAP.scs" "typ")
        '("$PDKROOT/models/spectre/DIO.scs" "typ")
    )
    analysis('dc ?saveOppoint t  )
    envOption(
        'analysisOrder  list("dc")
    )
    temp( 27 )


    gm = OP("/M0","gm")

    ocnxlOutputExpr( "(OP(\"/M0\" \"vds\") / OP(\"/M0\" \"ids\"))" ?plot t)
    ocnxlOutputExpr( "OP(\"/M0\" \"ids\")" ?plot t)
    ocnxlOutputExpr( "OP(\"/M0\" \"gm\")" ?plot t)
    ocnxlOutputExpr( "OP(\"/M0\" \"vth\")" ?plot t)
    ocnxlEndTest() ; "QA:NMOS:1"

    ;====================== Sweeps setup ===========================================

    ;====================== Model Group setup ==========================================

    ;====================== Corners setup ==========================================
    ocnxlCorner( "C0"
       '(
          ("model" "$PDKROOT/models/spectre/CAP.scs" ?section "\"typ\"")
          ("model" "$PDKROOT/models/spectre/DIO.scs" ?section "\"typ\"")
          ("model" "$PDKROOT/models/spectre/MOS.scs" ?section "\"typ\"")
          ("model" "$PDKROOT/models_old/spectre/MOS.scs" ?enabled nil  ?section "")
          ("model" "$PDKROOT/models/spectre/RES.scs" ?section "\"typ\"")
          ("modelGroup" "")
       )
    )
    ocnxlCorner( "C1"
       '(
          ("model" "$PDKROOT/models/spectre/CAP.scs" ?section "\"typ\"")
          ("model" "$PDKROOT/models/spectre/DIO.scs" ?section "\"typ\"")
          ("model" "$PDKROOT/models/spectre/MOS.scs" ?enabled nil  ?section "")
          ("model" "$PDKROOT/models_old/spectre/MOS.scs" ?section "\"typ\"")
          ("model" "$PDKROOT/models/spectre/RES.scs" ?section "\"typ\"")
          ("modelGroup" "")
       )
    )

    ;====================== Test v/s corners setup =================================

    ;====================== Job setup ==============================================
    ocnxlJobSetup( '(
        "blockemail" "1"
        "configuretimeout" "300"
        "distributionmethod" "LBS"
        "jobqueue" "cadence.q"
        "lingertimeout" "300"
        "maxjobs" "8"
        "name" "******************"
        "preemptivestart" "1"
        "reconfigureimmediately" "1"
        "runtimeout" "-1"
        "showerrorwhenretrying" "1"
        "showoutputlogerror" "1"
        "startmaxjobsimmed" "1"
        "starttimeout" "300"
    ) )

    ;====================== Disabled items =========================================

    ;====================== Starting Point Info ======================================


    out = outfile("./results.txt" "w")

    ;====================== Run command ============================================
    ocnxlRun( ?mode 'sweepsAndCorners ?nominalCornerEnabled nil ?allCornersEnabled t ?allSweepsEnabled t)

    fprintf(out "%5.2f" gm)
    ;====================== End XL Mode command ===================================
    ocnxlEndXLMode()

     

    • Post Points: 5
  • Fri, Apr 26 2013 3:21 AM

    • anirbanbob
    • Not Ranked
    • Joined on Thu, Apr 18 2013
    • Posts 4
    • Points 65
    Re: Printing operating point values to file Reply

     Hi Andrew, were you able to spot any error in the file? type(gm) returns other, how do i get the float value?

     Thanks

    • Post Points: 20
  • Fri, Apr 26 2013 3:28 AM

    Re: Printing operating point values to file Reply

     Sorry, meant to reply at the time but was busy travelling.

    I'm slightly surprised it works at all, as the gm variable is set during the definition of the test, not when it is run. But assuming that magically works somehow, you are running over corners, so you will have a waveform with the gm versus corners.

    I would suggest you try doing something like:

    selectResult('dcOp)
    sweepNames()

    at the end to see what the sweep names are - you will probably have to do a value(gm ...) to find the value at the value of one of the sweep variables to "slice" the data.

    Or define the gm measurement as an output expression for the test?

    Apologies for the quick (and untested) reply - I'm rather busy today.

    Regards,

    Andrew.

    • Post Points: 5
Page 1 of 1 (9 items)
Sort Posts:
Started by anirbanbob at 18 Apr 2013 02:15 AM. Topic has 8 replies.