• 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 get the file path of current running skill scrip...

Stats

  • Locked Locked
  • Replies 9
  • Subscribers 144
  • Views 22714
  • 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 get the file path of current running skill script

fatcat1206
fatcat1206 over 8 years ago

Hi All

Does anyone know how to get the the file path of current skill script.

My situation is that:

I'd like to use an icon for the label when creating the form.

As the code will be transferred to another location after the development.

Thus I'd like to use an relative path rather than an absolute path for the icon file.

This relative path should start with the file locations where this form has been made.

Thus I need to get the file path of current running skill script.

I have checked some skill reference, unfortunately I did not find the API I need.

Many thanks in advance.

Best Regards

Yi

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    Hi Yi,

    If it's at the script level (i.e. not inside a function) you can do get_filename(piport) to get the filename. It is then evaluated at file load time, and so piport is defined to be the file being read.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • fatcat1206
    fatcat1206 over 8 years ago

    Hi Andrew

    Thank you for your quick feedback.

    If I understand you correctly, I need to create a global variable to contain the file path, when the file is loaded.

    And then I pass its value to the form when it has been created afterwards.

    As the "piport" would point to CIW after file loading and Virtuoso has been started.

    And this why you mention "at the script level" in the begin.

    Is there any method to get the file name inside a function?

    Or simply after loading the file, all the functions are store in the memory, and there is no link to the original file.

    Best Regards

    Yi

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    Hi Yi,

    There is a way of doing it, but it's not yet documented. I recently filed a CCR requesting this, and it's been planned, but until it's documented I should not really describe it in a public forum.

    There is a record of which file functions are defined within, but only when the file was loaded when in debug mode (e.g. with the debugger enabled, or with sstatus(debugMode t) ). So that's not really a viable option either.

    The workaround is to define a global variable, as you say.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • fatcat1206
    fatcat1206 over 8 years ago
    Hi Andrew

    Thank you for your reply.
    It's not an urgent needs, I will wait for the documents.

    Best Regards

    Yi
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    Hi Yi,

    I did create a case and a duplicate CCR for you (you should have received an email from our support system with my reply on the details - please check in case it went into a spam filter - we've had a few occurrences of that recently because of the numbers in the subject line, I think).

    Kind Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • fatcat1206
    fatcat1206 over 8 years ago
    Hi Andrew

    Thank you.
    I do find it in my spam mails.

    Best Regards

    Yi
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • alexstepanov75
    alexstepanov75 over 7 years ago
    HI Andrew,
    So is this already implemented?
    BR,
    Alex.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago

    Alex,

    The feature has been there for many, many years, but it's now documented since IC617 ISR7. It's in Chapter 9 "Advanced Topics" of the SKILL Language User Guide in a section headed "Read-time evaluation".

    The way you'd use this is as follows:

    procedure(printFileThisWasFrom()
      printf( "The file is:%s\n" #.get_filename(piport) )
    )

    The idea is that #.funcCall(args) is evaluated at the time the file is read - and so you end up with a literal in your code wherever that is placed. If you pp(printFIleThisWasFrom) after loading, you'll see the literal filename string. This is something that you get in other LISP variants too.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • alexstepanov75
    alexstepanov75 over 7 years ago
    Thank you.
    • 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