• 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 can I make this code to work in CDB database

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 13669
  • 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 can I make this code to work in CDB database

varun kumar D
varun kumar D over 10 years ago

Hello,

Following density code I have written for the cadence OA database but it is not working in CDB since the command is not available.

Do we have any alternate of this   dbGetHierPathTransform(overlap)  to return the list of databse ID in the CDB databse.

cadence version ( 5141usr6_ams13.1_mmsim)

************************************************
id=nil
m2=list("M2" "drawing")
m3=list("M3" "drawing")
m5=list("M5" "drawing")
procedure(vdDensity()
cv=geGetEditCellView()
;m3ob=nil
bbox=nil
total_area=nil
area1=nil
area_final=0

points= enterBox(
?prompts list("Enter the first corner of your box."
"Enter the last corner of your box.")
; ?doneProc "boxDone"

)

x1=car(car(points))
y1=car(cdr(car(points)))
x2=caadr(points)
y2=car(cdr(yCoord(points)))
;bbox=list(list(x1 y1) list(x2 y2))


if(id then dbDeleteObject( id))

when(cv~>mode!="r"
id=dbCreateRect(cv list("text" "drawing") list(list(x1 y1) list(x2 y2)))
)
wid=x2-x1
leng=y2-y1
total_area=abs(wid*leng)

;name= enterString(
;?prompts list( "Enter order of Devices" )
;)

name=CSVreport~>width~>value

Ent=dbGetOverlaps(cv points list(name "drawing") 32 t)
cv1=dbOpenCellViewByType(cv~>libName symbolToString(gensym(cv~>cellName))
"layout" "maskLayout" "s" )

rectid=dbCreateRect(cv1 m2 list(list(x1 y1) list(x2 y2)))

abCopyOverlapShapeToNewCell(Ent cv1)

andIds=dbLayerAnd(cv1 m3 tempObjs list(rectid))
tileid=dbLayerTile(cv1 m5 andIds)

foreach(den tileid

bbox=den~>bBox
x3=caar(bbox)
y3=cadar(bbox)
x4=caadr(bbox)
y4=cadadr(bbox)
dx=x4-x3 dy=y4-y3
area1=abs(dx*dy)

area_final=area1+area_final


)

TotalDen=area_final/total_area


DENSITY=TotalDen*100

printf("%f " DENSITY)


outputWindow()
dbClose(cv1)
)

procedure(abCopyOverlapShapeToNewCell(objcts cv1)
tempObjs=nil
flattenendFigList2=foreach(mapcar overlap objcts
srcShape=abGetOverlapShape(overlap)
tempObj=dbCopyFig(srcShape cv1 dbGetHierPathTransform(overlap))
tempObjs=cons(tempObj tempObjs)
)
)

procedure(abCopyOverlapShape(objcts)
tempObjs=nil
flattenendFigList2=foreach(mapcar overlap objcts
srcShape=abGetOverlapShape(overlap)
tempObj=dbCopyFig(srcShape cv dbGetHierPathTransform(overlap))
tempObjs=cons(tempObj tempObjs)
)
)

procedure(abGetOverlapShape(overlap)
if(listp(overlap) then
when(overlap
abGetOverlapShape(cadr(overlap))
)
else
overlap
)
)

procedure(vdWindow()
width = hiCreateStringField(
?name 'width
?prompt "LAYER_NAME"
)

CSVreport = hiCreateAppForm(
?name 'CSVreport
?formTitle "ENTER LAYER NAME"
?formType 'nonoptions
?callback "vdDensity()"
?fields list(list(width 0:10 200:30 100) )
)
hiDisplayForm(CSVreport)
)

