• 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 skill for beginners

Stats

  • Locked Locked
  • Replies 21
  • Subscribers 148
  • Views 31799
  • 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 skill for beginners

stuso
stuso over 16 years ago

Hi,

i'd like some advice for creating my first simple pCell from skill. I have no skill experience so i'm looking for a good place to start.

My ultimate aim (for now) is to create a rectangular via array with X and Y stretch handles. For example you have M1->M4(the top & bottom layers would be parameters) that you can stretch in X or Y and it fills with the max vias allowed by spacing rules. However to begin with i'd be happy to create a parameterised rectangle of M1 that i can stretch in one direction & take it from there.

Pointers to on-line tutorials and very simple examples would be great, right now i am blindly searching around source-link.

Thanks

Stu

  • Cancel
  • skillUser
    skillUser over 16 years ago

    Oops, I forgot to say that the CDF callback can be used to provide feedback to the user, as well as changing the value, e.g. to clamp it at the minimum or maximum value so that the CDF callback enforces a valid range, as well as perhaps printing a message in the CIW or popping up a dialog box (although the latter tends to annoy users since you have to dismiss it).

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Messi
    Messi over 14 years ago

    Hi,

     I am new in pcell creation.I need help.I wnt code which creates pcell which takes more then 3 layers as its parameters.Also the layer purpose pair i would like to have as "fill".Can anyone help me out.

    Thanks,

     Messi

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • NewStudent
    NewStudent over 14 years ago

    I am  new to skill.I am trying to use your program to draw metal rectangle and labels.What command should I give in CIW window .I tried CCScreateBoxAndLabels( 1 0.6 1) its complaning about dnn being database object ?? I scanned through the sklanguser manual but could not get the answere.

     

    Thanks.

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

    The precise error message would have been:


    CCScreateBoxAndLabels( 1 0.6 1) *Error* CCScreateBoxAndLabels: argument #1 should be a database object (type template = "dnn") - 1

    The "dnn" is the argument to the function definition which adds type-checking. It is checking that the first argument is a database object, and the next two are numbers.

    I'm not sure why you passed 1 as the first argument, that makes no sense. It is expecting a cellView id, as returned by geGetEditCellView() (if you have a layout window open), or from dbOpenCellViewByType("mylib" "mycell" "layout" "maskLayout" "a")

    So for example:

    cv=geGetEditCellView()
    CCScreateBoxAndLabels(cv 0.6 1)

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • NewStudent
    NewStudent over 14 years ago

    Thanks Andrew. I started with top-down approach with skill rather then bottom-up.I thought it was easier way for me to learn skill coding.

    What I mean by that is :I have written skill code that can generate array and labels from already layed out cell.

    I had few questions regarding this :

    Is there any way I can generate skill code from layout I have? I had this question because I wanted generic way for generating text from lower level layout cells on top level cells.

    Eg : If I have x cell which has 10 - y cells arrayed.I want labels from y cells to be replicated at x level with _1,_2,_3 .

    I know and I already did skill code for this but I need a standard way ( single code) that can do it for any cell array I want .This without hardcoding the labels and pins in my skill script.

    For this reason wanted to check if there is some way I can generate skill code from layout of lower level.This way I can make my standard skill code point to  skill code generated from layout to pass on the pins labels etc. 

    I am really struggling over making standard code for all the array combinations without having hard coded labels or pins.Please suggest me if you have any other better way or idea regarding this.

     

    Thanks,

    Sapna. 

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • satishbabub
    satishbabub over 12 years ago

    Hello Lawrence ,

    I would really appreciate if you could take a look at the following code and the errors im getting .

    ; ------------------------------------------------------------------------------

    ; -- Init

    ; ------------------------------------------------------------------------------

    (define (jfet_fno_SKILL p_libname p_cellname) ; (pcDefinePCell

        (list

          (ddGetObj (eval p_libname) (eval p_cellname)) "layout"

        )

       

    ; ------------------------------------------------------------------------------

    ; -- Params

    ; ------------------------------------------------------------------------------

        (

          (W         float       10.0)

          (L          float       10.0)

          (PWpb       float  -0.20)

          (PDNpb            float   0.0)

          (PDPtop           boolean t)

          (PDPext           boolean t)

          (PDNcover   boolean t)

          (CELLHtop   boolean t)

         

        )

     

    ; ------------------------------------------------------------------------------

    ; -- Main

    ; ------------------------------------------------------------------------------

        (let

          (pcMember pcStretchGroup

              stretchOffsetX stretchOffsetY pcLib pcMaster pcInst

              pcTerm pcPin pcPinName pcNet pcTermNet

              pcNetName pcTermNetName pcMosaicInst tpcParameters pcParamProp

              pcStep pcStepX pcStepY pcRepeat pcRepeatX

              pcRepeatY pcIndexX pcIndexY pcLayer pcPurpose

              pcLabelText pcLabelHeight pcPropText pcParamText pcCoords

              pcPathWidth pcPolygonMargin

          )

          (setq pcLib

              (getSGq pcCellView lib)

          )

          (setq pcParameters

              (getSGq

                (getSGq pcCellView parameters) value

              )

          )

         

          (dbReplaceProp pcCellView "viewSubType" "string" "maskLayoutParamCell")

     

    ; -- Init layer names ----------------------------------------------------------

     

          lay_DIFF    = techGetLP(pcLib `("diff"   "drawing"))~>number

          lay_HV            = techGetLP(pcLib `("diff"   "hv"     ))~>number

          lay_POLY    = techGetLP(pcLib `("poly"   "drawing"))~>number

          lay_PWELL   = techGetLP(pcLib `("pwell"  "drawing"))~>number

          lay_NWELL   = techGetLP(pcLib `("nwell"  "drawing"))~>number

          lay_PDN           = techGetLP(pcLib `("nps"    "drawing"))~>number

          lay_PDP           = techGetLP(pcLib `("pps"    "drawing"))~>number

          lay_NSDM    = techGetLP(pcLib `("nsdm"   "drawing"))~>number

          lay_CELLM   = techGetLP(pcLib `("cellm"  "drawing"))~>number

          lay_CELLTX  = techGetLP(pcLib `("celltx" "drawing"))~>number

          lay_CELLH   = techGetLP(pcLib `("cellh"  "drawing"))~>number

          lay_CELLRS  = techGetLP(pcLib `("cellrs" "drawing"))~>number

          lay_CIRPO   = techGetLP(pcLib `("cirpo"  "drawing"))~>number

     

          lay_PIXID   = techGetLP(pcLib `("areaid" "pixel"))    ~>number

     

          lay_M1            = techGetLP(pcLib `("met1"   "drawing"))~>number

          lay_TEXT    = techGetLP(pcLib `("text"   "drawing"))~>number

     

    ; -- Defaults ------------------------------------------------------------------

     

          tech_lib          = "ts018c0702tc_dv"

          Wmax              = 20.0

          Lmax              = 20.0

          cor_size          = 0.15

         

          ref_x             =  0.0

          ref_y             = -L/2

     

    ; -- Init suncells -------------------------------------------------------------

     

          (setq pcMaster_DFM1 (dbOpenCellViewByType tech_lib "DFM1" "symbolic" "maskLayout"))

          (setq pcMaster_TPM1 (dbOpenCellViewByType tech_lib "TPM1" "symbolic" "maskLayout"))

         

         

    ; -- Metal 1 connection --------------------------------------------------------

         

          (setq pcInst

              (dbCreatePolygon pcCellView

                (list lay_M1 "drawing")

                (list

                    (range  ref_x+1.0                           ref_y+2.4+L)

                    (range  ref_x-1.0                           ref_y+2.4+L)

                    (range  ref_x-1.0                           10)

                    (range  ref_x+1.0                           10)

                )

              )

          )

     

          (setq pcInst

              (dbCreatePolygon pcCellView

                (list lay_M1 "drawing")

                (list

                    (range  ref_x+1.0                           ref_y-2.4)

                    (range  ref_x-1.0                           ref_y-2.4)

                    (range  ref_x-1.0                           -10)

                    (range  ref_x+1.0                           -10)

                )

              )

          )

         

    ; -- Contacts ------------------------------------------------------------------

         

          (numb_of_cont   = (round (Wmax/0.47))-1)

         

          (cell_coord     = (range ref_x-numb_of_cont/2.0*0.47 ref_y-2.5))

          (dbCreateParamInst pcCellView pcMaster_DFM1 nil cell_coord "R0" 1  list(

                      list( "column" "integer" numb_of_cont)

          )) 

     

          (cell_coord     = (range ref_x-numb_of_cont/2.0*0.47 ref_y+2.5+L))

          (dbCreateParamInst pcCellView pcMaster_DFM1 nil cell_coord "MX" 1  list(

                      list( "column" "integer" numb_of_cont)

          )) 

     

    ; -- Tap -----------------------------------------------------------------------

         

          (numb_of_cont   = (round ((Lmax+5)/0.47))-1)

         

          (cell_coord     = (range ref_x-(Wmax/2.0+4.0) -Lmax/2-2.5))

          (dbCreateParamInst pcCellView pcMaster_TPM1 nil cell_coord "R0" 1  list(

                      list( "row" "integer" numb_of_cont)

          )) 

     

          (cell_coord     = (range ref_x+(Wmax/2.0+34.0) -Lmax/2-2.5))

          (dbCreateParamInst pcCellView pcMaster_TPM1 nil cell_coord "R0" 1  list(

                      list( "row" "integer" numb_of_cont)

          )) 

     

         

    ; -- Diff ----------------------------------------------------------------------

     

          if((equal PDPext nil)

          then

          ; -- Do not ADD PDP extentions

                PDPext_diff = 0.0

          else

          ; -- ADD PDP extentions

                PDPext_diff = 1.3

          )

     

          (setq pcInst

              (dbCreatePolygon pcCellView

                (list lay_DIFF "drawing")

                (list

                    (range  ref_x+W/2.0                         ref_y+cor_size)

                    (range  ref_x+W/2.0+cor_size                ref_y+0.0)

                    (range  ref_x+Wmax/2.0+PDPext_diff          ref_y+0.0)

                    (range  ref_x+Wmax/2.0+PDPext_diff          ref_y-1.0)

                    (range  ref_x+Wmax/2.0                      ref_y-1.0)

                    (range  ref_x+Wmax/2.0                      ref_y-2.5)

     

                    (range  ref_x-Wmax/2.0                      ref_y-2.5)

                    (range  ref_x-Wmax/2.0                      ref_y-1.0)

                    (range  ref_x-Wmax/2.0-PDPext_diff          ref_y-1.0)

                    (range  ref_x-Wmax/2.0-PDPext_diff          ref_y+0.0)

                    (range  ref_x-W/2.0-cor_size                ref_y+0.0)

                    (range  ref_x-W/2.0                         ref_y+cor_size)

                   

                    (range  ref_x-W/2.0                         ref_y+0.0+L-cor_size)

                    (range  ref_x-W/2.0-cor_size                ref_y+0.0+L)

                    (range  ref_x-Wmax/2.0-PDPext_diff          ref_y+0.0+L)

                    (range  ref_x-Wmax/2.0-PDPext_diff          ref_y+1.0+L)

                    (range  ref_x-Wmax/2.0                      ref_y+1.0+L)

                    (range  ref_x-Wmax/2.0                      ref_y+2.5+L)

     

                    (range  ref_x+Wmax/2.0                      ref_y+2.5+L)

                    (range  ref_x+Wmax/2.0               ref_y+1.0+L)

                    (range  ref_x+Wmax/2.0+PDPext_diff          ref_y+1.0+L)

                    (range  ref_x+Wmax/2.0+PDPext_diff          ref_y+0.0+L)

                    (range  ref_x+W/2.0+cor_size                ref_y+0.0+L)

                    (range  ref_x+W/2.0                         ref_y+0.0+L-cor_size)

                   

                )

              )

          )

         

         

    ; -- PWELL ----------------------------------------------------------------------

      

          (setq pcInst

              (dbCreatePolygon pcCellView

                (list lay_PWELL "drawing")

                (list

     

                    (range  ref_x+PWpb+W/2.0              ref_y+PWpb+cor_size)

                    (range  40.0                                ref_y+PWpb+cor_size)

                    (range  40.0                                0.0-40.0)

                    (range  40.0                          0.0+40.0)

                    (range  -40.0                               0.0+40.0)

                    (range  -40.0                               0.0-40.0)

                    (range  40.0                                0.0-40.0)

                    (range  40.0                                ref_y+PWpb+cor_size)

     

                    (range  ref_x+PWpb+W/2.0                    ref_y+PWpb+cor_size)

                    (range  ref_x+PWpb+W/2.0+cor_size           ref_y+PWpb+0.0)

                    (range  ref_x+PWpb+Wmax/2.0           ref_y+PWpb+0.0)

                    (range  ref_x+PWpb+Wmax/2.0                       ref_y-PWpb-2.5)

     

                    (range  ref_x-PWpb-Wmax/2.0                 ref_y-PWpb-2.5)

                    (range  ref_x-PWpb-Wmax/2.0                 ref_y+PWpb+0.0)

                    (range  ref_x-PWpb-W/2.0-cor_size           ref_y+PWpb+0.0)

                    (range  ref_x-PWpb-W/2.0                  ref_y+PWpb+cor_size)

                   

                    (range  ref_x-PWpb-W/2.0                    ref_y-PWpb+0.0+L-cor_size)

                    (range  ref_x-PWpb-W/2.0-cor_size           ref_y-PWpb+0.0+L)

                    (range  ref_x-PWpb-Wmax/2.0          ref_y-PWpb+0.0+L)

                    (range  ref_x-PWpb-Wmax/2.0                 ref_y+PWpb+2.5+L)

     

                    (range  ref_x+PWpb+Wmax/2.0                 ref_y+PWpb+2.5+L)

                    (range  ref_x+PWpb+Wmax/2.0                       ref_y-PWpb+0.0+L)

                    (range  ref_x+PWpb+W/2.0+cor_size           ref_y-PWpb+0.0+L)

                    (range  ref_x+PWpb+W/2.0                    ref_y-PWpb+0.0+L-cor_size)

                   

                )

              )

          )

     

    ; -- PDN ----------------------------------------------------------------------

         

          if((equal PDNcover t)

          then

          (setq pcInst

              (dbCreatePolygon pcCellView

                (list lay_PDN "drawing")

                (list

                    (range  ref_x+Wmax/2.0+0.3                  ref_y-2.5-0.3)

                    (range  ref_x-Wmax/2.0-0.3                  ref_y-2.5-0.3)

                    (range  ref_x-Wmax/2.0-0.3                  ref_y+2.5+0.3+L)

                    (range  ref_x+Wmax/2.0+0.3                  ref_y+2.5+0.3+L)

                )

              )

          )

          else

          (setq pcInst

              (dbCreatePolygon pcCellView

                (list lay_PDN "drawing")

                (list

     

                    (range  ref_x+PDNpb+W/2.0                   ref_y+PDNpb+cor_size)

                    (range  ref_x+PDNpb+W/2.0+cor_size          ref_y+PDNpb+0.0)

                    (range  ref_x+PDNpb+Wmax/2.0          ref_y+PDNpb+0.0)

                    (range  ref_x+PDNpb+Wmax/2.0          ref_y-PDNpb-2.5)

     

                    (range  ref_x-PDNpb-Wmax/2.0                ref_y-PDNpb-2.5)

                    (range  ref_x-PDNpb-Wmax/2.0                ref_y+PDNpb+0.0)

                    (range  ref_x-PDNpb-W/2.0-cor_size          ref_y+PDNpb+0.0)

                    (range  ref_x-PDNpb-W/2.0                 ref_y+PDNpb+cor_size)

                   

                    (range  ref_x-PDNpb-W/2.0                   ref_y-PDNpb+0.0+L-cor_size)

                    (range  ref_x-PDNpb-W/2.0-cor_size          ref_y-PDNpb+0.0+L)

                    (range  ref_x-PDNpb-Wmax/2.0                ref_y-PDNpb+0.0+L)

                    (range  ref_x-PDNpb-Wmax/2.0                ref_y+PDNpb+2.5+L)

     

                    (range  ref_x+PDNpb+Wmax/2.0          ref_y+PDNpb+2.5+L)

                    (range  ref_x+PDNpb+Wmax/2.0          ref_y-PDNpb+0.0+L)

                    (range  ref_x+PDNpb+W/2.0+cor_size          ref_y-PDNpb+0.0+L)

                    (range  ref_x+PDNpb+W/2.0                   ref_y-PDNpb+0.0+L-cor_size)

                   

                )

              )

          )

          )

     

         

    ; -- PDP ----------------------------------------------------------------------

      

          if((equal PDPtop t)

          then

          (setq pcInst

              (dbCreatePolygon pcCellView

                (list lay_PDP "drawing")

                (list

                    (range  ref_x+Wmax/2.0+0.3+PDPext_diff      ref_y-1.0-0.3)

                    (range  ref_x-Wmax/2.0-0.3-PDPext_diff      ref_y-1.0-0.3)

                    (range  ref_x-Wmax/2.0-0.3-PDPext_diff      ref_y+1.0+0.3+L)

                    (range  ref_x+Wmax/2.0+0.3+PDPext_diff      ref_y+1.0+0.3+L)

                )

              )

          )

          )

     

    ; -- CELLH ----------------------------------------------------------------------

      

          if((equal CELLHtop t)

          then

          (setq pcInst

              (dbCreatePolygon pcCellView

                (list lay_CELLH "drawing")

                (list

                    (range  ref_x+Wmax/2.0+0.3+PDPext_diff+0.15 ref_y-1.0-0.3-0.15)

                    (range  ref_x-Wmax/2.0-0.3-PDPext_diff-0.15 ref_y-1.0-0.3-0.15)

                    (range  ref_x-Wmax/2.0-0.3-PDPext_diff-0.15 ref_y+1.0+0.3+L+0.15)

                    (range  ref_x+Wmax/2.0+0.3+PDPext_diff+0.15 ref_y+1.0+0.3+L+0.15)

                )

              )

          )

          )

     

    ; -- DIFF HV ----------------------------------------------------------------------

      

          (setq pcInst

              (dbCreatePolygon pcCellView

                (list lay_DIFF "hv")

                (list

     

                    (range  40.0                                -40.0)

                    (range  40.0                           40.0)

                    (range  -40.0                                40.0)

                    (range  -40.0                               -40.0)

     

                )

              )

          )    

     

    ; -- CELLM ----------------------------------------------------------------------

      

          (setq pcInst

              (dbCreatePolygon pcCellView

                (list lay_CELLM "drawing")

                (list

     

                    (range  40.0                                -40.0)

                    (range  40.0                           40.0)

                    (range  -40.0                                40.0)

                    (range  -40.0                               -40.0)

     

                )

              )

          )

     

    ; -- CIRPO ----------------------------------------------------------------------

      

          (setq pcInst

              (dbCreatePolygon pcCellView

                (list lay_CIRPO "drawing")

                (list

     

                    (range   40.3                               -40.3)

                    (range   40.3                                40.3)

                    (range  -40.3                                40.3)

                    (range  -40.3                               -40.3)

     

                )

              )

          )

     

    ; -- AREAID PIX ----------------------------------------------------------------------

      

          (setq pcInst

              (dbCreatePolygon pcCellView

                (list lay_PIXID "pixel")

                (list

     

                    (range  40.0                                -40.0)

                    (range  40.0                           40.0)

                    (range  -40.0                                40.0)

                    (range  -40.0                               -40.0)

     

                )

              )

          )

      

    ; -- label ----------------------------------------------------------------------

     

          (cell_coord     = (range ref_x ref_y))

          (dbCreateLabel pcCellView lay_TEXT cell_coord

                (sprintf nil "W=%.3f\nL=%.3f\nPWpb=%.3f\nPDNpb=%.3f\nPDPtop=%L\nPDPext=%L\nPDNcover=%L\nCELLHtop=%L"

                W L PWpb PDNpb PDPtop PDPext PDNcover CELLHtop  )

                "lowerLeft" "R0" "stick" 1)

         

    ; ------------------------------------------------------------------------------

    )

    )

    )

    I tried to load the skill code using

    load("/home/fg3z7q/Desktop/jfet_fno_SKILL.il")

    function jfet_fno_SKILL redefined

    t

    and when i call the function

    jfet_fno_SKILL "fno_ts018_etest" "jfet_fno_SKILL"

    it gives a waring stating that

    *WARNING* Invalid libId - dd:0x19a9bad4

    *WARNING* Invalid view name - nil

    nil

    Here I created a library named fno_ts018_etest and cell view named jfet_fno_SKILL before loading the skill.

    Im a beginer and I appreciate any sort of help regarding this

    Thanks,

    Satish

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

    There's a lot of code to try out there to debug this - I took a quick look, but it would be far easier to try it out as is - without your technology file, I'd have to go through and change all the layer/purpose names to something I have.

    So, can you either post the technology file, or if it's not yours to post, can you say which Foundry PDK you're using?

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ztzg
    ztzg over 12 years ago
    Hello Satishbabub,

    One thing I noticed is that you commented the pcDefinePCell form to
    replace it with a (define (jfet... ) ...) procedure.

    That is not a bad idea, but is not sufficient; pcDefinePCell has
    "special" evaluation semantics.

    In the code you posted, (list (ddGetObj ...)) won't cause pcCellView to
    be bound in the body. Similarly, the second argument of pcDefinePCell
    is a list of parameters, and cannot be evaluated as a normal expression.

    You should be able to fix that by adding another let() binding with
    "fake" pcell variables around the body. Have a look at the (UNTESTED!)
    solution in the attached file, or http://s.crosstwine.com/spb/05622ef3.

    Cheers, -D


    satishbabub writes:
    > Hello Lawrence ,
    >
    > I would really appreciate if you could take a look at the following code and the errors
    > im getting .
    >
    > ; ------------------------------------------------------------------------------
    > ; -- Init
    > ; ---------------------------------------------------------------------------
    >
    > (define (jfet_fno_SKILL p_libname p_cellname) ; (pcDefinePCell
    jfet-fno.il
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • AdiBharati
    AdiBharati over 12 years ago

     Thank you so much..

    That did help a lot.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • newbee
    newbee over 11 years ago

    I   try  this, but get  the  following  error  message.

    load("/users/bg027204/CADENCE_SKILL/CCSencapRodPcell.il")
    function CCScreateBoxAndLabels redefined
    *WARNING* Invalid libId - nil
    *WARNING* (DB-270205): dbOpenCellViewByType: must specify either a libName or a contextId.
    t

    • 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