• 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 8236
  • 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
Parents
  • Andrew Beckett
    Andrew Beckett over 1 year ago

    In the file viacreator.il you'd need to define a function - typically done using procedure() (there are other ways, but this is probably the most natural).

    procedure(viacreator(cv bBox)
      dbCreateRect(cv list("Via1" "drawing") bBox)
    )

    There's no requirement for the function name to match the file name, you can have multiple function definitions in each file, and it's a good idea to give them a unique prefix to avoid clashing with anybody else's functions - viacreator is not terribly unique, for example. So something like "CCFviacreator" (CCF being Cadence Community Forum; we recommend an uppercase prefix to avoid clashing with anything from Cadence).

    Then you'd call it:

    viacreator(pcCellView list(23.355:-14.46 24.945:14.4))

    (you had a space after the function name in your call which isn't legal - also the list() structure wouldn't work because you have matching duplicate parentheses which will confuse matters).

    For more detail, I suggest you read the SKILL Language User Guide or take one of the free online SKILL training classes at http://support.cadence.com (in the Learning section in the middle at the top).

    Andrew

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

    Hi Andew, I've solved by starting the file with the string: load("path/to/file.il")

    My question now is: do you have any suggestion to load all the files of a folder instead of doing this operation one by one? Thanks. 

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

    You could do this:

    foreach(file sort(pcreMatchList("\\.il.*$" getDirFiles("/some/directory")) 'alphalessp)
      loadi(file)
    )

    The pattern matching is just to look for anything that has a suffix of .il something (so copes with .ile, ils, ilse suffices too), and the sort is to ensure they are loaded in a well-defined order (if it matters).

    Regards,

    Andrew

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

    Hi Andrew,

    I believe your pattern matching lacks a dot '.'

    foreach(file sort(pcreMatchList("\\.il.?$" getDirFiles("/some/directory")) 'alphalessp)
      loadi(file)
    )

    This should work with all the file extensions you mentioned

    Cheers

    Aurélien

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

    Hi Andrew,

    I believe your pattern matching lacks a dot '.'

    foreach(file sort(pcreMatchList("\\.il.?$" getDirFiles("/some/directory")) 'alphalessp)
      loadi(file)
    )

    This should work with all the file extensions you mentioned

    Cheers

    Aurélien

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

    Hi Aurélien,

    Good catch (the perils of not testing what you just typed). Yours won't catch the ".ilse" suffix, so I edited my original reply to have the dot before the star (so I've hidden the evidence of it ever being wrong!)

    Andrew

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

    Thank you so much, Andrew. Your suggestions have been very helpful, especially for someone like me who is just starting out. I appreciate your compassion.

    • 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