how to get the path of the skill script itself

M

Marcel Preda

Guest
Hi,

Is it possible to get the path of the current running skill script ?
(it's not a context file)

What I mean:
Let's suppose that i do:
load("/path/to/my_script.il")
I'm interested to get that "/pth/to" because on that path I have some
other skill and NON_skill files that I use .

I know that the best idea is to set an environment variable set before
running the script and read it,
but I want to distribute the code to some other people and very often
they forget to set the proper path before running icfb/virtuoso .

In some other languages (e.g. Perl) we have some constants like
__FILE__ which tells the "current file".

Thanks,
Marcel
 
Hi Marcel,

There is a Cadence internal variable for this, it is called 'piport'.
piport is the standard input port from which user input is read. This
information is available from the SKILL Language User Guide.
The 'piport' tells the name of the current file when it's being
loaded.
So if you try the following at the top of your file:
fileBeingLoaded=simplifyFilename(get_filename(piport))
and then use the fileBeingLoaded variable to calculate the dir and
thus load other files.

Does this help ?
Cheers,
Riad.
 
On Aug 31, 5:17 pm, Riad KACED <riad.ka...@gmail.com> wrote:
Hi Marcel,

There is a Cadence internal variable for this, it is called 'piport'.
piport is the standard input port from which user input is read. This
information is available from the SKILL Language User Guide.
The 'piport' tells the name of the current file when it's being
loaded.
So if you try the following at the top of your file:
fileBeingLoaded=simplifyFilename(get_filename(piport))
and then use the fileBeingLoaded variable to calculate the dir and
thus load other files.

Does this help ?
Cheers,
Riad.
Hi Riad,

This is EXACTLY what I want :)

Thanks a lot.

BR,
Marcel
 

Welcome to EDABoard.com

Sponsor

Back
Top