I want a skill code to add an instance in a schematic sheet.
I tried the following code but it hasn't worked
schHiCreateInst("tsmcN90" component "symbol" "I0" 1 1)
then i call this function using:
I am new to skill so i expect that there are much better ways to do that.
by the way, what does Hi stands for in the word schHiCreateInst??
The "hi" refers to "Human Interface". These are the commands you find when you are interactively working in Composer or Virtuoso. For doing the same thing in Skill code, you want to look for commands without the "hi".
You should be able to use schCreateInst or dbCreateInst. To be honest, I'm not sure what the difference is between the two.
procedure(abc(component) ;First you need to get the master id of the cell you want to place mstr=dbOpenCellViewByType("tsmcN90" component "symbol" "schematicSymbol" "r") schCreateInst(geGetEditCellView() mstr "I0" 0:0 "R0" 1))
Note the following usage info for schCreateInst. If you set the instance name to be nil instead of I0, then Cadence will automatically name the instance uniquely.
schCreateInst( d_cvId d_masterId t_instanceName l_origin t_orient [ n_magnification ] )=> d_inst | nil
Creates an instance of the given master cellview in the specified cellview at the given location with the given orientation. You can specify the magnification to set for the instance. Although not fully supported, you can use this property to scale the appearance of an instance.Derek
In reply to dmay:
My question is the same but is related to the layout.
How can I place an instance in specific coordinates and aslo to change its parameter like W and L. Is there some function with argument the [postitions] and [parameters] ?
For example I want to place an instance with W=3.18u and L=2.22u to coordinates 0.25:5.35
In reply to jazzmatazz:
In this case, since it is a parameterized cell (PCell), you can use something like the following approach - you could create a procedure wrapper around these statements so that your inputs are just the cell to be placed, parameter values and the location of the instance.
geGetEditCellView() ;; the current cellview's dbId
"instLibName" ;; the library where the instance comes from
"instCellName" ;; the name of the cell to be instantiated
"instViewName" ;; the viewname of the cell to be instantiated
symbolToString(gensym("I")) ;; hopefully a unique instance name
0.25:5.35 ;; origin
"R0" ;; orientation
1 ;; number of instances
list(list("l" "float" "2.22u") list("w" "float" "3.18u")) ;; the parameters, types and values
I've put "hopefully" a unique instance name since the code does nothing to check if that instance name already exists in the cellview or not.
There is another similar function dbCreateParamInst which you pass the dbId of the master cell to be placed also - this would be more efficient if you had many instances to be placed since you obtain the master cellview dbId one time before using the function, thus saving looking it up for every instance placement. The above suggestion is generally simpler and should meet your requirements.
In reply to skillUser:
Should l and w values to be in quotes? "2.22u" "3.18u" ?
Because there is some error "invalid float "2.25u"" . And if no there is some other error : Datatype for input parameter "l" do not match the definition. How can I see the exact names of the W and L parameters ?
I apologise, this was an example that I could not test directly. However, it will be dependent on your devices - there is a good chance that "l" and "w" are defined as string parameters and then manipulated into floats either as CDF callbacks or within the PCell code. Look at the device CDF for the cell that you are trying to instantiate (Tools -> CDF -> Edit) and look for the parameters, then see if you can work out those that are actually passed on to the PCell (it may not be "w", for example, but, say, "totalW" and likewise for "l"). The call to dbCreateParamInst or dbCreateParamInstByMasterName is at a low level - if you have the pcDefinePCell code definition, this is what you would match up against.
I hope that this helps.
Thanks for the reminding for the CDF tool, I forgot for it.
Like you mantioned these parameters are string type not float, and dbCreateParamInst now works.