• 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. How to converts top level shape's bBox transform into a...

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 143
  • Views 3034
  • 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

How to converts top level shape's bBox transform into a lower level(hierarchy depth) cell ?

Charley Chen
Charley Chen over 15 years ago
Dear All,

I have a shape which is over a instance(maybe depth is 2) ,  the shape's bBox  is apply to level 0 coordinate  ,i.e  (5.075:3.16  5.335:3.52),
I want the bBox  converts into the instance's coordinate . It's similar to Edit-In-Place , But the instance is Read-Only and I don't want to using
Edit-In-Place .
;; Convert bBox from Top to Bottom

e.g.  I draw a rectangle shape(On level 0)  over the instance (depth is  2), I don't need to open the instance in another cellview  ,
 Just liker using Edit-In-Place, the shape's bBox is transformed inside the instance.
When I open the instance , using the sshape's bBox to draw a rectangle shape . It's the sam location when I return to top.

How to do it ?

Thank you,
Charley
  • Cancel
  • Andrew Beckett
    Andrew Beckett over 15 years ago

    If it was a single level, you'd use dbTransformBBox() with the inst~>transform (actually that's going to be the wrong way around - that would transform from the instance coordinate space to the top level, not the other way. There is a function in IC5141 called icDbInvertTransform, but it's not documented in IC61X (it's part of Preview so whilst the function still exists in the IC614 build, it may be removed at some point) - so it would be safer to write your own (not hard). If you want to handle more than one level of hierarchy, you'd need to concatenate the transformations down through the hierarchy to the right instance by using dbConcatTransform.

    If the path to the instance is in the same form as returned by dbGet*Overlaps (e.g. dbGetTrueOverlaps) you could use geGetInstTransform to get the complete transformation - but again, this allows you to transform something from the level 2 coordinate space to level 0.

    Regards,

    Andrew.

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

    You may be able to do what you need to do with these two commands. The description of the commands are identical, but basically one takes the coordinates from the data you are editing and translates to top level coordinates. The other takes the coordinates in the window and translates them to the coordinates for the cell you are editing in place.

    geEditToWindowPoint(
    w_windowId
    l_editCellViewPoint
    )
    => l_windowCellViewPoint

    Translates coordinate values when you are using edit in place. geWindowToEditPoint applies the top-level cellview's coordinates to the cellview being edited; geEditToWindowPoint does the reverse.

    geWindowToEditPoint(
    w_windowId
    l_windowCellViewPoint
    )
    => l_editCellViewPoint

    Translates coordinate values when you are using edit in place. geWindowToEditPoint applies the top-level cellview's coordinates to the cellview being edited; geEditToWindowPoint does the reverse.
     

     If you need to reverse a transform you can use this routine:

    procedure(myReverseTransform(trans)
        let((pt rot mag newPt)
            pt=car(trans)
            rot=cadr(trans)
            mag=caddr(trans)
            ;Think of the logic in this manner:  given that an instance is
            ;rotated, translated and magnified in the top level, what do you
            ;need to do to get it back to normal orientation.  If it is R90
            ;at the top, you need to R270 to get back.
            case(rot
                ("R0"    newPt=list(xCoord(pt)*-1.0 yCoord(pt)*-1.0) rot="R0"  )
                ("R90"   newPt=list(yCoord(pt)*-1.0 xCoord(pt))      rot="R270")
                ("R180"  newPt=list(xCoord(pt)      yCoord(pt))      rot="R180")
                ("R270"  newPt=list(yCoord(pt)      xCoord(pt)*-1.0) rot="R90" )
                ("MX"    newPt=list(xCoord(pt)*-1.0 yCoord(pt))      rot="MX")
                ("MY"    newPt=list(xCoord(pt)      yCoord(pt)*-1.0) rot="MY")
                ("MXR90" newPt=list(yCoord(pt)*-1.0 xCoord(pt)*-1.0) rot="MXR90")
                ("MYR90" newPt=list(yCoord(pt)      xCoord(pt))      rot="MYR90")
                (t newPt=pt)
            )
            list(newPt rot mag)
        )
    )

    Here is a routine to combine a list of transforms into one. The transList argument is the list of transforms from the bottom of the hierarchy to the top.

    procedure(myConcatTransforms(transList)
        let((newTrans trans)
            newTrans=list('(0.0 0.0) "R0" 1.0)
            ;transList is in order from bottom of hierarchy to top
            foreach(trans transList
                unless(trans
                    trans=list('(0.0 0.0) "R0" 1.0)
                )
                when(listp(caar(trans)) trans=car(trans))
                newTrans=dbConcatTransform(newTrans trans)
            )
            newTrans
        )
    )

    I hope this helps.

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Charley Chen
    Charley Chen over 15 years ago

    (1)If I using the command as below ,

    I only get the id(e.g. db:233871) of the instance , How to get the w_windowId ,

    Thank you,

    Charley

    geWindowToEditPoint(
    w_windowId
    l_windowCellViewPoint
    )
    => l_editCellViewPoint

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

    Those functions only really make sense when using edit in place - in which case you'd get the window id using hiGetCurrentWindow() (say).

    You'd already said that you didn't want to use edit in place, so I don't think they'll be useful to you?

    Regards,

    Andrew.

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

    You need to use one of these commands:

    hiGetCurrentWindow()

    or

    geGetCellViewWindow(geGetEditCellView())

    Try using the Skill command startFinder() to see an interface to help you find commands and see their usage.

    Derek

    • 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