• 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 pass CDF parameter's value of an instance in schematic...

Stats

  • Locked Locked
  • Replies 9
  • Subscribers 144
  • Views 9601
  • 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 pass CDF parameter's value of an instance in schematic pcell to CDF parameter of schematic pcell

patwardg
patwardg over 12 years ago

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,

  • Cancel
Parents
  • patwardg
    patwardg over 12 years ago

     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,

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • patwardg
    patwardg over 12 years ago

     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,

    • 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