• 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. Question about create wire in schematic with SKILL

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 14617
  • 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

Question about create wire in schematic with SKILL

morrris
morrris over 4 years ago

Hi, Cadence Family

I have a question about create wire in schematic with SKILL.

I have created the schematic named "test" where I have 1 cell ( with two port named "src" and "dst") and 1 pin which connected to the "src" port by schCreateWire.

When I directly open the "test" cell in read-only, it look fine. 

But if I add the "test" cell in another schematic then descend it, the wire which created by schCreateWire disappeard.

But the connectivity info still there.

How could I do to keep the wire there?

I would appreciate it if any one could guide me a little ~

Virtuoso version IC6.1.7-64b.500.21

Here is my code:

let((library pcellId)
  library="test"
  cell="test"
  unless(ddGetObj(library) error("Couldn't open library %L" library))
  ;Schematic
  pcellId=pcDefinePCell(
    list(ddGetObj(library) cell "schematic" "schematic")
    ;Formal parameters
    ( (uLib1 "basic") )
    ;Build itself
    let(()
      pcCV=pcCellView
      netPadId=dbCreateNet(pcCV "PAD")
      masterIopinCv=dbOpenCellViewByType(uLib1 "iopin" "symbolr" nil "r")
      PadId=schCreatePin(pcCV masterIopinCv "PAD" "inputOutput" nil -0.2:0 "R0")

      masterCv=dbOpenCellViewByType(uLib1 "cds_thru" "symbol" nil "r")
      instId=dbCreateInst(pcCV masterCv "X1" (0:0) "R0" 1)
      dbCreateInstTerm(netPadId instId dbFindTermByName(masterCv "src"))

      dbCreateConnByName(netPadId instId "src")

      ;PAD
      pinSrc=centerBox(car(dbFindTermByName(masterCv "src")->pins)->fig->bBox)
      padId=schCreateWire(pcCV "route" " full" list(pinSrc list(-0.25 0)) 0.0625 0.0625 0)
      schCreateWireLabel(pcCV car(padId) list(plus((xCoord pinSrc) -0.0625) plus((yCoord pinSrc) 0.0625)) "PAD" "lowerRight" "r0" "stick" 0.0625 nil)

      dbClose(masterIopinCv)
      dbClose(masterCv)
      t
    );end let
  );end pcDefinePCell
  dbSetConnCurrent(pcellId)
  schCheck(pcellId)
  dbSave(pcellId) dbClose(pcellId)

  ;Symbol
  pcellId=pcDefinePCell(
    list(ddGetObj(library) cell "symbol" "schematicSymbol")
    ;Formal parameters
    ()
    let(()
      pcCV=pcCellView
      dbCreateRect(pcCV list("text" "drawing") list(0.125:0 0.875:0.5))
      dbCreateRect(pcCV list("instance" "drawing") list(0:0 1:0.5))
    );end let
  );end pcDefinePCell
  dbSave(pcellId) dbClose(pcellId)

);let

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 4 years ago

    Other than a couple of typos in the code (which I'm sure you must have fixed - " full" had a space and "r0" should have been "R0"), I'm not sure precisely why it is failing, other than the fact that sch* functions are not legal in a PCell anyway. Since they are not valid in PCells (mainly because they wouldn't exist in all executables - for example, the CDL netlister wouldn't work on such a PCell, nor would executables like dbAccess, which doesn't have the schematic APIs), I changed the code to use appropriate db functions instead (I also added local variables in the let, and also commented out a couple of unnecessary lines):

    let((library pcellId)
      library="mylib"
      cell="testschpc"
      unless(ddGetObj(library) error("Couldn't open library %L" library))
      ;Schematic
      pcellId=pcDefinePCell(
        list(ddGetObj(library) cell "schematic" "schematic")
        ;Formal parameters
        ( (uLib1 "basic") )
        ;Build itself
        ; ANDREW - added local variables
        let((pcCV netPadId masterIopinCv PadId wireId masterCv instId
              pinSrc labelId)
          pcCV=pcCellView
          netPadId=dbCreateNet(pcCV "PAD")
          masterIopinCv=dbOpenCellViewByType(uLib1 "iopin" "symbolr" nil "r")
          PadId=schCreatePin(pcCV masterIopinCv "PAD" "inputOutput" nil -0.2:0 "R0")
    
          masterCv=dbOpenCellViewByType(uLib1 "cds_thru" "symbol" nil "r")
          instId=dbCreateInst(pcCV masterCv "X1" (0:0) "R0" 1)
          dbCreateInstTerm(netPadId instId dbFindTermByName(masterCv "src"))
    
          dbCreateConnByName(netPadId instId "src")
    
          ;PAD
          pinSrc=centerBox(car(dbFindTermByName(masterCv "src")->pins)->fig->bBox)
          ; ANDREW - create wire and label using PCell-safe functions
          ; sch functions not allowed in PCells
          wireId=dbCreateLine(pcCV '("wire" "drawing") list(pinSrc list(-0.25 0)))
          wireId~>net=netPadId
          labelId=dbCreateLabel(pcCV '("wire" "label")
            list(plus((xCoord pinSrc) -0.0625) plus((yCoord pinSrc) 0.0625))
            "PAD" "lowerRight" "R0" "stick" 0.0625
          )
          labelId~>parent=wireId
          dbClose(masterIopinCv)
          dbClose(masterCv)
          t
        );end let
      );end pcDefinePCell
    ; ANDREW - these are not needed
    ;  dbSetConnCurrent(pcellId)
    ;  schCheck(pcellId)
      dbSave(pcellId) dbClose(pcellId)
    
      ;Symbol
      pcellId=pcDefinePCell(
        list(ddGetObj(library) cell "symbol" "schematicSymbol")
        ;Formal parameters
        ()
        let(()
          pcCV=pcCellView
          dbCreateRect(pcCV list("text" "drawing") list(0.125:0 0.875:0.5))
          dbCreateRect(pcCV list("instance" "drawing") list(0:0 1:0.5))
        );end let
      );end pcDefinePCell
      dbSave(pcellId) dbClose(pcellId)
    
    );let
    
    
    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • morrris
    morrris over 4 years ago in reply to Andrew Beckett

    Hi, Andrew

    Thank you for your explanation.

    It works fine and helps me a lot ~

    Morrris

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

    Hi, Andrew

    Thank you for your explanation.

    It works fine and helps me a lot ~

    Morrris

    • 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