Home > Community > Forums > Custom IC SKILL > Temporarily Flattening Pcells

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: *

 Temporarily Flattening Pcells 

Last post Tue, Jun 10 2008 5:25 PM by archive. 5 replies.
Started by archive 10 Jun 2008 05:25 PM. Topic has 5 replies and 4695 views
Page 1 of 1 (6 items)
Sort Posts:
  • Tue, Jun 10 2008 5:25 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    Temporarily Flattening Pcells Reply

    I am using the bounding boxes of all shapes in a cell database at all hierarchy levels.
    I run into problems when encountering PCells that are stretched or otherwise altered since when opening the pcell I loose all the parameters.

    Is there any way to access the drawn shapes in a pcell with parameters?

    I searched and found this:

    You can't - these only work with database objects in the current cellView. You'd need to flatten first, or use a verification tool (e.g. Diva, Assura) to do the layer manipulation. You could use dbFlattenInst() to bring everything to the current cellView, or copy the source shapes to dummy shapes in the top cellView and then work on those.

    I've used a flow in the past where I've used dbGetOverlaps to find hierarchical shapes, work out the transformation by concatenating all the transforms, and then use dbCopyFig to copy into the top level cellView, and then use dbLayerAnd on these shapes - and then delete the "flattened" copies.

    Regards,

    Andrew.

    The data must be there because the shapes in a pcell have to be drawn. Can I access those "drawn" bBoxes through SKILL?


    Originally posted in cdnusers.org by ahamlett
    • Post Points: 0
  • Tue, Jun 10 2008 9:48 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    RE: Temporarily Flattening Pcells Reply

    Can't quite remember where I said that, but I'm 99% sure you're quoting me in the wrong context.

    You definitely can access the shapes in an evaluated pcell. If you have an instance of the pcell in your layout, then doing:

    instId~>master

    will give you the cellView ID of the "subMaster" of the pcell - i.e. the layout of the particular variant that has been instantiated. A pcell consists of the "superMaster" (which is what you get when you open it directly), and a collection of "subMasters" - one per variant. The subMaster is a readonly representation of all the objects in the layout, and you can read the shapes and so on it in it in exactly the way you would with any other layout.

    Regards,

    Andrew.


    Originally posted in cdnusers.org by adbeckett
    • Post Points: 0
  • Wed, Jun 11 2008 2:47 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    RE: Temporarily Flattening Pcells Reply

    Thanks Andrew. Since you seem to know your way around the database structure, is there a way to access the subMaster of a mosaic instance?

    Mosaics slow down my function considerably. Here is my test code (also attached):

    procedure( getAndDrawBoxes(@optional original cvId transform mosaic) prog( (winId temp a b c cell x1 y1 x2 y2 x y orient mag box i j boxes uX uY oX oY rows cols) if(dbobjectp(cvId) then if(dbobjectp(cvId~>master) then cell = cvId~>master else cell = cvId ) foreach(a cell~>layerPurposePairs ; loop through layers foreach(b a~>shapes ; loop through shapes if(stringp(b~>layerName) then x = nth(0 nth(0 transform)) y = nth(1 nth(0 transform)) orient = nth(1 transform) mag = nth(2 transform) if(!floatp(x) then x = 0.0 ) if(!floatp(y) then y = 0.0 ) if(!stringp(orient) then orient = "R0" ) if(!floatp(mag) then mag = 1.0 ) box = b~>bBox if(length(mosaic) != 0 then box = list(list((nth(0 nth(0 box)) + nth(0 mosaic)) (nth(1 nth(0 box)) + nth(1 mosaic))) list((nth(0 nth(1 box)) + nth(0 mosaic)) (nth(1 nth(1 box)) + nth(1 mosaic)))) ) box = geTransformUserBBox(box list(x:y orient mag)) dbCreateRect(original list("marker" "warning") box) ;println(box) ) ) ) ; Check instances foreach(a cvId~>instances if(a~>objType != "mosaicInst" then x = nth(0 a~>xy) y = nth(1 a~>xy) orient = a~>orient mag = a~>mag if(!floatp(x) then x = 0.0 ) if(!floatp(y) then y = 0.0 ) if(!stringp(orient) then orient = "R0" ) if(!floatp(mag) then mag = 1.0 ) if(length(transform) != 0 then temp = dbConcatTransform(list(list(x y) orient mag) transform) else temp = list(list(x y) orient mag) ) getAndDrawBoxes(original a~>master temp) else orient = car(a~>mosaic~>tileArray) rows = a~>mosaic~>rows cols = a~>mosaic~>columns uX = a~>mosaic~>uX uY = a~>mosaic~>uY oX = nth(0 a~>mosaic~>xy) oY = nth(1 a~>mosaic~>xy) if(orient == "R90" then temp = rows rows = cols cols = temp temp = uY uY = uX * -1 uX = temp ) if(orient == "R180" then uX = uX * -1 uY = uY * -1 ) if(orient == "R270" then temp = rows rows = cols cols = temp temp = uX uX = uY * -1 uY = temp ) if(orient == "MY" then uX = uX * -1 ) if(orient == "MYR90" then temp = rows rows = cols cols = temp temp = uY uY = uX * -1 uX = temp * -1 ) if(orient == "MX" then uY = uY * -1 ) if(orient == "MXR90" then temp = rows rows = cols cols = temp temp = uY uY = uX uX = temp ) if(uX < 0 then oX = oX * -1 ) if(uY < 0 then oY = oY * -1 ) if(length(transform) != 0 then temp = transform else temp = list(list(0.0 0.0) "R0" 1.0) ) for(y 0 (rows - 1) ; expand mosaic rows for(x 0 (cols - 1) ; expand mosaic columns getAndDrawBoxes(original a~>master dbConcatTransform(list(list(oX oY) orient 1.0) temp) list((x * uX) (y * uY))) ) ) ) ) else winId = hiGetCurrentWindow() if(winId == nil then return(t) ) cvId = geGetWindowCellView(winId) if(cvId == nil then return(t) ) getAndDrawBoxes(cvId cvId) ) ) )


    Originally posted in cdnusers.org by ahamlett
    • Post Points: 0
  • Wed, Jun 11 2008 4:14 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    RE: Temporarily Flattening Pcells Reply

    Disregard the

    if(dbobjectp(cvId~>master) then
    cell = cvId~>master
    else
    cell = cvId
    )

    since it is not used.


    Originally posted in cdnusers.org by ahamlett
    • Post Points: 0
  • Thu, Jun 12 2008 6:23 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    RE: Temporarily Flattening Pcells Reply

    You seem to be doing a lot of unnecessary manipulation of separating out x and y, and using nth() all over the place (use car() and cadr() rather than nth). Also, the manipulation of mosaics looks unnecessarily complex - you shouldn't need all that coding for different orientations. Take a look at my sourcelink solution 11328674 - this is doing a similar job of concatenating transforms - although the object of the code is to flatten a specific layer, rather than just report the bBox.

    The code is written in LISP syntax, but I don't think that should prevent you understanding it. In many cases you can use the "transform" attribute to do the transformation. Note that the code in the solution copes with both IC5141 and IC61; it handles the differences in OA - mosaics are a little different, and vias are now separate objects.

    Regards,

    Andrew.


    Originally posted in cdnusers.org by adbeckett
    • Post Points: 0
  • Thu, Jun 12 2008 7:50 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    RE: Temporarily Flattening Pcells Reply

    Thanks, but I don't have a Cadence sourcelink account at the moment. I'll see about creating one but would you mind posting the source code somewhere else temporarily?


    Originally posted in cdnusers.org by ahamlett
    • Post Points: 0
Page 1 of 1 (6 items)
Sort Posts:
Started by archive at 10 Jun 2008 05:25 PM. Topic has 5 replies.