• 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 write more efficient skill code for PCell?

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 14787
  • 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

How to write more efficient skill code for PCell?

richardyuan
richardyuan over 11 years ago

I wrote a PCell program for a MEMS project recently. The code imitates virtuoso automatic generated PCell program. It looks lengthy and run very slowly.

How can i make it more effective? 

1. How to retrieve PCell parameters more simply. Here is my let paragraph, looks ugly:

    let((p1_d1 p1_r2 p1_r3 v1_r p1_leaf_style p1_leaf_l p1_leaf_w p1_leaf_hd 

p1_notch_w p1_slot_angle p1_slot_ir p1_slot_or p1_slot p2_notch_angle

p2_notch_ir p2_notch_or p2_notch ang ang0 ang1 angi inita DPI x y i num 

p1 p2 p3 p4 sides

pcInst  pcParameters pcParamProp pcLayer pcPurpose 

) ;local parameters 

(pcLib = (pcCellView~>lib)) 

;Retrieve pCell parameters

(pcParameters = ((pcCellView~>parameters)~>value)) 

(pcParamProp = car(exists(prop pcParameters 

   ((prop~>name) == "P1_Visible")

)

   )) 

(p1v = (pcParamProp~>value)) ;P1_Visible

(pcParamProp = car(exists(prop pcParameters 

   ((prop~>name) == "P2_Style")

)

   )) 

(p2s = (pcParamProp~>value)) ;P2_Style

(pcParamProp = car(exists(prop pcParameters 

   ((prop~>name) == "P1_D1")

)

   )) 

(p1_d1 = (pcParamProp~>value)) ;P1_D1

(pcParamProp = car(exists(prop pcParameters 

   ((prop~>name) == "P2_D1")

)

   )) 

(p2_d1 = (pcParamProp~>value)) ;P2_D1

(pcParamProp = car(exists(prop pcParameters 

   ((prop~>name) == "P1_R2")

)

   )) 

(p1_r2 = (pcParamProp~>value)) ;P1_R2

(pcParamProp = car(exists(prop pcParameters 

   ((prop~>name) == "P2_R2")

)

   )) 

(p2_r2 = (pcParamProp~>value)) ;P2_R2

(pcParamProp = car(exists(prop pcParameters 

   ((prop~>name) == "P1_R3")

)

   )) 

(p1_r3 = (pcParamProp~>value)) ;P1_R3

(pcParamProp = car(exists(prop pcParameters 

   ((prop~>name) == "P2_R3")

)

   )) 

(p2_r3 = (pcParamProp~>value)) ;P2_R3

(pcParamProp = car(exists(prop pcParameters 

   ((prop~>name) == "V1_R")

)

   )) 

(v1_r = (pcParamProp~>value)) ;V1_R

(pcParamProp = car(exists(prop pcParameters 

   ((prop~>name) == "V1_L")

)

   )) 

(v1_l = (pcParamProp~>value)) ;V1_L

(pcParamProp = car(exists(prop pcParameters 

   ((prop~>name) == "V3_D")

)

   )) 

(v3_d = (pcParamProp~>value)) ;V3_D

(pcParamProp = car(exists(prop pcParameters 

   ((prop~>name) == "V3_SP")

)

   )) 

(v3_sp = (pcParamProp~>value)) ;V3_SP

(pcParamProp = car(exists(prop pcParameters 

   ((prop~>name) == "V3_EE")

)

   )) 

(v3_ee = (pcParamProp~>value)) ;V3_EE

(pcParamProp = car(exists(prop pcParameters 

   ((prop~>name) == "P1_Leaf_Style")

)

   )) 

(p1_leaf_style = (pcParamProp~>value)) ;P1_Leaf_Style

(pcParamProp = car(exists(prop pcParameters 

   ((prop~>name) == "P1_Leaf_L")

)

   )) 

(p1_leaf_l = (pcParamProp~>value)) ;P1_Leaf_L

(pcParamProp = car(exists(prop pcParameters 

   ((prop~>name) == "P1_Leaf_W")

)

   )) 

(p1_leaf_w = (pcParamProp~>value)) ;P1_Leaf_W

(pcParamProp = car(exists(prop pcParameters 

   ((prop~>name) == "P1_Leaf_HD")

)

   )) 

(p1_leaf_hd = (pcParamProp~>value)) ;P1_Leaf_HD

(pcParamProp = car(exists(prop pcParameters 

   ((prop~>name) == "P1_Notch_W")

)

   )) 

(p1_notch_w = (pcParamProp~>value)) ;P1_Notch_W

(pcParamProp = car(exists(prop pcParameters 

   ((prop~>name) == "P2_Notch_W")

)

   )) 

(p2_notch_w = (pcParamProp~>value)) ;P2_Notch_W

2. How to fill shape A with array of circular shape B efficiently,

    make sure B is inside A and the distance of B edge to A edge should be larger than 3um?

    I tried to use dbCreateEllipse in multiple loops. And it took several minutes to get a final result, seems very inefficient.

  • Cancel
Parents
  • richardyuan
    richardyuan over 11 years ago

    For the second question, I'll create a new post.

    I now think It's no need to use lots of "(pcCellView~>parameters)~>value)"  and "car(exists(...))" in the pCell definition.

    For more efficient coding, can you give any advice on the following?

    pcDefinePCell(list(ddGetObj("TTA") "ycRotate" "layout") 
        (   (p2_r1 float 300.0)     
    (p2_gapl float 280.0)
    (p2_gapa float 70.0)
    (p2_gapb float 25.0)

    (SETS int 20)

        ) 
        let((i x0 div_angle p2_base p2_rect p2_gap yctView
     pcInst  pcParameters pcParamProp pcLayer pcPurpose 
    ) ;local parameters 

    (pcLib = (pcCellView~>lib)) 

    ;Retrieve pCell parameters
    (pcParameters = ((pcCellView~>parameters)~>value)) 
    (pcPurpose = "drawing") 
    div_angle = 360.0/SETS

    (p2_base = dbCreateEllipse(pcCellView 
    list(4 pcPurpose) 
    list(((-p2_r1):(-p2_r1)) (p2_r1:p2_r1))
        )) 

    (p2_rect = dbCreateRect(pcCellView 
    list(64 pcPurpose) 
    list((p2_gapl:(-p2_gapb)) ((p2_gapl + 2*p2_gapa):p2_gapb))
        ))  
    yctView = dbOpenCellViewByType(" TTA " "YCTemp" "layout" "maskLayout" "s")
    p2_gap = dbCopyFig(p2_rect yctView)

    for(i 2 SETS
    dbTransformCellView(yctView 1 div_angle)
    dbCopyFig(p2_gap pcCellView)
    ); for i
    dbClose(yctView)
        ); let
             

    ); Pcell define 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • richardyuan
    richardyuan over 11 years ago

    For the second question, I'll create a new post.

    I now think It's no need to use lots of "(pcCellView~>parameters)~>value)"  and "car(exists(...))" in the pCell definition.

    For more efficient coding, can you give any advice on the following?

    pcDefinePCell(list(ddGetObj("TTA") "ycRotate" "layout") 
        (   (p2_r1 float 300.0)     
    (p2_gapl float 280.0)
    (p2_gapa float 70.0)
    (p2_gapb float 25.0)

    (SETS int 20)

        ) 
        let((i x0 div_angle p2_base p2_rect p2_gap yctView
     pcInst  pcParameters pcParamProp pcLayer pcPurpose 
    ) ;local parameters 

    (pcLib = (pcCellView~>lib)) 

    ;Retrieve pCell parameters
    (pcParameters = ((pcCellView~>parameters)~>value)) 
    (pcPurpose = "drawing") 
    div_angle = 360.0/SETS

    (p2_base = dbCreateEllipse(pcCellView 
    list(4 pcPurpose) 
    list(((-p2_r1):(-p2_r1)) (p2_r1:p2_r1))
        )) 

    (p2_rect = dbCreateRect(pcCellView 
    list(64 pcPurpose) 
    list((p2_gapl:(-p2_gapb)) ((p2_gapl + 2*p2_gapa):p2_gapb))
        ))  
    yctView = dbOpenCellViewByType(" TTA " "YCTemp" "layout" "maskLayout" "s")
    p2_gap = dbCopyFig(p2_rect yctView)

    for(i 2 SETS
    dbTransformCellView(yctView 1 div_angle)
    dbCopyFig(p2_gap pcCellView)
    ); for i
    dbClose(yctView)
        ); let
             

    ); Pcell define 

    • Cancel
    • Vote Up 0 Vote Down
    • 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.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information