cell reuse script

Discussion in 'Cadence' started by cadman, May 18, 2009.

  1. cadman

    cadman Guest

    Looking for a SKILL script that will look throughout the hierarchy
    tree to see where that cell is being used within the same library from
    current to bottom as well as current to top. Especially where used in
    different top level designs. Thankyou all in advance for any help in
    this matter.
    Regards,
    David Parmeter
     
    cadman, May 18, 2009
    #1
  2. cadman

    KB.How Guest

    Hi cadman,

    This script will help you to search for thoughout hierarchy for
    particular cell. U can view the report from top to bottom or bottom to
    top as well. This has to use when your top cell view is open in
    active mode.

    How to use:
    --------------------
    HowRepSubCell( "Library" "Cell" "View" ?disp "Bottom to Top")

    procedure( HowRepSubCell(lib cell view @key
    (cvid geGetEditCellView())
    (file "/tmp/sub1.rep")
    (stopLib nil)
    (disp "Top to Bottom")
    "tttdtgt")
    let((sub outp subcellList (indent "") (flag nil) numb scc
    (listSoFar '()) (count 0) (subList nil) er banner (rev nil)
    (big 0))

    sub = list(lib cell view)
    outp = outfile(file)

    fprintf(outp "Sub Cell Tree Report\n")
    fprintf(outp "---------------------------\n\n")
    fprintf(outp " Top cell : %s %s %s\n" cvid~>libName
    cvid~>cellName cvid~>viewName)
    fprintf(outp " Cell to find : %s %s %s\n" lib cell view)
    fprintf(outp "*************************************************\n\n")

    subcellList = reverse(HowGetHierList(cvid stopLib))

    foreach(sc subcellList

    ;-------------------------------
    ; Get the biggest level number
    ;------------------------------
    if( car(sc) > big then
    big = car(sc)
    );if

    ;---------------------
    ; Trace for sub cell
    ;---------------------
    if( cadr(sc) == sub then
    flag = t
    numb = car(sc)
    subList = append(subList list(sc))
    );if

    ;----------------------------------------
    ; Store the upper level cell into a list
    ;-----------------------------------------
    when( flag && numb > 0 && numb != car(sc) && numb > car(sc)&& !
    member(cadr(sc) listSoFar)
    subList = append(subList list(sc))
    listSoFar = append(listSoFar cadr(sc))
    numb--
    );if
    );foreach

    if( disp == "Top to Bottom" then
    subList = reverse(subList)
    rev = t
    );

    ;----------------------------------
    ; Create indent and write to file
    ;----------------------------------
    foreach( ss subList
    indent = ""
    scc = listToVector(cadr(ss))

    if( !rev then
    for(j 1 big-car(ss)
    indent = strcat(indent " ")
    );if
    else
    for(j 1 car(ss)
    indent = strcat(indent " ")
    );for
    );if

    fprintf(outp "%s[%d]:[%s %s %s]\n" indent car(ss) scc[0] scc[1]
    scc[2])
    count++
    );

    fprintf(outp "\n
    \n------------------------------------------------------\n")
    fprintf(outp "Notes: This hierarchy is from %s\n" disp)

    close(outp)
    if( plusp(count) then
    view(file)
    else
    er = sprintf(nil "NO [ %s ] cell was found." cell)
    warn(er)
    );if
    t
    );let
    );pro


    procedure( HowGetHierList(cvid stopLibs)
    let(( (level 1) cellList )
    cellList = list( list(0 list(cvid~>libName cvid~>cellName
    cvid~>viewName)) )
    cellList = HowHierSearch(cvid stopLibs level cellList)
    );let
    );proc


    procedure( HowHierSearch(cvid stopLibs level cellList)
    let(( newCellList )

    newCellList = cellList
    foreach( instMaster setof(im cvid~>instanceMasters !member
    (im~>libName stopLibs))
    when(instMaster~>libName && instMaster~>cellName &&
    instMaster~>viewName
    newCellList = append1( newCellList
    list(level list(instMaster~>libName
    instMaster~>cellName
    instMaster~>viewName)) )
    )

    newCellList = HowHierSearch(instMaster stopLibs level+1
    newCellList)
    );foreach

    newCellList
    );let
    );proc



    Regards.
    How
     
    KB.How, May 19, 2009
    #2
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.