• 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 15553
  • 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 12 years ago
    Don't set the children - set the parent attribute on the object being attached. That's because an object can have one parent but multiple children. Setting the parent attribute will automatically update the children attribute on the parent object (if that's not too confusing...)

    Andrew
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • dmay
    dmay over 12 years ago

    You can set the parent attribute on the pin shape instead. However, you shoud create textDisplays for pins rather than labels. A textDisplay will display the pin name (much like a label), but when the pin's connectivity/name changes, the display's value will change as well. The textDisplay will also be attached to the pin automatically since it by nature is a child of the pin.

    dbCreateTextDisplay(
    d_associateId
    d_ownerId
    ( tx_layer [ t_purpose ] )
    l_displayFlags
    l_point
    t_just
    t_orient
    t_font
    x_height
    [ g_isDrafted [ g_isOverbar [ g_isVisable [ g_isNameVisible [ g_isValueVisible [ t_attrOrParamName [ g_isParamAssoc ] ] ] ] ] ] ]
    )

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ebecheto
    ebecheto over 12 years ago

     Thantks Dereck,

    That was exactly what I was missing. Now I have the same behaviour as when I click on the button : Create Pin. I mean by that, that the text moves with the square rectangle. I was just curious how to use  dbCreateTextDisplay. I saw in one of your other post that the two first argument could be (should be?) similar.

     

    cv=geGetWindowCellView()
    ;; p=car(cv~>terminals~>pins)
    ;; term=car(cv~>terminals)
    foreach(term cv~>terminals
    p1=car(term~>pins) ;let supose term has only one pin
    p1~>net~>name
    f1=car(p1~>figs)   ;let supose p1 has only objType "rect" 
    unless(f1~>children ; when no attached text Display, let us create one (not a label, even if similar)
    disp=dbCreateTextDisplay( term term list(f1~>layerName  "label" ) t centerBox(f1~>bBox) "centerLeft" "R0" "roman" 0.5) 
    disp~>isNameVisible=nil ;makes the 'name=' invisible
    disp~>parent=p1~>fig    ;makes the text moving with the rect pin
    ; and now f1~>children is not nil => so a can re-run the script
    ))

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ohmycat
    ohmycat over 8 years ago

    Sorry for necroposting, but i found this page very useful, so i adding my code to automaticly generate labels on all selected pins

    foreach(X geGetSelectedSet()
    net = X~>net
    disp=dbCreateTextDisplay( net X list("TEXT" "drawing" ) t centerBox(X~>bBox) "centerCenter" "R0" "roman" 2 nil nil t nil t "name" nil)
    )
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Carona
    Carona over 7 years ago in reply to ohmycat

    Very simple and useful code, I was wondering if it was possible to use dbCreateTextDisplay to create a label with not just the net name, but say with the area value of a rectangle also?

    so passing a string value instead?  

    for instance

    area=5

    string = sprintf(area "%f" area)

    disp=dbCreateTextDisplay( net X list("text" "drawing" ) t centerBox(X~>bBox) "lowerCenter" "R0" "roman" abs(dy/3) nil nil t nil t string nil)  

    This gives me an error, but perhaps I am missing something.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to Carona

    If you want to create a label, use dbCreateLabel. dbCreateTextDisplay is to display the value of a database attribute or property on an associated object - it's not to display arbitrary text (the benefit of a text display is that if that associated attribute value or property value changes, the text displayed changes without needing to do any updates).

    By the way, the dynamic display feature in Virtuoso Layout Suite also allows you to dynamically show the area of an object as you hover over it...

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Carona
    Carona over 7 years ago in reply to Andrew Beckett

    Yes, I am aware of the dynamic display, but it is more useful to have the area attached to the object and visible at all times when floor-planning.

    I will try and play around with dbCreateLabel for passing a string in for the area.  Thank you for pointing me in the right direction.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • DanielDing
    DanielDing over 7 years ago

    These work well for my case in getting all the relations & connectivity correct:

    pin = leCreatePin(...)

    label = dbCreateLabel(...)

    leAttachFig(label pin~>fig)

    dbAddFigToNet(pin~>fig net)

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Carona
    Carona over 7 years ago in reply to Andrew Beckett

    Andrew, I had something working very well, but I was trying multiple iterations of things, and by the time I restarted cadence after a crash, the code I was using started to give me errors.

    *Error* dbCreateLabel: Invalid cellView - db:0x218a5c9a

    For a more complete picture here is the code I am working with now.... It is a simple bindkey that will grow a rectangle by a fixed amount and maintain the area. That part is fine, 

    It then should create labels for the Net Name, Area, and Length and Height of the shape.

    Right now only the Net Name is passing through.  It seems to be stalled at the dbCreatelabel portion.  but I had everything working for a few days.  Thanks in advance.

    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

    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)
    )
    )
    )

    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
    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)
    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
  • Carona
    Carona over 7 years ago in reply to DanielDing

    Thanks I got something working for a few days then after a cadence crash, I started getting errors.  I included the sample of code where things are breaking down just above your comment.

    • 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