Home > Community > Forums > Custom IC SKILL > How to instantiate a pcell in another pcell?

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 How to instantiate a pcell in another pcell? 

Last post Thu, Apr 7 2011 8:36 AM by skillUser. 7 replies.
Started by phenixgj 11 Jan 2010 07:55 PM. Topic has 7 replies and 3405 views
Page 1 of 1 (8 items)
Sort Posts:
  • Mon, Jan 11 2010 7:55 PM

    • phenixgj
    • Not Ranked
    • Joined on Tue, Jan 12 2010
    • Posts 6
    • Points 120
    How to instantiate a pcell in another pcell? Reply

     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?

    Filed under: ,
    • Post Points: 20
  • Mon, Jan 11 2010 9:18 PM

    • skillUser
    • Top 10 Contributor
    • Joined on Fri, Sep 19 2008
    • Austin, TX
    • Posts 2,570
    • Points 15,605
    Re: How to instantiate a pcell in another pcell? Reply
    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.
    Filed under: ,
    • Post Points: 20
  • Wed, Jan 13 2010 6:39 PM

    • phenixgj
    • Not Ranked
    • Joined on Tue, Jan 12 2010
    • Posts 6
    • Points 120
    Re: How to instantiate a pcell in another pcell? Reply

    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!

     

     

    • Post Points: 20
  • Wed, Jan 13 2010 6:53 PM

    Re: How to instantiate a pcell in another pcell? Reply

    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.

    • Post Points: 50
  • Wed, Jan 13 2010 7:27 PM

    • phenixgj
    • Not Ranked
    • Joined on Tue, Jan 12 2010
    • Posts 6
    • Points 120
    Re: How to instantiate a pcell in another pcell? Reply

     Cool.

    Problem solved. Thanks for the swift reply,  Andrew.

    • Post Points: 5
  • Tue, Apr 5 2011 6:32 PM

    • Peter123
    • Top 500 Contributor
    • Joined on Tue, Jan 12 2010
    • Posts 19
    • Points 305
    Re: How to instantiate a pcell in another pcell? Reply

    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

     

    • Post Points: 5
  • Tue, Apr 5 2011 6:36 PM

    • Peter123
    • Top 500 Contributor
    • Joined on Tue, Jan 12 2010
    • Posts 19
    • Points 305
    Re: How to instantiate a pcell in another pcell? Reply

     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

    • Post Points: 20
  • Thu, Apr 7 2011 8:36 AM

    • skillUser
    • Top 10 Contributor
    • Joined on Fri, Sep 19 2008
    • Austin, TX
    • Posts 2,570
    • Points 15,605
    Re: How to instantiate a pcell in another pcell? Reply

    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.

    • Post Points: 5
Page 1 of 1 (8 items)
Sort Posts:
Started by phenixgj at 11 Jan 2010 07:55 PM. Topic has 7 replies.