change cdsTerm labels

Discussion in 'Cadence' started by adsfadsf, Feb 21, 2005.

  1. adsfadsf

    adsfadsf Guest

    Are cdsTerm labels associated with the terminals at all? I would like
    to automatically update all the cdsTerm labels in a symbol so that they
    match the terminal names.
     
    adsfadsf, Feb 21, 2005
    #1
  2. Erik,

    The automatically generated cdsTerm() labels are attached to the shape making
    the pin (see the ~>parent attribute of the label). However, this is not
    necessary for the cdsTerm() labels to function, it's just how the automatic
    symbol generator does it (it means that the label will move when the pin is
    moved when the symbol is edited).

    To find the labels, you'd merely need to look at all the shapes in the
    cellView, find those with an objType of "label", and a labelType of "ILLabel",
    which match cdsTerm.*. The important thing is the name of the terminal passed
    as an argument to cdsTerm has to match the name of a terminal on the symbol.

    Regards,

    Andrew.
     
    Andrew Beckett, Feb 21, 2005
    #2
  3. adsfadsf

    Erik Wanta Guest

    Andrew:
    We rename terminals in the symbols often. Almost as often the cdsTerm
    label is not updated. I wrote the following to try to help the
    situation but it is a total failure as it only fixes the case when the
    cdsTerm label is different than the terminal name and not the case when
    the terminal name is different than the cdsTerm label. I guess the
    next thing I will do is write something that allows the user to click
    on the terminal and then the cdsTerm label to update them but that is
    quite lame.

    ;printf("ctu()\n")

    ;
    ; If terminals are renamed in the symbol the
    ; corresponding cdsTerm label is not updated.
    ; This program aims to help remedy the situation
    ; by giving the user the option of updating
    ; the cdsTerm label names to match the parent
    ; pin names.
    ;

    procedure(ctu()
    prog((cv label_name pin_name)

    ;get cv dbid for the current open symbol view
    cv=geGetWindowCellView()

    when(cv

    ;make sure the cell view is a symbol
    when(cv~>cellViewType == "schematicSymbol"

    ;find the cdsTerm label in the shapes
    foreach(shape cv~>shapes
    when(shape~>theLabel && rexMatchp("^cdsTerm"
    shape~>theLabel)

    ;get the label name
    label_name=nth(1 parseString(shape~>theLabel "\""))

    ;get the pin name
    pin_name=shape~>parent~>pin~>name
    dprint(pin_name)
    dprint(label_name)
    when(label_name!=pin_name && pin_name!=nil &&
    member(pin_name cv~>terminals~>name)

    dprint(pin_name)
    dprint(label_name)

    when(cv~>mode!="a"
    ;checkout call
    ddAutoCheckout(ddGetObj(cv~>libName cv~>cellName
    cv~>viewName))
    ;change mode to editable
    schHiChangeEditMode("a")
    ) ; when

    ;checkout failed, error out
    when(cv~>mode!="a"
    error("View could not be opened for edit.")
    ) ; when

    ;make the cdsTerm label the same as the pin name
    shape~>theLabel=strcat("cdsTerm(\"" pin_name "\")")

    ) ; when
    ) ; when
    ) ; when
    ) ; foreach

    ;check&save cell view
    dbCheck(cv)
    dbSave(cv)

    ) ; when

    return(t)

    ) ; prog
    ) ; procedure
     
    Erik Wanta, Feb 22, 2005
    #3
  4. Erik,

    Surely the case where the terminal name is different than the cdsTerm label is
    the same as when the cdsTerm label is different from the terminal name? In
    other words, non-equality is commutative...

    Andrew
     
    Andrew Beckett, Feb 22, 2005
    #4
  5. adsfadsf

    Erik Wanta Guest

    OK, I am trying to just delete all the cdsTerm labels and add them all
    again. Any advice on how to create the parent structure so that the
    cdsTerm moves when the terminal moves? I can do the attach manually by
    doing a query on the cdsTerm label and then hitting attach and
    selecting the terminal. How do I do the attach without using the
    mouse to specify where to attach?

    cv=geGetWindowCellView()

    ;delete all cdsTerm labels
    foreach(shape cv~>shapes
    when(shape~>theLabel && rexMatchp("^cdsTerm" shape~>theLabel)
    dbDeleteObject(shape)
    ) ; when
    ) ; foreach

    foreach(term cv~>terminals

    foreach(pin term~>pins

    shape=dbCreateLabel(cv list("annotate" "drawing8")
    car(pin~>fig~>bBox) strcat("cdsTerm(\"" term~>name "\")")
    "centerCenter" "R0" "stick" 0.0625)
    shape~>labelType = "ILLabel"
    ;hiSelectTextByLoc(hiGetCurrentWindow() shape~>bBox)
    ;schiAttachLabelAddPointCB(hiGetCurrentWindow()
    centerBox(shape~>bBox))
    ;schiAttachLabelAddPointCB(hiGetCurrentWindow()
    centerBox(pin~>fig~>bBox))
    schiAttachLabelDoneProc(hiGetCurrentWindow() t
    list(centerBox(shape~>bBox) centerBox(pin~>fig~>bBox)))

    ) ; foreach
    ) ; foreach
     
    Erik Wanta, Feb 22, 2005
    #5
  6. adsfadsf

    Erik Wanta Guest

    Andrew:
    Yes, but if one changes the cdsTerm label I can get the original
    parent~>pin~>name. If the terminal is changed I don't know which
    cdsTerm label to update.
     
    Erik Wanta, Feb 22, 2005
    #6
  7. OK, I understand. Probably what I'd do is look for any cdsTerm labels which
    don't have corresponding terminals, and delete those. I'd then look for any
    terminals which don't have corresponding cdsTerm labels, and then create new
    labels for these.

    That way, any manually moved/placed labels will stay in the same place, but
    you can auto-add the missing ones, and cleanup any incorrect ones.

    Regards,

    Andrew.
     
    Andrew Beckett, Feb 22, 2005
    #7
  8. schGlueLabel() is probably the function you want.

    Andrew.
     
    Andrew Beckett, Feb 22, 2005
    #8
  9. adsfadsf

    Erik Wanta Guest

    Andrew:
    Yes! schGlueLabel() is what I was looking for. I have a curiosity now
    however. If I create a schematic with terminals (a, b, c, and d) and
    do a Design->Create CellView->From CellView to generate a symbol it
    creates the parent~>pin on the cdsTerm label so that the label moves
    when the pin is moved in the symbol.

    If I change the name of pin a to newa and run the code to delete the
    cdsTerm labels and add them back and then schGlueLabel I see that the
    cdsTerm for the newa pin says cdsTerm("newa") as I would expect and the
    label moves when I move the newa pin in the symbol.

    What I don't understand is that if I select the cdsTerm("newa") label
    in the symbol and do a car(geGetSelSet())~>parent~>pin~>name it still
    returns "a".

    In addition I am trying to get the justification and orientation of the
    labels that correspond to the pins in the symbol (not the cdsTerm
    labels but the actual pin labels). There is no way to determine the
    pin label from the pin is there? If not, I will have to get search all
    the shapes and match the theLabel name with the pin name.
     
    Erik Wanta, Feb 24, 2005
    #9
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.