radio buttons in pcells

R

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 wrote, on 05/27/10 23:16:
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 )
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.
 
On May 28, 12:49 am, Andrew Beckett <andr...@DcEaLdEeTnEcTe.HcIoSm>
wrote:
rick wrote, on 05/27/10 23:16:



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 )

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.
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 wrote, on 05/28/10 15:42:
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")
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.
 
On May 28, 10:44 am, Andrew Beckett <andr...@DcEaLdEeTnEcTe.HcIoSm>
wrote:
rick wrote, on 05/28/10 15:42:



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")

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.
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 wrote, on 05/28/10 22:39:
On May 28, 10:44 am, Andrew Beckett<andr...@DcEaLdEeTnEcTe.HcIoSm
wrote:
rick wrote, on 05/28/10 15:42:



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")

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.

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,

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.
 

Welcome to EDABoard.com

Sponsor

Back
Top