name of skill source file

Discussion in 'Cadence' started by camelot, Jul 16, 2008.

  1. camelot

    camelot Guest

    Hi,
    it is possible to get the name of the last loaded skill file?

    Thank you,

    Camelot
     
    camelot, Jul 16, 2008
    #1
  2. camelot

    Riad KACED Guest

    Hi,

    I don't know how to get the last loaded skill file but I know how to
    get a list of loaded files into your current Cadence session. The
    skill function getAllLoadedFiles(). For this function to run, you need
    to enable the debug mode prior in your cadence session by adding the
    following skill line to your .cdsinit file for example:
    installDebugger

    I'm just wondering why your looking for the last loaded skill file. My
    guess is might be you've got a function defined in different files and
    you want to know where it is taken from really. If I'm right, you can
    find this information by using the skill function whereIs(myFunction).
    This requires the debugMode too.

    This is a bit of skill that combines the use of getAllLoadedFiles()
    and getFunctions to print out all the loaded files since the debug
    mode has been turned on and for each file prints the functions defined
    within it

    ;; Skill start here
    procedure( rkGetLoadedFilesAndFuncs(outFile)
    let((loadedFiles outPort functions)
    outPort=outfile(outFile)
    loadedFiles=getAllLoadedFiles( )
    foreach(file loadedFiles
    functions=getFunctions(file)
    when(car(functions)
    fprintf(outPort "\nFilename %s has the following Functions:\n"
    file )
    foreach(function functions
    fprintf(outPort " -> %L \n" function )
    )
    )
    )
    close(outPort)
    t
    )
    )
    ;; Skill end here

    You can try in your CIW :
    rkGetLoadedFilesAndFuncs("/tmp/LoadedFilesAndFuncs.txt")
    You may try also:
    whereIs(rkGetLoadedFilesAndFuncs)

    Hope these bits help you !

    Riad.
     
    Riad KACED, Jul 17, 2008
    #2
  3. camelot

    camelot Guest

    I'm just wondering why your looking for the last loaded skill file.

    Hi Riad,
    well, my purpose is very weird. I’m using the shell command dbAccess
    to execute a skill script. In particular I launch the command in this
    way:

    dbAccess – load “mySkillFile.il”

    Now, inside the skill file, I inserted same templates (as formatted
    comments) that the program itself should generate if it is not able to
    find them in the user account. In order to generate these templates, I
    should be able to do a parsing of the skill file but the problem is to
    know what is the name of the file I’m loading because the final user
    could change the name of skill file o, worse, could encrypt it. Does
    the debug mode requires extra licenses?

    Regards,

    Camelot
     
    camelot, Jul 18, 2008
    #3
  4. camelot wrote, on 07/18/08 08:39:
    Camelot,

    get_filename(piport)

    will tell you the name of the file you're currently in (when it's being loaded).

    Regards,

    Andrew.
     
    Andrew Beckett, Jul 18, 2008
    #4
  5. camelot

    camelot Guest

    Thank you!
     
    camelot, Jul 23, 2008
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.