• 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. attach label to a pin as a 'children'

Stats

  • Locked Locked
  • Replies 14
  • Subscribers 143
  • Views 15569
  • 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

attach label to a pin as a 'children'

ebecheto
ebecheto over 12 years ago

Dear all,

 I have only pins in the layout and I want to attach a label to it. Unfortunatelly the 'children' cannot be set.

Anyone knows how to set it correctly?

Here is the example of my code. 

Regards,

 

cv=geGetWindowCellView()
p=caar(cv~>terminals~>pins)
foreach(p cv~>terminals~>pins
p1=car(p)
p1~>net~>name
f1=car(p1~>figs)
unless(f1~>children f1~>children=
dbCreateLabel(cv list(f1~>layerName  "label" ) centerBox(f1~>bBox)
p1~>net~>name "centerLeft" "R0" "roman" 0.5)))
 
 
*Error* setSGq: (DB-370034): dbSetq: Cannot set attribute - children
 

 

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to Carona

    Your code doesn't the variable cv anywhere, so you're reliant on that having been set (and set correctly) before you hit the bindkey. Simplest solution is to put the line:

    cv=X~>cellView

    before the first dbCreateLabel line.

    By the way, your code breaks if the selected shape has no net information - so you might want to change it as follows. Note that I added some comments with "AB" above some parts that I had concerns about (for example, the setting of the label type to ILLabel makes no sense - that's for interpreted SKILL labels, and these are not SKILL expressions but strings containing numbers. That will have no effect at level 0, but if instantiated, it would mean the label has to be evaluated every time it is displayed, which is pointless.

    Finally, the code rather strangely has nested loops where the outer loop iterates over geGetSelectedSet and the inner loop iterates over geGetSelSet - both will return the same set of objects. I don't know why it's doing this, but if you have two rectangles selected, then it seems to stretch one and add labels on the other - I doubt that's what you want!

    Regards,

    Andrew.

    hiSetBindKey("Layout" "<Key>[" "stretchAreax()")
    
    /***********************************************
    Stretch Rectangle With Constant Area +X
    ************************************************/
    
    procedure( stretchAreax()
      foreach(X geGetSelectedSet()
        net = X~>net
        sSet = geGetSelSet()
        corners = car(sSet)~>bBox
        delta = 5
        ll = car(corners)
        ur = cadr(corners)
        dx = xCoord(ur) - xCoord(ll)
        x1 = xCoord(ll)
        x2 = xCoord(ur) + delta
        newdx = (xCoord(ur)+delta - xCoord(ll))
        rnewdx = round(newdx)
        dy = yCoord(ur) - yCoord(ll)
        rdy = round(dy)
        y1b = yCoord(ll)
        y1t = yCoord(ur)
        newarea = abs(newdx * dy)
        area = round(abs( dx * dy ))
        y2 = y1t - (dy-(area/newdx))
        printf("Area of rectangle is %L.\n" area) ;; Displays Area in CIW window
        printf("Length of Rectangle is %L.\n" newdx) ;; Displays Length in CIW window
        printf("Height of Rectangle is %L.\n" dy) ;; Displays Height in CIW window
    
        ; AB: this is a private function - should use car(geGetSelSet()) - or car(sSet) 
        ;     since you have it in a variable
        r=css()
        r~>?
        r~>??
        lowerLeft(r~>bBox)
        upperRight(r~>bBox)
        xCoord(lowerLeft(r~>bBox))
        yCoord(lowerLeft(r~>bBox))
        newBBox=list(list(x1 y1b) list(x2 y2))
        r~>bBox=newBBox
        string = sprintf(area "%L" area)
        stringL = sprintf(rnewdx "%L" rnewdx)
        stringH = sprintf(rdy "%L" rdy)
    
        foreach(selObj geGetSelSet()
          foreach(child selObj~>children
            when(member(child~>objType '("label" "textDisplay")) && child~>layerName=="text" && child~>purpose=="drawing"
              dbDeleteObject(child)
            )
          )
        )
    
        ; AB: Only create a textDisplay from the net if there is a net!
        when(net
          disp=dbCreateTextDisplay( net X list("text" "drawing" ) t centerBox(X~>bBox) "lowerRight" "R0" "roman" abs(dx/12) nil nil t nil t "name" nil) ;;Creates text label from net name of figure
        )
        cv=X~>cellView
        label=dbCreateLabel(cv "text" centerBox(X~>bBox) string "lowerLeft" "R0" "roman" abs(dx/18))
        labelL=dbCreateLabel(cv "text" centerBox(X~>bBox) stringL "upperRight" "MXR90" "roman" (dx/22))
        labelH=dbCreateLabel(cv "text" centerBox(X~>bBox) stringH "upperLeft" "MYR90" "roman" (dx/22))
        leAttachFig(label r)
        leAttachFig(labelL r)
        leAttachFig(labelH r)
        ; AB: these next three lines are superflous (incorrect, really)
        label~>labelType="ILLabel" ;;Creates text label with area of figure
        labelL~>labelType="ILLabel" ;;Creates text label with area of figure
        labelH~>labelType="ILLabel" ;;Creates text label with area of figure
      )
    ) ;procedure
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • DanielDing
    DanielDing over 7 years ago in reply to Carona

    I think Andrew's post answered the question well.

    If you use SKILL IDE for development, performing a LINT over the procedures would have flagged warnings, such as cv used but never defined, etc.

    Regards!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Deeksha D
    Deeksha D over 6 years ago in reply to Andrew Beckett

    Hi,

        while doing layout If pin labels are moved away from its respective pins... How to move those pin labels back to its respective pin location? I want to write a skill code where i want to select those labels and to press a bindkey then i want labels move its respective pins..?can you please help me on this..

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to DanielDing

    Please read the Guidelines for the Custom IC SKILL Forum . Rather than posting on the end of a (loosely related) 6 year old thread, please post a new question. Also don't post, then delete your post, and then post again as a means to get attention. It just irritates people if you do that.

    Andrew.

    • 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