• 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 instantiate a pcell in another pcell?

Stats

  • Locked Locked
  • Replies 7
  • Subscribers 144
  • Views 18560
  • 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 instantiate a pcell in another pcell?

phenixgj
phenixgj over 15 years ago

 Assume I have alread a pcell library and I would like to create another pcell, which has an instant object of the first pcell.

Could anyone give me a simple example?

  • Cancel
  • skillUser
    skillUser over 15 years ago
    Hi,

    The documentation is a good place to start for this, for example it contains this section:

     
    Creating Instances within Pcells

    It is often useful to create instances of other cells within a pcell. You can also create pcell instances within a pcell. For example, inside your pcell code, you can create the following:

        Get the cellview ID of the cell to add as an instance:

        cellId = dbOpenCellViewByType( gt_lib t_cellName lt_viewName)

        Create an instance of this cell:

        inst = dbCreateInst( d_cellView d_master nil l_point t_orient 1)

        If the instance is a pcell, use

        inst = dbCreateParamInst(
                    d_cellView d_master nil l_point t_orient 1
                         list(
                             list( param1Name "float" 10.)
                             list( param2Name "string" "some string" )

                         ) ; close list

        ) ; close dbCreateParamInst

     Another function, in addition to dbCreateParamInst() is dbCreateParamInstByMasterName().

    Hopefully the above information will help to get you started.  By the way, it often helps if you give information about which version you are using, since new functions are often added to the newer releases, and approaches to some topics change (e.g. things are often done differently in the OpenAccess database than they are under the CDB database) . The above was taken from the IC613 version but I think in this case it is the same as the IC5141 documentation (and the approach is the same too).

    Regards,

    Lawrence.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • phenixgj
    phenixgj over 15 years ago

    Thanks Lawrence.

    But I didn't succeed yet. I tried on a simple example (the parameters pcW pcH pclayer

    don't play a role yet):

    -----------------------

     pcDefinePCell(
      list(ddGetObj("test") "Pcell_test" "layout")
       ( ( pcW 100. )
         ( pcH 100. )
         (pclayer '("WG" "DT_DF_LINE")))

    cellview = dbOpenCellViewByType("test" "Pcell_test" "layout" "maskLayout" "a")
    cv_pcell = dbOpenCellViewByType("oalib" "Rings" "default" "" "r")
    inst = dbCreateParamInst(
                cellview cv_pcell "Rings" list(10 10) "R0" 1
                     list(
                         list( "ringRadius2" "float" 2.)
                         list( "ringRadius1" "float" 2. )
                         list( "deltaXBetweenRi" "float" 5. )              
                     )
    )
    ----------------------------

     I have the existing pcell library "oalib" which is in openaccess database.

    When I load the above script in CIW, it works fine. A pcell "Pcell_test" is created and I checked the layout, everything is fine.

    When I want to test this pcell, I meet the problem. I open another layout view in the same library,  choose create->instance->choose this pcell "Pcell_test", the pcell parameters form appears and I can filled the values for pcW pcH. But when I put the instance(which is a square with red outline), nothing is put in the layout. 

    Could you please help me to find the problem?

    I use  IC613 and openaccess database.

     Thanks  in advance!

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 15 years ago

    The problem is this line in the code:

    cellview = dbOpenCellViewByType("test" "Pcell_test" "layout" "maskLayout" "a")

    pcDefinePCell creates a parameterized cell within the test/Pcell_test/layout view, and the pcell code is responsible for building each subMaster. In your case you are overwriting the pcell within the pcell code, so it's bound to break.

    You should just use:

    cellview=pcCellView

    or better still just use pcCellView whereever you need the cellView to write to. The pcell code automatically has this variable set as the cellView you're building the subMaster in. There's no need to open anything in append mode - pcell subMasters are built in memory only.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • phenixgj
    phenixgj over 15 years ago

     Cool.

    Problem solved. Thanks for the swift reply,  Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Peter123
    Peter123 over 14 years ago

    Hi Andrew,

     CIW return error when i execute the dbCreateParamInsBy... command..

    *Error* car: Can't take car of atom  - "Rows"

    pv = dbOpenCellViewByType(lib cv "layout" "maskLayout" "a")

     dbCreateParamInstByMasterName(pv "TechLib" "M2_M1a" "layout" nil list(0 0) "R0" 1 list("Rows" "int" 5))

     

    I believe is due to the l_param..

     pls advice.

     

    Thanks,

    Peter

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Peter123
    Peter123 over 14 years ago

     Hi Andrew,

     

    CIW return errors when i execute dbCreateParamInstByMasterName command..

    *Error* car: Can't take car of atom  - "Rows"

     

    Here is my code..

     dbCreateParamInstByMasterName(pv "TechLib" "M2_M1a" "layout" nil list(0 0) "R0" 1 list("Rows" "int" 5))

     What went wrong?

     

    Pls advice..

     

    Thanks,

    Peter

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 14 years ago

    Hi Peter,

    The parameters list for dbCreateParamInstByMasterName needs to be a list of lists, something like this:

    dbCreateParamInstByMasterName(pv "TechLib" "M2_M1a" "layout" nil list(0 0) "R0" 1 list(list("Rows" "int" 5)))

    I think that should work.

    Regards,

    Lawrence.

    • 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