Does anyone know how to determine the environment a procedure was called from? There are many ways to call Skill code:icfb, pipo, si, dbAccess, cdsCopyShell, etc.Is there a way to know whether the Skill is running in icfb, pipo or cdsCopyShell? We have a very elaborate set of pcells and our technology library has a libInit file that takes several seconds to load. This is not a big deal in the Cadence environment since it happpens only once at the start of the session. However, if I call the ccpRename command to rename a lot of cells, I noticed that it spawns a sub-process for each rename and each sub-process calls the libInit.il. To do 100 renames will add 5 seconds of overhead per call. However, in this situation, the libInit.il code isn't even needed. Ideally, I would like the libInit.il code to selectively evaluate certain parts of the code depending on the calling environment. In the case of ccp sub-processes, I would do nothing. In the case of si, I would do a few schematic/netlist related things. In the case of pipo I would do all of the layout pcell things. In icfb, all of the libInit.il would be evaluated.
You could use the output of getVersion() to determine this.Andrew.
Or use isCallable('funcName) to determine whether a particular function is available. If you pick layout editor or schematic editor functions, these won't exist in pipo, cdsCopyShell, dbAccess etc.That could be a better approach, and depends less on parsing a version string.Andrew.
Thanks Andrew. I think the getVersion() will work best. It would be harder to differentiate between cdsCopyShell, pipo and dbAccess using the isCallable command unless I could find a function that was available in one but not the other. A parseString on getVersion would be the easiest.-Derek
I assumed you didn't really need to differentiate with that level of granularity - which was why I suggested the isCallable approach.Either way, take your pick...Andrew.
getVersion() is definitely the best way, but would parsing the environment variable CDS_MPS_SESSION also work?
CDS_MPS_SESSION will not be defined all the tine (dbAccess wouldn't have it, since it has no MPS support, for example), and also could be inherited from the parent application. So I don't think this is a good idea. Plus it's not documented...Andrew.