• 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

    Thanks a lot for the reply. I would be grateful if you can provide me some info about the file location? How should I handle it?

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

    The file location can be wherever you want, but you probably want to add a libInit.il file within the library directory that contains your PCell - this file is a SKILL file and should include a load("/path/to/your/code.il") to load it. That will then automatically load any functions used within your PCell at the time the library is first accessed. If you don't do that, nothing will auto-load your SKILL code.

    Regards,

    Andrew

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

    The file location can be wherever you want, but you probably want to add a libInit.il file within the library directory that contains your PCell - this file is a SKILL file and should include a load("/path/to/your/code.il") to load it. That will then automatically load any functions used within your PCell at the time the library is first accessed. If you don't do that, nothing will auto-load your SKILL code.

    Regards,

    Andrew

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

    I did not perfectly understood your suggestions. 

    In my case I'm running Skill from the  folder A="/home/user/cadence/ST/XXX"

    Inside this folder I have a subfolder SKILL and a sub-subfolder where I'd like to collect my functions. This will be B="/home/user/cadence/ST/XXX/Skill/MY_functions/"

    What you say is that I should create a file named libInit.il  in my folder A. This file should have as many lines as my functions are. Each line should look like this: 

    load("/home/user/cadence/ST/XXX/Skill/MY_functions//MY_viacreator.il")

    I tested this and it does not work. I still get the underfined function error. 

    As an alternative I was trying to change the SKILL path but this does not work either. 


    if( not(car(getSkillPath)="/home/user/cadence/ST/XXX/Skill/MY_functions/")
    setSkillPath(cons("/home/user/cadence/ST/XXX/Skill/MY_functions/" getSkillPath()))
    ); endif

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to ArbLouis
    ArbLouis said:
    I did not perfectly understood your suggestions. 

    I think this post got held up in moderation and based on your later dated reply you've solved it since? 

    BTW, the code:

    if( not(car(getSkillPath)="/home/user/cadence/ST/XXX/Skill/MY_functions/")
    setSkillPath(cons("/home/user/cadence/ST/XXX/Skill/MY_functions/" getSkillPath()))
    ); endif

    is not correct. getSkillPath() is a function, and your code will treat it as a variable (plus it would only work if it wasn't the first entry in the list. It would be better to do:

    unless(member("/home/user/cadence/ST/XXX/Skill/MY_functions" getSkillPath())
      setSkillPath(cons("/home/user/cadence/ST/XXX/Skill/MY_functions" getSkillPath()))
    )

    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