Hi everyone I am using SKILL to generate a schematic.
So I am using schReplaceProperty function, but i have some problems. How can I get the names used for the instance parameters? The way i do it is call:
schReplaceProperty(inst "name" "value")
So for width appearing (in Property editor and edit object properties) "Total Width" this is not the case. Apparently When I insert for name "Total Width" i get a user property named Total, apparently it does not like space :)
The "Total Width" is the prompt defined in the CDF, so what you want to find are the names of the properties.
In your CIW, you can type this to see the names and values:inst~>prop~>nameinst~>prop~>value
I have a little convenience command I have defined to a bindkey in the CIW (one of the function keys). First I select an instance in the schematic (or layout) and press this bindkey. It will store the car(selectedSet()) in a global variable 'X' and the cdf in a variable 'CDF' so I can easily reference them in the CIW while debugging. It also prints out all the properties, their prompts, their types and their values in an easy to read table:
procedure(mysel() let((promptTable) X=car(geGetSelectedSet()) promptTable = makeTable("cdfPrompts" nil) when(X~>objType=="inst" CDF = cdfGetInstCDF(X) foreach(p CDF~>parameters promptTable[p~>name] = p~>prompt ) ) printf("X = %L (%L)\n" X X~>objType) if(X~>prop then printf(" \nProperties on selected object:\n") printf("CDF Prompt Property Name (type) Value\n") printf("============================================================\n") foreach(prop X~>prop printf("%-25s = %-25s: %L\n" promptTable[prop~>name]||"no cdf" sprintf(nil "%s (%s)" prop~>name prop~>valueType) prop~>value) ) else printf("No properties on selected object\n") ) t ))Also, as a shortcut, you can set properties like this:
inst~>name = "myname"
You can define "name" during dbCreateInst as well.
I hope this helps.
Thanks for your reply.
When you say inst~>prop~>name in ICW you mean for inst i choose the instance name in properties?
for example I have generated the schematic through SKILL but when i type:
*Error* get/getq: first arg must be either symbol, list, defstruct or user type - "U78"
U78 is the instance name of a MOSFET, as defined through my SKILL code
Also when I try through my SKILL code to do:
mstr = dbOpenCellViewByType("UMC_18_CMOS" "N_18_MM" "hspiceD")
inst = dbCreateInst(cvid mstr sprintf(nil "U%L" k) x:y "R0" 1)
I get in CIW nil.
Any idea where the error could be?
Sotiris,The inst I was referring to is an object id like the one returned from dbCreateInst. There are several ways to get the object id:
1. inst = dbCreateInst(cvid mstr nil x:y "R0" 1)2. inst = dbFindAnyInstByName(cvid "U78")3. Select the instance in the cellView and then do: inst = car(selectedSet())
You need to understand the difference between the objects and their names and in the case of parameters, their prompts can be different from the names. Just as you can't do "U78"~>, you also can't do "Total Width"~>. The reason I sent you the sample procedure called "mysel" was to show you how to identify the the parameter name so you can access the parameter object.
cdfGetInstCDF is going to return an object id for the cdf, it is not going to return a string. Try loading and running the procedure I sent. Hopefully this will clarify some things for you. Load the code in the CIW, select the instance in your schematic and then run mysel() in your CIW.
cdf = cdfGetInstCDF(inst)This will get the cdf for the instance object id stored in the variable called inst. From this cdf object id, you can then obtain other information from its attributes and properties. To see what is availble on that object id, do the following in your CIW:
If the inst you are referring to is a pcell with a cdf, you should see a list of object ids when you do ~>? and a list of lists of each object's attributes and values when you do ~>??.
Let's say you have a cdf and one of the prompts is "Total Width". You can get this specific parameter from the cdf this way:tw = car(setof(x cdf~>parameters x~>prompt=="Total Width))
The setof command looks at all the parameter ids and finds the one with a prompt attribute equal to "Total Width". It returns this parameter in a list, so we take the car of it and store it in a variable called tw. Now, you can get its name:tw~>nametw~>value
Once you know that name, you can access it directly on the inst id. Lets say the name of the "Total Width" parameter is "totalWidth", then you can do this:inst~>totalWidthorinst~>master~>parameters~>totalWidth
Do some playing around until you get comfortable with object ids.
I accessed the number of fingers & width using cdf command.
The code is
x=car(geGetSelectedSet())x~>objType=="inst"cdf = cdfGetInstCDF(x)cdf~>parametersfingers = car(setof(x cdf~>parameters x~>name=="mi"))num_of_fingers=fingers~>value=1
But when i force the value to change to some other value, its giving a warning saying,
*WARNING* Invalid CDF param value
The MOS just disappears, & there will be a text layer in the laout window saying
"pcell Eval Failed".
Please help me out,
Thanks & Regards,