• 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 make a pin from net (or wire)?

Stats

  • Locked Locked
  • Replies 15
  • Subscribers 144
  • Views 20282
  • 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 make a pin from net (or wire)?

shyoon
shyoon over 3 years ago

Hello Guys,

I want to automatically make pins from Net name or symbols.

(Cadence version : 6.1.8)

And I do not know the SKill well. 

Can I get some help?

Thank you!

  • Cancel
  • Kevin Buck
    Kevin Buck over 3 years ago

    This should get you started. The first line creates a net in the object newSchView, the second line creates a terminal and the third line generates a pin on the schematic canvas. The last line also draws a wire but that part is not explicitly necessary. You should be able to find these functions in the documentation to figure out exactly what you're trying to do as it's not totally clear from your post.


    newInputNet = dbCreateNet(newSchView nth(0 nth(0 term~>pins~>figs~>net~>name)))
    newInputTerm = dbCreateTerm(newInputNet nil "input")
    schCreatePin(newSchView inputCVId nth(0 nth(0 term~>pins~>figs~>net~>name)) "input" nil 0:ypin_ofs "R0")
    schCreateWire(newSchView "draw" "full" list(0:ypin_ofs xpin_ofs:ypin_ofs) 0.0625 0.0625 0.0 )

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • shyoon
    shyoon over 3 years ago in reply to Kevin Buck

    Hi Kevin, 

    Thank you for your quick reply.

    I want to print to be created automatically according to the net applied to the symbol.

    For example, if it is an input, the pin wants an input pin to be created, and if it is an input output, I want an input output pin to be created automatically.

    Is it possible this?

    Thank you!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Kevin Buck
    Kevin Buck over 3 years ago in reply to shyoon

    As far as I'm aware nets themselves are not directional. If you have some way of determining which direction you want then of course you can set the direction, the example I gave you shows a pin/terminal configured as "input" but you can just as easily specify "output" or "inputOutput".

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • shyoon
    shyoon over 3 years ago in reply to Kevin Buck

    How can I use this?

    Please help me.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to Kevin Buck
    Kevin Buck said:
    newInputNet = dbCreateNet(newSchView nth(0 nth(0 term~>pins~>figs~>net~>name)))
    newInputTerm = dbCreateTerm(newInputNet nil "input")
    schCreatePin(newSchView inputCVId nth(0 nth(0 term~>pins~>figs~>net~>name)) "input" nil 0:ypin_ofs "R0")
    schCreateWire(newSchView "draw" "full" list(0:ypin_ofs xpin_ofs:ypin_ofs) 0.0625 0.0625 0.0 )

    Kevin,

    Note that the first two lines are redundant - if you call schCreatePin and tell it the terminal name and direction, it will automatically create the net and terminal objects in the database. It's also a bit odd that you are starting from a terminal on the first line, creating a net with the same name (which must already exist, unless the variable term is in a different cellView?).

    This code can also be used to conveniently get the pin master used for creating the pin based on the same choices that appear in the schematic editor when creating pins:

    ; the variable "direction" needs to be set to the terminal direction
    ; you want
    ;
    ; assume that pinUsage is the type of pin to use 
    pinUsage="schematic"
    ;----------------------------------------------------------------
    ; 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)
    )
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Kevin Buck
    Kevin Buck over 3 years ago in reply to shyoon

    I'm not sure what you are asking for. You can change the direction of the pin/terminal if you wish. In the code I provided you simply replace "input" with whatever pin direction you want. The documentation also has information explaining the different inputs to the functions. There is one part I forgot to add. You need to create an object to specify the type of pin you are using and they live in the basic library. The two lines below will create objects for input and output pin types. You can see where this is used in the third line of my first reply.

    inputCVId = dbOpenCellViewByType( "basic" "ipin" "symbol" "" "r" )
    outputCVId = dbOpenCellViewByType( "basic" "opin" "symbol" "" "r" )

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Kevin Buck
    Kevin Buck over 3 years ago in reply to Andrew Beckett

    Good to know. I was not aware that schCreatePin did these functions implicitly, I can cut a few lines from my scripts if that is the case.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • shyoon
    shyoon over 3 years ago in reply to Kevin Buck

    Ah, something seems to have gone wrong with the story.

    I draw one schematic, where I call symbol as instance, and make net name and wire on it.

    And then I have to put a pin, which means that I want it to be created automatically by judging the input or output or inoutput of the symbol.

    I wonder if there is a script that makes it.

    Thank you!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Kevin Buck
    Kevin Buck over 3 years ago in reply to shyoon

    If you open the symbol view for reading you can iterate over the terminals and then make your schematic pins based on what is found. Something like this would do it:

    libName=ddGetObj("shyoons_library") ;this is the name of the library that your schematic is in
    symView = dbOpenCellViewByType(yourLibName yourCellName "symbol" "" "r")

    foreach(term symView~>terminals

    ;Input pin case
    if(term~>direction == "input" then
    ;do something here
    );if
    ;Output pin case
    if(term~>direction == "output" then
    ;do something here
    );if
    );foreach

    You could also use a case statement instead of if statements. Note that you need to determine which cell you are trying to execute this function for and it should be a string.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • shyoon
    shyoon over 3 years ago in reply to Kevin Buck

    Thank you for your feedback and I try this. But there is an error below.

    *Error* eval: unbound variable - yourLibName

    symView = dbOpenCellViewByType(yourLibName yourCellName "symbol" "" "r")

     

    Even if I change yourLibName to something else, the unbound error continues.

    What am I doing wrong here?

    • 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