• 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. How to open two layouts, copy them into a third and sav...

Stats

  • Locked Locked
  • Replies 9
  • Subscribers 143
  • Views 16980
  • 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

How to open two layouts, copy them into a third and save

LostInRTN
LostInRTN over 16 years ago

I'm writing a script that will run automatically using icfb -nograph -replay script.il. I need it to open three layouts, and copy all the contents of two of the layouts into the third, then save it, close and exit.

I was originally going to use (procedure and let's omitted):
      window1 = dbOpenCellViewByType(Dir Name1 "layout" "" "w")
      window2 = dbOpenCellViewByType(Dir Name2 "layout" "" "r")
      geSelectAll()
      geCopySelSet()
      hiSetCurrentWindow(window1)
      mouseAddPt()
      dbClose(window2)
      window3 = dbOpenCellViewByType(Dir Name3 "layout" "" "r")
      geSelectAll()
      geCopySelSet()
      hiSetCurrentWindow(window1)
      mouseAddPt()  ;
      dbClose(window3)
      dbSave(window1)
      dbClose(window1)
However, dbOpenCellViewByType opens it in memory but doesn't open a window, so the geSelectAll() won't work. geOpen() just opens a design, but not a window- should I use hiOpenWindow + geOpen?

Also, the object returned by dbOpenCellViewByType doesn't match what hiSetCurrentWindow wants. And, I'm not sure how to end the geCopySelSet command- it wants a location to put the copied objects and there's no user to click the mouse.

 Thanks for any help

Tom Spargo

  • Cancel
Parents
  • skillUser
    skillUser over 16 years ago

    Ah yes, I forgot about instances etc. so Andrew's suggestion is really a better approach, and simpler too.
    Just for a brief reference, the dbFlattenInst() function is shown here:

    dbFlattenInst(
      d_instId
      x_levels
      [ g_flattenPCells ]
      [ g_preservePins ]
      [ g_preserveRODobjs ]
    )

    So the code might look something like this:

    procedure(CCScopyCellsToNew(@key lib1 cell1 (view1 "layout")
       lib2 cell2 (view2 "layout")
       libName cellName (viewName "layout") "ttttttttt")
      let(Cv_dest Cv_src1 Cv_src2 id1 id2)
       if(Cv_dest = dbOpenCellViewByType(libName cellName viewName "maskLayout" "w") then
        Cv_src1 = dbOpenCellViewByType(lib1 cell1 view1 "maskLayout" "r")
        Cv_src2 = dbOpenCellViewByType(lib2 cell2 view2 "maksLayout" "r")
        id1 = dbCreateInst(Cv_dest Cv_src1 "I1" 0:0 "R0")
        id2 = dbCreateInst(Cv_dest Cv_src2 "I2" 0:0 "R0")
        dbFlattenInst(id1 32 t t t)
        dbFlattenInst(id2 32 t t t)
        dbSave(Cv_dest)
        dbClose(Cv_dest)
        dbClose(Cv_src1)
        dbClose(Cv_src2)
       else
        warn("CCScopyCellsToNew: could not open destination cell for writing: %s %s %s" libName cellName viewName)
       ); if
      ); let
    ); procedure CCScopyCellsToNew

     

    This is completely untested, I just typed it in, but I expect it is about right, though it may need some tweaking or debugging.

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • skillUser
    skillUser over 16 years ago

    Ah yes, I forgot about instances etc. so Andrew's suggestion is really a better approach, and simpler too.
    Just for a brief reference, the dbFlattenInst() function is shown here:

    dbFlattenInst(
      d_instId
      x_levels
      [ g_flattenPCells ]
      [ g_preservePins ]
      [ g_preserveRODobjs ]
    )

    So the code might look something like this:

    procedure(CCScopyCellsToNew(@key lib1 cell1 (view1 "layout")
       lib2 cell2 (view2 "layout")
       libName cellName (viewName "layout") "ttttttttt")
      let(Cv_dest Cv_src1 Cv_src2 id1 id2)
       if(Cv_dest = dbOpenCellViewByType(libName cellName viewName "maskLayout" "w") then
        Cv_src1 = dbOpenCellViewByType(lib1 cell1 view1 "maskLayout" "r")
        Cv_src2 = dbOpenCellViewByType(lib2 cell2 view2 "maksLayout" "r")
        id1 = dbCreateInst(Cv_dest Cv_src1 "I1" 0:0 "R0")
        id2 = dbCreateInst(Cv_dest Cv_src2 "I2" 0:0 "R0")
        dbFlattenInst(id1 32 t t t)
        dbFlattenInst(id2 32 t t t)
        dbSave(Cv_dest)
        dbClose(Cv_dest)
        dbClose(Cv_src1)
        dbClose(Cv_src2)
       else
        warn("CCScopyCellsToNew: could not open destination cell for writing: %s %s %s" libName cellName viewName)
       ); if
      ); let
    ); procedure CCScopyCellsToNew

     

    This is completely untested, I just typed it in, but I expect it is about right, though it may need some tweaking or debugging.

    Regards,

    Lawrence.

    • 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