• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Skill code for finding coordinates of selected instances...

Stats

  • Locked Locked
  • Replies 18
  • Subscribers 148
  • Views 29492
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Skill code for finding coordinates of selected instances in the layout

Vignesh054
Vignesh054 over 16 years ago

 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 

 

  • Cancel
  • dmay
    dmay over 16 years ago

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

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Vignesh054
    Vignesh054 over 16 years ago

     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 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • dmay
    dmay over 16 years ago

    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

    • Cancel
    • Vote Up +2 Vote Down
    • Cancel
  • Vignesh054
    Vignesh054 over 16 years ago

     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 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Austin CAD Guy
    Austin CAD Guy over 16 years ago

     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

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • bharath2k4er
    bharath2k4er over 16 years ago

     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. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Austin CAD Guy
    Austin CAD Guy over 16 years ago

     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

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • dmay
    dmay over 16 years ago

    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

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • 0007
    0007 over 15 years ago

    You select the instances and use the

    db command: dbGet selected.pt

    Anil

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 15 years ago

    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.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
>

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information