• 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. Getting coordinates for pin placement

Stats

  • Locked Locked
  • Replies 15
  • Subscribers 143
  • Views 20813
  • 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

Getting coordinates for pin placement

LongTimeNovice
LongTimeNovice over 10 years ago

Hello, everyone.  I'm trying to examine a pin that's in a layout subcell, and then draw a pin directly over it.  I'm having trouble getting my coordinates in the correct format.  I'm sure of two things: 1) I'm probably making this harder than it needs to be, and 2) I'm probably missing something obvious.  I've pasted the code, and below that is the response from Cadence.

############# Here is my code #############

;GET bBox OF PIN IN TARGET INSTANCE

pBox=car(instTerm~>term~>pins)~>fig~>bBox

;SEPARATE OUT LOWER LEFT COORDINATES

pBoxLL=car(car(pBox))
pBoxFixLL=dbTransformPoint(pBoxLL inst~>transform)

;GET LOWER COORDINATE AND CONVERT TO STRING

pBoxFixLower=car(pBoxFixLL)
sprintf(pBoxFixLower "%L" pBoxFixLower)

;GET LEFT COORDINATE AND CONVERT TO STRING

pBoxFixLeft=cdr(pBoxFixLL)
sprintf(pBoxFixLeft "%L" pBoxFixLeft)
pBoxFixLeft = substring(pBoxFixLeft 2 strlen(pBoxFixLeft)-2)

;MAKE A STRING WITH LOWER AND THEN A COLON AND THEN LEFT

pinCoordsLL=strcat(pBoxFixLower ":" pBoxFixLeft)

;SEPARATE OUT UPPER RIGHT COORDINATES

pBoxUR= cdr(car(pBox))
pBoxUR=car(pBoxUR)
pBoxFixUR=dbTransformPoint(pBoxUR inst~>transform)

;GET UPPER COORDINATE AND CONVERT TO STRING

pBoxFixUpper=car(pBoxFixUR)
sprintf(pBoxFixUpper "%L" pBoxFixUpper)

;GET RIGHT COORDINATE AND CONVERT TO STRING

pBoxFixRight=cdr(pBoxFixUR)
sprintf(pBoxFixRight "%L" pBoxFixRight)
pBoxFixRight = substring(pBoxFixRight 2 strlen(pBoxFixRight)-2)

;MAKE A STRING WITH UPPER AND THEN A COLON AND THEN RIGHT

pinCoordsUR=strcat(pBoxFixUpper ":" pBoxFixRight)

;MAKE STRING WITH UPPER-LEFT COORDS AND LOWER-RIGHT COORDS SEPARATED BY A "/"

pinCoords=strcat(pinCoordsLL "/" pinCoordsUR)

;CONVERT THIS STRING TO A LIST CONTAINING L:L AND U:R

pinCoords = parseString(pinCoords "/")

;PRINT THESE VARIABLES FOR DEBUGGING PURPOSES

printf("  *** pinCoordsLL is %A\n" pinCoordsLL)
printf("  *** PinCoordsUR is %A\n" pinCoordsUR)
printf("  *** PinCoords is %A\n" pinCoords)

;MAKE A PIN USING pinCoords VARIABLE

leCreatePin( cv  pLPP  "rectangle"  pinCoords  pName  "inputOutput"  list("left" "right" "top" "bottom") )

############# This is the response from Cadence starting with the debugging lines and ending with the error #############

*** pinCoordsLL is "11.175:10.315"

*** PinCoordsUR is "11.605:10.745"

*** PinCoords is ("11.175:10.315" "11.605:10.745")

*Error* length: argument must be a list or an array - "11.175:10.315"

<<< Stack Trace >>>

leCreatePin(cv pLPP "rectangle" pinCoords pName ... )

I notice that the PinCoords list, when printed, looks right but has quotes in it.  I wonder if this throwing off my leCreatePin statement.

I'd love to hear your thoughts.

Thank you!

