• 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 1
  • Subscribers 149
  • Views 23
  • Members are here 0

Question on Skill Code for Cadence Official MOS PCell

SZ20260803361
SZ20260803361 2 hours 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 hour 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
Reply
  • Andrew Beckett
    Andrew Beckett 1 hour 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
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