I am new to Cadence SKILL. I am trying to understand a SKILL script file containing many procedures. Many of these procedures use a variable which holds a constant list. But it doesn't seem to be assigned anywhere in the script file. Can you suggest any possible place from where it could be assigned? Is there any way in SKILL to import variables from another file?
By default all the SKILL vars are global.
To identify where there were defined, may not be an easy task:
You have to look for calls like load(...) and/or loadi(...) in your code , or in CDS.log file.
Vars can also be defined in context ("compiled") files, using loagContext() functions - here it is even more dificult to track.
After identifimg all those files use "grep" command to find the lines where the var was defined.
Thanks for your reply. I checked the log file. It says loading many .il and .cxt files. But some of the files only have their names specified, not the complete path. Any info to locate them would be very helpful.
If you use this code:
procedure(CCFwhereVarSet(varName newValue) printf("Variable %s set to %L in %L\n" varName newValue get_filename(piport)) ; stacktrace() newValue)
and then do:
(replace 'theVarYouWantTo Check with whatever name you're looking for), it will tell you the file where it is set (if a SKILL file; not if set in a context file unfortunately). You could also uncomment the stacktrace() to tell you which function it was in when the variable was set.
Thanks, Andrew. I figured out that the variable is loaded through a load() function in one of the procedures. Should your method still work?
Yes. The setguard sets a "guard" function which gets called whenever the named variable is set, and that guard function uses get_filename(piport) to see what file is being read at the time the variable is set. So if it is set within a file that is being loaded, it should tell you. If the global variable was instead directly set inside the procedure, it wouldn't tell you - but the stacktrace() would hopefully reveal which function is was being set in.