• 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. Question on Skill Code for Cadence Official MOS PCell

Stats

  • Replies 9
  • Subscribers 149
  • Views 705
  • Members are here 0

Question on Skill Code for Cadence Official MOS PCell

SZ20260803361
SZ20260803361 18 days ago

Hi,

Cadence provided us with the Skill code for the MOS PCell. I've been learning it and ran into some issues, so I'd appreciate your help. Thanks.

Known information (from Cadence official):

;;substrateContact? specifies whether contacts are necessary or not on the
;; source and drain of the transistor, and then creates it.

;;leftContact? the left side of the transistor be it the source or
;; drain

;;rightContact? the right side of the transistor be it the source or
;; drain

;;transistor_length length of the transistor's active area
;; (note: this is a distance measured in the X-direction).
;; (float, default = 1.0)

;; car(substrateRules) = tap diffusion layer.
;; cadr(substrateRules) = tap diffusion contact enclosure.
;; caddr(substrateRules) = tap diffusion to active spacing.
;; cadddr(substrateRules) = tap diffusion to gate poly spacing.
;; car(cddddr(substrateRules)) = tap implant rules.

;;contactWidth the width of the contact layer being used for
;; connections
;; (default = 1.0)

(leftStretch techGetSpacingRule(techGetCurrentTechFile() "minSpacing"
     techParam("poly") techParam("cont")) + techGetSpacingRule(
     techGetCurrentTechFile() "minWidth" techParam("cont")) +
     techGetOrderedSpacingRule(techGetCurrentTechFile() "minEnclosure"
     techParam("ndiff") techParam("cont")) )


(rightStretch techGetSpacingRule(techGetCurrentTechFile() "minSpacing"
     techParam("poly") techParam("cont")) + techGetSpacingRule(
     techGetCurrentTechFile() "minWidth" techParam("cont")) +
     techGetOrderedSpacingRule(techGetCurrentTechFile() "minEnclosure"
     techParam("ndiff") techParam("cont")) )

Code segment with questions (from Cadence official):

;;*************************************************************************
;;
;;The following adjusts the rightStretch to account for the substrateContact
;;---------------------------------------------------------------------
;;
;;*************************************************************************
when( substrateContact? && substrateContact? !="FALSE"
         if( leftContact? && leftContact? != "FALSE" &&
             rightContact? && rightContact? != "FALSE" then
         else
             xtrWidth = leftStretch + transistor_length + rightStretch
             minSubTie = contactWidth + 2 * cadr(substrateRules)
           ; fprintf( stdout "xtrWidth minSubTie %L\n" list(xtrWidth minSubTie) )
             when( xtrWidth < minSubTie
                      rightStretch = rightStretch + minSubTie - xtrWidth
                      )
         )
)

My Questions:

1.The source code uses an if-then-else structure. I believe the correct form should be either if-then or if-else.

2.What is the purpose of this piece of code? Why does it only adjust rightStretch, with no case to adjust leftStretch?

3.I am particularly confused by this line of code:

             when( xtrWidth < minSubTie
                      rightStretch = rightStretch + minSubTie - xtrWidth
                      )

Why do we need to consider the scenario where xtrWidth is smaller than minSubTie? And why is rightStretch calculated as rightStretch + minSubTie - xtrWidth under this condition?

