• 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. Skill script to create pins on any selected metal by co...

Stats

  • Replies 3
  • Subscribers 143
  • Views 1504
  • Members are here 0

Skill script to create pins on any selected metal by connectivity

AK202411259249
AK202411259249 3 months ago

Hi,

I need a script to create pins on metals just by pressing a bindkey. If a path segment is partially selected at right end then the pin should be placed on the path segment at right end with the same width and height as of pathwidth along with a label same as the name of the path segment. If the Path segment is fully selected place a pin entirely on the mental along with its label.

  • Sign in to reply
  • Cancel
  • AK202411259249
    AK202411259249 3 months ago

    Actually I am in a learning phase 

    I have one sample script can someone help me in correcting that script and make it work ?

    (procedure (placePinOnMetal)
    (let* (
    (selSet (geGetSelSet))
    (obj (car selSet))
    (pathName nil)
    (layer nil)
    (width nil)
    (startPt nil)
    (endPt nil)
    (pinName nil)
    (pinXy nil)
    (bbox nil)
    )

    (unless selSet
    (hiDisplayAppDBox "Error: No object selected!")
    (return)
    )

    (unless (and obj (equal (car obj) "path"))
    (hiDisplayAppDBox "Error: Selected object is not a path!")
    (return)
    )

    (setq pathName (obj~>name obj))
    (setq layer (obj~>layerName obj))
    (setq width (obj~>width obj))
    (setq startPt (car (obj~>points obj)))
    (setq endPt (cadr (obj~>points obj)))
    (setq bbox (geGetBBox obj))
    (setq pinName (if pathName pathName "PIN"))

    ;; Assume partially selected if bbox doesn't match full path (simplified logic)
    (setq pinXy
    (if (and (equal (caar bbox) (car startPt)) (equal (cadar bbox) (cadr startPt)))
    bbox ; Fully selected
    (list ; Place at endPt (simplified)
    (list (- (car endPt) (/ width 2)) (- (cadr endPt) (/ width 2)))
    (list (+ (car endPt) (/ width 2)) (+ (cadr endPt) (/ width 2)))
    )
    )
    )

    ;; Create the pin
    (dbCreatePin
    (geGetEditCellView)
    pinName
    layer
    pinXy
    "inputOutput"
    "shape"
    )

    ;; Optional: label on pin
    (dbCreateLabel
    (geGetEditCellView)
    layer
    (list (car endPt) (cadr endPt))
    pinName
    "centerCenter"
    "stick"
    nil
    (list 0.2 0.2)
    )

    (hiDisplayAppDBox "Pin placed on metal path")
    )
    )

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 3 months ago in reply to AK202411259249

    First of all, you don't need to write SKILL to do this, since it's standard functionality in Virtuoso Layout Suite. If you use Create→Pin and then choose "Auto" then clicking on the end of a wire will add a pin with the name chosen from the existing net name.

    However, since you are learning, some feedback:

    1. Posting  your code with no indentation doesn't help with making it easy to make suggestions (I understand that sometimes cut and paste loses the formatting, but I'd suggest opening the code in a web browser and then copying and pasting from there).
    2. Your code is using LISP function calls such as let* / + - and these won't work in SKILL. Whilst SKILL is a LISP, it doesn't offer the same function names for math functions as Common LISP or Scheme - partly because of the fact that SKILL also supports infix operators (C-style) and this would clash with the operators used in function names. The SKILL equivalents are letseq, quotient, plus and difference. 
    3. All the code using  (obj~>name obj) etc is wrong. You are trying to get attributes from the object then calling that as a function, which is not valid. It would be obj~>name directly
    4. In fact it's not obj~>name for a path or pathSeg, it would be obj~>net~>name
    5. Similarly your code for retrieving the start and end points will only work if it was a path. If it was a pathSeg, then you'd use obj~>beginPt or obj~>endPt . I fixed it to handle this.
    6. There's no such function as geGetBBox (no idea how you came up with this. Did you use some generative AI to write the code?).
    7. The check that this is a path is checking (car obj) is "path" which won't work because obj is a db object and not a list. I fixed this to handle both paths and pathSegs.
    8. You are calling return, but this can only be used within a prog().
    9. dbCreatePin has totally the wrong arguments. You seem to be passing the cellView, pinName, layer, xy coordinates. It doesn't take that - it takes a netId and figId - and expects the figure and net to have already been created already. I rewrote this to the set of calls.
    10. I didn't try to rewrite the code to handle partial selection (since it doesn't). At the moment the logic as to which end it places the pin is a bit arbitrary, but you'd need to look into geIsObjectPartiallySelected and geGetSelSetFigPoint for this. I'll leave that as an exercise for you.
    11. dbCreateLabel has the wrong arguments. The third argument needs to be a single point, the argument after "centerCenter" needs to be the orientation, and the 8th argument needs to be the height as a single number. 
    12. The hiDisplayAppDBox has the wrong arguments too.

    I do rather assume this code has come out of ChatGPT or similar because you should have worked through fixing some of these things as you go along. I do hope my life isn't going to become fixing code from hallucinating LLMs!

    Here's the code (note it's formatted to make it easier to read).

    (procedure (placePinOnMetal)
      (prog ()
        (letseq ((selSet (geGetSelSet))
                 (obj (car selSet))
                 (pathName nil)
                 (layer nil)
                 (width nil)
                 (startPt nil)
                 (endPt nil)
                 (pinName nil)
                 (pinXy nil)
                 (bbox nil)
                 (cv (geGetEditCellView))
                 pinShape 
                 net)
          
          (unless selSet
            (hiDisplayAppDBox "Error: No object selected!")
            (return))
          
          (unless (and obj (member obj~>objType (list "path" "pathSeg")))
            (hiDisplayAppDBox "Error: Selected object is not a path or pathSeg!")
            (return))
          
          (setq pathName obj~>net~>name)
          (setq layer obj~>layerName)
          (setq width obj~>width)
          (setq startPt (or obj~>beginPt (car obj~>points)))
          (setq endPt (or obj~>endPt (cadr obj~>points)))
          (setq bbox obj~>bBox)
          (setq pinName (if pathName
                          pathName
                          "PIN"))
          
          ;; Assume partially selected if bbox doesn't match full path (simplified logic)
          ;; doesn't handle partial selections currently...
          (setq pinXy
                (if (and (equal (caar bbox) (car startPt)) (equal (cadar bbox) (cadr startPt)))
                  bbox ; Fully selected
                  (list ; Place at endPt (simplified)
                   (list
                    (difference (car endPt) (quotient width 2))
                    (difference (cadr endPt) (quotient width 2)))
                   (list (plus (car endPt) (quotient width 2)) (plus (cadr endPt) (quotient width 2))))))
          
          ;; Create the pin
          (setq pinShape (dbCreateRect cv layer pinXy))
          (setq net (dbMakeNet cv pinName))
          (dbCreatePin net pinShape)
          
          ;; Optional: label on pin
          (dbCreateLabel cv
                         layer
                         endPt
                         pinName
                         "centerCenter"
                         "R0"
                         "stick"
                         0.2)
          
          (hiDisplayAppDBox
            ?name 'pinPlaced
            ?dboxBanner "Pin placed"
            ?dboxText "Pin placed on metal path"
            ?dialogType hicInformationDialog
            ?buttonLayout 'Close
            )
          )))
    
    

    Andrew

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • AK202411259249
    AK202411259249 3 months ago

    Thanks for your help

    • 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