Home > Community > Forums > Custom IC SKILL > SKILL code to traverse the hierarchy of cellviews in schematic

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 SKILL code to traverse the hierarchy of cellviews in schematic 

Last post Mon, Jun 3 2013 8:58 PM by Atul Dwivedi. 2 replies.
Started by Atul Dwivedi 03 Jun 2013 03:12 AM. Topic has 2 replies and 1731 views
Page 1 of 1 (3 items)
Sort Posts:
  • Mon, Jun 3 2013 3:12 AM

    SKILL code to traverse the hierarchy of cellviews in schematic Reply

    Hi there,

    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:

    currentSession=asiGetSession(hiGetCurrentWindow())

    topCellView=asiGetTopCellView(currentSession)

    Now where to head next? Can anyone suggest?

    Thanks and Regards,

    Atul 

    • Post Points: 20
  • Mon, Jun 3 2013 5:15 AM

    • marcelpreda
    • Top 200 Contributor
    • Joined on Tue, Jan 19 2010
    • Bucharest, Romania
    • Posts 44
    • Points 715
    Re: SKILL code to traverse the hierarchy of cellviews in schematic Reply

    Hi Atul,

    See bellow a starting example.

    The idea:

    - 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 .

    BR,

    Marcel

     

     ;; 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)

    • Post Points: 20
  • Mon, Jun 3 2013 8:58 PM

    Re: SKILL code to traverse the hierarchy of cellviews in schematic Reply
    Dear Marcel, That worked great! Thanks a lot for such a detailed solution. Regards, Atul
    • Post Points: 5
Page 1 of 1 (3 items)
Sort Posts:
Started by Atul Dwivedi at 03 Jun 2013 03:12 AM. Topic has 2 replies.