• 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 29497
  • 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
Parents
  • 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
Reply
  • 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
Children
No Data

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