• 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. How to add pin to end of a wire

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 144
  • Views 17112
  • 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

How to add pin to end of a wire

Martinsh
Martinsh over 4 years ago

In schematic, there is a wire with net name of "net01". One end of the wire connects to an instance and the other end of the wire is floating. I'd like to add a pin with same net name "net01" on the floating end of the wire. What I want like this: select the wire first, then run a skill, and the skill will add a pin named "net01" on the floating end of the wire. How to realize this with a skill script?

BR,

Martin

  • Cancel
Parents
  • malcolm70
    malcolm70 over 4 years ago

    hello, you have one decision to make which is where to actually draw the pin.
    I "usually" use the wire~>beginPt *OR* wire~>endPt as the actual location to draw the pin rectangle.
    try the following code ( your mileage may vary ) as a starting point.
    Let's just assume, for the sake of arguement, to place the pin on the beginPt location.
    **newPinName must be a string in quotes. Also when you make the label in the last step that purpose
    must be one which is used by your verification tools, not necessarily "label" .

    procedure( createPin(newPinName)
    cvID=geGetEditCellView()
    wireShape=css()
    pinLayer=list(wireShape~>layerName "pin")
    PL = wireShape~>beginPt ; Pin Location
    pinBox=list(car(PL):bottomEdge(wireShape~>bBox) car(PL)+wireShape~>width:topEdge(wireShape~>bBox))
    pinShape=dbCreateRect(cvID pinLayer pinBox)
    signalNet=dbMakeNet(cvID newPinName)
    dbCreatePin(signalNet pinShape)
    when(wireShape~>route
    dbDeleteObject(wireShape~>route)
    )
    dbAddFigToNet(wireShape signalNet)
    dbCreateLabel(cvID list(wireShape~>layerName "label") car(PL)+(wireShape~>width)*0.5:cadr(PL) newPinName "centerLeft" "R0" "roman" wireShape~>width*0.9)
    ) ; procedure

    The preceding code may or may not be the best way to make pins on a wire. there are newer ways of auto-pin creation in cadence tools
    using "auto" mode, you might try that first.

    for information on what to do if your wire is a route : See :
    community.cadence.com/.../1363903

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Martinsh
    Martinsh over 4 years ago in reply to malcolm70

    Hi, malcolm70,

    Thanks for your reply. I tried with your code. But not get the expected result. I select a wire in the schematic window. Then I input the following commands in CIW window. No beginPt property for the selected wire object.

    sel=geGetSelSet()
    (db:0x47ef8ac2)
    x=css()
    db:0x47ef8ac2
    x~>?
    (cellView objType prop bBox children
    groupMembers isAnyInst isShape matchPoints net
    parent pin purpose textDisplays assocTextDisplays
    markers figGroup isUnshielded shieldedNet1 shieldedNet2
    layerName layerNum lpp connRoutes routeStatus
    nPoints points
    )

    x~>objType
    "line"
    x~>beginPt
    nil

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • malcolm70
    malcolm70 over 4 years ago in reply to Martinsh

    sorry I did not realize you wanted code for edits in a schematic, my code works in a layout cellview.  Malcolm

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to malcolm70

    How about this? You may want to specify the pin direction argument when calling the function...

    /* abAddPinToFloatingWire.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Dec 02, 2020 
    Modified   
    By         
    
    Add a pin to any selected floating wire. Usage:
    
    abAddPinToFloatingWire()
    abADdPinToFloatingWire(?direction "input")
    
    The default is to add inputOutput pins unless the ?direction
    is specified
    
    ***************************************************
    
    SCCS Info: @(#) abAddPinToFloatingWire.il 12/02/20.10:59:59 1.1
    
    */
    
    /********************************************************************
    *                                                                   *
    *         abAddPinToFloatingWire([?direction "inputOutput"]         *
    *                      [?pinUsage "schematic"]                      *
    *                      [?wires geGetSelSet()]                       *
    *                                 )                                 *
    *                                                                   *
    *   Take the selected wires (or wires passed in) and add pins to    *
    *  the floating end of that wire, based on the net information on   *
    *   the wire. The pin direction can be specified as an argument,    *
    *  and the pins to use are looked up using schPinMasters (the same  *
    * as the schematic editor create pin command uses to seed the form) *
    *                                                                   *
    ********************************************************************/
    
    procedure(abAddPinToFloatingWire(@key (direction "inputOutput") 
            (pinUsage "schematic")
            (wires geGetSelSet()))
        let((netName cvId pinUnderneath pinOptions pinMasterInfo offsheet
                pinMaster wireUnderneath)
            ;----------------------------------------------------------------
            ; Determine the pin master to use given the direction
            ; and pinUsage (normally schematic)
            ;----------------------------------------------------------------
            offsheet=cadr(assoc(pinUsage car(schPinMasters)))
            pinOptions=foreach(mapcar (usageInfo pinInfo)
                    car(schPinMasters)
                    cddr(assoc(direction schPinMasters))
                cons(car(usageInfo) pinInfo)
            )
            pinMasterInfo=cdr(assoc(pinUsage pinOptions))
            if(pinMasterInfo then
                pinMaster=dbOpenCellViewByType(
                    car(pinMasterInfo) cadr(pinMasterInfo) caddr(pinMasterInfo)
                )
                unless(pinMaster
                    error("Could not open pin master %L\n" pinMasterInfo)
                )
            else
                error("Could not find pin master for direction %L usage %L\n"
                    direction pinUsage)
            )
            ;----------------------------------------------------------------
            ; Determine cellView to create in from one of the wires
            ;----------------------------------------------------------------
            cvId=car(wires)~>cellView
            ;----------------------------------------------------------------
            ; Visit each wire and check that it's actually a wire (in case you
            ; have selected other things on the schematic
            ;----------------------------------------------------------------
            foreach(wire wires
                when(wire~>objType=="line" || wire~>objType=="path"
                    netName=wire~>net~>name
                    if(netName then
                        foreach(point wire~>points
                            pinUnderneath=dbShapeQuery(
                                cvId
                                "pin"
                                list(point point)
                            )
                            ;------------------------------------------------
                            ; Find any wires underneath that aren't this wire
                            ;------------------------------------------------
                            wireUnderneath=setof(
                                shapeUnderneath
                                dbShapeQuery(
                                    cvId
                                    "wire"
                                    list(point point)
                                    0
                                    0
                                )
                                shapeUnderneath!=wire
                            )
                            unless(pinUnderneath || wireUnderneath
                                schCreatePin(
                                    cvId
                                    pinMaster
                                    netName
                                    direction
                                    offsheet
                                    point
                                    "R0"
                                )
                            )
                        )
                    else
                        warn("Selected wire does not have net name yet\n")
                    )
                )
            )
            dbClose(pinMaster)
            t
        )
    )
    

    • Cancel
    • Vote Up +2 Vote Down
    • Cancel
  • malcolm70
    malcolm70 over 4 years ago in reply to Andrew Beckett

    Thank you Andrew for this code snippet which gives me some new functions to research and see what they do and give some thought to how I can incorporate that in some new code.  Malcolm

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • malcolm70
    malcolm70 over 4 years ago in reply to Andrew Beckett

    Thank you Andrew for this code snippet which gives me some new functions to research and see what they do and give some thought to how I can incorporate that in some new code.  Malcolm

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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