• 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 151
  • Views 1075
  • Members are here 0

Question on Skill Code for Cadence Official MOS PCell

SZ20260803361
SZ20260803361 1 month 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 1 month 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 1 month ago in reply to Andrew Beckett
    Hi Andrew,
    Thank you very much for your detailed reply. I mistakenly assumed this was provided by Cadence official. I will refer to it as a "MOS PCell sample code" going forward.
    Unfortunately, I do not know who authored this code, so I am unable to contact the original developer. I will loaded the full code to the thread.(Cadence won’t let me upload .tar or .zip files, so I have to paste the code directly into the post. Sorry it looks messy)
    I am eager to learn how to write PCells for MOS, BJT and other devices using Skill. As you mentioned, technologies are often different. My plan is to learn fundamental PCell implementation from this example first. With continued practice, I hope to eventually build PCells that adapt to different foundry processes.
    However, teaching resources for PCell development are quite limited from what I can find. That is why I am seeking guidance from you and other experts. I hope my questions will not disrupt your work or take up too much of your time.
    Thank you for your contributions to the Cadence Community and for helping me with my questions.
    Best regards,
    Steve
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • SZ20260803361
    SZ20260803361 1 month ago in reply to Andrew Beckett
    Hi Andrew,
    Thank you very much for your detailed reply. I mistakenly assumed this was provided by Cadence official. I will refer to it as a "MOS PCell sample code" going forward.
    Unfortunately, I do not know who authored this code, so I am unable to contact the original developer. I will loaded the full code to the thread.(Cadence won’t let me upload .tar or .zip files, so I have to paste the code directly into the post. Sorry it looks messy)
    I am eager to learn how to write PCells for MOS, BJT and other devices using Skill. As you mentioned, technologies are often different. My plan is to learn fundamental PCell implementation from this example first. With continued practice, I hope to eventually build PCells that adapt to different foundry processes.
    However, teaching resources for PCell development are quite limited from what I can find. That is why I am seeking guidance from you and other experts. I hope my questions will not disrupt your work or take up too much of your time.
    Thank you for your contributions to the Cadence Community and for helping me with my questions.
    Best regards,
    Steve
    • 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