I would appreciate your insights. Thank you.
Steve

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

    As far as I'm aware there's no such thing as a "Cadence Official MOS PCell". I can only assume this is some sample that's been provided (I don't recognise the code and a bit of searching hasn't allowed me to locate it). The reason why there would be no "Official MOS PCell" is that technologies are often different so having a one-size-fits-all would be unlikely...

    I suggest you ask your questions to whomever from Cadence provided you with the sample code.

    There's no problem with having if(condition then then_code else else_code) even if the then_code is empty (it's a bit odd having the then keyword if you don't have any associated code - I'd probably just have used unless instead). For the rest of the questions I couldn't answer without seeing the rest of the code (and even then I'd need to know the intent - hence my suggestion for you to contact the person who provided you with the example).

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • SZ20260803361
    SZ20260803361 18 days ago in reply to Andrew Beckett
    Hi Andrew,

    Thanks a lot for your advice. I don’t know who wrote these sample code files, but I suspect they are located under a path like /eda/cadence/IC618/tools/dfII/samples/ROD/rodPcells/components/mos.

    I find MOS PCells really interesting, yet quite challenging for me. If you happen to have time, feel free to check if this example is available under that path. I would really appreciate it.

    Best regards,

    Steve
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 18 days ago in reply to SZ20260803361

    Steve,

    Thanks for the reference. I've not looked at those samples for many years (I think they were written almost 30 years ago).

    I'll take a look during today and then can hopefully answer your questions having inspected the full code.

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 18 days ago in reply to Andrew Beckett

    OK, I took a look.

    The code is fairly complicated - it contains a whole load of infrastructure to install and configure various devices by adding extra information into your tech file and then installing the devices in the tech library too.

    To set up, you'd use:

    setSkillPath(cons(prependInstallPath("samples/ROD/rodPcells") getSkillPath()))
    load("install/spcLoadInstall.il")

    and then interact with the UI. You have to select the devices you want, choose the appropriate layers to use, and then fill in any missing design rule info that can't already be found in the tech file (sometimes these might be because of table rules).

    The code is not being maintained and it's just a sample - whether you'd want to start from this or not is another matter. I'd probably recommend using PCell Designer instead if you can get access to it  - see this video: Creating a Simple MOSFET with PCell Designer

    To answer your questions:

    1. It's a little unusual, but having an empty then within an if/then/else is OK. It potentially makes it simpler to edit in the then part if you decide you need it later.
    2. The rightStretch and leftStretch parameters are hidden parameters which are then altered by the abutment function when two transistors are abutted. If you've chosen to have the substrate contact enabled at the top/bottom, it may have to adjust the size of the diffusion to allow for these substrate contacts, but it only really needs to do it on one side - and in this case the right side is used.
    3. This is (I think) trying to handle the scenario where the substrate contact protrudes beyond the transistor width (in this case it's the overall width of the device, not the width of the gate). That's where you'd have a problem with the substrate contacts hitting each other otherwise, so more space needs to be allowed.

    Hope that helps!

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • SZ20260803361
    SZ20260803361 17 days ago in reply to Andrew Beckett

    Hi Andrew,

    Thank you so much for taking the time to look into this and give such a detailed explanation!

    Now I understand the big picture: this sample has a complete framework to add device definitions into the tech library. I also get why the code only adjusts rightStretch for substrate tie abutment. That makes sense now.

    I will check out the PCell Designer video you shared.

    Thanks again for your patient help!

    Best regards,
    Steve

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • SZ20260803361
    SZ20260803361 9 days ago in reply to Andrew Beckett

    Hi Andrew,

    I came across a new problem when going over the code and hope to get your input.

    Code segment with questions (from Cadence official):
    ;; Route poly if needed
    when(routePoly && routePoly != "FALSE" && numberOfFingers > 1
         strap_width = ((numberOfFingers - 1) * gatePitch) +
                   transistor_length
         strap_offset = gate_Extension - diffusionGateSpace
         polyfig = rodCreatePath(
            ?cvId cellViewId
            ?layer gateLayer
            ?width minPolyWidth
            ?pts list(0:0 strap_width:0)
            ?termName "G"
            ?pin t
            ?termIOType "input"
         )
         cond(
             ( routePolydir == "Top"
               rodAlign(
                  ?alignObj polyfig
                  ?alignHandle "lowerRight"
                  ?refObj topPin
                  ?refHandle "upperRight"
                  ?ySep -strap_offset
                  )
             )
             ( routePolydir == "Bottom"
               rodAlign(
                  ?alignObj polyfig
                  ?alignHandle "upperRight"
                  ?refObj botPin
                  ?refHandle "lowerRight"
                  ?ySep strap_offset
                  )
             )
         )
         polyfig~>dbId~>pin~>name = "gatePin"
         spcClearGatePins( gatePins )
    )

    My Questions:

    My question: I understand that strap_offset is used to meet DRC requirements. However, if the value of diffusionGateSpace is larger than gate_Extension, wouldn’t that mean polyfig is not placed right next to topPin / botPin? They would be separated by a distance of |strap_offset|. The intended behavior is that all gates (in the multi-finger case) are connected together by polyfig. This is where I’m confused.

    Best regards,
    Steve

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 6 days ago in reply to SZ20260803361

    Yes, that's correct. You'd have seen that if you'd tried it (which is what I did). It's clearly an assumption in the code (trying to cater for every possible scenario is hard, and in most technologies I've seen the gate extension is larger than the poly to diffusion spacing so it probably didn't get caught in testing when this sample was created almost 30 years ago. It is a sample after all - not guaranteed to be perfect.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • SZ20260803361
    SZ20260803361 3 days ago in reply to Andrew Beckett

    I’ve only touched PDK (Skill/PCell) for half a year and haven’t systematically learned process knowledge and Skill coding. So I’m using these PCell codes as my entry point for structured study. Despite some bugs, they let me understand the general framework. Haha, I still need to learn much more about process and Skill.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • SZ20260803361
    SZ20260803361 3 days ago in reply to Andrew Beckett

    I’ve only touched PDK (Skill/PCell) for half a year and haven’t systematically learned process knowledge and Skill coding. So I’m using these PCell codes as my entry point for structured study. Despite some bugs, they let me understand the general framework. Haha, I still need to learn much more about process and Skill.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data

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