• 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. Using nested scripts

Stats

  • Locked Locked
  • Replies 14
  • Subscribers 143
  • Views 8230
  • 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

Using nested scripts

ArbLouis
ArbLouis over 1 year ago

Hi. I'm trying to create a set of vias using a SKILL file. 

Issue 1: Instead of replicating the same piece of code several times, I'd like to use, within the main script, a call to a function (which hopefully I can store as an external file on a custom location and reuse in other projects).

Issue 2: Furthermore, I'd like to pass to this function some parameters, e.g. a position.

This is an example of main script in which I've highlighted where I'd like to call the external function creating a stack of vias (this part of code is not written, I've just used here the script file name viacreator.il). 

I hope someone could help.

pcDefinePCell(list(ddGetObj("TestExternalFunction") "testPCELL_SKILL" "layout") nil
let((pcMember pcStretchGroup stretchOffsetX stretchOffsetY pcLib
pcMaster pcInst pcTerm pcPin pcPinName
pcNet pcTermNet pcNetName pcTermNetName pcMosaicInst
pcParameters pcParamProp pcStep pcStepX pcStepY
pcRepeat pcRepeatX pcRepeatY pcIndexX pcIndexY
pcLayer pcPurpose pcLabelText pcLabelHeight pcPropText
pcParamText pcCoords pcPathWidth pcPolygonMargin
)
(pcLib = (pcCellView~>lib))
(pcParameters = ((pcCellView~>parameters)~>value))
(pcLayer = 187)
(pcPurpose = "drawing")
(pcInst = dbCreateRect(pcCellView
list(pcLayer pcPurpose)
list((0.0:-14.5)
(25.0:-7.5)
)
))

(pcLayer = 19)
(pcPurpose = "drawing")
(pcInst = dbCreateRect(pcCellView
list(pcLayer pcPurpose)
list((23.355:-14.46)
(24.945:14.4)
)
))

; Call to an external function located, for instance, in the folder /EDA/SKILL

viacreator ( list((23.355:-14.46) )

)
)

Thanks for your help!

  • Cancel
  • ArbLouis
    ArbLouis over 1 year ago in reply to Andrew Beckett

    I've been able to create a SKILL code using an external function (called MY_viacreator) which generates a PCELL layout that can be instantiated and works well. Very cool!

    When I create a cell using a PCELL instance it works fine but, as I close and open Virtuoso, the PCELL shows the text "". 

    I can notice that the log reports this error: pcell Eval Failed. 

    *WARNING* (DB-270001): Pcell evaluation for MY_CELLS/myPCELL_TEST/layout has the following error(s):
    *WARNING* (DB-270002): ("eval" 0 t nil ("*Error* eval: undefined function" MY_viacreator))
    *WARNING* (DB-270003): Error kept in "errorDesc" property of the label "pcellEvalFailed" on layer/purpose "marker/error" in the submaster.

    This error appears only when I use an external function and after I restart Virtuoso. No errors appear when I do not use an external function. I hope you could help me. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to ArbLouis

    Presumably the file containing the function definition is not being loaded. Did you definitely load the file from within the libInit.il file in the library containing the PCell? (I’m sure something must have been done incorrectly because this mechanism works well and is widely used)

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ArbLouis
    ArbLouis over 1 year ago in reply to Andrew Beckett

    Thanks Andrew. I fixed it. . 

    MY_cell (folder)

        - MY_functions (folder)

       - libInit.il 

    The libInit.il file contains a single line: 

    load("./MY_cell/MY_functions/MY_viacreator.il")

    In the main Skill code (which is located in a folder different from the MY_cell one) I load the libInit.il. Now it works. thanks a lot!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to ArbLouis

    The libInit.il can't just be anywhere you want. It has to be in the library directory as that's the only place it will be auto-loaded from.

    Also, the paths in any load() call either need to be full paths, or if relative they are relative to the SKILL path and not relative to the file from which they are loaded). You can use this approach in the library libInit.il :

    let((pathToMe dirPat dirPath)
      pathToMe=get_filename(piport)
      dirPat=pcreCompile("/[^/]*$")
      dirPath=pcreReplace(dirPat pathToMe "" 1)
      load(lsprintf("%s/fileToLoad.il" dirPath))
    )

    Ah, I now see you edited the post to say you fixed it (I really must get used to reading the posts rather than just the email notification...). Anyway, maybe the above will be useful.

    Andrew

    • Cancel
    • Vote Up +1 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