• 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. Temporarily Flattening Pcells

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 142
  • Views 16597
  • 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

Temporarily Flattening Pcells

archive
archive over 17 years ago

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
  • Cancel
  • archive
    archive over 17 years ago

    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
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    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
    getAndDrawBoxes.il
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    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
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    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
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    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
    • 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