• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Search all cells in all libraries for layout instance

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 144
  • Views 13429
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Search all cells in all libraries for layout instance

Michael Kolesnik
Michael Kolesnik over 4 years ago

I would like some hints for SKILL code.

I am writing a function which can be summarized " where are all the places this instance is used".

I want to search all cells in all libraries .

The only code I have seen that is close are these two:

CCSfindInstCellLib = find a instance in ONE library

CCSFindCellInLibrary = finds a CELL in all libraries 

I have been trying to combine these two but have no luck so far.

My plan is something like this:

foreach(library...

       foreach(cell in library... search for instance "inv2"

            print the results.

  • Cancel
Parents
  • psill000
    psill000 over 4 years ago

    Not sure the criteria of how you want to search of whole string or substring, but will provide a skeleton to started

    findCellStr = substring searching

    schLayBool = t schematic nil layout
    findCellStringAllLib("INV" t)

    procedure(findCellStringAllLib(findCellStr schLayBool)
    let( (cellDb fndList instList)
    foreach(lib sort(ddGetLibList()~>name nil)
        printf("Searching %s\n" lib)
       foreach(cName ddGetObj(lib)~>cells~>name
           if(schLayBool then
                 when(ddGetObj(lib cName "schematic")
                          cellDb = dbOpenCellViewByType(lib cName "schematic" "schematic" "r")
                          instList = setof(i cellDb~>instances dbIsId(i) && rexMatchp(findCellStr i~>cellName))~>cellName)
          else when(ddGetObj(lib cName "layout")
                        cellDb = dbOpenCellViewByType(lib cName "layout" "maskLayout" "r")
                        instList = setof(i cellDb~>instances dbIsId(i) && rexMatchp(findCellStr i~>cellName))~>cellName)
    )

    when(instList
               fndList = cons(strcat(lib " " cName) fndList))
               instList = nil
    ))

    if(fndList then
            printf("%L\n\n" sort(fndList nil))
    else printf("%s not found\n" findCellStr))
    )); end of findCellStringAllLib

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Reply
  • psill000
    psill000 over 4 years ago

    Not sure the criteria of how you want to search of whole string or substring, but will provide a skeleton to started

    findCellStr = substring searching

    schLayBool = t schematic nil layout
    findCellStringAllLib("INV" t)

    procedure(findCellStringAllLib(findCellStr schLayBool)
    let( (cellDb fndList instList)
    foreach(lib sort(ddGetLibList()~>name nil)
        printf("Searching %s\n" lib)
       foreach(cName ddGetObj(lib)~>cells~>name
           if(schLayBool then
                 when(ddGetObj(lib cName "schematic")
                          cellDb = dbOpenCellViewByType(lib cName "schematic" "schematic" "r")
                          instList = setof(i cellDb~>instances dbIsId(i) && rexMatchp(findCellStr i~>cellName))~>cellName)
          else when(ddGetObj(lib cName "layout")
                        cellDb = dbOpenCellViewByType(lib cName "layout" "maskLayout" "r")
                        instList = setof(i cellDb~>instances dbIsId(i) && rexMatchp(findCellStr i~>cellName))~>cellName)
    )

    when(instList
               fndList = cons(strcat(lib " " cName) fndList))
               instList = nil
    ))

    if(fndList then
            printf("%L\n\n" sort(fndList nil))
    else printf("%s not found\n" findCellStr))
    )); end of findCellStringAllLib

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Children
  • Michael Kolesnik
    Michael Kolesnik over 4 years ago in reply to psill000

    That worked perfect except for one unseen situation - during the run, memory usage jumped from 2gb to 27gb before I stopped it. It was probably due to the "dbOpen" function which loads the cell into memory, and was loading hundreds of cells into memory. I will see if there is a purge command to purge each cell after it is done.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information