• 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. skill code to place all layout cells in a Virtuoso lib to...

Stats

  • Locked Locked
  • Replies 12
  • Subscribers 143
  • Views 21856
  • 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

skill code to place all layout cells in a Virtuoso lib to top level cell

mantang
mantang over 7 years ago

Hi

I would like to instantiate all layout cells in a lib to newly created top cell and run DRC on all cells at the same time. Each layout cell cannot be overlapped in the top cell.

Does anyone have SKILL code or similar code to achieve this goal ?

Thanks,

ManChak

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

    /* CCFplaceAllInstances.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Dec 01, 2017 
    Modified   
    By         
    
    Place an instance of each layout in a library into a cellView
    
    examples 
    
    CCFplaceAllInstances(?libName "stdcellLib" ?viewName "layout" ?columns 20
       ?spacing 2.0)
    CCFplaceAllInstances(?cv cvId ?libName "stdcellLib" ?spacing 4.0)
    
    ***************************************************
    
    SCCS Info: @(#) CCFplaceAllInstances.il 12/01/17.06:33:20 1.1
    
    */
    
    /***************************************************************
    *                                                              *
    *      CCFplaceAllInstances(@key (cv geGetEditCellView())      *
    *         libName viewName (spacing 5.0) (columns 10))         *
    *                                                              *
    *    Place an instance of every layout from library libName    *
    *  with view viewName (or if viewName not specified, pick all  *
    *   maskLayout view types from the library) in rows with up    *
    * to columns instances per row. Additional spacing (specified  *
    *    by the ?spacing argument) is added between instances.     *
    *                                                              *
    ***************************************************************/
    
    procedure(CCFplaceAllInstances(@key (cv geGetEditCellView()) 
        libName viewName (spacing 10.0) (columns 10))
      let((master masterDdId (x 0.0) (y 0.0) maxY width height (column 0))
        ;--------------------------------------------------------------------
        ; Iterate over all cells and views in the library, and either pick the
        ; matching viewName or views with type maskLayout
        ;--------------------------------------------------------------------
        foreach(cell ddGetObj(libName)->cells
          foreach(view cell->views
            master=nil
            if(viewName then
              when(view->name==viewName
                master=dbOpenCellViewByType(libName cell->name viewName)
              )
            else
              masterDdId=ddGetObj(libName cell->name view->name "*")
              when(masterDdId && ddMapGetFileViewType(masterDdId)=="maskLayout"
                master=dbOpenCellViewByType(libName cell->name view->name)
              )
            )
            when(master
              ;--------------------------------------------------------------
              ; Place instance, and then increment position based on size of
              ; the instance placed
              ;--------------------------------------------------------------
              destructuringBind(((llx lly) (urx ury)) master~>bBox
                width=urx-llx
                height=ury-lly
                maxY=if(maxY max(maxY height) height)
                dbCreateInst(cv master "" x-llx:y-lly "R0")
                column=mod(column+1 columns)
                if(zerop(column) then
                  x=0.0
                  y=y+maxY+spacing
                  maxY=nil
                else
                  x=x+width+spacing
                )
                dbClose(master)
              )
            )
          )
        )
        t
      )
    )
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Srikanth51
    Srikanth51 over 4 years ago in reply to Andrew Beckett

    I am seeing following ERROR when i run the command 

    CCFplaceAllInstances(?libName "work_test" ?viewName "layout" ?columns 20 ?spacing 2)

    *Error* dbCreateInst: argument #1 should be a database object (type template = "ddgltxg") - nil

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to Srikanth51

    You either need to run it with a layout window open and the current window (which is not the case for you, because otherwise the ?cv argument to the function would have had the default value of geGetEditCellView() - if that is returning nil, it means there is no current window for it to place the instances into), or you need to pass ?cv cvId where cvId is the database id of the cellView you're trying to place the instances into.

    If you're trying to do this from batch (without any windows open),  you'd do:

    cvId=dbOpenCellViewByType("mylib" "allCells" "layout" "maskLayout" "w")
    CCFplaceAllInstances(?cv cvId ?libName "work_test" ?viewName "layout" ?columns 20 ?spacing 2)

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Srikanth51
    Srikanth51 over 4 years ago in reply to Andrew Beckett

    Thanks @andrew..  for the quick response 

    It worked with the layout opened 

    To do in a batch mode .. Can you send me updated skill code with the updates 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to Srikanth51
    Srikanth51 said:
    To do in a batch mode .. Can you send me updated skill code with the updates

    The code doesn't need updating. It works as-is (i.e. as posted back in 2017), and I gave an example of how to do this in batch mode in my last reply. The code was already designed to be used either with an interactive window, or a specified cellView id.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to Srikanth51
    Srikanth51 said:
    To do in a batch mode .. Can you send me updated skill code with the updates

    The code doesn't need updating. It works as-is (i.e. as posted back in 2017), and I gave an example of how to do this in batch mode in my last reply. The code was already designed to be used either with an interactive window, or a specified cellView id.

    Andrew.

    • 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