• 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 SKILL
  3. OCEAN script only works on re-evaluation

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 144
  • Views 6071
  • 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 only works on re-evaluation

imulsion
imulsion over 2 years ago

Hi all,

I have an OCEAN script added to my simulation outputs, which I need to do the following (per corner):

- Detect when a particular signal crosses a threshold

- Take that crossing point and add it to the current corner as one of the corner parameters

Here is what I have:

axlAddOutputs(list("Success/Fail"))
sess = axlGetWindowSession()
sdb = axlGetMainSetupDB(sess)
crnr_name = axlGetCornerNameForCurrentPointInRun()
crnr_handle = axlGetCorner(sdb, crnr_name)

openResults()
trim_val_s = aelEngNotation(round(cross(VS("/vref_out") 1.204 1 "either" nil nil nil)))
putvar = axlPutVar(crnr_handle "trim_val" trim_val_s)
if(putvar == nil then s_f = 0 else s_f = 1)
axlOutputResult(s_f "Success/Fail")

As you can see, it simply updates the current corner by accessing the appropriate corner handle. 

This solution isn't perfect. When I run my simulations, the script always results in eval err when executing axlGetMainSetupDB, because axlGetWindowSession returns nil. However, if I re-evaluate the outputs (all/full as opposed to incremental/partial), the script runs fine and the corners are updated. 

Is there any explanation for why axlGetWindowSession might return nil? Am I going about this the wrong way? Is there a better solution?

I'm on sub-version IC6.1.8-64b.500.31

Many thanks

  • Cancel
  • ShawnLogan
    ShawnLogan over 2 years ago

    Dear imulsion,

    imulsion said:
    When I run my simulations, the script always results in eval err when executing axlGetMainSetupDB, because axlGetWindowSession returns nil.

    Does the use of the following verbose form of the command provide a response of "nil" on the first attempt to run your script?

    axlGetWindowSession( hiGetCurrentWindow())

    Shawn

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

    That's not a valid thing to do in an OCEAN script output. For a start, the script is run at each sweep point/Monte Carlo point/corner (or combinations of the above), and it's not going to work when simulations are running because the scripts (as are other output expressions) are run in a background process (either a background virtuoso if using ICRP or a background expression evaluator if using LSCS) and there's no "window" for axGetWindowSession to retrieve. That's also no axl/mae session in those background sessions because it would be locked by the parent virtuoso - so even if you could find a way of getting a session it wouldn't be able to write to it. This will therefore only work when running a single simulation (because single point optimisation in the job policy runs everything in the virtuoso session itself, at least for ICRP), or when doing re-evaluation (and even then, not when using the new distributed re-evaluation that's available in Virtuoso Studio IC23.1).

    Andrew 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • imulsion
    imulsion over 2 years ago in reply to Andrew Beckett

    Hi Andrew,

    Thanks for your reply. The reason I opted for this approach is so I could use axlGetCornerNameForCurrentPointInRun() (otherwise I couldn't think of a way to apply each trim code to each corner). Is there an alternative approach that is less "hacky", or is this kind of thing not really possible?

    Cheers

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to imulsion

    I get why you've done it this way - it's probably simpler than the alternative which is to use the maeReadResDB() function to get a handle and then iterate over the results (I'd have a scalar result value to make it easier to find rather than needing to read waveform data) and then update the corners that way - and run this manually after simulation whenever you want to update the corner settings. What you've done is a bit more self-contained, but it just can't work at run time without needing a re-eval.

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • imulsion
    imulsion over 2 years ago in reply to Andrew Beckett

    Hi Andrew,

    That makes a lot of sense. I'll stick with my current method, even though it doesn't quite work it's probably the easiest way of doing it (at the very least it executes automatically!) 

    Thanks very much for your time

    Cheers

    • 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