• 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. Loading Pcell into virtuoso

Stats

  • Replies 5
  • Subscribers 143
  • Views 2257
  • Members are here 0

Loading Pcell into virtuoso

AE202502048334
AE202502048334 5 months ago

I have created a PCell for metal tracks using skill.

The code relies on a having a created cell with a specific name and library so it can generate the shapes inside it and I checked in this view.

I have string / float inputs to control metal tracks number and widths, also switches to control the appearing or disappearing of some layers (cut layers for poly and MD).

When I first load the code it works very well no issues and create my pcell just fine and the switches and inputs work. I instantiated it in a layout view called "test".

The issue

when I restart virtuoso, the "test" view gives me pcell evaluation failed as it needs to load the script every time, so I added the "load script line" in libinit.il file of the library containing the pcell view, now each time I reload virtuoso it prompts me to check out the pcell view and I choose "NO", now I open the "test" view to find only the metal tracks shapes are there but all other shapes are not there (all these shapes rely on the ON/OFF switches that I have in my pcell)

The code controlling these shapes are if statements and logic written inside pcell main body (I don't use callbacks)

I believe this behavior is normal as I redefine the cell each time I open virtuoso so it sort of resets all my switch values, The question here how to avoid the "pcell evaluation failed" message, or what is the right part of code to have it written in libinit.il file to define my pcell without rerunning the code again and resetting everything.

Thanks in advance

  • Sign in to reply
  • Cancel
  • Andrew Beckett
    Andrew Beckett 5 months ago

    You should not call pcDefinePCell from within the libInit.il . You would however need to define any custom functions used within the pcDefinePCell because otherwise those will not be available. I suggest (if it's all in one file) doing something like this:

    procedure(MyAuxilliaryFunc(x y z)
      ; do something
    )

    procedure(MyDefinePCell()
      pcDefinePCell(
        list(ddGetObj("libName") "cellName" "layout")
        ; formal params
        (
          ...
        )
        ; body of the PCell - does the work and probably
        ; calls your other custom functions
        MyAuxilliaryFunc(e f g)
     )
    )

    Loading all this would be fine. You only then need to define the PCell once, by calling MyDefinePCell() - the code in the body of the pcDefinePCell will be stored in the layout view  (or whatever view you're creating) and does not need to be defined again. The auxiliary functions will be loaded each time by virtue of the libInit.il

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • AE202502048334
    AE202502048334 5 months ago in reply to Andrew Beckett

    Thank you Andrew, Will apply this structure

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • AE202502048334
    AE202502048334 5 months ago in reply to Andrew Beckett

    Hi Andrew,

    I wanted to make sure of my understanding as now I have the Pcell evaluation issue.

    My main Pcell code which I load in CIW is just load 5 files as follows:

    ;Defining Global Parameters
    load("Global_Parameters.il")
    ; Defining CDF Parameters
    load("CDF_Parameters.il")
    ; Defining PCELL Default Variables Definitions
    load("PCELL_Default_Variable.il")
    ; Defining Routing PCELL
    load("Routing_PCELL.il")
    ; Defining Custom Procedures
    load("Procedures.il")

    Global_Parameters.il is just some fixed values

    The main focus here will be on Routing_PCELL.il, Procedures.il & CDF_Parameters.il.
    here I have a small sample of the code:


    Routing_PCELL.il is as follows:

    ___________________Pcell Definition Section__________________
    pcDefinePCell(
    ; Cell Identifier
    cellIdentifier
    ;Formal Arguments : Default-Values
    (
    (fingers default_fingers)
    (polyPitch default_PolyPitch)
    (cellHight default_cellHight)

    )

    ; Main
    let(()

    createPR()

    );end of let function
    );end of pcell definition function


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

    Procedures.il is as follows:

    procedure(createPR()
    fingers = cdfgData~>fingers~>value
    polyPitch = cdfgData~>polyPitch~>value
    cellHight = cdfgData~>cellHight~>value

    rodCreateRect(
    ?layer list("prBoundary" "boundary")
    ?width fingers*polyPitch
    ?length cellHight
    ?origin list(0 0)
    )
    )


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


    CDF_Parameters.il is as follows:

    let( (cellId cdfId)
    when(cellId = ddGetObj("M0_PCELL_v2" "M0_PCELL_v2")
    when(cdfId = cdfGetBaseCellCDF(cellId)
    cdfDeleteCDF(cdfId)
    )
    cdfId = cdfCreateBaseCellCDF(cellId)
    )

    ________________________________________Poly Pitch________________________________________
    cdfCreateParam( cdfId
    ?name "polyPitch"
    ?prompt "Poly Pitch"
    ?defValue 0.048
    ?type "float"
    )

    ________________________________________Cell Height________________________________________
    cdfCreateParam( cdfId
    ?name "cellHight"
    ?prompt "Cell Height"
    ?defValue 0.208
    ?type "float"
    )

    ________________________________________Number of Fingers__________________________________
    cdfCreateParam( cdfId
    ?name "fingers"
    ?prompt "Number of fingers"
    ?defValue 1
    ?type int
    )
    )

    Regarding libInit.il file I have loaded ("Procedures.il") inside it

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 5 months ago in reply to AE202502048334

    OK, first of all, you should not load CDF_Parameters.il or Routing_PCELL.il from the libInit.il. I'm not sure what's in Global_Parameters.il or PCELL_Default_Variable.il - maybe these are needed to be loaded too?

    In addition, the code in Procedures.il is not going to work. Rather than taking the Pcell parameters directly, it is getting them from cdfgData. That won't work - it might work whilst you are instantiating, but won't work if you re-open the design. cdfgData is only set during the create instance or edit properties form, and is the wrong way to communicate to the PCell code. Instead, your function should be something like:

    procedure(createPR(fingers polyPitch cellHight)
    ;  fingers = cdfgData~>fingers~>value
    ;  polyPitch = cdfgData~>polyPitch~>value
    ;  cellHight = cdfgData~>cellHight~>value

      rodCreateRect(
        ?layer list("prBoundary" "boundary")
        ?width fingers = fingers*polyPitch
        ?length cellHight
        ?origin list(0 0)
      )
    )

    and then in the PCell definition code you should have:

    pcDefinePCell(
      ; Cell Identifier
      cellIdentifier
      ;Formal Arguments : Default-Values
      (
        (fingers default_fingers)
        (polyPitch default_PolyPitch)
        (cellHight default_cellHight)
      )

      ; Main
      let(()

        createPR(fingers polyPitch cellHight)

      );end of let function
    );end of pcell definition function

    In other words, pass the variables from your PCell into your construction function. The CDF is just a means of causing the parameters to be set on the instance, and to control what the form looks like - the PCell code should not be trying to refer to the CDF.

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • AE202502048334
    AE202502048334 5 months ago in reply to Andrew Beckett

    Hi Andrew, 

    Thank you so much for your continuous support.

    Maybe for a future reference for anyone, I was using check box switch and trying to pass it's value to the my construction functions but it was a big issue, now I used radio button and the structure you guided me to, and it's working fine.

    Thank you so much andrew.

    Regards.

    Ali 

    • 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