• 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. Compute the area of a layer inside a PCell instance from...

Stats

  • Replies 2
  • Subscribers 144
  • Views 181
  • Members are here 0

Compute the area of a layer inside a PCell instance from the callback

Florent Jehannin
Florent Jehannin 7 days ago

Hi everyone,

During the development of my latest PCell, I came across a problem when trying to compute the area of one of my layers in the design.
I want to be able to compute the total area of one layer, let's call it cap_1 in order to update a field in my CDF.
This layer can be holed so i thought about getting the point list of the polygons and add them up but i can't seem to find a way of getting access to my instance from the callback.

Surely using the "Tools" menu and "Area and Density Calculator" from Layout XL does give me the area but i want it to be computed automatically.
Is there a way of running this tool using a skill function ?
I already have the code to compute the area i just need to access the layer data in order to compute it.

Thank you

  • Cancel
  • Sign in to reply
Parents
  • henker
    henker 5 days ago

    It is rather unclear what you did and what want to achieve.
    e.g. you ask for how to run the 'Area and Density Calculator' from skill to calculate the area of a polygon, but then you state that you already have skill code for area calculation, which makes the previous passages and the polygon details obsolete.

    So I'm rather guessing now.
    First, you mean "CDF callback" when you use the term "callback".
    Second, you have a cell with a layout pcell view. The other views, symbol/schematic/cdl/simulation model/etc. are not relevant for the rest.
    Third, you want a CDF parameter (you call it 'field') that should contain the area of specific shapes from the corresponding layout pcell view in order to display this area value e.g. on the instantiated symbol and/or on the properties form.

    This area CDF parameter shall be readonly (created with '?editable nil'); having this editable, so the user can specify the area, would make it more complicated.
    And last, the area CDF parameter shall be updated, when the user edits whatever other CDF parameters you have for the layout pcell. So you added a CDF callback on these other CDF parameters, which is called whenever the user edits these values.

    If that is true, than the answer is no, you cannot access an evaluated layout pcell instance and the contained shapes from the CDF callback, because the layout does not necessarily exist when the CDF callback is invoked. The CDF callback is e.g. also executed, when you place the symbol of the cell in a schematic and change the parameters there, no layout is involved in the process.
    Inside the CDF callback, you only have the cdfgData, which is the source for later evaluation of the layout pcell. You cannot access the end product at the beginning.
    Although, it might be possible to create a temporary layout cellview, instantiate the layout pcell there, set the parameters from the current cdfgData on the instance, so the pcell instance is evaluated (CDF callbacks are not invoked here) and then access the shapes, but this is guesswork and quite some overkill.

    More realistic is to just call the code pieces that generate the layout shapes from the CDF callback with the arguments from the current cdfgData. Though, it would require to put this part of the pcell code in a separate procedure in order to call it from both the layout pcell code and the CDF callback; or have this code replicated on both places.

    You also need to consider that the source parameters can be controlled by ADE design variables or expressions (e.g. pPar/iPar) so the actual parameter values may be unknown when the CDF callback is invoked. The result in the area CDF parameter should still be reasonable in that case.


    You may also have a look at the articles 'The dangers of CDF callbacks' and 'Component Description Format (CDF) - Quick Reference to Basics and Frequently Referred Solutions', the latter has some examples, but if you already have experience with pcell development, this is maybe nothing new.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • henker
    henker 5 days ago

    It is rather unclear what you did and what want to achieve.
    e.g. you ask for how to run the 'Area and Density Calculator' from skill to calculate the area of a polygon, but then you state that you already have skill code for area calculation, which makes the previous passages and the polygon details obsolete.

    So I'm rather guessing now.
    First, you mean "CDF callback" when you use the term "callback".
    Second, you have a cell with a layout pcell view. The other views, symbol/schematic/cdl/simulation model/etc. are not relevant for the rest.
    Third, you want a CDF parameter (you call it 'field') that should contain the area of specific shapes from the corresponding layout pcell view in order to display this area value e.g. on the instantiated symbol and/or on the properties form.

    This area CDF parameter shall be readonly (created with '?editable nil'); having this editable, so the user can specify the area, would make it more complicated.
    And last, the area CDF parameter shall be updated, when the user edits whatever other CDF parameters you have for the layout pcell. So you added a CDF callback on these other CDF parameters, which is called whenever the user edits these values.

    If that is true, than the answer is no, you cannot access an evaluated layout pcell instance and the contained shapes from the CDF callback, because the layout does not necessarily exist when the CDF callback is invoked. The CDF callback is e.g. also executed, when you place the symbol of the cell in a schematic and change the parameters there, no layout is involved in the process.
    Inside the CDF callback, you only have the cdfgData, which is the source for later evaluation of the layout pcell. You cannot access the end product at the beginning.
    Although, it might be possible to create a temporary layout cellview, instantiate the layout pcell there, set the parameters from the current cdfgData on the instance, so the pcell instance is evaluated (CDF callbacks are not invoked here) and then access the shapes, but this is guesswork and quite some overkill.

    More realistic is to just call the code pieces that generate the layout shapes from the CDF callback with the arguments from the current cdfgData. Though, it would require to put this part of the pcell code in a separate procedure in order to call it from both the layout pcell code and the CDF callback; or have this code replicated on both places.

    You also need to consider that the source parameters can be controlled by ADE design variables or expressions (e.g. pPar/iPar) so the actual parameter values may be unknown when the CDF callback is invoked. The result in the area CDF parameter should still be reasonable in that case.


    You may also have a look at the articles 'The dangers of CDF callbacks' and 'Component Description Format (CDF) - Quick Reference to Basics and Frequently Referred Solutions', the latter has some examples, but if you already have experience with pcell development, this is maybe nothing new.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
Children
  • Florent Jehannin
    Florent Jehannin 4 days ago in reply to henker

    Thank you for you detailed and informative answer.

    I understand that my way of working was wrong and i will reconsider it using the cdf parameters at my disposal.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • 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