radio buttons in pcells

Discussion in 'Cadence' started by rick, May 27, 2010.

  1. rick

    rick Guest

    Thanks for all of the help so far, this thing is actually
    working!....just need to add a few features

    I would like to include a radio button in this pcell that turns on/off
    the taps. Based on the handful of previous posts, this needs to be
    done with the CDF's. The code below creates the tap and CDF's but
    doesnt there need to be an if/then statement or something that gates
    whether to insantiate or not? I was unable to find an example.


    ;;; Parameters
    cdfCreateParam( cdfId
    ?name "ptapBulk"
    ?prompt "substrate tap"
    ?defValue "t"
    ?type "boolean"
    ?editable "t"
    ?display "t"

    )



    ntapId = dbOpenCellViewByType("tsmc13rf" "M1_NWELL"
    "symbolic")
    ntapInst=dbCreateParamInst(cv ntapId
    "ntapWell" 0:0 "R0" 1 list(
    list("row" "int" 1)
    list("column" "int" 5)
    )
    )
    dbClose(ntapId)
    ntapWell = rodGetObj("ntapWell" cv)
    rodAlign(?alignObj ntapWell ?alignHandle "lowerCenter" ?ySep
    halfHeight-0.39 ?xSep 1.5 )
     
    rick, May 27, 2010
    #1
  2. rick wrote, on 05/27/10 23:16:
    Hi Rick,

    First of all, this is a boolean checkbox rather than radio button, but that's
    just a matter of terminology. Radio buttons have a set of mutually exclusive
    choices, rather than just on/off as in this case.

    Secondly, when you define your pcell, you need to define the parameter as
    boolean. For example:


    cvId = pcDefinePCell( list( ddGetObj( libName ) "fingerCap" "layout")

    ;; default parameters setup.
    (
    (startLayer "M1")
    (stopLayer "M2")
    (fingers "2")
    (fingerLength "10")
    (calcTopBarWidth boolean "TRUE")
    ....

    Then what I'd normally do is cope with the fact that the value might be
    "TRUE"/"FALSE" or t/nil:
    calcTopBarWidth=!(calcTopBarWidth=="FALSE" || !calcTopBarWidth)

    And then having done this, you can make your code just have simple if or when
    statements:

    when(calcTopBarWidth
    ... create the objects you want when this is turned on ...
    )

    Regards,

    Andrew.
     
    Andrew Beckett, May 28, 2010
    #2
  3. rick

    rick Guest

    Hi Andrew - what is the correct datatype for the procedure statement,
    not matter what I use, it complains:

    *Error* CCSdrawNand: argument #17 should be a floating point number
    (type template = "dfffxffxffxffxff") - t

    procedure(CCSdrawNand(cv cellHeight
    .....stuff deleted to keep it short............
    iConnWidth outConnWidth ptapInst "dfffxffxffxffxfff")
     
    rick, May 28, 2010
    #3
  4. rick wrote, on 05/28/10 15:42:
    Hi Rick,

    Your question is a bit incomplete. You appear to be passing a t (boolean) when
    it's expecting a float (type template for the 17th argument is "f").

    If you're asking what type template letter to use for a boolean, then use "g"
    (which means "anything"). There's not a boolean type in SKILL - nil means false,
    and anything else means true (with the mild exception of pcells, which also
    allow "FALSE" to represent false).

    Regards,

    Andrew.
     
    Andrew Beckett, May 28, 2010
    #4
  5. rick

    rick Guest

    Hi Andrew - yes, I was inquiring about the datatype. "g" worked but
    also commenting
    the whole ;;;"dfffxffxffxffxfff" out also worked. Is this an
    optional item?

    Thanks

    Rick
     
    rick, May 28, 2010
    #5
  6. rick wrote, on 05/28/10 22:39:
    Rick,

    The type-checking argument is not compulsory, but in cases where you have a lot
    of arguments, it's a good idea as it tends to trap errors sooner rather than
    later. So I would probably keep it and use "g" as I suggested.

    Having no type-checking string is a bit like having "g" as the type-checking
    string (which means g (general) for all arguments - i.e. no type-checking
    performed).

    Regards,

    Andrew.
     
    Andrew Beckett, May 29, 2010
    #6
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.