• 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 a list of all instances that match a cellName...

Stats

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

How to get a list of all instances that match a cellName in a hierarchical schematic ?

FAwqati
FAwqati over 7 years ago

Ideally, im looking to get a complete list of hierarchical instances names for a specific device type in my schematic.

Eg. (/MN0 /I0/MN0 /I1/MN0  etc ....) 

Is there a skill command to find this ?

i guess i could use this = setof(devs cv~>instances devs~>cellName == "dgxnfet" ) to find the instances at a certain schematic level.

but this isn't hierarchical, and while ive found some references to recursively traverse hierarchy, ive struggled to get it working.

FYI, Im using the latest IC617. And there is a tree view in the schematic viewer and a "Print Tree" in the Edit banner menu, so surely something simple exists ?

  • Cancel
  • mbracht
    mbracht over 7 years ago

    As far as I know there is no SKILL builtin command which returns you all instances down a hierarchy - as you say cv~>instances only returns those instances on the current level. So yes you need a recursive approach to walk through the hierarachy. I wrote something similar recently - gimme some time and I'll look it up for you

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to mbracht

    Unfortunately there's no "simple" way of doing it - particularly if you want to handle both view switching and configs (which complicate matters rather because the bindings get more complicated).

    Here's some code I wrote a while back to create a schematic tree - before it was added as a standard feature for the schematic editor: How to print a hierarchy tree of a config based schematic, normal schematic or layout view?

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • mbracht
    mbracht over 7 years ago in reply to Andrew Beckett

    Hi Andrew...I see the problem with the config view. The code I was referring to was under the assumption that for each symbol there is a corrsponding schematic in terms of a switch list of names. I'll check out your code...

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to mbracht

    Hi Max,

    Yes, a search with a switch view list is a lot simpler - that can be done fairly simply with a short bit of recursive code.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • FAwqati
    FAwqati over 7 years ago in reply to Andrew Beckett

    Max & Andrew,

    Many thanks for your comments. It's much appreciated.

    However, I've really struggled since yesterday to get something working. I tried to extract what i need from Andrew's CCSschTree() code in addition to other threads but to no avail (eg this or this). Also couldnt make progress using your "switch view list search" suggestion.

    Not only am i stuck at traversing the hierarchy, but i cant seem to map between cv~>instances and cv~>instanceMasters in order to get the hierarchical instance name.

    At this point, I would be eternally grateful for any guidance.

    Thanks

    Faisal

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • FAwqati
    FAwqati over 7 years ago in reply to FAwqati

    Hi again,

    Finally, I managed to get the following code fairly working as i intend it to. I would be grateful if you can review it and point out its weaknesses.

    Thanks

    procedure(FAfindInstances(@optional (cv geGetEditCellView()) hierName (visited makeTable('visited nil)) )
        ;printf("===> Decending into = %s %s\n" cv~>libName cv~>cellName)
        foreach(instance cv~>instances
            if( member(instance~>cellName list("dgxnfet" "dgxpfet")) then
                ;
                printf("Found Instance = %s%s\n" hierName instance~>name) 
            else
                unless(visited[instance] 
                    visited[instance]=t
                    if(ddGetObj(instance~>libName instance~>cellName "schematic") then
                        FAfindInstances(dbOpenCellView(instance~>libName instance~>cellName "schematic") concat(hierName "/" instance~>name "/") visited)
                    )
                ) 
            ) 
        ) 
    )
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to FAwqati

    Hi Faisal,

    I restructured your code formatting to make it readable (not sure if I included the comments in the right place or not - couldn't tell from the wrapped code).

    Anyway, it looks fine. I probably would have used dbGetAnyInstSwitchMaster rather than the ddGetObj and dbOpenCellView part, but that's a small change. It's similar to what I would have written (I did start trying to use some classes and methods together with my CCSschTree code, but it's not really designed to operate at the instance level - it's mostly about gathering the different types of cells that are found at each level, rather than visiting every instance).

    Regards,

    Andrew.

    • 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