• 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. Connect pin to instance terminal

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 17603
  • 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

Connect pin to instance terminal

HarisNoman513
HarisNoman513 over 7 years ago

Dear Cadence Family, 

I am begineer at SKILL scripting. I have a basic question for which i am unable to find any solution.

I have a schematic where i have symbol of an NMOS transistor. I want to connect pins to it. 

For simplicity, i have created only 1 pin and now i want it to be connected to the drain (terminal) of NMOS transistor (instance).

Following is my sample code:

cv = dbOpenCellViewByType( libname cellname viewname viewname "a")
pin_cvid = dbOpenCellViewByType( "basic" "ipin" "symbol" "" "r" )

inst = nthelem(1,cv~>instances)
pin_net_id = dbMakeNet(cv "dn0")
pin_inst_id = dbCreateInst(cv pin_cvid "" 0:0 "R0")
dbCreateConnByName(pin_net_id inst "d")
pin_id = dbCreatePin(pin_net_id pin_inst_id)

dbSave(cv)
dbClose(cv)

In the schematic, created pin can be seen but it is not connected to the drain terminal. 

Can anyone guide me a bit. The function dbCreateConnByName is right but i believe i am making some other mistake. Cant seem to pin-point it. 

Any help would be much appreciated. 


Regards,
Haris 

  • Cancel
Parents
  • mbracht
    mbracht over 7 years ago

    Hi Haris,

    Not sure whether dbCreateConnByName(..) is really what you want.
    It creates an instance terminal on an instance and associates that instance for one
    - with a terminal in the instance's master cell...this is what the third arguments defines, "d" is the terminal name in the master
    and other than that
    - with a net in your current cellview, that net is specified as the first argument.

    I think what you really want to do is just draw a wire isn't it?

    Max

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • HarisNoman513
    HarisNoman513 over 7 years ago in reply to mbracht

    Hi Max,

    Thanks for going through my query.

    Yes a wire is to be drawn connecting the pin (dn0) with the "d" terminal of nmos transistor instance. 
    But how to do it with skill script? I mean i can do it manually but i want to automate it. 

    Consider the scenario where i do not know the position of "d" terminal and the pin. How to connect them through a wire using skill script?

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

    What you were doing was creating the connectivity in the database (so your database knew logically how it was connected, and had you done dbSetConnCurrent it would have been netlistable). However, you weren't adding the physical information - the wire. So opening in the schematic editor and checking-and-saving would have destroyed the connectivity info in the database.

    You'll need to do something like:

    dTerm=dbFindTermByName(inst~>master "D")
    pin=car(dTerm)~>pins ; assume there's only one D pin
    pinFig=car(pin)~>pinFigs ; assume there's only one pin shape (almost certainly true)
    pinCenter=dbTransformPoint(centerBox(pinFig~>bBox) inst~>transform)

    For the other end of the wire, that's where you created the top level pin - which you placed at 0:0

    Not sure if you're running this code in Virtuoso - if so, you can use schCreateWire to create the wire - that's got a simpler interface than having to use dbCreateLine with all the right layers, arguments and so on. This function is documented - and it can route between the two points using the same methods the create wire does in the schematic editor.

    Caveat emptor - I didn't test the code above - I just typed it into the reply and so it may not be completely correct.

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to HarisNoman513

    What you were doing was creating the connectivity in the database (so your database knew logically how it was connected, and had you done dbSetConnCurrent it would have been netlistable). However, you weren't adding the physical information - the wire. So opening in the schematic editor and checking-and-saving would have destroyed the connectivity info in the database.

    You'll need to do something like:

    dTerm=dbFindTermByName(inst~>master "D")
    pin=car(dTerm)~>pins ; assume there's only one D pin
    pinFig=car(pin)~>pinFigs ; assume there's only one pin shape (almost certainly true)
    pinCenter=dbTransformPoint(centerBox(pinFig~>bBox) inst~>transform)

    For the other end of the wire, that's where you created the top level pin - which you placed at 0:0

    Not sure if you're running this code in Virtuoso - if so, you can use schCreateWire to create the wire - that's got a simpler interface than having to use dbCreateLine with all the right layers, arguments and so on. This function is documented - and it can route between the two points using the same methods the create wire does in the schematic editor.

    Caveat emptor - I didn't test the code above - I just typed it into the reply and so it may not be completely correct.

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 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