• 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. SKILL Lint "Unrecognized global variable" error when referencing...

Stats

  • Replies 5
  • Subscribers 147
  • Views 871
  • Members are here 0

SKILL Lint "Unrecognized global variable" error when referencing CDF default values in pcDefinePCell

thiruvenkata
thiruvenkata 28 days ago

Hi!,

I am writing a SKILL PCell and trying to align the default parameter values in the pcDefinePCell by fetching cdfId to ensure the synchronization, as described in the "Introduction to SKILL PCell Programming" RAK (specifically Lab 4: Automatically Aligning Default Parameter Values)".

It describes to define cdf globally and use it in the parameter list and set to nil at the end.

For eg:

lib="PCell"
cellName="test"
cdf=cdfGetBaseCellCDF(ddGetObj(lib cellName))

pcDefinePCell(

list(ddGetObj(lib) cellName "layout")
list(
(w "float" cdf->w->defValue)
(l "float" cdf->l->defValue)
(layer "string" cdf->layer->defValue)
) ;parameters
let((cv)

;body

);let

);pcDefinePCell

lib=nil
cellName=nil
cdf=nil

So, When I run SKILL lint on this code, it flages lib, cellName and cdf as unrecognized global variables.

So, I tried wrapping the variables inside the let statement and run the skill lint, the outcome is that it still flags cdf as unrecognized global variable but not the variables lib and cellName.

Why only cdf is still flagged and not the other variables?

I want to know what is the best practice to avoid these warnings? Any suggestions or insights are appreciated.

Virtuoso version: IC618 Base release: "sub-version  IC6.1.8-64b.83 "

Thanks,

Thiruvenkata

  • Cancel
  • Sign in to reply
Parents
  • Andrew Beckett
    Andrew Beckett 27 days ago

    Thiruvenkata,

    First of all, there's a mistake throughout that article (it's an article rather than a RAK, so I couldn't find it initially as I was looking in the wrong place). It uses:

    pcDefinePCell(

      list(ddGetObj(lib) cellName "layout")
      list(
        (w "float" cdf->w->defValue)
        (l "float" cdf->l->defValue)
        (layer "string" cdf->layer->defValue)
      ) ;parameters
      let((cv)

      ;body

      );let

    );pcDefinePCell

    The list should not be present in the formal argument list. It should just be open and close parentheses. SKILL Lint actually reports it as an error (it sees the list as a parameter which is not properly defined). So remove that. I'll request that the article is updated to correct this.

    Newer IC versions correctly handle the use of the cdf variable in a let and don't complain with this code:

    let((cdf lib cellName)
      lib="mylib"
      cellName="testforumpc"
      cdf=cdfGetBaseCellCDF(ddGetObj(lib cellName))
    
      pcDefinePCell(
    
        list(ddGetObj(lib) cellName "layout")
          (
            (w "float" cdf->w->defValue)
            (l "float" cdf->l->defValue)
            (layer "string" cdf->layer->defValue)
          ) ;parameters
        let(((cv pcCellView))
    
          dbCreateRect(cv layer list(0:0 w:l))
    
        );let
    
      );pcDefinePCell
    
    )

    I tracked down the change, and this was fixed in IC6.1.8-64b.500.30 (aka ISR30).

    In the version you're using, click on the Options icon - top right of the Lint Manager assistant in the IDE - and set cdf in the Global Variables. That will stop it complaining. It's not actually global, but the SKILL Lint rule for pcDefinePCell was not written at that stage to correctly handle expressions in the value part of a parameter definition.

    Regards,

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • thiruvenkata
    thiruvenkata 26 days ago in reply to Andrew Beckett

    Thanks Andrew,

    As a follow-up, are the variables lib, cell, and cdf defined outside pcDefinePCell saved in the data.dm file? How does the PCell retrieve the cdf variable values each time without requiring the source code to be loaded in every session? Could the variables be saved in data.dm file?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • thiruvenkata
    thiruvenkata 26 days ago in reply to Andrew Beckett

    Thanks Andrew,

    As a follow-up, are the variables lib, cell, and cdf defined outside pcDefinePCell saved in the data.dm file? How does the PCell retrieve the cdf variable values each time without requiring the source code to be loaded in every session? Could the variables be saved in data.dm file?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett 26 days ago in reply to thiruvenkata

    No, nothing is saved in the data.dm (not sure why you mention that - nothing to do with the PCell is saved in the data.dm). The lib/cell/cdf variables are only accessible in the first argument and second argument of pcDefinePCell (i.e. the cellView description and the formal parameters); they cannot be referred to in the body of the pcDefinePCell - that is evaluated each time a variant is constructed.

    Why would you need them to be saved in the data.dm? Within the body you know the lib and cell - it's pcCellView~>libName and pcCellView~>cellName - and if you need to get the base CDF (not sure why you'd want this - it's generally not a good idea) - you could use cdfGetCellCDF or cdfGetBaseCellCDF within the PCell code to find it again.

    Andrew 

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • thiruvenkata
    thiruvenkata 26 days ago in reply to Andrew Beckett

    Thank you, Andrew, for the clarification. I realize now that I misunderstood how this works.

    I was under the impression that an expression like cdf->layer1->defValue remained dynamically linked and was re-evaluated every time a PCell instance was created. I now understand that pcDefinePCell evaluates that expression immediately when the SKILL file is loaded, and the resulting value is stored as the default parameter value in the PCell master. In that sense, cdf is only used temporarily during that initial evaluation.

    I also mistakenly assumed that the compiled PCell code itself was stored in the data.dm file, which is why I brought up data.dm earlier. That was my misunderstanding.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 26 days ago in reply to thiruvenkata
    thiruvenkata said:
    I also mistakenly assumed that the compiled PCell code itself was stored in the data.dm file, which is why I brought up data.dm earlier. That was my misunderstanding.

    Ah, that clarifies why you asked. The PCell code is actually stored in the cellView itself (i.e. in the layout, schematic or symbol database).

    Andrew

    • Cancel
    • Vote Up +1 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.

© 2026 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information