• 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 16615
  • 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
Parents
  • 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
Reply
  • 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
Children
No Data

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