• 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. close all views opened by dbOpenCellViewByType()

Stats

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

close all views opened by dbOpenCellViewByType()

pkerichang
pkerichang over 8 years ago

Hello,

I noticed that when you use dbOpenCellViewByType() to open a schematic view, it actually will also open all symbol views contained in the schematic.  As the result, This makes tracking references hard and could even have unintentional edit locks.  For example, suppose schematic A contains the symbol of B, and if we perform the following operation:

calling dbOpenCellViewByType() with append mode on A opens A in append mode, symbol of B in read mode.

calling dbClose() on A closes A.

calling dbOpenCellViewByType() with append mode on symbol of B will change it to append mode, and increment reference count by 1.

calling dbClose() on B does not close B (because it still has reference count of 1), and now it still has an edit lock.

Now my work-around is always use dbReopen() before dbClose() to change append mode back to read mode, so when dbClose() fails at least I don't have edit lock problems.  However, this leaves a lot of unnecessary cellviews in virtual memory, and over time this could become a problem.  Is there a way to find all the cellviews opened by the dbOpenCellViewByType() command?

 

  • Cancel
  • RK56
    RK56 over 8 years ago
    Hi,

    dbPurge() removes cellview from virtual memory. And if I'm correct, dbClose() just releases the lock of the cellview. Correct me if I'm wrong here.

    I don't know how to close all the opened cellviews.

    Thanks
    Ramakrishnan
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 8 years ago

    Hi Eric,

    You might want to try a call to dbFindOpenCellView() first before explicitly calling dbOpenCellViewByType().

    dbFindOpenCellView(
      g_libId
      t_cellName
      t_viewName
      [ t_version ]
    )

    So you can do something like this:

    
      when(symCv = dbFindOpenCellView(libId symCellName "symbol") || dbOpenCellViewByType(libId symCellName "symbol")
        unless(symCv~>mode=="a" dbReopen(symCv "a"))
        ;; ... go on to use symCv ...
      ); when the symbol cellview can be found or opened
    

    I did not test the above, but hopefully it is close to what you are looking for (assuming that libId is a dd library ID and symCellName is a variable containing the cell name as a string)? This should at least avoid incrementing the opened cellview count for each cellview that you are working with. Calling the dbClose() function will decrement the opened cellview counter by one, until it reaches zero, at which point dbClose() returns nil rather than t. You can use dbPurge() to close all references to a cellview but it will not save any edits, so just be aware of how it functions. The documentation should cover all of this too.

    Best regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RK56
    RK56 over 8 years ago
    Hi Lawrence,

    A dbSave() before dbPurge() will not loose any edits. Will it?

    -Ramakrishnan
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 8 years ago
    Hi Ramakrishnan,

    No, if you call dbSave() first then the save will occur and it would be 'safe' to purge the cellview from virtual memory. Just make sure that you know what you are doing. If there is a DM system involved then take care and test because it adds a whole other level of complexity.

    Regards,
    Lawrence.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    You might also want to look at using dbGetOpenCellViews() to find out everything that is currently open in memory.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RK56
    RK56 over 8 years ago
    Thanks Lawrence for the clarification
    • 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