• 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 make the pcell parameters visible upon placement...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 12490
  • 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 make the pcell parameters visible upon placement of cellview

malcolm70
malcolm70 over 4 years ago

I am learning pcell creation , so I started out with this basic structure, a metal resistor.

problem : when the pcell is FIRST placed into a layout cell , the parameters for "metalLayer" and "squareSize"

I can address them and change them with css()~>metalLayer = some layer,  or,  css()~>squareSize = something.

If after they are first placed, I type in CIW :  css()~>metalLayer <ret> the value returned is nil.

I cannot query the value of the parameter.  Not until I type something like , 

if(!css()~>metalLayer then css()~>metalLayer="metal2" )

Why is that and how can I make visible the parameter value as soon as the instance is placed ?? 

(current cadence version 18 )

TIA.   Malcolm

-------------------------------------------------------

pcDefinePCell(

   ;  Identify the target cellview.

   list(ddGetObj("myPcellLib") "metalResistor" "pcell")

 

   ;  Define formal parameter name-value pairs.

   (

     (metalLayer "metal1")

     (squareSize 2)

   )

 

   ;  Define the contents of this cellview.

   let(()

 

   rodCreateRect(

       ?layer list(metalLayer "resistor")

       ?width squareSize

       ?length squareSize

       ?origin list(-squareSize*0.5 -squareSize*0.5)

 

    ) ; close LET

) ; close pcDefinePcell

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 4 years ago

    Hi Malcolm,

    First of all, a little bit on the background (before I suggest a solution) - the instance property is only needed to override the default. You can find the actual value used by the PCell (whether it is default or overridden) by using:

    instId~>master~>parameters~>metalLayer

    (BTW, css() is actually a private function and so should not be used in code; fine to use in the CIW for debugging, but should not be used in any programs you write in case we remove it or change it!)

    Now, having to check the parameters hierProp on the master is a bit awkward, because you need to get it from one place and set it in another (to update the parameter you'd have to set the property on the instance, because that would trigger a re-master to a different variant of the PCell). So the best solution is to create CDF for the component too - with the CDF defaults matching your PCell defaults. If you have $CDS_Netlisting_Mode set to "Analog" (normal for ADE users), then that has the benefit that if you then do:

    instId~>metalLayer

    then it will get the instance property if set, or if not, it will retrieve the CDF default (which as it matches the PCell default) does what you want. Defining the CDF also allows you to have nicer prompts for your parameters on the forms, so it's good for that reason too.

    There is however a danger here - if your CDF default is different from the PCell default, then strange things can happen - that's because normally if the value on the edit properties/create instance form matches the CDF default, it does not set the property on the instance. If the property is not set on the instance, then the PCell will evaluate using its default. So the form might show one thing, but the PCell is doing another. That can be worked around by turning on storeDefault=yes for the parameter in question, but in general the right thing to do is ensure your CDF and PCell defaults are the same (it's less efficient to use storeDefault=yes because you have to store the default values on each and every instance).

    Hope that helps!

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 4 years ago

    Hi Malcolm,

    First of all, a little bit on the background (before I suggest a solution) - the instance property is only needed to override the default. You can find the actual value used by the PCell (whether it is default or overridden) by using:

    instId~>master~>parameters~>metalLayer

    (BTW, css() is actually a private function and so should not be used in code; fine to use in the CIW for debugging, but should not be used in any programs you write in case we remove it or change it!)

    Now, having to check the parameters hierProp on the master is a bit awkward, because you need to get it from one place and set it in another (to update the parameter you'd have to set the property on the instance, because that would trigger a re-master to a different variant of the PCell). So the best solution is to create CDF for the component too - with the CDF defaults matching your PCell defaults. If you have $CDS_Netlisting_Mode set to "Analog" (normal for ADE users), then that has the benefit that if you then do:

    instId~>metalLayer

    then it will get the instance property if set, or if not, it will retrieve the CDF default (which as it matches the PCell default) does what you want. Defining the CDF also allows you to have nicer prompts for your parameters on the forms, so it's good for that reason too.

    There is however a danger here - if your CDF default is different from the PCell default, then strange things can happen - that's because normally if the value on the edit properties/create instance form matches the CDF default, it does not set the property on the instance. If the property is not set on the instance, then the PCell will evaluate using its default. So the form might show one thing, but the PCell is doing another. That can be worked around by turning on storeDefault=yes for the parameter in question, but in general the right thing to do is ensure your CDF and PCell defaults are the same (it's less efficient to use storeDefault=yes because you have to store the default values on each and every instance).

    Hope that helps!

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • malcolm70
    malcolm70 over 4 years ago in reply to Andrew Beckett

    Thank you Andrew for your help, I don't understand the concepts behind "CDF" but I think you've given me a good pointer to go read the documentation now.  My initial task was merely to query the pcell instance searching for the metalLayer type so I can do a quick and easy inventory count on the amount of devices of one type or the other.  for that I think I can simply query with the instId~>master~>parameters solution.

    • 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