• 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. Ocean script query

Stats

  • Locked Locked
  • Replies 7
  • Subscribers 126
  • Views 14786
  • 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

Ocean script query

eppramod
eppramod over 15 years ago
May be this has already been discussed here... Can anyone help here? Pramod My query is Is there a way in OCEAN script to avoid the job getting failed just because you have one measurement failing? This is the same way hspice prints “failed” in the measurement files and allow simulation to conclude. I have some measurements (using cross) which may not find values in some corners and which may find in some other. I have multiple measures and may be in some corner one among them will fail but others will pass. Right now if one measurement fails it stops the simulation after mentioning the error.
  • Cancel
  • skillUser
    skillUser over 15 years ago

     Hi Pramod,

    There is a SourceLink solution that I believe can you help you with this: Solution 11508500

    The short answer is to use errset() around any code that is throwing an error to programmatically trap and handle the error condition.

    Regards,

    Lawrence.

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

    I disagree with Lawrence a little on this. I think that actually the right way to handle this is using the first approach in that solution (I think the approaches in the solution came from something I said in an internal discussion anyway). That is to do this kind of thing:

    when(member('ac results())
    PM=phaseMargin(VF("/out"))
    when(PM
    fprintf(fp "Phase margin = %f\n" PM)
    )
    )

    In other words, it's better to explicitly check for various things - in this case, we check that the ac results are present (maybe it failed for some reason) prior to trying to calculate the phaseMargin. In other words, at each stage, check the result of an expression was non-nil before using it in another expression or print.

    Using errset() is fine when you have no control over the code being executed - but using it to trap errors is a slightly lazy approach and doesn't allow much precision in pinpointing where the error occurred (not strictly true, but true if you just stick errset around a massive piece of code). Far better to code defensively, checking for unexpected results at each point, and handling the problem as soon as it occurs.

    Best Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • eppramod
    eppramod over 15 years ago
    Hi Lawrence,Andrew, Thanks for the response,this should certainly help. Pramod
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Dave Kovac
    Dave Kovac over 13 years ago
    How would you deal with the case where convergence fails in the middle of a transient run? For example, I have a 2uSec long transient run, and it fails to converge at 1.2uSec. Using the when(member('tran results()) method as a test doesn't work because the results do exist, just not complete results. Is there a way to test that the simulation ran to completion?
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    One possibility is to check that the last X point is where you think it is. You could use the abLastX function from below on a waveform:

    /* abFirstLast.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Mar 02, 2009 
    Modified   
    By         
    
    Functions for finding the first and last X and Y points
    in a waveform. To register abFirstX, abFirstY, abLastX, abLastY
    with the calculator (so they show up in the user defined special
    functions), call
    
    abRegFirstLastCalcFunctions()
    
    ***************************************************
    
    SCCS Info: @(#) abFirstLast.il 03/02/09.06:53:01 1.1
    
    */
    
    /***************************************************************
    *                                                              *
    *                       (abFirstY wave)                        *
    *                                                              *
    *          Return the first Y value from the waveform          *
    *                                                              *
    ***************************************************************/
    (defun abFirstY (wave)
      (cond
        ((drIsWaveform wave)
         (drGetElem (drGetWaveformYVec wave) 0)
         )
        ((famIsFamily wave)
         (famMap 'abFirstY wave))
        (t
          (artError "abFirstY: can't handle %L\n" wave)
          )
        )
      ) ; defun abFirstY
    
    /***************************************************************
    *                                                              *
    *                       (abFirstX wave)                        *
    *                                                              *
    *          Return the first X value from the waveform          *
    *                                                              *
    ***************************************************************/
    (defun abFirstX (wave)
      (cond
        ((drIsWaveform wave)
         (drGetElem (drGetWaveformXVec wave) 0)
         )
        ((famIsFamily wave)
         (famMap 'abFirstX wave))
        (t
          (artError "abFirstX: can't handle %L\n" wave)
          )
        )
      ) ; defun abFirstX
    
    /***************************************************************
    *                                                              *
    *                        (abLastY wave)                        *
    *                                                              *
    *          Return the last Y value from the waveform           *
    *                                                              *
    ***************************************************************/
    (defun abLastY (wave)
      (cond
        ((drIsWaveform wave)
         (let (len vec)
           (setq vec (drGetWaveformYVec wave))
           (setq len (drVectorLength vec))
           (drGetElem vec (sub1 len))
           )
         )
        ((famIsFamily wave)
         (famMap 'abLastY wave))
        (t
          (artError "abLastY: can't handle %L\n" wave)
          )
        )
      ) ; defun abLastY
    
    /***************************************************************
    *                                                              *
    *                        (abLastX wave)                        *
    *                                                              *
    *          Return the last X value from the waveform           *
    *                                                              *
    ***************************************************************/
    (defun abLastX (wave)
      (cond
        ((drIsWaveform wave)
         (let (len vec)
           (setq vec (drGetWaveformXVec wave))
           (setq len (drVectorLength vec))
           (drGetElem vec (sub1 len))
           )
         )
        ((famIsFamily wave)
         (famMap 'abLastY wave))
        (t
          (artError "abLastX: can't handle %L\n" wave)
          )
        )
      ) ; defun abLastX
    
    /***************************************************************
    *                                                              *
    *                 (abFirstLastGenCB funcName)                  *
    *                                                              *
    *   Macro (and invocations) to build the calculator callback   *
    *                          functions.                          *
    *                                                              *
    ***************************************************************/
    (defmacro abFirstLastGenCB (funcName)
      `(defun ,(concat funcName 'CB) ()
         (calSpecialFunctionInput (quote ,funcName) nil)
         ))
    (abFirstLastGenCB abFirstX)
    (abFirstLastGenCB abFirstY)
    (abFirstLastGenCB abLastX)
    (abFirstLastGenCB abLastY)
    
    /***************************************************************
    *                                                              *
    *                (abRegFirstLastCalcFunctions)                 *
    *                                                              *
    * Register all four first/last functions as special functions  *
    *                     for the calculator.                      *
    *                                                              *
    ***************************************************************/
    (defun abRegFirstLastCalcFunctions ()
      (foreach func '(abFirstX abFirstY abLastX abLastY)
               (calRegisterSpecialFunction
                 (list (get_string func) (concat func 'CB)))
               )
      ) ; defun abRegFirstLastCalcFunctions

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Dave Kovac
    Dave Kovac over 13 years ago

     Thanks, I think I came up with something similar

     last_step=ymax(xval(VT("/out")))

    if(last_step>2u converged=1 converged=0)

     

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

    If there are a lot of points, then abLastX will be more efficient than the ymax approach, but other than that you probably won't notice the difference.

    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