pcell with multiple layouts

Discussion in 'Cadence' started by rick, Jun 29, 2010.

  1. rick

    rick Guest

    I have created two versions of pcell (same schematic) that has 2
    different layouts which currently in separate skill routines. I
    would like to have one cell that has a cyclic button to select the
    desired layout. What is the best
    way to implement this type of feature? A code example would be
    greatly appreciated

    Thanks

    Rick
     
    rick, Jun 29, 2010
    #1
  2. rick

    rick Guest

    Ive managed to get the layouts to switch but the CDF's (parameters)
    are not switching/updating. One of the
    differences is some of the parameters are not editable.

    Rick
     
    rick, Jun 30, 2010
    #2
  3. rick

    rick Guest

    I kinda got it to work but the CDF/parameters are not quite right. If
    you enter in values that are ok for layout-1 they are
    carried into layout-2 even though they are not editable....they should
    revert back to the default values. Example, layout-1
    has variable a finger count whereas layout-2 does not, its hard
    coded. I guess I need some type of reset routine or something?

    Rick
     
    rick, Jun 30, 2010
    #3
  4. rick

    I-F AB Guest

    Hi Rick,

    How about something like below:


    pcDefinePCell(
    list( ddGetObj("Tech250") "nmos" "layout" )

    ;;; parameter defaults
    ( ( lch "0.5u" ) ( wch "0.6u" ) (switchPcell "pcell1" )
    ( finger "1" ) ( totalch "0.6u" ) ( Gconn "None" )
    ( SDconn "None" ) ( Bulktie "None" ) ( TapSpa "0.3u" )
    ( TapRow "1" )
    )

    if( switchPcell == "pcell1" then
    MOS_PCell_1(lch wch "nmos" finger Gconn SDconn Bulktie TapSpa
    TapRow)
    else
    MOS_PCell_2(lch wch "nmos" finger Gconn SDconn Bulktie TapSpa
    TapRow)
    )

    ) ; pcDefinePCell


    MOS_PCell_1 & MOS_PCell_2 are 2 procedures where you define layers,
    shapes, etc.
    'switchPcell' is a CDF parameter (default points to MOS_PCell_1()
    procedure) which controls which layout to use.
     
    I-F AB, Jun 30, 2010
    #4
  5. rick

    rick Guest

    I have something very close and the layout does switch but the
    property panel does not update with the
    correct fields for the new layout after the second switch......like
    that makes sense! :^) Restated.....

    1) compile the cell, instantiate and query. Everything is correct.
    layoutA --> parameters for A

    2) switch for layoutB
    layoutB --> parameters for B (yay!)

    3) switch back to layoutA
    layoutA --> parameters for B still :^(

    Rick
     
    rick, Jun 30, 2010
    #5
  6. rick

    I-F AB Guest

    I believe the problem now is how your parameters interact.
    By the way, are you using CDF parameters?
    Better take a look at how to use them.

    The CDF parameter 'switchPcell' can hide CDF parameter "TapSpa" from
    the form in this example :

    cdfCreateParam( cdfId
    ?name "TapSpa"
    ?prompt "Tap Extension"
    ?units "lengthMetric"
    ?defValue "300.0n"
    ?type "string"
    ?display " equal(cdfgData->switchPcell->value
    \"pcell1\") "
    ?callback "MOS_PCell_1( 'TapSpaR )"
    ?parseAsNumber "yes"
    ?parseAsCEL "yes"
    )



    Best regards,
    I-FAB
     
    I-F AB, Jul 2, 2010
    #6
  7. rick

    rick Guest

    Just to confirm, use the CDF equation to select whether a parameter is
    visible...is that correct?
    One other issue, I need to reset one of the parameters back to the
    default value. Would the
    same methodology work?

    Thanks
     
    rick, Jul 2, 2010
    #7
  8. rick

    I-F AB Guest

    Hi,

    Yes, the command equal() controls visibility of the parameter form,
    use editable() command if needed.
    To reset parameters back to default, maybe you would need to specify
    in a callback
    (here would be the callback trigger when changing the 'switchPcell'
    parameter) i.e. using something like :

    ;;;callback procedure
    .......
    cdfgData->Param1_MOS_PCell_1->value = cdfgData->Param1_MOS_PCell_1-
    cdfgData->Param2_MOS_PCell_1->value = cdfgData->Param2_MOS_PCell_1-
    cdfgData->Param3_MOS_PCell_1->value = cdfgData->Param3_MOS_PCell_1-
    .......

    There might be a better/simpler way to do this but this is what I
    have.

    Best regards,
    I-FAB
     
    I-F AB, Jul 5, 2010
    #8
  9. rick

    rick Guest

    Can you please provide an example this, I am syntax-tically
    challenged! :^)

    Thanks

    Rick
     
    rick, Jul 6, 2010
    #9
  10. rick

    rick Guest

    Ive tried many different combinations and result is the same, the
    layout changes but the
    property form does not unless I change another parameter, then it
    syncs up. Could any
    of the other CDF's cause this like dontSave or storeDefaults? The
    write in the manual
    is overly helpful. Basically this variables determine if the
    parameter is saved...but saved
    where?

    Rick
     
    rick, Jul 7, 2010
    #10
  11. rick

    I-F AB Guest

    Hi,

    Could you give an example how you load your CDF parameters?
    The CDF parameters is saved to the mos cell you are creating.
    You can edit/add from the CIW menu if you don't want to use the
    cdfCreateParam() function.
    Just open the menu Tools > Edit > CDF in CIW & remember to set CDF
    Type as "Base".
    If there are Warnings/Errors, it should provide some clues if the CDF
    parameters are loaded succesfully or not.

    Best regards,
    I-FAB
     
    I-F AB, Jul 7, 2010
    #11
  12. rick

    rick Guest

    The CDF's are created in the code with cdfCreateParam() function. The
    cell compiles clean, no errors and everything works.
    The only problem is that the property form. The cell has 2 layout
    options that are selectable with a parameter switch. Once
    you select the second layout, the layout will change and the
    parameters will also update. Select the original layout and the
    form is now out of sync as some of the parameters are different.
    Change any of the parameters and it is back in sync.

    1) compile the cell, instantiate and query. Everything is correct.
    layoutA --> parameters for A

    2) switch for layoutB
    layoutB --> parameters for B (yay!)

    3) switch back to layoutA
    layoutA --> parameters for B still :^(

    I need a force re-load of the form or something.
     
    rick, Jul 7, 2010
    #12
  13. rick

    I-F AB Guest

    Hi,

    Just need to backtrace a bit:
    That is what I meant in the example:
    cdfCreateParam( cdfId
    ?name "switchPcell"
    ?prompt "Pcell switch"
    ?defValue "layoutA"
    ?choices '("layoutA" "layoutB")
    ?type "cyclic"
    ?callback "MOS_CB( 'switchPC )"
    ?display "t"
    )
    cdfCreateParam( cdfId
    ?name "Width_layoutA"
    ......
    ?display " equal(cdfgData->switchPcell->value \"layoutA\") "
    ......
    )
    cdfCreateParam( cdfId
    ?name "Width_layoutB"
    ......
    ?display " equal(cdfgData->switchPcell->value \"layoutB\") "
    ......
    )

    So, the parameter "TapSpa_layoutA" will be on display only if
    'switchPcell' parameter is selected as "layoutA" & hence similarly for
    "layoutB".
    No reloading of the form, just control when the parameters are
    displayed.
    But it means you have to have separate 'Width' parameters for each
    cell configuration.

    I'm not sure if you can do something like:
    cdfCreateParam( cdfId
    ?name "Width"
    ?prompt if( cdfgData->switchPcell->value == "layoutA"
    then "Width for configuration layoutA"
    else "Width for configuration layoutB" )
    ...... if( .... then ... else ...)
    ?display "t"
    ......
    )
    But I think this is possible too.

    From the code above, there is a callback procedure being invoked:
    MOS_CB( 'switchPC )
    Set defaults for any parameter you want whenever the 'switchPcell'
    parameter to switch is thrown.
    I can't see any of your code so I don't know where the problem is.

    Best regards,
    I-FAB
     
    I-F AB, Jul 8, 2010
    #13
  14. rick

    rick Guest


    I dont see my last post so let me recap. The original problem was
    that I had the CDF's in the
    pcell code so it was stepping on itself. the form mostly updates
    except for the fields that need
    to be reset to defaults. I am hardcoding it in the routine call but
    would prefer to set it with a callback
    but cant get that to work. There is a solution on sourcelink that I
    used a model/guide but it has no
    effect.

    Rick
     
    rick, Jul 8, 2010
    #14
  15. rick wrote, on 07/08/10 05:36:
    Rick,

    Just got to catching up with comp.cad.cadence after some days of being too busy
    to look at it.

    The fundamental problem is that everyone is running blind here - we cannot know
    what you're actually doing because you're not giving enough details.

    It all sounds rather dubious to me, and dangerous. Pcells should not interfere
    with CDF parameters (although they can read pcells). Also, you should read my
    solution "The Dangers of CDF callbacks" just to make sure you know what you're
    getting yourself into.

    You reference a solution on sourcelink but don't say what it is.

    Please help us to help you - withholding information is not going to get you an
    answer, and tests the patience of those who want to help...

    Regards,

    Andrew.
     
    Andrew Beckett, Jul 9, 2010
    #15
  16. rick

    rick Guest

    Ive had some problems with posts saying that they were successful but
    never showed up.
    I know you are not a fan of callbacks and Im only using them because
    the PDK uses them heavily
    so it a requirement.

    Im creating a high level pcell that instantiates PDK pcells and the
    layout has 2 different implementations
    which with restrictions depending on the layout that is selected. I
    created both versions independently
    for the initial build then was the last step was to combine them into
    on cell. The CDF's were stepping on
    each other which caused some pretty strange behavior.

    The good news is that I got it working finally but still have one
    issue left, the libinit.il file for Assura to run.
    This pcell is currently comprised of 3 different files layoutA,
    layoutb, and the code to combine which might
    not be the best way but there will be other cells and it would be nice
    to be able to keep them separate.
    I was able to band-aid it by cat'ing all off the files together into
    one file and use that in the libInit. What is
    the syntax to load multiple files.

    Thanks to all!

    Rick
     
    rick, Jul 9, 2010
    #16
  17. rick wrote, on 07/09/10 22:04:
    load("file1.il")
    load("file2.il")
    load("file3.il")

    (or loadi if your code has errors in it and you don't want to do the right thing
    and fix the errors).

    Isn't this obvious? I'm assuming there must be some complexity to your question
    that I can't guess...

    Perhaps there would be some benefit in attending a SKILL class?

    Regards,

    Andrew.
     
    Andrew Beckett, Jul 12, 2010
    #17
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.