Home > Community > Forums > Custom IC Design > Schematic terminals location and position for automated routing.

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Schematic terminals location and position for automated routing. 

Last post Tue, Jan 12 2010 7:09 PM by Andrew Beckett. 1 replies.
Started by KishanVNs 11 Jan 2010 08:58 AM. Topic has 1 replies and 1484 views
Page 1 of 1 (2 items)
Sort Posts:
  • Mon, Jan 11 2010 8:58 AM

    • KishanVNs
    • Not Ranked
    • Joined on Mon, Jan 11 2010
    • bangalore, Karnataka
    • Posts 3
    • Points 60
    Schematic terminals location and position for automated routing. Reply

    Hi,

     I am trying to create a testchip schematic from a inputfile. But i am facing a small problem.

    i.e when i am trying to find the loaction of the terminals whether they are  top , bottom, left , right .. some times it is working . but some times it is giving nil. which i don't understand at all. Instead of beating around the bush i am trying to find an alternate solution.

     Here is the sample code that i am trying to creat for a single instance.

     /**

    SchConnectivity("Marvel8_testchips" "SingleCell" "padlib_m6p50derclrev18" "PGB_CSEA_CMGPxA_DxAA_BxL")

    **/

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Procedure 1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    procedure( SchConnectivity(templibName tempcellName sourcelibName sourcecellName "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 Loc_x Loc_y Inst_num  cells  direction
            accessdirection 
      )

    ;; Opening the Created Cell View ;;

    cvSinglecell = dbOpenCellViewByType(templibName tempcellName "schematic" "" "a")
    geOpen(    ?lib   "Marvel8_testchips"
            ?cell  "SingleCell"
            ?view  "schematic"
            ?mode  "a"
            )

    /*************************************************************************
    ; symbolId = dbOpenCellViewByType( "ifxbasic" "c_term" "symbol" "" 'r )
    ; instId = schCreateInst( cvSinglecell  symbolId "I23" -10:5 "R0" )
    *************************************************************************/

    ;; Deleting all the content in the present Cell View
    schSelectAllFig( cvSinglecell )
    schHiDelete()

    Loc_x = 0
    Loc_y = 0

    cells = 1000
    Inst_num = sprintf(nil "IN%d" cells)
    symbolId2 = dbOpenCellViewByType( sourcelibName sourcecellName "symbol" "" 'r )
    instId2 = schCreateInst( cvSinglecell  symbolId2  Inst_num   Loc_x:Loc_y "R0" )
    dbClose(symbolId2)
    dbSave(cvSinglecell)
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

        x=1
        y=1
        wireSpace=0.0625
        wireWidth=0
        wireLength=0.6
        cterm_num = 0

    Instance_BBox = cvSinglecell~>instances~>bBox
    println(Instance_BBox )
    foreach( inst cvSinglecell~>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
           
        ;; Reading the lable

    direction =    instTerm~>term~>pins~>accessDir
        accessdirection = caar(direction)
         println(accessdirection)

            case(lowerCase(accessdirection)
                ("top"
                  deltaX=0
                  deltaY=wireLength
                  wireLabel="Drain"
                  wireOrientation="R270"
                  wireJustification="lowerRight"
                )
                ("bottom"
                  deltaX=0
                  deltaY=-wireLength
                  wireLabel="Source"
                  wireOrientation="R90"
                  wireJustification="lowerLeft"
                )
                ("right"
                  deltaX=wireLength
                  deltaY=0
                  wireLabel="Bulk"
                  wireOrientation="R180"
                  wireJustification="lowerRight"
                )
                ("left"
                  deltaX=-wireLength
                  deltaY=0
                  wireLabel="Gate"
                  wireOrientation="R0"
                  wireJustification="lowerLeft"
                )
                ("nil"
                  printf("cannot access direction !!! \n")
                )
              )

            wireEndX=wireOriginX+deltaX
            wireEndY=wireOriginY+deltaY

            ; Create the wire
              termWire=schCreateWire(cvSinglecell "draw" "full"
              list(wireOriginX:wireOriginY wireEndX:wireEndY)
              wireSpace wireSpace wireWidth)
            ; Create the Label
            schCreateWireLabel(cvSinglecell car(termWire)
                                 wireEndX:wireEndY wireLabel
                                  wireJustification wireOrientation
                                  "fixed"  wireSpace nil)

            ; Create the c_term
            cterm_num = cterm_num  +1
            ctermInst_num = sprintf(nil "IN%d" cterm_num)
            ctermid = dbOpenCellViewByType( "ifxbasic" "c_term" "symbol" "" 'r )
            ctermID2 = schCreateInst( cvSinglecell  ctermid   ctermInst_num  wireEndX:wireEndY wireOrientation )
            dbClose(ctermid)

           
            ) ; foreach
        ) ; foreach

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    dbSave(cvSinglecell)
    dbClose(cvSinglecell)
    )
    )
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; END OF Procedure 1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
     

     If you see the above script ther is a line

     

    direction =    instTerm~>term~>pins~>accessDir

     

    from where i get which side the terminal is located.

    But it doesn't work for every thing. Please let me know if you know any other way.

     

    With Regards

    Kishan VNs

    With Regards Kishan VNs
    • Post Points: 20
  • Tue, Jan 12 2010 7:09 PM

    Re: Schematic terminals location and position for automated routing. Reply

    I'd say it's fairly unusual for symbol pins to have the accessDir attribute set. I just looked at a handful of symbols, and the access direction is not set. It was originally intended that this attribute was used for layout pins, to tell routers which direction(s) to approach them from. It can actually be a list of up to four strings, "left" "right" "bottom" and "top" - in your case you're just looking at the first access direction in the list. If no access direction is set, then it will be nil, as you're finding.

    Usually when writing code to route symbols, you look at the position of the centre of the pin figure, and see which edge it is nearest to - often looking at the "instance" box (the "selection box") on the symbol to decide which edge is nearest.

    Here's a snippet of code I've used tor that - given a point, and a bBox - probably the location of the instance box:

        /***************************************************************
        *                                                              *
        *                   (getClosestEdge xy bBox)                   *
        *                                                              *
        *  INTERNAL function to return one of the symbols left, right  *
        *   bottom or top to indicate whether the specified point is   *
        *  closest to which edge - given a bBox of the symbol - prior  *
        *  to adding pins or labels. Helpful to determine orientation  *
        *                       of labels, etc.                        *
        *                                                              *
        ***************************************************************/
        (defun getClosestEdge (xy bBox)
          (let (edgeData distances)
    	(setq edgeData
    	      (list
    		(list (xCoord (lowerLeft bBox)) (xCoord xy) 'left)
    		(list (yCoord (lowerLeft bBox)) (yCoord xy) 'bottom)
    		(list (xCoord (upperRight bBox)) (xCoord xy) 'right)
    		(list (yCoord (upperRight bBox)) (xCoord xy) 'top)
    		))
    	(setq distances 
    	      (foreach mapcar edge edgeData
    		       (list (abs (difference (car edge) (cadr edge)))
    			     (caddr edge))))
    	(cadar (sortcar distances 'lessp))
    	)
          )
    
    

    Regards,

    Andrew.

     

    • Post Points: 5
Page 1 of 1 (2 items)
Sort Posts:
Started by KishanVNs at 11 Jan 2010 08:58 AM. Topic has 1 replies.