• 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 instance mode

Stats

  • Locked Locked
  • Replies 16
  • Subscribers 143
  • Views 18059
  • 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 instance mode

psill000
psill000 over 7 years ago

How do I get the mode of an instance in layout.

I know the cell is editable but when I try instDb~>master~>mode or instDb~>master~>mode~>cellView I get "r".

Paul

  • Cancel
Parents
  • mbracht
    mbracht over 7 years ago

    Hi Paul,

    I'am not sure whether it makes sense to talk about the "mode of an instance". An instance points to a master cell view and the mode of that master cell view depends from how you open it - in "r", "w" or "a"mode.
    In other words - I  think the mode is an attribute of a cell view in memory only. You may open a cell view in  in "a" mode and in one design editor and in "r" mode in another one.
    Moreover - the SKILL expression 'instDb~>master~>mode~>cellView' will throw an error because 'instDb~>master~>mode' returns a string to which you cannot apply a squiggle operator.

    Or maybe I just didn't get your question right...

    Max

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

    Max, Paul,

    If you open the cellView in "r" mode in one window and "a" mode in another, it will be editable in both windows because the mode is per cellView, not per window (and it picks the highest mode).

    I did wonder whether the instances were instances of pcells, in which case the master would have a different mode than the superMaster, but then the mode of the master (subMaster) is "s" regardless of the mode of the pcell superMaster.

    Note the mode is not whether it can be edited or not, it's whether it is open for edit or not. I can only assume the instance you have is a different cellView than you think it is - because the mode cannot be two different things for the same cellView.

    Regards,

    Andrew.

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

    Hi Andrew,

    Thanks for the clarification. What is really surprising for me is that the mode is not per window. I mean sometimes when you try to open a design you get a message that this cell view can be opened in read mode only (I was always assumimg because somebody else had opened it in write mode)...or maybe this is controlled through clsbd is it?

    Max

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

    Hi Max,

    Locking only plays a part when trying to open it for edit in two different virtuoso sessions (two different processes). clsbd is only used for stranded lock recovery - this is where it looks at the details in the lock file (which says which process id on which machine has the lock), and then the locking system asks clsbd on that machine to check if that process is still running or not. If it's not, then the lock file can be removed and then the open for edit can proceed. If there's no response from the request to clsbd (maybe clsbd isn't running, or the machine is unreachable) it errs on the side of caution and retains the lock. Obviously if it says that the process is running still, then the lock is denied too.

    Regards,

    Andrew.

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

    Hi Andrew,

    That pretty much matches my understanding of how clsbd works - I was just getting confused because of that mode attribute. And quite honestly I still don't quite get it why the mode is an attribute of a cell view. I mean in the end attributes get saved to the layout.oa file don't they? Why would you store this information on the hard disk? Or is the mode an attribute of the cell view in memory only?
    Sorry for keeping you so busy...

    Max

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

    Max, the mode is not saved to disk (that wouldn't make any sense). It's an attribute of the in-memory cellView representation to say which mode it's currently open in. The in-memory representation of various db objects contain additional data that only make sense in memory and are not saved persistently to disk.

    Regards,

    Andrew

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

    Thanks - no more questions Slight smile

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

    Sorry I did not describe the circumstance better. I have a script to move objects into an instance. The object and the instance are in the same cellview and move the object into a lower level. I want to test if the instance is in read or edit mode. I opened the instance for edit and I still got a "r" when I check the mode, instDb~>master~>mode.

    Was there another way to test if the instance editable or is there something I am missing. ( Its not a pcell )

    Paul

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

    Paul,

    May we see the script.

    Max

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

    procedure(instMode(inst)
    let( (mode)
    if(equal(inst~>master~>mode "r") then
    printf("Instance %s is in read only mode.\n" inst~>cellName)
    else mode = t)
    mode
    ); end of let
    ); end of instMode

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

    OK, nothing unusual about that code. Can you present some evidence (screenshots, maybe) showing both the window where the instance is contained (and on which you're running instMode) and a window for the underlying cellView (the master) is open in edit mode - and information to show that they're absolutely the same master? I cannot imagine how this is possible, knowing how things are structured in the database.

    This would be much easier to handle via a webex with customer support, BTW.

    Regards,

    Andrew.

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

    Hi Paul,

    What exactly do you mean  when you say "you opened the instance" - do you mean you opened the master in a separate window or did you just descend the hierarchy in Edit mode?

    Max

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

    Hi Paul,

    What exactly do you mean  when you say "you opened the instance" - do you mean you opened the master in a separate window or did you just descend the hierarchy in Edit mode?

    Max

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • psill000
    psill000 over 7 years ago in reply to mbracht

    I did both. opened the cell for edit and descended into the cell for edit.

    Same result instDb~>master~>mode = "r"

    Will check in it again

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

    Paul,

    Can you please post the results of the following, plus screenshots of the banners of the windows you've opened (the bit where it says Virtuoso Layout Suite ... Editing: lib cell view) - don't really need to see the contents, although seeing the toolbars would be useful too.

    instDb~>libName
    instDb~>cellName
    instDb~>viewName
    instDb~>master~>mode
    instDb~>cellView~>libName
    instDb~>cellView~>cellName
    instDb~>cellView~>viewName
    instDb~>cellView~>mode

    Thanks.

    Andrew.

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

    instMode(CDB())
    "zzz_psillaLib"
    "zzzCell"
    "layout"
    "a"    ( I have to have the cell open for edit in another cell window to get an "a" for the mode; otherwise I get an "r" )
    "zzz_psillaLib"
    "zzz_psilla"
    "layout"
    "r"

    I am not sure if it is Cadence envirnoment or a trigger that places the cell into read mode if the top cell in read.

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

    OK, so everything looks correct. That contradicts what you were saying earlier, where you said that even if you opened it for edit, the mode showed "r".

    I assume what you thought was that if you opened in edit mode the cellVIew in which the  instance is contained that the master for each instance would also be in edit mode? That's not the case - it would be pretty annoying (especially in a design-managed environment) to have cellViews open by default in edit mode as this would cause a check out or lock them unnecessarily, as well as leading to a risk of unexpected changes being made. So regardless of whether the containing cellView is in "a" or "r" mode, the masters for the instances would be in "r" mode unless they're explicitly open in append mode.

    It's easy enough to reopen them in append mode though if you know you want to make changes to them. Just do:

    dbReopen(instDb~>master "a")

    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