• 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 3035
  • 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
Parents
  • 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
Reply
  • 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
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