• 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. Is it possible to add properties to a layout pcell?

Stats

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

Is it possible to add properties to a layout pcell?

Sheppy
Sheppy over 9 years ago

Hi,

This is what I would like to do:

The p-cell code to generate a layout instance must store certain values computed in the code as a property to that instance.

This is simular to someting I have done before: added properties of computed values for a group in layout.

In the code for generating shapes in a layout, I group all the generated shapes together and then add properties to this group. I use the command:

dbCreateProp( topGroupID fieldName fieldType fieldValue )

I want to do the same with a p-cell. The values I want to report are not parameters (I don't want them to be that either), so they should be stored as properties. When an instance is instantiated, upon selecting that instance and hitting the "q" key, I wnat properties to show-up under the properties tab. I tried to do it with the same command like so:

dbCreateProp( pcCellView fieldName fieldType fieldValue )

but this did not work.

Is there any way to get the p-cell code to store certain values as properties to the instance it is creating?

With kind regards,

Sjoerd

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    Hi Sjoerd,

    You can't do this. The reason is because the PCell code is evaluated once per variant, not once per instance. So if you have multiple instances with the same pcell parameters, the PCell code only gets evaluated for one of them - the first it encounters. Because of this, it isn't possible for the PCell to reliably have access to the instance - because it would only be one of the instances (I have seen people abusing a certain variable to do this, but it is not safe because it only will impact one instance). Subsequent instances you place would not trigger any re-evaluation of the code (unless the parameters were different), so it wouldn't work. Plus you wouldn't want subsequent opens of the database in future sessions scribbling on parent instances and modifying designs.

    One possibility (but I really don't like this idea, so I'd discourage you from pursuing it) is to store properties on the PCell subMaster (i.e. the pcCellView) and then have a CDF doneProc which copies them across from inst~>master~>propName to CDF properties on the instance (or instance properties). The reason I don't like this is that I thing that modifying properties on an instance in a doneProc is really wrong - you're potentially changing information after the user has seen what he has changed (so this may not be of any use anyway, because the user may not see the properties you want him to see until next time the form is opened), and secondly there are numerous places where the doneProc is not called - so you may end up with inconsistent data.

    You can use labels on the PCell to display information to the user - maybe that would be a better idea? Or you could have a button in the CDF called "Display PCell Info" with a callback that gets the current instance and displays the properties from the PCell master. That might be a bit clunky, because CDF shouldn't really be dealing with instances either - it doesn't know what the instance is necessarily because on the create Instance form you don't have an instance yet but the CDF is still active. So using a separate custom function to inspect the PCell might be better.

    Alternatively, do these calculations in a CDF callback and display the information to the user that way.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Sheppy
    Sheppy over 9 years ago

    Hi Andrew,

    Thank you very much for the very detailed response.

    And it is actually what I expected it to be, so no big surprise. And I agree with you that solution/backdoor you propose shouldn't be used (keep that door closed!).

    What was needed: a colleague wants to automatically (using SKILL script part of a validation toolbox) place pins on all pins of a transistor pcell (in an other layout). I developed this pcell, and all pins have labels, each label has its origin exactly in the middle of the pin. This information is easily retrievable from the instance master (just do a foreach of all shapes and look for object-type "label" and that is has the correct value in "theLabel") so I suggested to just use that. I understand it would be easier for him if there would be a property with a list of all pin locations, but I think this is the best way to do it. (looking for terminals and than locating the pins/shapes and determine the centre is a solution as well, many roads lead to...) Now I can tell him that a property can't (reliably) be created.

    With kind regards,

    Sjoerd

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    Hi Sjoerd,

    If that's what he wants to do, then you can certainly store the information as a property on the subMaster cellView (so pcCellView~>yourProp=...). So for example, this could be of the form:

    pinCentres=list(list("A" 1:2) list("B" 3:4) list("C" -1:-2))
    pcCellView~>pinCentres=pinCentres

    The coordinates would be relative to the subMaster origin (so not instance coordinates).

    Then all he'd have to do is:

    pinAcentre=dbTransformPoint(cadr(assoc("A" inst~>master~>pinCentres) inst~>transform)

    and so on. The cadr(assoc(...)) bit is just an example of how you'd look it up, and then we're transforming it to the parent coordinate system using whatever transformation has been done on the instance. This would work, because the coordinates are in the PCell's coordinate space and so common to all instances of the same variant.

    This would avoid having to hunt down shapes in the master.

    Another approach is to use rodNameShape to name the shapes, and then use rodGetObj to retrieve the named hierarchical object and from that you can use the various handles to (say) find the centre of the shape.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Sheppy
    Sheppy over 9 years ago
    Hi Andrew, I will test this shortly and give you an update. Thanks. Sjoerd
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Sheppy
    Sheppy over 9 years ago

    HI Andrew,

    Thank you very much with the suggested solution (the one with pcCellView...). It works perfect and it is actually exactly what my colleague wanted to have.

    And I learned something new: normally, when I wanted to get the value of a certain property, I would do something using:

    objId~>master~>prop~>value (this returns a list of all values of all properties, so not exactly the value of one property, but you'll get the point, this would be used in a foreach or setof sequence)

    I did not know it is actually much simpler to do:

    objId~>master~>propName (this will return the value of only the property you specify, much simpler)

    With kind regards,

    Sjoerd

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • brossi
    brossi over 6 years ago in reply to Andrew Beckett

    Hi Andrew, I´ve created a pcell that can be strech, and I want to a property like victim or attacker it will be a boolean property. I was able to add those parameters after instanciating the pcell, however I would like that anyone that use that pcell has those properties available. do you have any guide to do that? My idea later is to do a search of that instance and read how many victim / attaker cells I have.

    Regards!

    Brenda

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to brossi

    Hi Brenda,

    The forum guidelines ask you not to post on the end (or in the middle of) old threads - even though this is loosely related to the previous topic. You can always reference the old thread (including the link) if needed.

    Anyway, if you want the property to show up as something that the user might want to set, you can do that by defining it as a CDF parameter for the cell in question. I'm assuming it's not actually a PCell parameter (i.e. it doesn't influence the PCell's behaviour), but you can add whatever CDF parameters you like and then this governs what shows up on the create instance/edit properties forms.

    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