• 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. How to get the top level coordinate of an instance on lower...

Stats

  • Replies 5
  • Subscribers 150
  • Views 77
  • Members are here 0

How to get the top level coordinate of an instance on lower level?

Martinsh
Martinsh 8 days ago

There is a cell named CellX in a hierarchical layout design. The cell CellX is placed on one of lower level of the layout design. How to get the top level coordinate of the bBox of the cell CellX?

Thanks!

  • Sign in to reply
  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett 7 days ago

    This code traverse the hierarchy finding matching cells and then transforms the bBoxes up to the top-level coordinate system. Hopefully this does what you want (I think I tested it enough...):

    /* CCFlistInstBBoxes.il
    
    Author     A.D.Beckett
    Group      CPG, Cadence Design Systems Inc.
    Language   SKILL
    Date       Sep 10, 2026 
    Modified   
    By         
    
    This code traverses the hierarchy, collecting the transformations
    as it goes, and outputs the bBox point of any matching instance,
    searching based on the libName and/or cellName (also viewName if
    desired). If any of these criteria are unspecified, then matches all.
    
    e.g.
    
    cv=geGetEditCellView()
    instBoxes=CCFlistInstBBoxes(cv ?cellName "CELL1")
    instBoxes=CCFlistInstBBoxes(cv ?libName "mylib" ?cellName "CELL1")
    
    Handles mosaics (for OA releases only).
    
    ***************************************************
    
    SCCS Info: @(#) CCFlistInstBBoxes.il 09/10/26.23:11:15 1.1
    
    */
    
    
    /***************************************************************
    *                                                              *
    *         CCFlistInstBBoxes(cvId [?libName "libName"]          *
    *         [?cellName "cellName"] [?viewName "layout"]          *
    *                [?transform list(0:0 "R0" 1)]                 *
    *                              )                               *
    *                                                              *
    *   Search the hierarchy recursively (including mosaics) for   *
    *  any inst that matches the given libName/cellName/viewName   *
    *   (if any are unspecified, they match all), and return the   *
    *      transformed bBox of the instance in the top-level       *
    *    coordinate system. Callers of this function would not     *
    *     normally pass ?transform - it's used internally when     *
    *                     called recursively.                      *
    *                                                              *
    ***************************************************************/
    
    procedure(CCFlistInstBBoxes(cvId @key 
      libName cellName viewName
      (transform list(0:0 "R0" 1))
      )
      let((instBBoxes)
        ;----------------------------------------------------------------------
        ; Recursively traverse the instances
        ;----------------------------------------------------------------------
        foreach(inst cvId~>instances
          when(inst~>objType=="inst"
            when((!libName || inst~>libName==libName) &&
                (!cellName || inst~>cellName==cellName) &&
                (!viewName || inst~>viewName==viewName)
              instBBoxes=cons(dbTransformBBox(inst~>bBox transform) instBBoxes)
            )
            instBBoxes=nconc(
              CCFlistInstBBoxes(inst~>master ?libName libName 
                ?cellName cellName ?viewName viewName
                ?transform dbConcatTransform(inst~>transform transform)
              )
              instBBoxes
            )
          )
        )
        ;----------------------------------------------------------------------
        ; Recursively traverse the mosaics (arrays). This is the most
        ; complicated part because you have to visit each row and column
        ;----------------------------------------------------------------------
        foreach(mosaic cvId~>mosaics
          let((master orient xy newTransform mosaicTransform)
            master=car(mosaic~>instanceList)~>master
            orient=car(mosaic~>tileArray)
            mosaicTransform=
              dbConcatTransform(
                dbConcatTransform(
                  list(mapcar('minus mosaic~>xy) "R0" 1)
                  list(0:0 orient 1)
                )
                list(mosaic~>xy "R0" 1)
              )
            ;------------------------------------------------------------------
            ; Iterate over the rows and columns, visiting each
            ; sub-instance in the simple mosaic
            ;------------------------------------------------------------------
            for(row 0 mosaic~>rows-1
              for(col 0 mosaic~>columns-1
                xy=xCoord(mosaic~>xy)+col*mosaic~>uX:yCoord(mosaic~>xy)+row*mosaic~>uY
                ;--------------------------------------------------------------
                ; Compute the transformation of the sub-instance
                ;--------------------------------------------------------------
                newTransform=
                  dbConcatTransform(
                    dbConcatTransform( list(xy "R0" 1) mosaicTransform)
                    transform
                  )
                when((!libName || mosaic~>libName==libName) &&
                    (!cellName || mosaic~>cellName==cellName) &&
                    (!viewName || mosaic~>viewName==viewName)
                  instBBoxes=cons(dbTransformBBox(master~>bBox newTransform) instBBoxes)
                )
                instBBoxes=nconc(
                  CCFlistInstBBoxes(master ?libName libName 
                    ?cellName cellName ?viewName viewName
                    ?transform newTransform
                  )
                  instBBoxes
                )
              )
            )
          )
        )
      instBBoxes
      )
    )

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Martinsh
    Martinsh 7 days ago in reply to Andrew Beckett

    Andrew,

    Thanks a lot!

    Martinsh

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Martinsh
    Martinsh 7 days ago in reply to Andrew Beckett

    Andrew,

    Thanks a lot!

    Martinsh

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data

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.

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

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