• 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. Get all other cells used in a given cell

Stats

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

Get all other cells used in a given cell

CClauson
CClauson over 13 years ago

Hello,

Given a cell, I'm wondering if there's any easy way to programmatically get all other cells used in that cell's design.

Code looks something like this:

;;winId has type "window", as tested
;;by function wtypep()
myCell = windId->cellView

Now, given myCell, how can I create a list of other cells that are referenced in myCell's design?

Also, I have a more general question:  If I'm given a type in SKILL, is there any easy way of finding the documentation for what members it has, like Javadoc?  If this were Javadoc, I'd go to the "window" type, see that it has a "cellView" member.  I'd then go to that type's doc, which would probably answer my question.

Thanks in advance for any advice that can be offered.

 

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

    Working from the "dd" objects is not going to help you particularly because it does not give you any indication of the hierarchy - that information is contained within the "db" objects (such as the "cellView" objType object you're dealing with above. There are three alternative ways you could traverse the design:

    cvId=geGetEditCellView() ; gets the cellView in the current window using the proper API rather than using properties on the window
    ; look at every instance
    foreach(instance cvId~>instances
      ...
      master=instance~>master
      ...
    )

    ; look once at each master
    foreach(master cvId~>instanceMasters
      ...
    )

    ; look once at head instHeader
    foreach(instHeader cv~>instHeaders
      master=instHeader~>master
      ...
    )

    The benefit of instances is that every single instance gets visited - which is useful if you need to do some kind of flattening type operation, or collect other instance-specific information. But if you only want to find out the cells that are instantiated, it's rather more expensive because you end up visiting every instance of the same cell over and over again. The other two approaches avoid that. The instanceMasters approach directly gives you the "master" (i.e. the thing that has been instantiated, typically the symbol in the case of a schematic), whereas the instHeaders gives you a database object which has access to both the master and the list of instances of that type. Take your pick.

    What you are looking to do is some kind of view switching. So for example:

    foreach(master cvId~>instanceMasters
      switchedMaster=dbOpenCellViewByType(master~>libName master~>cellName list("schematic" "cmos.sch"))
      when(switchedMaster
        printf("Found %s has view %s\n" master~>cellName switchedMaster~>viewName)
        ; do whatever you want
        ; might want to close it to ensure reference counts handled properly
        dbClose(switchedMaster)
      )
    )

    Notice that the dbOpenCellViewByType has a list of view names to try - this is analogous to a "switch view list" when netlisting, and allows you to specify a priority.

    Note there is a mechanism to do this when you have a config - that's a bit more complicated - and you might want to take a look at Solution 11300048 for a more complete example (that handles either view switching or configs).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    Working from the "dd" objects is not going to help you particularly because it does not give you any indication of the hierarchy - that information is contained within the "db" objects (such as the "cellView" objType object you're dealing with above. There are three alternative ways you could traverse the design:

    cvId=geGetEditCellView() ; gets the cellView in the current window using the proper API rather than using properties on the window
    ; look at every instance
    foreach(instance cvId~>instances
      ...
      master=instance~>master
      ...
    )

    ; look once at each master
    foreach(master cvId~>instanceMasters
      ...
    )

    ; look once at head instHeader
    foreach(instHeader cv~>instHeaders
      master=instHeader~>master
      ...
    )

    The benefit of instances is that every single instance gets visited - which is useful if you need to do some kind of flattening type operation, or collect other instance-specific information. But if you only want to find out the cells that are instantiated, it's rather more expensive because you end up visiting every instance of the same cell over and over again. The other two approaches avoid that. The instanceMasters approach directly gives you the "master" (i.e. the thing that has been instantiated, typically the symbol in the case of a schematic), whereas the instHeaders gives you a database object which has access to both the master and the list of instances of that type. Take your pick.

    What you are looking to do is some kind of view switching. So for example:

    foreach(master cvId~>instanceMasters
      switchedMaster=dbOpenCellViewByType(master~>libName master~>cellName list("schematic" "cmos.sch"))
      when(switchedMaster
        printf("Found %s has view %s\n" master~>cellName switchedMaster~>viewName)
        ; do whatever you want
        ; might want to close it to ensure reference counts handled properly
        dbClose(switchedMaster)
      )
    )

    Notice that the dbOpenCellViewByType has a list of view names to try - this is analogous to a "switch view list" when netlisting, and allows you to specify a priority.

    Note there is a mechanism to do this when you have a config - that's a bit more complicated - and you might want to take a look at Solution 11300048 for a more complete example (that handles either view switching or configs).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • 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.

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

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