• 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. How To find currently opened library path in ADE L

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 16181
  • 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

How To find currently opened library path in ADE L

skueppers
skueppers over 6 years ago

Hi all,

In our workflow, we have supplementary files that are stored alongside but not within the OA library database, belonging to cells of a library. An example of such a file would be an electromagnetic simulation or a resulting s-parameter file of a layout view of a cell. We are storing this data in a separate directory directly below the library path. However, when we are running ADE/spectre, we would like to add this supplementary directory to the include paths automatically so that for example, the nport component can load the s-parameter file using a relative path.

It would be possible to enter the full absolute path under ADE L -> Setup -> Simulation Files, however when switching systems, the absolute path breaks and needs to be adjusted by hand in every testbench. Currently, as a workaround we define an environment variable before running virtuoso, however this seems clumsy and error prone.

I wonder if there is a better way to achieve this, so that I can, for example, add the following path as an include path in ADE

$CURRENT_LIBRARY_DIR/_extra

where $CURRENT_LIBRARY_DIR is automatically populated with the library of the opened cell view.

Best regards

Simon

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago

    Hi Simon,

    I'm not sure how robust this would be, but you could use:

    procedure(CCFinitLibDir(sess)
      let((libName libPath)
        libName=asiGetDesignLibName(sess)
        when(libName
          libPath=ddGetObjReadPath(ddGetObj(libName))
        )
        when(libPath
          setShellEnvVar("CURRENT_LIBRARY_DIR" libPath)
        )
      )
    )

    envSetVal("asimenv.startup" "sessInitTrigFunc" 'string "CCFinitLibDir")

    This automatically sets the $CURRENT_LIBRARY_DIR env var to the path to the library containing the design whenever ADE is opened.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skueppers
    skueppers over 6 years ago in reply to Andrew Beckett

    Hi Andrew,

    Thanks for your reply. I will try this on next occasion.

    I am certainly no expert with the scripting functionality in virtuoso, but isn't it possible to add some kind of script to the Library itself, that gets executed once the Library gets "opened" or loaded into memory? Then the Library registers it's path in an environment variable such as LIB_<LIBNAME>_DIR.

    Best Regards and much appreciated

    Simon

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to skueppers

    Hi Simon,

    You could put this in your .cdsinit - that would have this effect:

    procedure(CCFsetLibDirVar(libId)
        let((libPath)
            libPath=ddGetObjReadPath(libId)
            setShellEnvVar(strcat("LIB_" libId~>name "_DIR") libPath)
            t
        )
    )
    
    ddRegTrigger("FirstAccessLib" 'CCFsetLibDirVar 1)

    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