procedure(outputWindow()
DENSITY1=sprintf(DENSITY1 "%f " DENSITY)
density = hiCreateOutputStringField(
?name 'density
?prompt strcat(name " density is in %")
?value DENSITY1
)

CSVrepor11 = hiCreateAppForm(
?name 'CSVreport11
?formTitle "Output Density"
?formType 'nonoptions
?fields list(list(density 0:10 200:30 150) )
)
hiDisplayForm(CSVreport11)
)

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 10 years ago
    /* abGetHierPathTransform.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Apr 27, 2014 
    Modified   
    By         
    
    IC61X has a function dbGetHierPathTransform which takes one of the 
    outputs from dbGetOverlaps and gives you the overall transformation.
    This function did not exist in IC5141. So this code provides an
    equivalent function which handles mosaics (i.e. when the fifth
    argument to dbGetOverlaps is t, which returns the mosaic index information)
    
    Note that the code assumes the rotation semantics for IC5141 for
    mosaics; if dbGetHierPathTransform is available, it uses that.
    
    Also contains an implementation of a function to return the leaf shape
    itself - abGetHierPathShape. A combination of these can be used to
    copy a figure to the top level coordinate space, or transform points
    or bBox to the top level.
    
    Test functions are at the bottom of the code (I have layouts with
    lots of "F" shapes with different orientations, in mosaics or not, at
    different levels of hierarchy).
    
    ***************************************************
    
    SCCS Info: @(#) abGetHierPathTransform.il 04/27/14.07:24:39 1.1
    
    */
    
    
    /********************************************************************
    *                                                                   *
    *                 (abGetHierPathTransform overlap)                  *
    *                                                                   *
    *     An equivalent of the IC61 dbGetHierPathTransform function     *
    * which also works in IC5141 and earlier. If dbGetHierPathTransform *
    *   is available, it uses that - otherwise it does the same thing   *
    *              itself, making sure it handles mosaics.              *
    *                                                                   *
    ********************************************************************/
    
    (defun abGetHierPathTransform (overlap)
      (if (isCallable 'dbGetHierPathTransform)
        (dbGetHierPathTransform overlap)
        (if (listp overlap)
          (dbConcatTransform
            (abGetHierPathTransform (cadr overlap))
            (if (listp (car overlap))
              (let (mosaic xy row col)
                (setq mosaic (dbGetq (caar overlap) mosaic))
                (setq row (cadar overlap))
                (setq col (caddar overlap))
                (setq xy
                      (list
                        (plus (xCoord (dbGetq mosaic xy))
                              (times col (dbGetq mosaic uX)))
                        (plus (yCoord (dbGetq mosaic xy))
                              (times row (dbGetq mosaic uY)))
                        ))
                (list xy (car (dbGetq mosaic tileArray)) 1.0)
                )
              (if (equal (dbGetq (car overlap) objType) "mosaicInst")
                (error "Encountered mosaicInst %L - should have used t as 5th arg of dbGetOverlaps"
                       (car overlap))
                (dbGetq (car overlap) transform)
                )
              )
            )
          (list 0:0 "R0" 1.0)
          )
        )
      )
    
    /***************************************************************
    *                                                              *
    *                 abGetHierPathShape (overlap)                 *
    *                                                              *
    *             Find the leaf shape from an overlap              *
    *                                                              *
    ***************************************************************/
    
    (defun abGetHierPathShape (overlap)
      (if (listp overlap)
        (abGetHierPathShape (cadr overlap))
        overlap))
    
    /***************************************************************
    *                                                              *
    *            (abTestHierPathTransformCB wid points)            *
    *                                                              *
    *   addPointProc for the test function. Finds an overlapping   *
    * shape at the clicked point (on Metal2) and copies it to top  *
    *                       level on Metal3.                       *
    *                                                              *
    ***************************************************************/
    
    (defun abTestHierPathTransformCB (wid points)
      (let (newPoint newFig)
        (setq newPoint (car (last points)))
        (foreach overlap 
                 (dbGetOverlaps (geGetEditCellView wid) (list newPoint newPoint)
                                "Metal2" 32 t)
                 (setq newFig
                       (dbCopyFig (abGetHierPathShape overlap)
                                  (geGetEditCellView wid)
                                  (abGetHierPathTransform overlap)))
                 (dbSetq newFig "Metal3" layerName)
                 )
        )
      )
    
    /***************************************************************
    *                                                              *
    *                  (abTestHierPathTransform)                   *
    *                                                              *
    *             Interactive test for this function.              *
    *                                                              *
    ***************************************************************/
    
    (defun abTestHierPathTransform ()
      (enterPoints
        ?prompts (list "Click on a shape")
        ?addPointProc "abTestHierPathTransformCB"
        )
      )
    
    
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • varun kumar D
    varun kumar D over 10 years ago
    thanks..function solved the purpose
    • 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