• 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. flattening an instance and then removing certain layers

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 18220
  • 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

flattening an instance and then removing certain layers

ssarik
ssarik over 9 years ago

Hi,

I am trying to create an instance of a cellview in my layout (the cel view can contain one or more pcells) and then remove certain layers from it (like all the metal 2 and metal 3 layers).

The process which I am following is as follows:

1. Create an instance of the object in my cellview

2. Flatten the instance till 10 level of hierarchy (10 is a randomly chosen number, my hierarchy will not exceed 10)

3. Get the list of all the db objects in the cellview

4. delete all the shapes with layer type as metal2 or metal3

5. save and close

I am able to create the instance in my cell view and it is flattened but the shapes are not removed.

I get the following error in the console window:

.

.

dbGetq: object is a purged/freed object - db:0x21776ca2
type: nil
dbGetq: object is a purged/freed object - db:0x21776ca3
*WARNING* (DB-270063): dbDeleteObject: Invalid database object 0
dbGetq: object is a purged/freed object - db:0x21776ca3
type: nil
dbGetq: object is a purged/freed object - db:0x21776ca4
*WARNING* (DB-270063): dbDeleteObject: Invalid database object 0
dbGetq: object is a purged/freed object - db:0x21776ca4

.

.

.

Below is my code:


cellview = dbOpenCellViewByType( libraryName viewname1 "layout" "maskLayout" "w")

instA2 = dbOpenCellViewByType( libraryName viewname2 "layout" "maskLayout" "r" )

instIdA2 = dbCreateInst(cellview instA2 "inst1" list(0 0) "R0" 1)

dbFlattenInst(instIdA2 10 t t)


allShapes = cellview~>shapes

(foreach shape all_shapes

   if((member(shape~>layerName toRetain) == nil) then
       dbDeleteObject(shape)

)
)

dbClose(inst)
dbSave(cellview)
dbClose(cellview)

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    There was an enhancement CCR for this in the past, but it was rolled into another CCR which only implemented part of the requested functionality (dbFlattenInst2). I've filed enhancement CCR 1530372 to make up for the earlier one having been only partially fixed.

    In the meantime, you can use this code, which has similar semantics to dbFlattenInst2 (which was added in IC6.1.6). The usage would be something like this:

    figsA=abFlattenInst2(inset 5 `(nil flattenVias t flattenPCells t))

    Regards,

    Andrew

    /* abFlattenInst2.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Jan 25, 2016 
    Modified   
    By         
    
    Like dbFlattenInst2 but returns a list of the resulting figures.
    Has same call signature as dbFlattenInst2
    
    ***************************************************
    
    SCCS Info: @(#) abFlattenInst2.il 01/25/16.11:41:11 1.1
    
    */
    
    /***************************************************************
    *                                                              *
    *         abFlattenInst2(instId levels options "dxg")          *
    *                                                              *
    *    Wrapper around dbFlattenInst2 to return a list of the     *
    *                       resulting shapes                       *
    *                                                              *
    ***************************************************************/
    
    procedure(abFlattenInst2(instId levels options "dxg")
        let((cv bBox (before makeTable('before nil)))
            cv=instId~>cellView
            bBox=instId~>bBox
            foreach(fig dbProduceOverlap(cv bBox 0)
                before[fig]=t
            )
            when(dbFlattenInst2(instId levels options)
                setof(fig dbProduceOverlap(cv bBox 0)
                    !before[fig]
                )
            )
        )
    )
    

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    There was an enhancement CCR for this in the past, but it was rolled into another CCR which only implemented part of the requested functionality (dbFlattenInst2). I've filed enhancement CCR 1530372 to make up for the earlier one having been only partially fixed.

    In the meantime, you can use this code, which has similar semantics to dbFlattenInst2 (which was added in IC6.1.6). The usage would be something like this:

    figsA=abFlattenInst2(inset 5 `(nil flattenVias t flattenPCells t))

    Regards,

    Andrew

    /* abFlattenInst2.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Jan 25, 2016 
    Modified   
    By         
    
    Like dbFlattenInst2 but returns a list of the resulting figures.
    Has same call signature as dbFlattenInst2
    
    ***************************************************
    
    SCCS Info: @(#) abFlattenInst2.il 01/25/16.11:41:11 1.1
    
    */
    
    /***************************************************************
    *                                                              *
    *         abFlattenInst2(instId levels options "dxg")          *
    *                                                              *
    *    Wrapper around dbFlattenInst2 to return a list of the     *
    *                       resulting shapes                       *
    *                                                              *
    ***************************************************************/
    
    procedure(abFlattenInst2(instId levels options "dxg")
        let((cv bBox (before makeTable('before nil)))
            cv=instId~>cellView
            bBox=instId~>bBox
            foreach(fig dbProduceOverlap(cv bBox 0)
                before[fig]=t
            )
            when(dbFlattenInst2(instId levels options)
                setof(fig dbProduceOverlap(cv bBox 0)
                    !before[fig]
                )
            )
        )
    )
    

    • 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