Steven.

  • Cancel
  • skillUser
    skillUser over 10 years ago

    Hi Steven,

    I'm not sure why you are converting the coordinates to strings?  I think the code could be simplified to something like the following (untested!):

    
    pinFig = car(instTerm~>term~>pins)~>fig
    
    pinCoords = dbTransformBBox(pinFig~>bBox inst~>transform)
    
    leCreatePin( cv  pLPP  "rectangle"  pinCoords  pName  "inputOutput"  list("left" "right" "top" "bottom") )
    

    Hopefully the above will work for you?

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    LongTimeNovice said:
    ############# This is the response from Cadence starting with the debugging lines and ending with the error #############

    When I first read this, when you were referring to "the response from Cadence" (in a couple of places), I assumed you were talking about a response from Cadence customer support. However, I suspect you mean "the response from Virtuoso". There is no tool called "Cadence"....

    Lawrence's suggestions are what I would have said - I've no idea why you're doing all that conversion to strings. That's the root of both unnecessary complexity and the error you're seeing...

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • LongTimeNovice
    LongTimeNovice over 10 years ago

    Lawrence, thank you!  This is exactly what I need.  It definitely looks like I was running too far down the wrong path!

    I can tell you why I was converting the coordinates to strings.  My statement pBox=car(instTerm~>term~>pins)~>fig~>bBox gives the coordinates in the format (((5.82 5.88) (6.25 6.31))).  Cadence Help for leCreatePin has an example where the coordinates format is like this: list(0:0 10:10).  So I converted my results to strings so that I could remove the parentheses and add the colons.  I hope that makes sense.  I know it wasn't the correct way.  Thank you for setting me straight!

    Steven.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 10 years ago
    Ah, I see. The colons can be used to specify a coordinate pair (e.g. 0:0) but this is always returned in the list format (e.g. (0 0) ) by the interpreter. Wherever possible you want to try to leverage the native format. In SKILL the most fundamental datatype is a list, so in order to understand and write code better it would be advantageous to learn about lists in SKILL (or Lisp, which SKILL is mostly based on). Cheers, Lawrence.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • LongTimeNovice
    LongTimeNovice over 10 years ago

    Hi, Andrew.

    Thanks for responding.  It's always great to hear from you.

    First off, I'm so sorry I misrepresented the tool name.  You're exactly right: the tool is Virtuoso.  I didn't mean to imply that Cadence the company had anything to do with this.  I'm sure Customer Support would have been very helpful.  You all always do a great job!

    Please see my reply to Lawrence for my explanation of why I converted the coordinates to strings.  I know it was incorrect and certainly not what a professional SKILL programmer would do.  My education and work experience is in electrical engineering and layout, not programming, and I'm doing my best to create good scripts without bothering you all any more than necessary.  I'm able to figure out most things on my own through the Cadence Help documents and old posts on this forum, but sometimes I get stuck, and sometimes I go down the wrong path.  Thank you for setting me straight when I need it!

    Thanks again.

    Steven.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • LongTimeNovice
    LongTimeNovice over 10 years ago
    Thank you, Lawrence! I love that you understood my reasoning and talked me through the answer. That's wonderful. Yes, I would love to learn more about SKILL so that I wouldn't have to go through this every time I need to write a script. I've asked my supervisor about training, but at this point, it's just not a priority, so it looks like I'll have to keep feeling my way through these things and learning as I go. Thanks again, and have a great day! Steven.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • LongTimeNovice
    LongTimeNovice over 10 years ago

    Hi, Lawrence.

    I've still got a problem.  I'm sure it's related to what I'm feeding into the dbTransformBBox statement.  My definition of instPinList is probably wrong.  Here is my code:

     

    instList=selectedSet() ;MULTIPLE INSTANCES ARE SELECTED WHEN SCRIPT IS RUN

    ;CYCLE THROUGH INSTANCES, FIND PINS OF EACH INSTANCE, AND THEN GET EACH PIN'S COORDS BEFORE MOVING TO THE NEXT INSTANCE

    foreach(inst instList

    instPinList = inst~>instTerms~>term~>pins

    foreach( instTerm instPinList

    pinFig = car(instTerm~>term~>pins)~>fig

    printf("  *** pinFig is %A\n" pinFig) ;PRINT LINE FOR DEBUGGING

    pinCoords = dbTransformBBox(pinFig~>bBox inst~>transform)

    printf("  *** pinCoords is %A\n" pinCords) ;PRINT LINE FOR DEBUGGING

    );foreach

    );foreach

    And here is the response from Virtuoso:

      *** pinFig is (db:0x43911dcd)
    *Error* dbTransformBBox: Invalid bBox - (((5.82 5.88) (6.25 6.31)))
    <<< Stack Trace >>>
    dbTransformBBox((pinFig~>bBox) (inst~>transform))

    I'd love to hear your thoughts.  Thank you!

    Steven.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • LongTimeNovice
    LongTimeNovice over 10 years ago

    Hi, Lawrence.

    I've still got a problem.  I'm sure it's related to what I'm feeding into the dbTransformBBox statement.  My definition of instPinList is probably wrong.  Here is my code:

     

    instList=selectedSet() ;MULTIPLE INSTANCES ARE SELECTED WHEN SCRIPT IS RUN

    ;CYCLE THROUGH INSTANCES, FIND PINS OF EACH INSTANCE, AND THEN GET EACH PIN'S COORDS BEFORE MOVING TO THE NEXT INSTANCE

    foreach(inst instList

    instPinList = inst~>instTerms~>term~>pins

    foreach( instTerm instPinList

    pinFig = car(instTerm~>term~>pins)~>fig

    printf("  *** pinFig is %A\n" pinFig) ;PRINT LINE FOR DEBUGGING

    pinCoords = dbTransformBBox(pinFig~>bBox inst~>transform)

    printf("  *** pinCoords is %A\n" pinCords) ;PRINT LINE FOR DEBUGGING

    );foreach

    );foreach

    And here is the response from Virtuoso:

      *** pinFig is (db:0x43911dcd) *Error* dbTransformBBox: Invalid bBox - (((5.82 5.88) (6.25 6.31))) <<< Stack Trace >>> dbTransformBBox((pinFig~>bBox) (inst~>transform))

    I'd love to hear your thoughts.  Thank you!

    Steven.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 10 years ago

    Hi Steven,

    I can see your latest response in my email, but it does not appear here on the forum yet??

    Anyway, you have a list in pinFig rather than a single object, which is why the bounding box is invalid. Working from memory, I think that each pin can have one or more figs associated with it, hence ...pins~>fig gives a list rather than a single object.  So you either need to iterate over each of these (with another foreach loop), or just take the car again, e.g. (pinFig = car(car(instTerm~>term~>pins)~>fig)  - this could be done with 'caar' also.) to pick the first (perhaps only) pin figure.

    Hopefully this will resolve the latest issue.

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • LongTimeNovice
    LongTimeNovice over 10 years ago

    Yes, I posted it, but I didn't see it in the thread, so I posted it again, and I still didn't see it.  Now I see it once, which, if nothing else, is better than twice.

    Anyhow, thank you for your response.  The problem was that I had defined instPinList as follows:

    instPinList = inst~>instTerms~>term~>pins

    foreach( instTerm instPinList

     

    and in your code, you had correctly used

     

    pinFig = car(instTerm~>term~>pins)~>fig

    so it's like I was getting the pins and calling them instTerm, and then I was trying to get the pins of that.  It was duplicated.  This is the solution that works:

    instList=selectedSet()

    foreach(inst instList

    instPinList = inst~>instTerms

    foreach( instTerm instPinList

    pinFig = car(instTerm~>term~>pins)~>fig

    pinCoords = dbTransformBBox(pinFig~>bBox inst~>transform)

    );foreach

    );foreach

    So I'm all set.  Thank you, Lawrence, and thank you, Andrew as well!

    Have a terrific day!

    Steven.

     

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