• 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 that calls other ocean scripts. Is that possible...

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 14325
  • 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 that calls other ocean scripts. Is that possible?

C4n0s4
C4n0s4 over 14 years ago
Hi! Everyone! Im doing a verification for LNA and i made 3 scripts for 3 different kinds of simulation. What i would like to do is: Use an ocean script to call the other 3 scripts but the design path need to be a global variable acessible to all scripts. Just to make shure the script is running on the same design. Is that possible? Similiar solutions are welcome.... Best Regards Canosa
  • Cancel
  • skillUser
    skillUser over 14 years ago

    Hi Canosa,

    The OCEAN function design() will return the current design if it has been set, and nil otherwise, so you might use this to rely on the design being set globally before any of the scripts run.  For example, in each of the files, if you had an explicit "design" statement opening a specific design, replace it with something that checks for a global design first.  Also, do not include a "simulator('spectre)", for example, in each script as this would start a new session - you want these to run under the same session (if I understand correctly).  Example, have this near the top of each script:

    unless(design()
    design("...") ;; original entry
    )

    The idea is that if a design is not yet set, design will return nil and the script can set up the design as before. I think that you might be able to do something similar with the simulator command, i.e., if a simulator session is already running use that, otherwise set up a new one - simulator will return the current simulator setting.

    So to use the three scripts all together, you would manually start a simulator and design session and then load each of the scripts.

    I hope that this works as I think it would and that it helps you!

    Regards,

    Lawrence.

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

    Lawrence,

    Whilst your suggestion is quite appealing, it has a number of drawbacks. One is that it requires the simulator to be the same in all script (because calling simulator('somethingElse) will reset the session and hence lose the design), but the main one is that it would require each script to use the delete() function to delete everything before running. For example, imagine I had one script which did analysis('ac ...), and another which did analysis('tran ...). If I ran the first script, and then the second script, using Lawrence's suggestion for avoidance of calling simulator() or design() if already called, it would run an ac analysis in the first script, and then a tran and an ac in the second. The analysis calls (like many other things are cumulative). Since you've no idea what ran before, you'd have to assume you needed to delete everything (and not quite everything can be deleted). So it's really safer to call simulator() each time to start a fresh session.

    You could then declare a global variable:

    MYdesign="/path/to/netlist"

    and then in each script:

    simulator('spectre)
    design(MYdesign)

    If you wanted to allow it to specify the design as a lib/cell/view triplet, you could do:

    MYdesign='("/path/to/netlist")

    or

    MYdesign='("myLib" "myCell" "myView")

    and then do in each script:

    simulator('spectre)
    apply('design MYdesign)

    And of course if you want to avoid the global variable, you could use SKILL++ to create a closure (but I won't complicate things with that suggestion this late on a Friday night (well, it is for me)!).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 14 years ago

    Good point Andrew, I forgot that the analyses etc. would be cumulative, so your proposal is better.  Good evening and have a beer since it's Friday night (or perhaps you have already had some for inspiration? ;-) )

    Regards,

    Lawrence.

    • 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