Creating schematic by SKILL

Discussion in 'Cadence' started by RolfK, Aug 3, 2008.

  1. RolfK

    RolfK Guest

    Dear Experts,

    I'm quite new to SKILL (schematic) and have somed questions about
    creation of schematics by skill. I had a look in various mails but I
    could not figure out how I get the coordinates of a terminal.
    Afterr I have created some instancies I would like to draw a
    line(wire) between the terminals (pins).
    So, my first idea was is to get the id of the instance and ask for a
    specific terminal. Next to get the coords of it. But this first idea
    seems to be quite wrong.

    Does somebody having an example how to get the cordinates of the
    terminal bbox ?

    Any hint is welcome.
    Rolf
     
    RolfK, Aug 3, 2008
    #1
  2. Look for the pins (which are shapes), not the terminal (which is purely
    logical). And notes that there may be several pins for one terminal.

    On the layout side (I don't remember any equivalent issue with schematic),
    and with OA (CDB has another way to represent the same things but I don't
    remember the details), there is differences between terminals tagged must
    connect (this mean that the user MUST connect all the instterm to the same
    net), having several pins on the same terminal (weak connection, the user
    can't use the fact that the pins are connected to complete a net, the
    internal connection is too resistive for that) and having several shapes
    for the same pin (strong connection).

    Yours,
     
    Jean-Marc Bourguet, Aug 4, 2008
    #2
  3. RolfK

    Riad KACED Guest

    Rolf,

    I'm far away from being the expert you are looking for but here is my
    attempt.
    For more information about the skill functions I've used in there,
    please give it a glance at the following CDS documentation:

    1. The SKILL Language Reference Manual
    UNIX> $CDSHOME/doc/sklangref/sklangref.pdf

    2. The SKILL Language User Guide
    UNIX> $CDSHOME/doc/sklanguser/sklanguser.pdf

    3. The Cadence® Design Framework II SKILL Functions Reference
    UNIX> $CDSHOME/doc/skdfref/skdfref.pdf

    4. Virtuoso® Schematic Editor SKILL Functions Reference
    UNIX> $CDSHOME/doc/skcompref/skcompref.pdf

    /* Skill Starts here rkSchConnectivityExample.il
    1. Load The file into the CIW
    2. launch something like:
    rkSchConnectivityExample("rkWorkLib" "rkSchConnectivityExample")
    */

    procedure( rkSchConnectivityExample(libName cellName "tt")
    let( (masterId x y cvId instTermBbox instTermBboxInCv
    instTermLLX instTermLLY instTermURX instTermURY
    wireOriginX wireOriginY wireSpace wireWidth wireLength
    deltaX deltaY wireLabel wireOrientation wireJustification
    wireEndX wireEndY termWire
    )
    x=1
    y=1
    wireSpace=0.0625
    wireWidth=0
    wireLength=0.6
    ; Open the CV to create
    cvId=dbOpenCellViewByType(libName cellName "schematic"
    "schematic" "w")
    ; Open the master cell to instatiate
    masterId = dbOpenCellViewByType("analogLib" "nmos4"
    "symbol" "schematicSymbol" "r")
    ; Create an instance of analogLib/nmos4 at point 1:1
    schCreateInst(cvId masterId nil x:y "R0")
    ; Search all the instances in the CV
    foreach( inst cvId~>instances
    printf( "Instance : %s\n" inst~>name )
    ; Print all the Instance terminals for each instance found
    ; in the CV.
    foreach( instTerm inst~>instTerms
    ; For each instance terminal, i.e D-S-B-G, get the bbox
    ; of the terminal's little square then use dbTransformBBox
    ; to transform the pin bbox to the cellview
    instTermBbox=car(instTerm~>term~>pins~>fig~>bBox)
    instTermBboxInCv=dbTransformBBox(instTermBbox
    inst~>transform)
    printf( " Instance Terminal= %s : absBbox=%L :
    relBbox=%L\n" instTerm~>name
    instTermBbox instTermBboxInCv)
    ; get the X/Y coordinates from the BBOX
    instTermLLX=xCoord(lowerLeft(instTermBboxInCv))
    instTermLLY=yCoord(lowerLeft(instTermBboxInCv))
    instTermURX=xCoord(upperRight(instTermBboxInCv))
    instTermURY=yCoord(upperRight(instTermBboxInCv))
    wireOriginX=(instTermLLX+instTermURX)/2
    wireOriginY=(instTermLLY+instTermURY)/2
    ; A little bit of code to make a KOF nice schematic
    case(lowerCase(instTerm~>name)
    ("d"
    deltaX=0
    deltaY=wireLength
    wireLabel="Drain"
    wireOrientation="R90"
    wireJustification="lowerRight"
    )
    ("s"
    deltaX=0
    deltaY=-wireLength
    wireLabel="Source"
    wireOrientation="R90"
    wireJustification="lowerLeft"
    )
    ("b"
    deltaX=wireLength
    deltaY=0
    wireLabel="Bulk"
    wireOrientation="R0"
    wireJustification="lowerRight"
    )
    ("g"
    deltaX=-wireLength
    deltaY=0
    wireLabel="Gate"
    wireOrientation="R0"
    wireJustification="lowerLeft"
    )
    (t
    printf("Unknow terminal !!! \n")
    )
    )
    wireEndX=wireOriginX+deltaX
    wireEndY=wireOriginY+deltaY
    ; Create the wire
    termWire=schCreateWire(cvId "draw" "full"
    list(wireOriginX:wireOriginY wireEndX:wireEndY)
    wireSpace wireSpace wireWidth)
    ; createLabel
    schCreateWireLabel(cvId car(termWire)
    wireEndX:wireEndY wireLabel
    wireJustification wireOrientation
    "fixed" wireSpace nil)

    ) ; foreach
    ) ; foreach

    ; Check and save, close the DB and then open the
    ; schematic in Read.
    schCheck(cvId)
    getWarn()
    dbSave(cvId)
    dbClose(cvId)
    geOpen(?lib libName ?cell cellName ?view "schematic"
    ?viewType "schematic" ?mode "r")
    )
    )
    ; Skill Ends here

    Hope this little help you.
    Cheers,
    Riad.
     
    Riad KACED, Aug 5, 2008
    #3
  4. RolfK

    RolfK Guest

    Riad, thanks a lot for the exhaustive examples. I got some snipets
    from Cadence too and the approach seems to be similar. Hence I'm
    confident to manage it now.
    May be I will put back my solution as I could not find any example in
    the comminity before.

    Cheers
    Rolf
     
    RolfK, Aug 5, 2008
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.