Cadence is frozen after execution of skill script

Discussion in 'Cadence' started by bu-bu, Jun 10, 2009.

  1. bu-bu

    bu-bu Guest

    Hello ,

    i have a problem with the following code.

    This script traverses the schematic hierarchy. It creates a file that
    contains schematic name for every instance (like |i1|I12)

    For that, i have modified a script i have found on sourceLink.

    This code works fine. The file is created correctly, but after
    execution of the script on a "big" schematic (more than 1000
    instances), my Cadence session is frozen during 5 minutes.

    On a smaller schematic (100 instances) , the Cadence session is frozen
    during few seconds only.

    I would like to know how to improve this code to make it faster on big
    schematics. Because waiting 5 minutes is very long!

    And this function is a part of a script : I guess users could be
    surprised if they run the whole script!

    I use Cadence IC5.1.41 usr6 isr10.

    Could you help me please?

    Thanks and regards,

    bubu

    ---------------------------


    procedure(MyScript()
    let((ResultFile cv cw)
    cv = geGetWindowRep()
    cw = hiGetCurrentWindow()

    ResultFile= outfile("./Myfile.txt")
    MyScriptSub(cv cw ResultFile)
    close(ResultFile)
    )) ;; let proc


    procedure(MyScriptSub(cv cw ResultFile)
    let(( viewList stopList ExcludeList switchedView Inst List)

    viewList = "schematic cmos.sch symbol"
    stopList = list("symbol")
    List = list()
    ExcludeList = list("basic" "analogLib")


    foreach(Inst cv~>instances if(member(Inst~>libName ExcludeList) ==
    nil then List=tconc(List Inst))) ;; foreach

    foreach(Inst car(List)

    switchedView = dbGetAnyInstSwitchMaster(Inst viewList)
    geSwitch(cw "r" Inst 1 1 1 )

    when(switchedView
    unless(member(switchedView~>viewName stopList)
    fprintf(ResultFile strcat(geGetInstHier(cw) "\n"))
    MyScriptSub(switchedView cw ResultFile)
    ) ;; unless
    ) ;; when
    geReturn()
    ) ;; foreach
    )) ;; let proc
     
    bu-bu, Jun 10, 2009
    #1
  2. bu-bu

    Vitalie Guest

    Hi Bubu, try to check with a small design (~10~20 components) where
    the skill code is cycling, for debuging, include "printf("<your
    message>") and you will know what is happening ;)
     
    Vitalie, Jun 10, 2009
    #2
  3. bu-bu

    bu-bu Guest

    Hello Vitalie,

    Thanks a lot for your reply.
    I think my code is working because the output file is created
    correctly and quiclky.
    The problem happens when the function returns : it freezes Cadence
    during few minutes.

    Thanks and regards,

    bubu
     
    bu-bu, Jun 10, 2009
    #3
  4. bu-bu wrote, on 06/10/09 18:09:
    Does your code really need to keep switching the hierarchy with geSwitch and
    geReturn? It seems you're just producing some kind of "tree" type output - you
    ought to be able to do that more efficiently with something like sourcelink
    solution number 11300048. This uses db functions to traverse the hierarchy, and
    avoids switching graphically, which is what you are doing.

    Best Regards,

    Andrew.
     
    Andrew Beckett, Jun 11, 2009
    #4
  5. bu-bu

    bu-bu Guest

    Hello Andrew,

    Thanks a lot for the solution.
    The reason why i switch graphically is simple: i would like to use the
    function geGetInstHier() to write in my file the hierarchy path. (like
    |I1|I12|X23)
    This is possible only if i use the same window to open all my cells.
    The only function i have found for that is geswitch().

    The solution you have provided me is useful (i have modified this one
    to write the code above) but i can not see how to get the hierarchy
    path without graphically switching ?

    Thanks and regards,

    bubu
     
    bu-bu, Jun 11, 2009
    #5
  6. bu-bu

    Marcel Preda Guest

    Hi Bubu,

    Here an improved version of your original script, it should do the job
    in few seconds.

    Two differences in the code:
    - do not build a new list with the insts that you want to traverse,
    just traverse them when you do the test on ignoreLibs
    - a new param 'hierStr' was added on MyScriptSub()
    it keeps the hierarchPath as string, so you do not have to
    geGetInstHier()/geReturn for every single inst

    BR,
    Marcel

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    procedure(MyScript()
    let((ResultFile cv cw)
    cv = geGetWindowRep()
    cw = hiGetCurrentWindow()

    ResultFile= outfile("./Myfile.txt")
    MyScriptSub(cv cw ResultFile)
    close(ResultFile)
    )) ;; let proc

    procedure(MyScriptSub(cv cw ResultFile @optional (hierStr geGetInstHier
    ()))
    let(( viewList stopList ExcludeList switchedView Inst List)

    ;; if last char is not "/", add it
    unless(substring(hierStr -1) == "/"
    hierStr = strcat(hierStr "/")
    )

    viewList = "schematic cmos.sch symbol"
    stopList = list("symbol")
    List = list()
    ExcludeList = list("basic" "analogLib")

    foreach(Inst cv~>instances
    if(member(Inst~>libName ExcludeList) == nil then
    switchedView = dbGetAnyInstSwitchMaster(Inst viewList)

    when(switchedView
    unless(member(switchedView~>viewName stopList)
    fprintf(ResultFile strcat(hierStr Inst->name
    "\n"))
    MyScriptSub(switchedView cw ResultFile strcat
    (hierStr Inst->name "/"))
    ) ;; unless
    ) ;; when
    )
    ) ;; foreach

    )) ;; let proc
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
    Marcel Preda, Jun 12, 2009
    #6
  7. bu-bu

    bu-bu Guest

    Hello Marcel,

    Thanks a lot for your improvments. It's amazing how it's fast now !

    i did not think at all about strcat a variable with the name of the
    instance.

    Thanks and regards,

    bubu
     
    bu-bu, Jun 12, 2009
    #7
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.