• 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. Finding empty area in a selected Region by the user.

Stats

  • Locked Locked
  • Replies 9
  • Subscribers 144
  • Views 2751
  • 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

Finding empty area in a selected Region by the user.

CG20240827312
CG20240827312 6 months ago

Hi, I have been trying to find all of the empty area(without any metal or base layer) in a selected box by the user using enterbox. I used dbLayerAndNot and it works fine but it asks dbids instead of layers and that too of in only current heirarchy and of course performs the function in whole of cellview. Right now iam using text as return and then breaking it using dbLayerTile(). Any suggestions would help.Thanks

  • Cancel
Parents
  • henker
    henker 6 months ago

    abe functions are probably easiest to use for this case if you have octalinear shapes only. These can also go through hierarchy without extra effort.

    abeLayerOrPtArray to define the basic region from your selected box
    foreach layers of interest:
    abeLayerFromCellView to get the areas filled
    abeLayerAndNot to subtract the filled areas from the first
    then iterating over the result with abeTileIterator or abeIslandIterator
    The result are rectangle/polygon coordinates of the empty areas.

    With db functions, you would use dbGetTrueOverlaps or dbGetOverlaps to get all shapes in a defined region. This also returns the objects from lower levels in the hierarchy as nested lists, so the operation is a bit more effort, but the general method is same as above.

    dbCreateRect to define your basic region
    foreach shape returned by dbGetTrueOverlaps or dbGetOverlaps and when of required layer:
    apply instance transformation when from lower hierarchy
    dbLayerAndNot to subtract the shape from the first
    Final result is a list of shapes that cover the empty areas.

    The abe could work on a read-only cellview, while the db functions need it writable as these modify the cellview. This may be a point of interest depending on what you want to do with the "empty areas".

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • henker
    henker 6 months ago

    abe functions are probably easiest to use for this case if you have octalinear shapes only. These can also go through hierarchy without extra effort.

    abeLayerOrPtArray to define the basic region from your selected box
    foreach layers of interest:
    abeLayerFromCellView to get the areas filled
    abeLayerAndNot to subtract the filled areas from the first
    then iterating over the result with abeTileIterator or abeIslandIterator
    The result are rectangle/polygon coordinates of the empty areas.

    With db functions, you would use dbGetTrueOverlaps or dbGetOverlaps to get all shapes in a defined region. This also returns the objects from lower levels in the hierarchy as nested lists, so the operation is a bit more effort, but the general method is same as above.

    dbCreateRect to define your basic region
    foreach shape returned by dbGetTrueOverlaps or dbGetOverlaps and when of required layer:
    apply instance transformation when from lower hierarchy
    dbLayerAndNot to subtract the shape from the first
    Final result is a list of shapes that cover the empty areas.

    The abe could work on a read-only cellview, while the db functions need it writable as these modify the cellview. This may be a point of interest depending on what you want to do with the "empty areas".

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • CG20240827312
    CG20240827312 6 months ago in reply to henker

    Thanks henker that works just perfect. Is there any function that tiles the maximum possible area, i mean the current function is randomly creating tiles deviding the area in smaller parts.Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett 6 months ago in reply to CG20240827312

    You could use cvId~>bBox to find the area of the cellView? It's not clear what you want here...

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • CG20240827312
    CG20240827312 6 months ago in reply to Andrew Beckett

    Hi andrew, actually i have achieved my basic motive, that is to find all of the empty region inside pr boundary. When iam tiling it , it is randomly creating smaller tiles besides each other. What i want is to create tiles of maximum possible area or merge all the smaller tiles to create a rectangle with maximum possible area.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett 6 months ago in reply to CG20240827312

    It would be best if you share your code and a picture showing what you are getting that you want to change. Otherwise there's a bit of guesswork here and an increased likelihood of us answering the wrong question (as I did earlier).

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • CG20240827312
    CG20240827312 6 months ago in reply to Andrew Beckett

    abeinit(cvid)

    x=abeLayerOrPtArray(prboundary~>bBox)

    foreach(layer cvid~>lpps

    c=craeteabelayer()

    a=abeLayerFromCellView(layer~>layerName )

    b=abeLayerAndNot(x a c)

    x=c

    )

    d= abeTileIterator(x)

    while(e=d->next

    dbcreaterect(cvid "text" "drawing" e~>bbox)

    )

    unfortunately i cannot share pictures.

    The only problem with this is tiling as in some places it is randomly adding small rectangles in a much larger area.

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett 6 months ago in reply to CG20240827312

    If you're going to post code with the hope of somebody helping you, please do not post it as you did - full of errors and typos. All it means is that somebody (i.e. me in this case) has to spend a bunch of time correcting the mistakes caused by code that can never have worked as is.

    Anyway, perhaps the simple solution would be to not use tiled output, but use abeLayerToCellView instead with the ?tiles nil argument. For example:

    cvId=geGetEditCellView()
    prBoundary=cvId~>prBoundary
    abeInit(cvId)
    x=abeLayerOrPtArray(prBoundary~>bBox abeNewLayer())
    ;;lpps=setof(lpp cvId~>lpps lpp~>layerName=="Metal3" && lpp~>purpose=="drawing")
    lpps=cvId~>lpps
    foreach(layer lpps
        c=abeNewLayer()
        a=abeLayerFromCellView(layer~>layerName )
        b=abeLayerAndNot(x a c)
        x=c
    )
    
    /*
    d= abeTileIterator(x)
    while(e=d->next
        dbCreateRect(cvId list("text" "drawing") e)
    )
    */
    abeLayerToCellView(x "text" ?tiles nil)
    
    

    Hopefully that does what you want? There's not really much point looping over the tiles or islands if you are just going to create shapes for all of them when abeLayerToCellView does that for you.

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • CG20240827312
    CG20240827312 6 months ago in reply to Andrew Beckett

    apologies for that code, I assumed basic flow to show the motive would do. Thanks for correcting. The actual motive is to create the tiles as i want to use the bbox of these tiles to call a function that adds decaps that sets x and y limits. I am iterating over each of these tiles (if the dx and dy of bbox is greater than capacitor size) and perform the function. The function that i wrote to add decaps only works for rectangular areas. So now when a small tile is being added in middle it is creating a gap between the cap set which otherwise would have been continuous know it is very difficult to understand it when typed, i will try to get and post pictures from my workstation if possible that would help you understand better,Thanks again for your time: here is the code

    cvId=geGetEditCellView()
    prBoundary=cvId~>prBoundary
    abeInit(cvId)
    x=abeLayerOrPtArray(prBoundary~>bBox abeNewLayer())
    ;;lpps=setof(lpp cvId~>lpps lpp~>layerName=="Metal3" && lpp~>purpose=="drawing")
    lpps=cvId~>lpps
    foreach(layer lpps
        c=abeNewLayer()
        a=abeLayerFromCellView(layer~>layerName )
        b=abeLayerAndNot(x a c)
        x=c
    )
    
    
    d= abeTileIterator(x)
    while(e=d->next
    if (abs(caar(e~>bbox)-caadr(e~>bbox)) >10 && abs(cadar(e~>bbox)-cadadr(e~>bbox))>10
    xlim=caadr(e~>bbox)
    ylim=cadadr(e~>bbox)
    addcap(xlim ylim)
    )
    )
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • henker
    henker 6 months ago in reply to Andrew Beckett

    Other option would be to use the abeIslandIterator, which returns polygons (as list of points) instead of fractures tiles. Although it depends on what the next operations would be, resp. if point lists are easier to handle than shapes.

    Just as notice, a look into the documentation would had made that clear from the beginning as the functionality of the iterators is described quite explicit, e.g. abeTileIterator:

    returns an iterator holding a list of tessellated rectangles. If a figure is represented by a polygon in an OpenAccess layer, it is broken into rectangles that do not overlap and have no gaps.

    Regards,

    • 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