easy way to copy pin and text display in Skill??

Discussion in 'Cadence' started by vlsidesign, Dec 13, 2008.

  1. vlsidesign

    vlsidesign Guest

    I wanted to copy a pin and its associated text display. When I use the
    dbCopyFig it just gets the rectangle and not the text display. There
    doesn't seem to be an skill function that will make this easy, but I
    will need to do some work. Any thoughts are appreciated.
     
    vlsidesign, Dec 13, 2008
    #1
  2. vlsidesign

    layoutDesign Guest

    dbCopyFig doesn't copy connectivity. So I am trying to use
    "leCreatePin" instead. So what I have so far, is that I look at the
    pin (that I want to copy) object properties, and save it, and then I
    pass some of those values to the "leCreatePin" function call, and that
    seems like it will work, but I am still missing associated text
    display. I am not sure if I will need to use dbGetOverlaps on the pin
    and find the text display or not? or if there is a simpler way?
     
    layoutDesign, Dec 16, 2008
    #2
  3. vlsidesign

    layoutDesign Guest

    Wasn't sure on whether to use leCreatePin or dbCreatePin... Andrew has
    a previous post that clarifies which should be used.

    Andrew Beckett says the following:
    "dbCreatePin is a lower level function - you need to have created the
    net, terminal and shape, and then create the pin (actually you can
    omit creating the terminal).
    leCreatePin takes care of creating the pin shape, and the net, and the
    terminal. It also sets various attributes like the terminal direction,
    and the pin access directions,etc."
     
    layoutDesign, Dec 16, 2008
    #3
  4. vlsidesign

    layoutDesign Guest

    tmpPin = car(pinList) ;;grab pin template so I can create duplicates
    newPin = leCreatePin(cv tmpPin~>fig~>lpp "rectangle" tmpPin~>fig~>bBox
    tmpPin~>net~>name "inputOutput" tmpPin~>accessDir
    textId = dbCreateTextDisplay(
    tmpPin~>net~>term
    newPin
    list(tmpPin~>fig~>layerName "label")
    t
    centerBox(tmpPin~>fig~>bBox)
    car(tmpPin~>fig~>children)~>justify
    car(tmpPin~>fig~>children)~>orient
    car(tmpPin~>fig~>children)~>font
    car(tmpPin~>fig~>children)~>height
    t nil t nil t "name"
    )
    textId~>parent = newPin~>fig ;; attach to fig
     
    layoutDesign, Dec 17, 2008
    #4
  5. vlsidesign

    layoutDesign Guest

    Answer: Correct, there is no easy way through Skill
     
    layoutDesign, Dec 17, 2008
    #5
  6. Andrew Beckett wrote, on 01/01/09 09:00:
    Sending again, as posts with attachments don't seem to make it through. Including the code in the post instead...

    Andrew.

    /* abFxNetNames.il

    Author A.D.Beckett
    Group Structured Custom, Cadence Design Systems Ltd.
    Machine SUN
    Date Feb 06, 1996
    Modified
    By

    abFixNetNames finds all the terminals in the current or supplied cellView
    which have net names different from the terminal name, and fixes this

    ***************************************************

    SCCS Info: @(#) abFixNetNames.il 10/04/02.12:45:31 1.1

    */

    (procedure (abFixNetNames @optional (cellView (geGetEditCellView)))
    (let (termName newNet newTerm newTextDisplay)
    (foreach terminal (dbGetq cellView terminals)
    (unless (equal (setq termName (dbGetq terminal name))
    (dbGetq (dbGetq terminal net) name))
    /* set terminal name back to the net name, so that
    we can create the new terminal properly */
    (dbSetq terminal (dbGetq (dbGetq terminal net) name) name)
    /* create the net for the desired terminal name */
    (setq newNet (dbMakeNet cellView termName))
    /* create a terminal for this net */
    (unless (setq newTerm (dbGetq newNet term))
    (setq newTerm (dbCreateTerm newNet termName
    (dbGetq terminal direction))))
    /* set the net for all the pins to be the new net */
    (foreach pin (dbGetq terminal pins)
    (dbSetq pin newNet net))
    /* recreate the textDisplays */
    (foreach textDisplay (dbGetq terminal textDisplays)
    (setq newTextDisplay
    (dbCreateTextDisplay newTerm newTerm
    (dbGetq textDisplay lpp)
    t
    (dbGetq textDisplay xy)
    (dbGetq textDisplay justify)
    (dbGetq textDisplay orient)
    (dbGetq textDisplay font)
    (dbGetq textDisplay height)
    (dbGetq textDisplay isDrafted)
    (dbGetq textDisplay isOverbar)
    (dbGetq textDisplay isVisible)
    (dbGetq textDisplay isNameVisible)
    (dbGetq textDisplay isValueVisible)
    "name" nil))
    /* attach the label to the figure for the pin */
    /* don't know the db way of doing this */
    (leAttachFig newTextDisplay (dbGetq textDisplay parent))
    /* nasty bodge to get the bounding box of the label
    correct */
    (dbMoveFig newTextDisplay cellView nil)
    )
    /* delete the old terminal and net */
    (dbDeleteObject (dbGetq terminal net))
    ))
    t))

    (procedure (abMakeTermsGlobal cellView listOfTerms)
    (let (term)
    (foreach termName listOfTerms
    (setq term (dbFindTermByName cellView termName))
    (when term
    (dbSetq term (strcat termName "!") name)
    )
    )
    (abFixNetNames cellView)
    )
    )
     
    Andrew Beckett, Jan 2, 2009
    #6
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.