I am in want of a simple procedure to set the componet values (eg. w,l of MOS; capacitance value of a cap) in the schematic from a file. The input file may contain the desired component value in the required format.
Please tell me if this is possible. If yes, please suggest the appropriate APIs to do the same and what all formatted information should the input file store.
Thanks in advance.
If the ID of your capacitor is "instId" and if you have the schematic open then you can modify its parameters using the code below. Then you just need to read in the values from a file which should be straight forward.
;; Select the instancegeDeselectAll()geSelectObject( instId );; Call the "Edit Object Properties" dialog;; Using this method ensures that callbacks are maintainedschHiObjectProperty();; Update the instance propertiesschObjPropForm->w->value = "2u"schObjPropForm->l->value = "0.5u";; Close the formhiFormDone(schObjPropForm);; Unselect the instancegeDeselectAll()
You may wish to look at this code from the support site. When changing instance parameters through SKILL, the CDF callbacks would not be invoked, so you will also most likely need the following solution code also: How to invoke CDF callbacks procedurally through SKILL
Then the only piece missing for you is to have a file of an appropriate format and read it in using SKILL - let us know if you need help with that part.
Thank you both of you!
Lawrence, a special thanks for providing those links. I am yet to deeply understand these codes. But before that I just want to confirm that are these compatible with a hierarchy of cellViews? For eg. I have one topLevel and three instances of another CellView (and further nesting is possible). We can assume the name of the subcircuit instance in the topLevel (and at all levels) is available in the input file. Is the code capable of handling this level of complexity. If not, then can you please further suggest me how do I go about it?
Thanks and Regards,
If you provide the library and cellview name in your file, then you can open each cellview in append mode using:
cellId = dbOpenCellViewByType("myLibrary" "myCellView" "schematic" "schematic" "a")
To get a particular instance you use:
instId = dbGetInstanceByName(cellId, "myInstanceName")
Do some modifications. And when you are complete you would save the changes and close the cell
To be clear, the code for changing instance parameters works at the current level only, so you would need to do something like what Niall is suggesting. The callback-invoking code is called per-cellview also, but you can call it for all cellviews in a library, for example, so you can perform all the parameter updates first and then you could force all the callbacks for everything afterwards.
To expand through the hierarchy, you could control it from the top-level using the names found in the file, and you would need to intelligently handle how to push down more than one level if needed. An alternative approach is to expand everything in the hierarchy (assuming that you need to change something at all levels, for example). In this case you might find code similar to that found in this solution helpful, it contains an example of a recursive function for expanding or traversing all cells in the hierarchy.
Good luck with the coding!