I have been stuck for quite sometime with a requirement, to access the parameter values of each instance (MOS, RES, CAP, VDC...) in a design which has instances of many other cell view, hence creating a hierarchy (These sub-cell views translate to subcircuits in the netlist) .
What I want is, to be able to access recurisively each instance in the design and be able to change the 'w's and 'l' etc. from the top cell view.
As a starting point I have collected some information and coded the following:
Now where to head next? Can anyone suggest?
Thanks and Regards,
See bellow a starting example.
- scan all instances in the cell
- if your isnt has an schematic view descend in it
- if no schematic view available I assume that it is a primitive (I print for it lib/cell)
you should decided the "primitives" lib/cell which are interesting for you.
If your design is big the code bellow may slow,
think of a nonrecursive implementation, or to not visist the already seen lib/cell/view .
;; traverse schematic hier ;; and print all the instances that do not have any schematic view;; most likely those are your primitives;; cv - cv to scan
;; level - level down into hierarchy, used just to indent the printed lines.
procedure( mpTraverseHierSch( cv @optional (level 0) ) foreach(inst cv->instances if( cview = dbGetAnyInstSwitchMaster(inst "schematic") then mpTraverseHierSch(cview level+1) else ;; some preety printing for( i 1 level printf(" ") ) printf("%s %s/%s in %L\n" inst->name inst->libName inst->cellName list(cv->libName cv->cellName cv->viewName)) ) ))mpTraverseHierSch(topCellView)