Home > Community > Forums > Custom IC SKILL > how to pass CDF parameter's value of an instance in schematic pcell to CDF parameter of schematic 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 pass CDF parameter's value of an instance in schematic pcell to CDF parameter of schematic pcell 

Last post Thu, Feb 14 2013 9:33 AM by patwardg. 7 replies.
Started by patwardg 24 Jan 2013 12:41 PM. Topic has 7 replies and 1831 views
Page 1 of 1 (8 items)
Sort Posts:
  • Thu, Jan 24 2013 12:41 PM

    • patwardg
    • Not Ranked
    • Joined on Thu, Jan 24 2013
    • Posts 5
    • Points 70
    how to pass CDF parameter's value of an instance in schematic pcell to CDF parameter of schematic pcell Reply

    An explanation of the problem I am facing is in order -

    I have created a schematic pcell (A) in which I am instantiating the instance of a foundry delivered pcell (B). There are some independent (e.g. Bp, Bq ) and some dependent CDF parameters (e.g. Bx) defined for the CDF  of the pcell B.

    So, Bx = FB_callback(Bp Bq)

    Bx is calculated whenever I change Bp or Bq, using a call back function which I have absolutely no access to.

    I have created 2 independent CDF  parameters for A (which is the pcell I created) - Ap and Aq. In the code for my schematic pcell I pass these values Ap and Aq to Bp and Bq respectively. Something like this -

    master_b = dbOpenCellViewByType( "foundry_library" "foundry_cell_B" "symbol" )
    inst_b = dbCreateInst( pcCellView master_b "I_B" list( 0.0 0.0 ) "R0")
    inst_b~>Bp = Ap
    inst_b~>Bq = Aq

    However, after this when I print out the inst_b~>Bx then I see that it is not getting changed and is always the default.

    How do I make sure that the callback routine for the foudry cell gets called? Also how do I pass the new value of Bx back into my pcell's CDF Ax?

    Thanks,

    • Post Points: 20
  • Thu, Jan 24 2013 12:50 PM

    Re: how to pass CDF parameter's value of an instance in schematic pcell to CDF parameter of schematic pcell Reply

    I suggest using the code in solution 11018344 to call the callbacks.

    Regards,

    Andrew.

    • Post Points: 20
  • Fri, Jan 25 2013 9:53 AM

    • patwardg
    • Not Ranked
    • Joined on Thu, Jan 24 2013
    • Posts 5
    • Points 70
    Re: how to pass CDF parameter's value of an instance in schematic pcell to CDF parameter of schematic pcell Reply

     Hi Andrew,

    Thanks for the quick reply.

    The solution worked and I was able to update the CDF values of the foundry instances.

    Although how do I pass them into the CDF values of the schematic pcell, from the schematic pcell code? When I use cdfgData variable in the pcell code, it's giving me an unbound variable error.

    Thanks,

    • Post Points: 20
  • Sat, Jan 26 2013 11:20 AM

    Re: how to pass CDF parameter's value of an instance in schematic pcell to CDF parameter of schematic pcell Reply

    I don't really understand. The schematic pcell will receive the pcell parameters (which will probably correspond to CDF parameters), and then it can operate on those. It wouldn't access the CDF of the cell. It's quite right that cdfgData should not be defined. So I'm not really sure what you're trying to do and what you are expecting to work - can you describe this carefully (ideally with the code that isn't working)?

    Thanks,

    Andrew.

     

    • Post Points: 20
  • Mon, Jan 28 2013 9:46 AM

    • patwardg
    • Not Ranked
    • Joined on Thu, Jan 24 2013
    • Posts 5
    • Points 70
    Re: how to pass CDF parameter's value of an instance in schematic pcell to CDF parameter of schematic pcell Reply

     Hey Andrew,

    Sorry for not being able to describe it correctly, being a novice in this field. Here's an example of a section of the code that I am working on. I am calling the pcell code first (pcDefinePCell and my_schpcell_code) followed by the code to create the CDF for my schematic pcell. I have also included the relevant section of the cdfdump I performed on the foundry's pcell.

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

     ;;pcell code
    pcDefinePCell(
      list(ddGetObj(<my_lib_name>) <my_cell_name> "schematic" "schematic")
      (
        (gw "float" 5.0)
        (gl "float" 5.0)
        (gtotcap "string" "1p")
      )
      my_schpcell_code(pcCellView gw gl garea gtotcap)
    )

    procedure(my_schpcell_code(id gw gl garea gtotcap gm dnw)
      let((
            master_fc inst_fc master_mos inst_mos master_pin inst_pin_plus inst_pin_minus
            capnet_minus capnet_plus capterm_minus capterm_plus mim_bot_minus mim_top_plus mos_minus_minus mos_plus_plus mos_sub_minus
            pin_plus pin_minus
            pt_mim_top pt_mim_bot pt_mos_plus pt_mos_minus pt_mos_sub
            node_plus node_minus_1 node_minus_2
            wire_mim_top wire_mim_bot wire_mos_plus wire_mos_minus wire_mos_sub wire_mos_sub_1 wire_plus wire_minus
            elipse_radius
          )
        master_fc = dbOpenCellViewByType( "<foundry_lib_name>" "<foundry_cell_name" "symbol" )
        inst_fc = dbCreateInst( pcCellView master_fc "I_MIM_SCH" list( 0.0 0.0 ) "R0")
                               |
                               |
        <other code for creating pins, wires, connections etc. for the schematic pcell>
                               |
                               |
        inst_fc~>w = ftos(gw, 1)
        inst_fc~>l = ftos(gl, 1)
        CCSinvokeInstCdfCallbacks(inst_fc)
        fprintf(stdout "inst_fc~>ctotal = %L\n" inst_fc~>ctotal) [I could see here that the ctotal gets updated after calling CCSinvokeInstCdfCallbacks function]
      )
    )

    procedure(my_callback()
      when(boundp('cdfgData)
        let( ((cdf cdfgData))
            ;cdf~>garea~>value = cdf~>gw~>value * cdf~>gl~>value
          cdf~>gtotcap~>value = ????? [here is where I don't understand how to pass the value of ctotal to the cdf that I defined]
        )
      )
    )

    ;;cdf code without the simulator information
    let( (id cdfid)
      when(id = dbOpenCellViewByType("<my_lib_name>" "<my_cell_name>" "layout")
        when(cdfid=cdfGetBaseCellCDF(id~>cell)
          cdfDeleteCDF(cdfid)
        )
        cdfid = cdfCreateBaseCellCDF(id~>cell)
        foreach(param reverse(id~>parameters~>value)
          unless(param~>name == "dnw"
            cdfCreateParam(cdfid
              ?name        param~>name
                ?type        param~>valueType
                ?prompt        case(param~>name
                          ("gw" "width (um)")
                          ("gl" "length (um)")
                          ("gtotcap" "Total Capacitance")
                        )
                ?defValue    unless(param~>value=="FALSE" param~>value)
                ?callback    "my_callback()"
                ?editable    case(param~>name
                                (("gl" "gw" ) "t")
                                (("gtotcap") "nil")
                        )
              ?display case(param~>name
                         (("gtotcap") "nil")
                         (("gw" "gl") "t")
                       )
            )
          )
        )
      )
    )

    ;;here is the relevant portion of the cdf dump of the foundry cell
        cdfCreateParam( cdfId
            ?name           "l"
                    :
                    :
                    :
            ?callback       "<foundry_callback>('l)"
        )
        cdfCreateParam( cdfId
            ?name           "w"
                    :
                    :
                    :
            ?callback       "<foundry_callback>('w)"
        )
        cdfCreateParam( cdfId
            ?name           "ctotal"
                    :
                    :
                    :
            ?callback       "<foundry_callback>('ctotal )"
        )
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

     I hope I have decribed it correctly this time. When I instantiate the schematic pcell that I created and change it's properties, I see that the callbacks get called first followed by my schematic pcell code. So should I be reversing the order in which I tried to create the pcell and the cdf? Am I using the correct way to create the schematic pcell and its CDF?

    Thanks,

    • Post Points: 5
  • Thu, Feb 14 2013 7:34 AM

    • patwardg
    • Not Ranked
    • Joined on Thu, Jan 24 2013
    • Posts 5
    • Points 70
    Re: how to pass CDF parameter's value of an instance in schematic pcell to CDF parameter of schematic pcell Reply

     Hello Andrew,

    Did you get a chance to look at the code example I posted earlier? Any comments?

    Thanks,

    • Post Points: 20
  • Thu, Feb 14 2013 9:15 AM

    • theopaone
    • Top 75 Contributor
    • Joined on Tue, Feb 12 2013
    • Cedar Park, TX
    • Posts 98
    • Points 1,470
    Re: how to pass CDF parameter's value of an instance in schematic pcell to CDF parameter of schematic pcell Reply

     Looking at your code I see two parameter names: ctotal and gtotcap but I can't find where you set up the relationship. Is gtotcap defined as a vendor parameter?

     Ted

    • Post Points: 20
  • Thu, Feb 14 2013 9:33 AM

    • patwardg
    • Not Ranked
    • Joined on Thu, Jan 24 2013
    • Posts 5
    • Points 70
    Re: how to pass CDF parameter's value of an instance in schematic pcell to CDF parameter of schematic pcell Reply

     "gtotcap" is a cdf parameter that I defined for my schematic pcell and I want it to assign a value of "ctotal" which is actually a cdf parameter of the foundry delivered pcell that i am instantiating in my schematic pcell

    • Post Points: 5
Page 1 of 1 (8 items)
Sort Posts:
Started by patwardg at 24 Jan 2013 12:41 PM. Topic has 7 replies.