• 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. how to Add M1 drawing on pcell,only for mos?

Stats

  • Replies 4
  • Subscribers 142
  • Views 753
  • Members are here 0

how to Add M1 drawing on pcell,only for mos?

FormerMember
FormerMember 5 months ago
This is the code I wrote to add a layer of M1 on the pcell, and the M1 package hole is 0.005, which meets the requirements of DRC.
But now this code will handle all instances and mosaics, such as resistors, capacitors, BJTs, etc. This is not the result I wanted. Can you help me modify it? It only needs to be processed for MOS. Thank you
procedure(AddMosM1()
let((cv objs metal1 temp shapes x y ux uy xy row column transform
M1_width)
M1_width = 0.11
cv = geGetEditCellView()
objs = geGetSelSet()
foreach(obj objs
transform = nil
if(obj~>objType == "inst" then transform = list(obj~>transform))
if(obj~>objType == "mosaic" then
x = xCoord(obj~>xy)
y = yCoord(obj~>xy)
ux = obj~>uX
uy = obj~>uY
row = obj~>rows
column = obj~>columns
for(a 0 row-1
for(b 0 column-1
case(car(obj~>tileArray)
("R0" xy = list(x+b*ux : y+a*uy))
("MXR90" xy = list(x+a*ux : y+b*uy))
("R90" xy = list(x-a*ux : y+b*uy))
("MY" xy = list(x-b*ux : y+a*uy))
("R0" xy = list(x+a*ux : y-b*uy))
("MXR90" xy = list(x+b*ux : y-a*uy))
("R0" xy = list(x-b*ux : y-a*uy))
("MXR90" xy = list(x-a*ux : y-b*uy))
) ;end case
transform = append1(transform list(car(xy) car(obj~>tileArray) 1.0))
) ;end for
) ;end for
) ;end if
shapes = obj~>master~>shapes
foreach(shape shapes
if(car(shape~>lpp) == "M1" && cadr(shape~>lpp) == "drawing" then
foreach(trans transform
metal1 = dbCopyFig(shape cv trans)
temp = leConvertPolygonToPath(metal1)
temp~>width = M1_width
) ;foreach trans
) ;if M1
) ;foreach shape
) ;foreach obj
) ;let
) ;procedure
hiSetBindKey("Layout" "ctrl<Key>v" "AddMosM1()")
  • Sign in to reply
  • Cancel
  • Andrew Beckett
    Andrew Beckett 5 months ago

    The code is hard to read because of the lack of indentation, and also it's not quite clear what your intent is, but presumably you just need to add a condition around the:

    if(obj~>objType == "inst" then transform = list(obj~>transform))
    if(obj~>objType == "mosaic" then
     
    part to check that obj~>libName and obj~>cellName correspond to one of the MOS devices you care about. Then you'd only be collecting the transforms for the relevant devices?
    Andrew
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • FormerMember
    FormerMember 5 months ago in reply to Andrew Beckett

    For example, I need to handle several names of MOS, pch3v,pch5v,nch5v,nch3v。
    So how to modify this code?
    need to create a list?

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

    when(obj~>libName=="yourPDK" && member(obj~>cellName '("pch3v" "pch5v" "nch5v" "nch3v"))
      ...
    )

    or you could use a regular expression:

    when(obj~>libName=="yourPDK" && pcreMatchp("^[pn]ch" obj~>cellName)
      ...
    )

    Andrew

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

    thank you very much,best wishes.

    I try it right now.

    • 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