• 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. PCell callbacks and cdfgData variable

Stats

  • Locked Locked
  • Replies 8
  • Subscribers 144
  • Views 19030
  • 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

PCell callbacks and cdfgData variable

VadimBorisov
VadimBorisov over 8 years ago

I want to execute the callback from a cell(pcell) after instantiation it to a layout, in order to check if chosen parameters are correct (no callback validation). 

evalstring(callbackOfPcell)

and it always returns t, even for the obviously mistaken setup for the inst. parameters. 

I've checked the source code of the "callbackOfPcell" callback function, and for getting the value from the cell it's using the cdfgData variable. The documentation and internet didn't give me an answer how cdfgData knows which cell is under test now.

So, the question is how cdfgData gets the right value for a cell, and why it has nil value after executing it in the CIW.

  • Cancel
  • Quek
    Quek over 8 years ago

    Hi Vadim

    cdfgData allows us to access the CDF data of the current object which is in use. E.g.

    a. Enter "cdfgData" in CIW. You will get "nil"
    b. Select a schematic object and open the properties form
    c. Enter "cdfgData" in CIW again. You will now get the inst CDF ID of the object

    Please search for "cdfgData" in $CDSHOME/doc/skartistref/skartistref.pdf.


    Best regards
    Quek

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

    In addition to what Quek says, you can also use the code in this article to call the callbacks procedurally (i.e. without the form being involved). That sets cdfgData appropriately so that the callbacks can be evaluated.

    You may find other versions of the same code elsewhere on the net (and in these forums, I think), called abInvokeCdfCallbacks.il (the version in the article has the "CCS" prefix as it's from Cadence Customer Support).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • VadimBorisov
    VadimBorisov over 8 years ago

    An interesting solution, thank you for sharing.

    Sorry, one more question, if you have a time, could you please tell me do you know how to switch off the option which returns a PCell to the default state... Sorry for asking it here, but the code is quite advance for me...

    I found the part of code, which does it, however, to my regret, I can't find there exactly...



    (procedure (CCScreateEffectiveCDFLookalike cdf @optional lookalikeParams
    (resetLookalikeParams t))
    (let (new cdfFields newParam)
    (unless (getd 'make_CCSeffCDF)
    ;---------------------------------------------------------
    ; Because some slots appear twice in cdf->? have
    ; to make the list unique
    ;---------------------------------------------------------
    (setq cdfFields (makeTable 'cdfFields))
    (foreach field (getq cdf ?)
    (setarray cdfFields field t)
    )
    (eval `(defstruct CCSeffCDF ,@(getq cdfFields ?))))
    (setq new (make_CCSeffCDF))
    (when (and lookalikeParams (null (getd 'make_CCSeffCDFparam)))
    (setq cdfFields (makeTable 'cdfFields))
    (foreach field (getq (car (getq cdf parameters)) ?)
    (setarray cdfFields field t))
    (eval `(defstruct CCSeffCDFparam ,@(getq cdfFields ?))))
    ;-----------------------------------------------------------------
    ; populate the effective cdf with the top level cdf attributes
    ;-----------------------------------------------------------------
    (foreach param (getq cdf ?)
    (putprop new (get cdf param) param))
    ;-----------------------------------------------------------------
    ; Set the id and type attributes appropriately
    ;-----------------------------------------------------------------
    (when (equal (getq new type) "instData")
    (putpropq new (dbGetq (dbGetq (getq cdf id) master) cell) id)
    (putpropq new "cellData" type)
    )
    ;-----------------------------------------------------------------
    ; If we want the parameters to be lookalike too, create those
    ;-----------------------------------------------------------------
    (when lookalikeParams
    (putpropq new
    (foreach mapcar param (getq cdf parameters)
    (setq newParam (make_CCSeffCDFparam))
    (foreach slot (getq param ?)
    (putprop newParam (get param slot) slot))
    (when resetLookalikeParams
    ; reset the value to defValue for safety
    (putpropq newParam (getq newParam defValue) value)
    )
    newParam
    )
    parameters)
    ) ; when
    ;-----------------------------------------------------------------
    ; Add the parameters as properties in the effective cdf
    ;-----------------------------------------------------------------
    (foreach param (getq new parameters)
    (putprop new param (getq param name))
    )
    new
    )
    )

    Best regards,
    Vadim

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • VadimBorisov
    VadimBorisov over 8 years ago

    I should mention, I set the variable resetLookalikeParams to nil, but still the script returns default PCells.

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

    I don't understand what you mean here. The script doesn't "return default PCells" or even "return PCells" - so I'm not sure what you mean. Similarly, if you're calling CCSinvokeCdfCallbacks or CCSinvokeInstCdfCallbacks, it doesn't pass ?lookalikeParams to CCScreateEffectiveCDFLookalike, so the ?resetLookalikeParams won't have an effect. That would only be important if you're calling this lookalike CDF function directly, which I rather doubt you'd need (I needed it for a slightly unusual application, which is why it's in the code). 

    What is the actual problem  you're trying to solve here?

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • VadimBorisov
    VadimBorisov over 8 years ago

    thank you for your quick answer, and excuse me for the bad explanation. Shortly, I don't need the reset to default function for PCells, and I want to switch that option off.

    What is the actual problem you're trying to solve here?

    I have my script which quasi-randomly changes the parameters of the pcell(s), after each irritation I want to check all callback functions.

    The issue the script (which you've provided me) always resets PCells to the default state, but I would prefer just to keep as is with the warning or error message.

    Later on, I'm going to enhance my script, and it will return the previous parameter set for a pcell, which wasn't validate the callback.


    Again, thank you Andrew for your help here!
    Vadim

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • VadimBorisov
    VadimBorisov over 8 years ago
    Andrew Beckett , I believe, I found the source of my issue, it isn't your script reset the PCell to the default state, the PCell itself does it internally, but I'm not sure...

    Anyway, thank you for the wonderful script!
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    Unknown said:
    I believe, I found the source of my issue, it isn't your script reset the PCell to the default state, the PCell itself does it internally, but I'm not sure...

    Good. My code doesn't reset the "PCell" (or CDF) to its defaults, so it must have been something else...

    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