• 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. Display all nets Hierarchically per block

Stats

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

Display all nets Hierarchically per block

J P Cardoso
J P Cardoso over 2 years ago

Hi,

I would like to display all the nets from the top of a design and down the hierarchy.

I've found an easy way of doing it, but it is very dumb. I am parsing the netlist and using the following commands:

deOpenCellView("lib_name" "cell_name" "schematic" "schematic" hiGetSessionWindow(hiGetCurrentWindow()) "r" )

geGetEditCellView()~>nets~>name

The approach above has two problems:

1 - It will open the cellview and I just want to "point" to that view, so the geGetEditCellView() gets the nets from the correct schematic

2 - I need a netlist. It would be nice, given the top, to dive into each block and then just do geGetEditCellView()~>nets~>name

Any help would be appreciated.

Thanks in advance.

Cheers,

Pedro

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago

    Hi Pedro,

    Presumably you could do a recursive traversal of the schematic hierarchy (relatively simple if you can just use a switch view list) - I'm sure there are many examples of doing a recursive traversal. Something like this:

    procedure(CCFsimpleRecurse(cv @key 
        (viewList "schematic symbol") (excludeLibs list("basic")) visited)
      let((master)
        unless(visited
          visited=makeTable('visited nil)
        )
        foreach(instMaster cv~>instanceMasters
          unless(member(instMaster~>libName excludeLibs) || visited[instMaster]
            if(instMaster~>cellViewType=="schematicSymbol" then
              master=dbOpenCellViewByType(
                instMaster~>libName 
                instMaster~>cellName 
                viewList
              )
            else
              master=nil
            )
            visited[instMaster]=master
            when(master
              CCFsimpleRecurse(
                master
                ?viewList viewList 
                ?excludeLibs excludeLibs 
                ?visited visited
              )
            )
          )
        )
        visited
      )
    )
    
    procedure(CCFgetAllSchematics(cv @key 
        (viewList "schematic symbol") (excludeLibs list("basic"))
        )
      let((visited withSch)
        visited=CCFsimpleRecurse(cv ?viewList viewList ?excludeLibs excludeLibs)
        withSch=setof(symbMaster visited visited[symbMaster])
        foreach(mapcar symbMaster withSch visited[symbMaster])
      )
    )

    Then you could start from the top level schematic and do:

    allSchematics=CCFgetAllSchematics(topCV)

    (you could open the topCV with dbOpenCellViewByType - no window needed).

    Then you have a list of all the schematic cellViews, so you could do a:

    foreach(cv allSchematics
      ; do something with each to get all nets - e.g. cv~>nets~>name
    )

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • J P Cardoso
    J P Cardoso over 2 years ago in reply to Andrew Beckett

    Thanks Andrew.

    But how do I pass topCV (I mean the syntax)? I've tried this without success: topCV = hiGetCurrentWindow() .

    Kind regards,

    Pedro

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to J P Cardoso

    If the top cellview is open in a window, use topCV=geGetEditCellView() . hiGetCurrentWindow() returns the window identifier, not the cellView (please read the documentation for these functions). If you don't want to open in a window, you can use:

    topCV=dbOpenCellViewByType("topLib" "topCell" "topView")

    to open the database in SKILL.

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • J P Cardoso
    J P Cardoso over 2 years ago in reply to Andrew Beckett

    Hi Andrew,

    I am sorry, but it is not working for me.

    From the CIW:

    topCV=dbOpenCellViewByType("pedro" "tb" "schematic")
    db:0x3e4ca01a
    allSchematics=CCFgetAllSchematics(topCV)
    (db:0x423e611a db:0x3b7e2b9a db:0x3e4c299a db:0x3e4cd49a db:0x3e4c8f9a
    db:0x3e4c691a db:0x3e4cd49a
    )
    foreach(cv allSchematics
    cv~>nets~>name
    )
    (db:0x423e611a db:0x3b7e2b9a db:0x3e4c299a db:0x3e4cd49a db:0x3e4c8f9a
    db:0x3e4c691a db:0x3e4cd49a
    )

    Kind regards,

    Pedro

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to J P Cardoso

    Your foreach loop is not doing anything with the list of net names. You either need to print it somehow, or you should use foreach(mapcar ...). For example:

    foreach(cv allSchematics
      println(cv~>nets~>name)
    )

    (use tilde-arrow rather than straight arrow, as otherwise the ->name won't work for each net).

    Or:

    foreach(mapcar cv allSchematics
      cv~>nets~>name
    )

    which will give you a list of lists of all the net names for each cellView. 

    You could also do:

    allSchematics~>nets~>name

    to achieve the same thing.

    If you're going to write SKILL code, it might be worth following one of the (free) training classes on SKILL Programming on http://support.cadence.com (use Learning→Online Courses to see what's there)

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • J P Cardoso
    J P Cardoso over 2 years ago in reply to Andrew Beckett

    I think something is not right.

    When I enter the commands below ...

    deOpenCellView("pedro" "tb" "schematic" "schematic" hiGetSessionWindow(hiGetCurrentWindow()) "r" )
    geGetEditCellView()~>nets~>name

    I get ....

    ("gnd!" "vprog" "vref" "out" "in")

    which is correct.
    However, when I try the recursive algorithm the output of the top level doesn't look right.

    topCV=dbOpenCellViewByType("pedro" "tb" "schematic")
    db:0x3e4ca01a

    allSchematics~>nets~>name
    (("O")
    ("MINUS" "PLUS")
    ("PLUS" "MINUS")
    ("IN" "IP" "O" "R" "S")
    ("n" "p")
    ("gnd!")
    ("IN" "IP" "O" "R" "S")
    )

    here vprog and vref are missing and the function is grabbing names of pins too, not only nets.

    Kind regards,

    Pedro

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to J P Cardoso

    Two things:

    1. The code as I provided uses a viewList of "schematic symbol". That means that if there's not a schematic view, it finds the symbol view. The CCFgetAllSchematics doesn't really take that into account (the function was badly named - this wasn't supposed to be the final solution - just something to get you started) - after all, I threw it together in a few minutes.
    2. Secondly, it doesn't include the top cellView.

    You can workaround this by doing:

    allSchematics=cons(topCV CCFgetAllSchematics(topCV ?viewList "schematic cmos.sch"))

    Note I gave two alternatives for the schematic view name - if you don't do that you get a bunch of warnings if you only give "schematic". You could just do this:

    allSchematics=cons(topCV CCFgetAllSchematics(topCV ?viewList "schematic schematic"))

    (normally specifying the view name twice is a bit pointless, but it's just a way of suppressing the warning you'd get otherwise).

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • J P Cardoso
    J P Cardoso over 2 years ago in reply to Andrew Beckett

    Thanks a lot Andrew. I really appreciate your help.
    Kind regards,
    Pedro

    • 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