Home > Community > Forums > Custom IC SKILL > Skill code for finding coordinates of selected instances in the layout

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 for finding coordinates of selected instances in the layout 

Last post Tue, Jun 21 2011 8:05 AM by Andrew Beckett. 13 replies.
Started by Vignesh054 28 Sep 2008 09:04 PM. Topic has 13 replies and 18144 views
Page 1 of 1 (14 items)
Sort Posts:
  • Sun, Sep 28 2008 9:04 PM

    • Vignesh054
    • Top 500 Contributor
    • Joined on Fri, Sep 26 2008
    • Hyderabad, Andhra Pradesh
    • Posts 20
    • Points 515
    Skill code for finding coordinates of selected instances in the layout Reply

     Hi,

     I need a skill script to find the co-ordinates of all selected instances in the layout?

    Can anyone help me on this?

    Thanks,

    Vignesh T K 

     

    Filed under:
    • Post Points: 35
  • Mon, Sep 29 2008 5:12 AM

    • dmay
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • Allen, TX
    • Posts 393
    • Points 7,415
    Re: Skill code for finding coordinates of selected instances in the layout Reply

    coordList = nil
    foreach(item geGetSelSet()
        printf("Selected item coordinate: %L\n" item~>xy)
        coordList = cons(item~>xy coordList)
    )

     

    • Post Points: 20
  • Mon, Sep 29 2008 5:24 AM

    • Vignesh054
    • Top 500 Contributor
    • Joined on Fri, Sep 26 2008
    • Hyderabad, Andhra Pradesh
    • Posts 20
    • Points 515
    Re: Skill code for finding coordinates of selected instances in the layout Reply

     Hi,

     Thank you for the reply.

    I need lower left(llx,lly) and upper right (urx,ury) coordantes. And also is it possible to print the instance name with the coordintes?

    Can you help me on this?

    Thanks,

    Vignesh T K 

    • Post Points: 20
  • Mon, Sep 29 2008 5:50 AM

    • dmay
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • Allen, TX
    • Posts 393
    • Points 7,415
    Re: Skill code for finding coordinates of selected instances in the layout Reply

    Coordinates come in a variety of ways, depending on the objects you select. All instances have xy and bBox attributes. The xy will be the origin of the instance. The bBox will be the bounding box of the instance. All shapes have a bBox, but polygons and paths also have a set of points.

    A bBox comes as a list of two coordinates: bBox = list(list(x1 y1) list(x2 y2))
    To get the lower left:  ll = car(bBox)  or  ll = lowerLeft(bBox)
    To get the upper right:  ur = cadr(bBox)  or  ur = upperRight(bBox)

    foreach(item geGetSelSet()
        ll = lowerLeft(item~>bBox)
        ur = upperRight(item~>bBox)
        case(item~>objType
            ("inst"  printf("Instance %s of cell %s at  xy = %L, ll = %L, ur = %L\n" item~>name item~>cellName item~>xy ll ur))
            ("rect"  printf("Rectangle with ll = %L and ur = %L\n" ll ur))
            ("polygon" printf("Polygon with ll of extents at %L and ur of extents at %L and points %L\n" ll ur item~>points))
            ("path" printf("Path with ll of extents at %L and ur of extents at %L and points %L\n" ll ur item~>points))
        )
    )

    This is basic Skill. You should take a look at the Skill user's guide. You should also explore available attributes on an object to see what you can do. Here is a simple thing to do:

    Select one item in layout. Then in your CIW do this:  x = css()
    This will assign the "car of the selected set" or car(geGetSelSet()) to the variable x.
    Then do this in the CIW: x~>?
    This will show you the attribute names available on the selected item.
    Then do this in the CIW: x~>??
    This will show you the attribute names and values on the selected item.
    Try this with instances, rectangles, paths, polygons, or any other objects you may be using.
    You can also traverse these items as deep as you want. For example, if you select an instance in the layout, you can do the following:
    inst = css()
    instName = inst~>name
    instMaster = inst~>master
    termsInInst = instMaster~>terminals
    This could also be done like this:
    css()~>master~>terminals
    css()~>master~>terminals~>name

    Time to dig out the manual.

    -Derek

    • Post Points: 20
  • Mon, Sep 29 2008 6:26 AM

    • Vignesh054
    • Top 500 Contributor
    • Joined on Fri, Sep 26 2008
    • Hyderabad, Andhra Pradesh
    • Posts 20
    • Points 515
    Re: Skill code for finding coordinates of selected instances in the layout Reply

     Hi,

    Thank you very much for the reply.

    It is working fine..Since i am new to the skill i couldn't go in deep.

    Can you point me to a user guide for learning skill

     Thanks,

    Vignesh T K 

    • Post Points: 20
  • Thu, Dec 4 2008 7:03 AM

    Re: Skill code for finding coordinates of selected instances in the layout Reply

     Hi Vignesh

    The best way to learn SKILL is to look at other SKILL programs. There are lots of examples here on this site and under Source Link. In addition, the user manual  SKILL Language User Guide will give you lots of the background to the language. I always learn best when I have a specific problem to solve.

    Things to learn:

    Lists: Pretty much the standard method for holding lots of data.

    db... commands: Database access

     foreach: A looping structure for processing lists

    if, when, unless, case, cond:  conditional statements.

     Good luck and stay with this forum as there are lots of very good SKILL users here.

     Ted

    • Post Points: 20
  • Wed, Feb 11 2009 10:27 PM

    • bharath2k4er
    • Top 500 Contributor
    • Joined on Wed, Feb 11 2009
    • blr, Karnataka
    • Posts 34
    • Points 650
    Re: Skill code for finding coordinates of selected instances in the layout Reply

     can you add a line to above script,

    How to select all the instances?and get their coordinates and instance names?

    second part is answered..need help in first part.

     

    Thanks,

    Bharath. 

    Thanks, Bharath
    • Post Points: 35
  • Thu, Feb 12 2009 7:03 AM

    Re: Skill code for finding coordinates of selected instances in the layout Reply

     I usually parse instHeaders instead of instances if I am looking for placements of specific masters:

     foreach( ih deGetCellView()~>instHeaders
       when( { test for matching master name is true }
            foreach( inst ih~>instances
                geSelectObject( inst )
            ) ; foreach
         ) ; when
    ) ; foreach

     

    To just get all the instances:

    foreach( inst deGetCellView()~>instances
        geSelectObject( inst)
    ) ; foreach

     

    Ted

    • Post Points: 5
  • Thu, Feb 12 2009 7:10 AM

    • dmay
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • Allen, TX
    • Posts 393
    • Points 7,415
    Re: Skill code for finding coordinates of selected instances in the layout Reply

    I highly recommend looking into the documentation. Cadence has some great docs and online help. Try running cdsFinder from your shell window (or startFinder from your CIW window). In the search field, search for select. Look at the commands that start with ge for graphical editor. Other commands you find useful will start with hi, le, db, sch. It is usually easy to find what you need. Follow the tips listed earlier for looking at the attributes of objects. Use the Cadence docs for more details on commands. Then, answering your question is easy.

    cv = geGetEditCellView()
    foreach(inst cv~>instances
        geSelectFig(inst)
        printf("Inst name: %s  xy: %L  bBox: %L  cellName %s\n" inst~>name inst~>xy inst~>bBox inst~>cellName)
    )

    -Derek

    • Post Points: 20
  • Fri, Jan 22 2010 5:04 PM

    • 0007
    • Not Ranked
    • Joined on Fri, Jan 22 2010
    • Hyderabad, Andhra Pradesh
    • Posts 6
    • Points 105
    Re: Skill code for finding coordinates of selected instances in the layout Reply

    You select the instances and use the

    db command: dbGet selected.pt

    Anil

    • Post Points: 20
  • Fri, Jan 22 2010 5:10 PM

    Re: Skill code for finding coordinates of selected instances in the layout Reply

    Hi Anil,

    That is a Tcl command for Encounter. This forum is for Custom IC SKILL (and this post was 18 months old anyway, and answered already).

    Regards,

    Andrew.

    • Post Points: 5
  • Mon, Jun 20 2011 11:25 PM

    • ManuNarayan
    • Not Ranked
    • Joined on Mon, Jun 20 2011
    • Mysore, Karnataka
    • Posts 5
    • Points 65
    Re: Skill code for finding coordinates of selected instances in the layout Reply

    can u please guide me in the regards,

    Place multiple instances in layout editor window with co-ordinates as specified in the text file and check if the layout is on grid.
    • Post Points: 20
  • Tue, Jun 21 2011 6:59 AM

    Re: Skill code for finding coordinates of selected instances in the layout Reply

     Rather than bury this as a sub topic, why don't you ask it as a new topic.

     You will have to open the file and parse its format. fscanf can do that depending on the format. See the command in help documentation.

    The command to place instances is dbCreateInst.

     Depending on what you mean by checking if the layout is on grid, you may be better off using a DRC checker as there may be a lot of data to process. If it the concern is only the instance placement, snap it to grid before placing the instance.

     Ted

    • Post Points: 20
  • Tue, Jun 21 2011 8:05 AM

    Re: Place multiple instances in layout editor window with co-ordinates as specified in the text file and check if the layout is on grid Reply

    Arjun,

    You asked the same question 4 times (two new posts in two forums, and adding to two existing threads). That will simply annoy people and not get you an answer any quicker. Please do not do that.

    I'll merge your posts together to avoid confusion.

    Andrew.

    • Post Points: 5
Page 1 of 1 (14 items)
Sort Posts:
Started by Vignesh054 at 28 Sep 2008 09:04 PM. Topic has 13 replies.