• 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. Tree Hierarchy of layout to table format

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 143
  • Views 19188
  • 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

Tree Hierarchy of layout to table format

LakshmanQual
LakshmanQual over 6 years ago

Hi all,

I want to create a tree hierarchy of layout to the table as mentioned below & should not see any cell repetitions of particular library and the same cell name can be in different library.

Could anyone help me in creating this?

Default Option should be 'Current to stop level'.

library1 cell1oflib1

             cell2oflib1

             cell3oflib1

             cell4oflib1

library2 cell1oflib2

             cell2oflib2

             cell3oflib2

             cell4oflib2

library3 cell1oflib3

             cell2oflib3

             cell3oflib3

             cell4oflib3

.

.

.

.

.

Can we dump that table to a file without disturbing its format so that We can read that file and check parent and child of the cells?

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 6 years ago

    I don't really understand what you're asking here. Are you asking about the Hierarchy->Tree command in the layout editor? Or are you asking about writing something else? I can't see how you can avoid duplicates if you want to know the parent child information - the example you are showing above appears to not be a hierarchical tree, but just a list of libraries and cells that are used in the design, not the hierarchical structure.

    Andrew. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • LakshmanQual
    LakshmanQual over 6 years ago in reply to Andrew Beckett

    Hi Andrew,

    Thanks for the reply. I want to get hierarchy(Shift+t) or 'Hierarchy->Tree' to a table key & value format as mentioned below. In general hierarchy(Shift+t), we are getting the output to a file format and had numbers beside cell names. So i want to remove all the other stuff and make a table as libraries(key) and cell names(value) as below & don't need parent and child information.

    Key        Value

    library1 cell1oflib1

    library1 cell2oflib1

    library1 cell3oflib1

    library1 cell4oflib1

    library2 cell1oflib2

    library2 cell2oflib2

    library2 cell3oflib2

    library2 cell4oflib2

    library3 cell1oflib3

    library3 cell2oflib3

    library3 cell3oflib3

    library3 cell4oflib3

    .

    .

    .

    .

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to LakshmanQual

    I just threw together this bit of code to do this. It doesn't use the tree report - very little point since it's just as easy to traverse the hierarchy and collect the data rather than producing a tree and munging the output somehow.

    To use it, if you have the top layout view open, simply do:

    CCFprintAllCellsUsed()

    or

    CCFprintAllCellsUsed(?fileName "./report.txt")

    Regards,

    Andrew.

    /*************************************************************************
    *                                                                        *
    *                  CCFallCellViewsUsed([cv] [visited])                   *
    *                                                                        *
    * Traverse the hierarchy recursively, visiting each master and recording *
    *  in a table every cellView id visited. Intentionally visit subMasters  *
    *     of pcells because there may be different hierarchy under each.     *
    *                           Returns the table.                           *
    *                                                                        *
    *************************************************************************/
    
    procedure(CCFallCellViewsUsed(@optional 
            (cv geGetEditCellView()) (visited makeTable('visited nil))
            )
        foreach(master cv~>instanceMasters
            unless(visited[master]
                visited[master]=t
                CCFallCellViewsUsed(master visited)
            )
        )
        visited
    )
    
    /****************************************************************
    *                                                               *
    *       CCFprintAllCellsUsed(?cv cvId ?fileName fileName)       *
    *                                                               *
    * Starting from a given cellView (defaults to current cellView) *
    *  collect all library/cell combos used and write to the given  *
    * fileName. If no fileName supplied, prints to standard output  *
    *                          (e.g. CIW).                          *
    *                                                               *
    ****************************************************************/
    
    procedure(CCFprintAllCellsUsed(@key (cv geGetEditCellView()) fileName)
        let((port visited cellsUsed cellUsedList)
            if(stringp(fileName) then
                port=outfile(fileName)
            else
                port=poport
            )
            visited=CCFallCellViewsUsed(cv)
            ;----------------------------------------------------------------
            ; Uniquify the list to just the lib and cell names
            ; (so ignores the views and different variants of pcells)
            ;----------------------------------------------------------------
            cellsUsed=makeTable('cellsUsed nil)
            foreach(master visited
                cellsUsed[list(master~>libName master~>cellName)]=t
            )
            ;----------------------------------------------------------------
            ; Sort into alphabetical order, by libName then cellName
            ;----------------------------------------------------------------
            cellUsedList=sort(cellsUsed~>?
                lambda((a b)
                    car(a)==car(b) && alphalessp(cadr(a) cadr(b)) ||
                    alphalessp(car(a) car(b))
                )
            )
            ;----------------------------------------------------------------
            ; Now print the report and close the file
            ;----------------------------------------------------------------
            foreach(cellUsed cellUsedList
                fprintf(port "%-20s %s\n" car(cellUsed) cadr(cellUsed))
            )
            when(stringp(fileName)
                close(port)
            )
            t
        )
    )
    
    
    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to LakshmanQual

    I just threw together this bit of code to do this. It doesn't use the tree report - very little point since it's just as easy to traverse the hierarchy and collect the data rather than producing a tree and munging the output somehow.

    To use it, if you have the top layout view open, simply do:

    CCFprintAllCellsUsed()

    or

    CCFprintAllCellsUsed(?fileName "./report.txt")

    Regards,

    Andrew.

    /*************************************************************************
    *                                                                        *
    *                  CCFallCellViewsUsed([cv] [visited])                   *
    *                                                                        *
    * Traverse the hierarchy recursively, visiting each master and recording *
    *  in a table every cellView id visited. Intentionally visit subMasters  *
    *     of pcells because there may be different hierarchy under each.     *
    *                           Returns the table.                           *
    *                                                                        *
    *************************************************************************/
    
    procedure(CCFallCellViewsUsed(@optional 
            (cv geGetEditCellView()) (visited makeTable('visited nil))
            )
        foreach(master cv~>instanceMasters
            unless(visited[master]
                visited[master]=t
                CCFallCellViewsUsed(master visited)
            )
        )
        visited
    )
    
    /****************************************************************
    *                                                               *
    *       CCFprintAllCellsUsed(?cv cvId ?fileName fileName)       *
    *                                                               *
    * Starting from a given cellView (defaults to current cellView) *
    *  collect all library/cell combos used and write to the given  *
    * fileName. If no fileName supplied, prints to standard output  *
    *                          (e.g. CIW).                          *
    *                                                               *
    ****************************************************************/
    
    procedure(CCFprintAllCellsUsed(@key (cv geGetEditCellView()) fileName)
        let((port visited cellsUsed cellUsedList)
            if(stringp(fileName) then
                port=outfile(fileName)
            else
                port=poport
            )
            visited=CCFallCellViewsUsed(cv)
            ;----------------------------------------------------------------
            ; Uniquify the list to just the lib and cell names
            ; (so ignores the views and different variants of pcells)
            ;----------------------------------------------------------------
            cellsUsed=makeTable('cellsUsed nil)
            foreach(master visited
                cellsUsed[list(master~>libName master~>cellName)]=t
            )
            ;----------------------------------------------------------------
            ; Sort into alphabetical order, by libName then cellName
            ;----------------------------------------------------------------
            cellUsedList=sort(cellsUsed~>?
                lambda((a b)
                    car(a)==car(b) && alphalessp(cadr(a) cadr(b)) ||
                    alphalessp(car(a) car(b))
                )
            )
            ;----------------------------------------------------------------
            ; Now print the report and close the file
            ;----------------------------------------------------------------
            foreach(cellUsed cellUsedList
                fprintf(port "%-20s %s\n" car(cellUsed) cadr(cellUsed))
            )
            when(stringp(fileName)
                close(port)
            )
            t
        )
    )
    
    
    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Children
  • LakshmanQual
    LakshmanQual over 6 years ago in reply to Andrew Beckett

    Hi Andrew Beckett I am not getting the library and cell combinations in schematic hierarchy, Only that level cells only coming. Its not traversing to inside cells. Could you please tell me where its failing while trans-versing the schematic?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to LakshmanQual

    Posting a question a few days ago, then deleting it and posting again is not going to get my attention any quicker. In fact it normally just serves to irritate me a bit... if something is urgent, you should contact customer support (I answer here in my fairly limited spare time as it's not part of my role at Cadence to answer questions in the forums).

    This code is not intended to work with schematics. It would need modification to handle view switching, and then there's a lot more involved if you are dealing with config views.

    You might want to look at the code in this article.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • LakshmanQual
    LakshmanQual over 6 years ago in reply to Andrew Beckett

    Hi Andrew, Sorry for the deletion of the comment. I deleted my old comment to explain the statement clearly. Not with any other intentions!! Thanks for the article link. I will try to understand that.

    • 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