• 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. Fetch Skill Script run directory inside a procedure

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 144
  • Views 6840
  • 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

Fetch Skill Script run directory inside a procedure

Shankar PA
Shankar PA over 2 years ago

Hi

I have a skill procedure/function defined inside a skill script(".il" file) that calls an external script(python).

This external script is placed relative to the folder in which the original skill script is located.

Currently I am hardcoding the absolute path of my external script. However I would like to reference the external script relatively.

I understand that outside a skill procedure

get_filename(piport)

would expand to the script name from which I can fetch the absolute path.

I would like to achieve the same thing inside a skill function/procedure. Is there any easy way to achieve this?

I did see an old thread on this type of requirement but couldn't get any directions.

Thanks

Shankar

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago

    Shankar, this post in that thread is the pertinent post.

    You could have:

    procedure(MyFunc()
      let((pathToMe dirPat dirPart)
        pathToMe=#.get_filename(piport)
        dirPat=pcreCompile("/[^/]*$")
        dirPart=pcreReplace(dirPat pathToMe "" 1)
        ;printf("dirPart=%L\n" dirPart)
        system(strcat(dirPart "/myScript.py"))
      )
    )
    

    The key is that the #.get_filename(piport) will get expanded and file loading time and if you pp(MyFunc) you'll see it contains the actual path embedded in the code.

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Shankar PA
    Shankar PA over 2 years ago in reply to Andrew Beckett

    Hi Andrew

    Thanks for the explanation, This works for me.

    However, when I try to encrypt the skill file and load the encrypted version. 

    #.get_filename(piport) gets expanded to "*ciwInPort*"

    Any workaround possible? My other alternative is to split the my main code into two files where I would keep the "path fetch" alone in an unencrypted procedure and keep the rest encrypted.

    Thanks

    Shankar

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to Shankar PA

    Shankar,

    That seems to be a limitation - it's expanded on the first read (when the file is read to encrypt it). I can't think of a way around it other than the approach you've suggested.

    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