• 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. Finding the lowerleft(x1,y1) and upperright(x2,y2) of a...

Stats

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

Finding the lowerleft(x1,y1) and upperright(x2,y2) of a bounding box

JMCaJHU
JMCaJHU over 16 years ago

 Hi,

I'm new to Cadence and skill.  I've been studying sample code and ultimately need to make procedures that will create instances of different inv, different or gates and other logic gates in a row.  To do this, I plan to find the width of the gate, and stack them side by side.  Is there any code that will let me find a bounding box's x1 and x2?  I can then subtract to find its width and run a for loop that places an instance every n(x2-x1). 

 

I realize there is already a similar question.  I tried that code but it didnt seem to work.

JC 

  • Cancel
Parents
  • skillUser
    skillUser over 16 years ago

     Hi JC,

    Oops - the dbComputeBBox() forces the bounding box to be recalculated but it does not return the bounding box of the cellview.  The bounding box of a database object can be found easily by querying the bBox attribute of it. Using your example:

    bBox = db_inv_master~>bBox

    Then the code should work. As a suggestion I would recommend "defensive" programming, i.e. check what you are expecting and only continue if it is correct. Example of this:

    when( bBox = db_inv_master~>bBox ;; when this attribute is non-nil
     ll = lowerLeft(bBox)
     ...
    ); when

    Or you could issue a warning, depending on what you want to do:

    bBox = db_inv_master~>bBox
    if(isBBox(bBox) then
     ;; do the code
    else
     warn("Did not obtain a valid bBox - %L" bBox)
    ); if

    Notice the use of the isBBox() function to validate the bounding box in the second example.

    Hopefully the examples above help you to get past this problem.

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • skillUser
    skillUser over 16 years ago

     Hi JC,

    Oops - the dbComputeBBox() forces the bounding box to be recalculated but it does not return the bounding box of the cellview.  The bounding box of a database object can be found easily by querying the bBox attribute of it. Using your example:

    bBox = db_inv_master~>bBox

    Then the code should work. As a suggestion I would recommend "defensive" programming, i.e. check what you are expecting and only continue if it is correct. Example of this:

    when( bBox = db_inv_master~>bBox ;; when this attribute is non-nil
     ll = lowerLeft(bBox)
     ...
    ); when

    Or you could issue a warning, depending on what you want to do:

    bBox = db_inv_master~>bBox
    if(isBBox(bBox) then
     ;; do the code
    else
     warn("Did not obtain a valid bBox - %L" bBox)
    ); if

    Notice the use of the isBBox() function to validate the bounding box in the second example.

    Hopefully the examples above help you to get past this problem.

    Regards,

    Lawrence.

    • 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