Firstly, I am using the Cadence Pcell Layout enviroment to create/modify Pcells. So in other words I am using the pcell menu within the layout window, I am not generating the pcell using skill. I am trying to use an already supported device and I am trying to inherit certain parameters. However, the parameters can only be inherited as a "string". And in order to use this parameter else where within the pcell (i.e. stretch or repitition) it needs to be a "float".
So is there an easy way to convert a string to a float within cadence?
Thanks very much,
one of the easiest ways to do this is to use the function cdfParseFloatString() which takes a numeric string and outputs a floating point number.
In reply to skillUser:
Excellent, that works perfect for what I need. Thanks very much Lawrence.
In reply to Patrick1982:
I was about to ask a similar question relating to an earlier post i had made which was:
1) How to determine which type a variable is?
2) How to convert variable types (which i have an idea of now with the parse example from Lawrence)
Specifically my issue is that i have assigned the w&l of a transistor to variables X & Y but when i do X*Y it does not work, i assume its the format of the w&l initially OR that in assigning them to new variable names i have not specified a variable type therefore string is assumed. As if you type: 500n*2u directly into the CIW it returns a result OK.
In reply to stuso:
The type() function will tell you the type of a variable (actually, to be precise, it tells you the type of the data pointed to by the variable, as variables do not have a type).
To produce strings, the best way is to use something like:
sprintf(nil "%g" X*Y)
For example. What you have to set the parameters of a transistor to depends on things like the type of the parameter in the CDF and/or the type of the pcell parameter (I'm not quite sure exactly what you're trying to do) - it all depends on how it has been defined.
In reply to Andrew Beckett:
i am trying to estimate area of layout from schematic, so for example i have assigned gate length to a variable:
if(sd_instance~>cellName == "nmos_myPDK"
sd_length = sd_instance~>l
so basically i have assigned gate length to "sd_length". I just did as you suggested:
so i guess if i convert string to flonum (or some such number) then i can begin to multiple width x length x fingers...etc.
Hi Lawrence and Andrew,
I've got another question for you guys. Similar to my original question, I have a string "3u" but I want to convert it to a float, is there a way for me to just ignore the "u" in the string?
Thanks very much,
Not directly related to your question, but to what you want to do.
In the "Virtuoso Preview Fundamentals Reference" documentation "installdir/doc/prfref/prfref.pdf" (in IC 5.1.41 installation tree) there is a skill procedure example that estimate the layout area from schematic. Procedure name is "areaEstSchematic" (p638) may it help you.