• 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 create netlist for global ground with schematic which...

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 143
  • Views 4052
  • 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 create netlist for global ground with schematic which generated by skill

morrris
morrris over 1 year ago

Hi, Cadence family

I've created a cell named "rc" as below, the minus pin of cap connected as "gnd!".

Then try to create netlist by ADE as below, the minus pin of cap is _net0, not global ground "gnd!".

Am I missing something ?

How can I fix it?

Your help will be appreciated.

Virtuoso version IC6.1.7-64b.500.21

My code as shown below

let(
(pcSchId symId)
unless(ddGetObj("test") error("Couldn't open library %L" "test"))

;{{{schematic
pcSchId=pcDefinePCell(
list(ddGetObj("test") "rc" "schematic" "schematic")
;formal parameters
(
(res "10") (cap "10f")
)

;build itself
let((pcSchCv x y
instResId instCapId
wireId
)
pcSchCv=pcCellView
masterIpinCv=dbOpenCellViewByType("basic" "ipin" "symbol" nil "r")
masterOpinCv=dbOpenCellViewByType("basic" "opin" "symbol" nil "r")
dbCreatePin(dbCreateNet (pcSchCv "I") dbCreateInst(pcSchCv masterIpinCv "I" 2.75:2 "RO"))
dbCreatePin(dbCreateNet (pcSchCv "0") dbCreateInst(pcSchCv masterOpinCv "0" 4.125:2 "RO"))
dbFindNetByName(pcSchCv "I")->term->direction="input"
dbFindNetByName(pcSchCv "0")->term->direction="output"
dbCreateNet (pcSchCv "gnd!")

masterRCv=dbOpenCellViewByType("analogLib" "res" "symbol" nil "r")
masterCCv=dbOpenCellViewByType("analogLib" "cap" "symbol" nil "r")
setq(x 2.374) setq(y 2)
x=x+0.875
instResId=dbCreateParamInst(pcSchCv master RCv "R1" (x:y) "R90" 1 list(
list("r" "string" res)
))
dbCreateInstTerm(dbFindNetByName(pcSchCv "I") instResId dbFindTermByName(master RCv "PLUS"))
dbCreateInstTerm(dbFindNetByName(pcSchCv "0") instResId dbFindTermByName(master RCv "MINUS"))
instCapId=dbCreateParamInst(pcSchCv masterCCv "C1" (x-0.25:y-0.25) "R0" 1 list(
list("c" "string" cap)
))
dbCreateInstTerm(dbFindNetByName(pcSchCv "I") instCapId dbFindTermByName(masterCCv "PLUS"))
dbCreateInstTerm(dbFindNetByName(pcSchCv "gnd!") instCapId dbFindTermByName(masterCCv "MINUS"))

;I
wireId=dbCreateLine(pcSchCv list("wire" "drawing") list(
list(x y)
list(plus(x -0.5) y)) )
wireId->net-dbFindNetByName(pcSchCv "I")
wireId=dbCreateLine(pcSchCv list("wire" "drawing") list(
list(x-0.25 y)
list(x-0.25 plus(y -0.25))))
wireId->net-dbFindNetByName(pcSchCv "I")
;0
wireId=dbCreateLine(pcSchCv ("wire" "drawing") list(
list(x+0.375 y)
list(x+0.875 y)))
wireId->net-dbFindNetByName(pcSchCv "0")
;gnd!
wireId=dbCreateLine(pcSchCv list("wire" "drawing") list(
list(x-0.25 y-0.625)
list(x-0.25 -0.875)
))
wireId->net-dbFindNetByName(pcSchCv "gnd!")

dbClose(masterIpinCv)
dbClose(masterOpinCv)
dbClose(master RCV)
dbClose(masterCCV)
t
); end let
);end pcDefine PCell ;}}}schematic
dbSave(pcSchId) dbClose(pcSchId)

;{{{symbol
symId=dbOpenCellViewByType(ddGetObj("test") "rc" "symbol" "schematicSymbol" "w")

;build itself
let((hp ss label)
hp=0.025 half pin size
ss=0.00625 snap spacing

;line
dbCreateLine(symId("device" "drawing") list(0:0 0.125:0))
dbCreateRect(symId '("device" "drawing") list(0.125:-0.125 0.5:0.125))
dbCreateLine(symId '("device" "drawing") list(0.5:0 0.625:0))
dbCreatePath(symId("device" "drawing1") list(0.25:0.03125 0.375:0.03125) 0.025 "extendExtend")
dbCreatePath(symId("device" "drawing1") list(0.28125:0.03125 0.28125:-0.0625) 0.025 "extendExtend")
dbCreatePath(symId("device" "drawing1") list(0.34375:0.03125 0.34375:-0.0625 0.375: -0.05) 0.025 "extendExtend")
; select box
dbCreateRect(symId list("instance" "drawing") list(0:-0.125 0.625:0.125))
;label
label=dbCreateLabel (symId list("annotate" "drawing7") 0.125:0.1875 "cdsName()" "centerLeft" "RO" "stick" 0.0625)
label ->label Type="ILLabel"
;pin
dbCreatePin(dbMakeNet (symId "I") dbCreateRect(symId '("pin" "drawing") list(0-hp:0-hp 0+hp: 0+hp)))
dbCreatePin(abMakeNet(symd "0") abCreateRect(symid '("pin" "drawing") list(0.625-hp:0-hp 0.625+hp:8+hp)))
dbMakeNet(symId "I")->term->direction="input"
dbMakeNet (symId "0")->term->direction="output"
label=dbCreateLabel (symId '("pin" "drawing") 0+hp: 0.0625 "I" "centerLeft" "RO" "stick" 0.05)
label ->label Type="NLPLabel"
label=dbCreateLabel (symId '("pin" "drawing") 0.625-hp:0.0625 "0" "center Right" "RO" "stick" 0.05)
label -> label Type="NL PLabel"
);end let ;}}}symbol
symId->instNamePrefix="X"
dbsave(symId) abClose(symId)
);let
  • Cancel
  • RobMan
    RobMan over 1 year ago

    There's a few things wrong with your code....

    'dbCreateInstTerm' unnecessarily. You do not need to create instTerms for created instance. This is inherent on the object.

    You are using '->' instead of the more correct '~>' for db object data retrieval (-> may not always work).

    Essentially you need to assign the net connection to the cap instTerm like so...

    pcSchCv=geGetEditCellView()
    gndNet=dbCreateNet(pcSchCv "gnd!")
    instCapId=dbCreateParamInst(pcSchCv masterCCv "C1" (x-0.25:y-0.25) "R0" 1 list( list("c" "string" cap)))

    capMinusInstTerm=car(setof(instTerm instCapId~>instTerms instTerm~>name=="MINUS"))
    capMinusInstTerm~>net=gndNet

    The physical wire shape is not strictly necessary (unless you wish to see/use it down the line).

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • morrris
    morrris over 1 year ago in reply to RobMan

    Hi, RobMan

    Thanks for your replay !

    I try to fix it by your recommendation like below

    pcSchCv=pcCellView
    gndNet=dbCreateNet(pcSchCv "gnd!")
    masterCCv=dbOpenCellViewByType("analogLib" "cap" "symbol" nil "r")
    instCapId=dbCreateParamInst(pcSchCv masterCCv "C1" (x-0.25:y-0.25) "R0" 1 list(list("c" "string" cap)))
    capMinusInstTerm=car(setof(instTerm instCapId~>instTerms instTerm~>name=="MINUS"))
    capMinusInstTerm~>net=gndNet
    capPlusInstTerm=car(setof(instTerm instCapId~>instTerms instTerm~>name=="PLUS"))
    capPlusInstTerm~>net=dbFindNetByName(pcSchCv I")
    
    

    But the MINUS pin of Cap cell will shown as below

    Then it's netlist will like this

    the input and output pin is missing for c1

    So, I guess dbCreateInstTerm is necessarily?

    Morrris

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to morrris

    Morris,

    First of all, please do not post text from OCR-scanned images (I'm sure this must be what you did). Your original code was full of extraneous spaces, incorrect lowercase/uppercase letters, missing characters and so on - I had to spend probably 20 minutes fixing all the mistakes. When trying to debug somebody's code, you then don't know whether it was because of the scanning or the original code. If you must  do this, at least test the text before posting it.

    As a result, I'm sure RobMan didn't have a chance to test your code, so it's completely forgivable that his suggestions weren't quite right. 

    1. Because this is within a PCell, the dbCreateInstTerm calls are necessary. If you create an instance in the schematic editor, the system automatically adds the instTerms for you - but that won't happen at the low level in SKILL if you don't have the schematic editor open (which you wouldn't in a PCell).
    2. The use of -> rather than ~> is fine in this case. The difference is actually how lists on the left-hand-side are handled. If the left-hand-side of the -> or ~> operator is a single object, it doesn't matter which you use; if it's a list, then -> treats it as a disembodied property list, whereas ~> applies the attribute to each member of the list and returns a list of the result.

    The problem in this case was because you are creating a net intended to be global "gnd!", but didn't actually mark the net as a global. The name alone is not enough - there's an attribute on the signal in the database which marks it as being global. Because of that, your top level schematic (presumably, since you didn't share that) had a global net gnd!, but because the PCell had a non-global net gnd! it renamed it to avoid clashing with the global net (this is correct behaviour). 

    I'll try to post the code in a moment - I'm getting errors from the forum currently.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to Andrew Beckett
    let(
     (pcSchId symId)
     unless(ddGetObj("test") error("Couldn't open library %L" "test"))
     
     ;{{{schematic
     pcSchId=pcDefinePCell(
     list(ddGetObj("test") "rc" "schematic" "schematic")
     ;formal parameters
     (
     (res "10") (cap "10f")
     )
     
     ;build itself
     let((pcSchCv x y
     instResId instCapId
     wireId
     )
     pcSchCv=pcCellView
     masterIpinCv=dbOpenCellViewByType("basic" "ipin" "symbol" nil "r")
     masterOpinCv=dbOpenCellViewByType("basic" "opin" "symbol" nil "r")
     dbCreatePin(dbCreateNet(pcSchCv "I") dbCreateInst(pcSchCv masterIpinCv "I" 2.75:2 "R0"))
     dbCreatePin(dbCreateNet(pcSchCv "O") dbCreateInst(pcSchCv masterOpinCv "0" 4.125:2 "R0"))
     dbFindNetByName(pcSchCv "I")->term->direction="input"
     dbFindNetByName(pcSchCv "O")->term->direction="output"
     dbCreateNet(pcSchCv "gnd!")
    
    ;; NEED TO MARK THE gnd! SIGNAL AS GLOBAL
    dbFindSigByName(pcSchCv "gnd!")~>isGlobal=t
    ;; fprintf(stderr "IS GLOBAL %L\n" dbFindSigByName(pcSchCv "gnd!")~>??)
     
     masterRCv=dbOpenCellViewByType("analogLib" "res" "symbol" nil "r")
     masterCCv=dbOpenCellViewByType("analogLib" "cap" "symbol" nil "r")
     setq(x 2.374) setq(y 2)
     x=x+0.875
     instResId=dbCreateParamInst(pcSchCv masterRCv "R1" (x:y) "R90" 1 list(
     list("r" "string" res)
     ))
     dbCreateInstTerm(dbFindNetByName(pcSchCv "I") instResId dbFindTermByName(masterRCv "PLUS"))
     dbCreateInstTerm(dbFindNetByName(pcSchCv "O") instResId dbFindTermByName(masterRCv "MINUS"))
     instCapId=dbCreateParamInst(pcSchCv masterCCv "C1" (x-0.25:y-0.25) "R0" 1 list(
     list("c" "string" cap)
     ))
     dbCreateInstTerm(dbFindNetByName(pcSchCv "I") instCapId dbFindTermByName(masterCCv "PLUS"))
     dbCreateInstTerm(dbFindNetByName(pcSchCv "gnd!") instCapId dbFindTermByName(masterCCv "MINUS"))
    
    ;I
     wireId=dbCreateLine(pcSchCv list("wire" "drawing") list(
     list(x y)
     list(plus(x -0.5) y)) )
     wireId->net=dbFindNetByName(pcSchCv "I")
     wireId=dbCreateLine(pcSchCv list("wire" "drawing") list(
     list(x-0.25 y)
     list(x-0.25 plus(y -0.25))))
     wireId->net=dbFindNetByName(pcSchCv "I")
     ;0
     wireId=dbCreateLine(pcSchCv list("wire" "drawing") list(
     list(x+0.375 y)
     list(x+0.875 y)))
     wireId->net=dbFindNetByName(pcSchCv "0")
     ;gnd!
     wireId=dbCreateLine(pcSchCv list("wire" "drawing") list(
     list(x-0.25 y-0.625)
     list(x-0.25 y-0.875)
     ))
     wireId->net=dbFindNetByName(pcSchCv "gnd!")
    
    dbClose(masterIpinCv)
     dbClose(masterOpinCv)
     dbClose(masterRCv)
     dbClose(masterCCv)
     t
     ); end let
     );end pcDefine PCell ;}}}schematic
     dbSave(pcSchId) dbClose(pcSchId)
    
    ;{{{symbol
     symId=dbOpenCellViewByType(ddGetObj("test") "rc" "symbol" "schematicSymbol" "w")
    
    ;build itself
     let((hp ss label)
     hp=0.025 ;half pin size
     ss=0.00625 ;snap spacing
    
    ;line
     dbCreateLine(symId '("device" "drawing") list(0:0 0.125:0))
     dbCreateRect(symId '("device" "drawing") list(0.125:-0.125 0.5:0.125))
     dbCreateLine(symId '("device" "drawing") list(0.5:0 0.625:0))
     dbCreatePath(symId '("device" "drawing1") list(0.25:0.03125 0.375:0.03125) 0.025 "extendExtend")
     dbCreatePath(symId '("device" "drawing1") list(0.28125:0.03125 0.28125:-0.0625) 0.025 "extendExtend")
     dbCreatePath(symId '("device" "drawing1") list(0.34375:0.03125 0.34375:-0.0625 0.375: -0.05) 0.025 "extendExtend")
     ; select box
     dbCreateRect(symId list("instance" "drawing") list(0:-0.125 0.625:0.125))
     ;label
     label=dbCreateLabel(symId list("annotate" "drawing7") 0.125:0.1875 "cdsName()" "centerLeft" "R0" "stick" 0.0625)
     label ->labelType="ILLabel"
     ;pin
     dbCreatePin(dbMakeNet(symId "I") dbCreateRect(symId '("pin" "drawing") list(0-hp:0-hp 0+hp: 0+hp)))
     dbCreatePin(dbMakeNet(symId "O") dbCreateRect(symId '("pin" "drawing") list(0.625-hp:0-hp 0.625+hp:0+hp)))
     dbMakeNet(symId "I")->term->direction="input"
     dbMakeNet(symId "O")->term->direction="output"
     label=dbCreateLabel(symId '("pin" "drawing") 0+hp: 0.0625 "I" "centerLeft" "R0" "stick" 0.05)
     label ->labelType="NLPLabel"
     label=dbCreateLabel(symId '("pin" "drawing") 0.625-hp:0.0625 "0" "centerRight" "R0" "stick" 0.05)
     label -> labelType="NLPLabel"
     );end let ;}}}symbol
     symId->instNamePrefix="X"
     dbSave(symId) dbClose(symId)
    );let
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • morrris
    morrris over 1 year ago in reply to Andrew Beckett

    Hi, Andrew

    Thank you for your reply.

    Sorry about that. The code indeed come from OCR-scanned.

    Next time I'll check it before posting it.

    After explaining, I understand what you mean about dbCreateInstTerm and the difference between "->" and "~>".

    Then the netlist is work when I assign the net to global, as you suggested.

    Again, I am really grateful for your help.

    Morrris

    • 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