Home > Community > Forums > Custom IC SKILL > How to determine your calling environment

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 How to determine your calling environment 

Last post Thu, Jun 12 2008 7:25 AM by archive. 6 replies.
Started by archive 12 Jun 2008 07:25 AM. Topic has 6 replies and 4401 views
Page 1 of 1 (7 items)
Sort Posts:
  • Thu, Jun 12 2008 7:25 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    How to determine your calling environment Reply

    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.


    Originally posted in cdnusers.org by dmay
    • Post Points: 0
  • Thu, Jun 12 2008 7:42 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: How to determine your calling environment Reply

    You could use the output of getVersion() to determine this.

    Andrew.


    Originally posted in cdnusers.org by adbeckett
    • Post Points: 0
  • Thu, Jun 12 2008 7:44 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: How to determine your calling environment Reply

    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.


    Originally posted in cdnusers.org by adbeckett
    • Post Points: 0
  • Thu, Jun 12 2008 8:01 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: How to determine your calling environment Reply

    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


    Originally posted in cdnusers.org by dmay
    • Post Points: 0
  • Thu, Jun 12 2008 8:06 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: How to determine your calling environment Reply

    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.


    Originally posted in cdnusers.org by adbeckett
    • Post Points: 0
  • Fri, Jun 13 2008 12:39 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: How to determine your calling environment Reply

    getVersion() is definitely the best way, but would parsing the environment variable CDS_MPS_SESSION also work?


    Originally posted in cdnusers.org by ahamlett
    • Post Points: 0
  • Mon, Jun 16 2008 10:27 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: How to determine your calling environment Reply

    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.


    Originally posted in cdnusers.org by adbeckett
    • Post Points: 0
Page 1 of 1 (7 items)
Sort Posts:
Started by archive at 12 Jun 2008 07:25 AM. Topic has 6 replies.