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.
In reply to skillUser:
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,
In reply to Atul Dwivedi:
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
In reply to NiallDuncan:
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!
Dear Niall, thanks a lot for such a simple solution. I had been hunting around for such an easy solution, but never found it. If you don't mind, can you please elaborate on how you guys know about so many APIs? I mean the Cadence Finder is there and so is the community, what else?
Lawrence, I must thank you for the efforts. My problem is solved by above method, hence would not go for any approach requiring recursion (although that was indeed my last resort!).
The cdsFinder is only a quick reference - I'd advise taking a look at the documentation in more detail (cdnshelp in IC61X releases). There are manuals in there for various SKILL API, in much more depth than the cdsFinder - which is intended really only as a reminder. There are whole manuals for SKILL language, User Interface functions, Design Framework/Virtuoso, Schematic, Virtuoso Layout Suite, etc, etc.
In reply to Andrew Beckett:
'cdnshelp' is indeed a wonderful tool. I am sure this will help me a lot in my work. Thanks a lot for voluntering and helping me out!