• 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. Convert M1 bBox coordinates inside a hierarchy to upper...

Stats

  • Locked Locked
  • Replies 8
  • Subscribers 144
  • Views 15328
  • 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

Convert M1 bBox coordinates inside a hierarchy to upper hierarchy coordinates

Leonardo Vinci
Leonardo Vinci over 7 years ago

I have a list called "A" of bBoxes of M1 metal shapes from inside a pCell. Lets consider the lowest hierarchy (deepest hierarchy) ie the hierarchy where the pCell is also flat as Hierarchy(X). I want to convert this list A corrdinates to the corrdinates of the present hierarchy ie. Hierarchy X-1. 

A=list( ((0.425 0.0005) (0.0475 0.1775))  ((0.175 0.0005) (0.225 0.1775)) ((-0.075 0.0005)  (-0.025 0.1775)) ((-0.029 0.304) (0.429 0.326)) )  ; this list contains M1 shapes bBoxes according to inside pCell coordinates, ie these are coordinates according to hierarchy(X).

There are 4 metal1 shapes in that pCell. 

I want these bBox converted according to the hierarchy they are placed in, i.e i want coordinates of M1 shapes according to hierarchy(X-1) and not hierarchy(X). 

How to do this? 

Thank you,

Leonardo da Vicni

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 7 years ago

    OK, so if you have a single bBox you'd do:

      dbTransformBBox(bBox inst~>transform)

    where inst was the instance id of the instance of the pcell. So I mean that inst is an instance in hierarchy X-1, and the shapes within it are in the coordinate system of hierarchy X (using your terminology).

    To do it for your entire list, you'd do:

      B=foreach(mapcar bBox A dbTransformBBox(bBox inst~>transform)

    that would give you a list of transformed bBoxes.

    Hope that helps,

    Regards,

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Leonardo Vinci
    Leonardo Vinci over 7 years ago in reply to Andrew Beckett

    From Cadence Help, i found the usage of this function: dbTransformBBox() and it expects from me to give "l_list" argument l_list is the transform(displacement vector, rotation/reflection, and magnification(optional)).
    But i dont know the transform, thats what i want to know, i want to know the bBox of the M1 coordinates in hierarchy(X-1), sorry if i am sounding dumb, i am new in SKILL.  

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • dmay
    dmay over 7 years ago in reply to Leonardo Vinci

    The transform is available on the instance in which the shape is placed. If your rectangle is placed inside an instance stored in variable inst1, then the transform of the shape is inst1~>transform. You'll notice that this transform simply consists of the xy of the instance and the orient of the instance and 1.0 for the magnification. You could therefore build the transform yourself with list(inst1~>xy inst1~>orient 1.0) although that is a waste of time. If a shape is multiple levels deep in the hierarchy, then you need to build the transform from the instances hierarchically. You can combine one or more transforms using dbConcatTransform.

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • dmay
    dmay over 7 years ago in reply to Leonardo Vinci

    The transform is available on the instance in which the shape is placed. If your rectangle is placed inside an instance stored in variable inst1, then the transform of the shape is inst1~>transform. You'll notice that this transform simply consists of the xy of the instance and the orient of the instance and 1.0 for the magnification. You could therefore build the transform yourself with list(inst1~>xy inst1~>orient 1.0) although that is a waste of time. If a shape is multiple levels deep in the hierarchy, then you need to build the transform from the instances hierarchically. You can combine one or more transforms using dbConcatTransform.

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Leonardo Vinci
    Leonardo Vinci over 7 years ago in reply to dmay

    I am doing this: 
    reqM1list=nil
    foreach(element z
    h=list(dbTransformBBox(element geGetSelSet()~>transform))
    reqM1list=append(reqM1list h))
    reqM1list

    where reqM1list is the list of the converted coordinates/bBoxes of M1 shapes according to current hierarchy.   

    It is throwing me this error: *Error* dbTransformBBox: Invalid transform - (((0.273 0.336) "R0" 1.0))

    geGetSelSet() is the instance i have selected from click of the mouse in which shape M1's bBox i need to convert to current hierarchy. . 

    I noticed that (0.273 0.336) is the xy of my instance. 

    But i am not getting what i want. I want to convert M1 shapes's bBoxes inside this instance to be converted to my current level hierarchy bBoxes.  

    Moreover, what is the l_list argument (the 2nd argument) in the documentation for the "dbTransformBBox" function. I know its a transform, but transform of what?- the M1 shape? or the insatnce in which the M1 shape is? 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • dmay
    dmay over 7 years ago in reply to Leonardo Vinci

    The dbTransformBBox wants one transform. The one transform is a list that looks like this: ((0.273 0.336) "R0" 1.0)

    The transform is a list of three items: xy, orient, magnification  (note also that xy is a list of two points). It is a transform of the instance and the shapes in the instance. If the shapes were at the top level, they would not have a transform or the transform would be ((0 0) "R0" 1.0). If the shapes are in an instance placed at 10, 5 with a rotation of R90, then the shapes will need to be transformed by that amount to know their top level position.

    You are passing in a list of transforms because geGetSelectedSet returns a list of selected items. Therefore geGetSelSet()~>transform is a list of one transform. Notice the extra parentheses in the error message:  (((0.273 0.336) "R0" 1.0))

    This would solve your current implementation:

    h=list(dbTransformBBox(element car(geGetSelSet())~>transform))

    As a tip, I almost always avoid append because of performance reasons with long lists. There is no reason for you to create h as a list and then append it to another list. You should use cons instead. The cons command will put the new item on the front of the list. If the order of the list matters, you can reverse the list when you are done.

    reqM1list=nil
    transform = car(geGetSelSet()~>transform)
    foreach(element z
        reqM1list = cons(dbTransformBBox(element transform) reqM1list)
    )
    reqM1list

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Leonardo Vinci
    Leonardo Vinci over 7 years ago in reply to dmay

    Thanks, that solved my problem! Thank you for your explanation, now i understand it. Slight smile

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to Leonardo Vinci

    In essence, my original reply explained this too - and used a foreach mapcar to build the list. That means the list is in the same order, without needing to repeatedly cons (and optionally reverse the list). Adapting my original reply:

      B=foreach(mapcar bBox A dbTransformBBox(bBox inst~>transform))

    to your variables. it would be:

      transform=car(geGetSelSet())~>transform
      reqM1list=foreach(mapcar bBox z dbTransformBBox(bBox transform))

    The foreach mapcar allows you to create a new list with 1-1 correspondence to the original list.

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Leonardo Vinci
    Leonardo Vinci over 7 years ago in reply to Andrew Beckett

    Thanks Andrew so much! :) 

    • 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