• 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 Design
  3. Printing operating point values to file

Stats

  • Locked Locked
  • Replies 8
  • Subscribers 127
  • Views 16921
  • 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

Printing operating point values to file

anirbanbob
anirbanbob over 12 years ago

 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

  • Cancel
  • berndfi
    berndfi over 12 years ago

     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.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • berndfi
    berndfi over 12 years ago

    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.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    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.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • anirbanbob
    anirbanbob over 12 years ago

    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?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    Can you post your whole OCEAN script?

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • anirbanbob
    anirbanbob over 12 years ago

     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()

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • anirbanbob
    anirbanbob over 12 years ago

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

     Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

     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.

    • Cancel
    • Vote Up 0 Vote 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.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information