• 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 area of a rectilinear layout block

Stats

  • Locked Locked
  • Replies 7
  • Subscribers 144
  • Views 16130
  • 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 area of a rectilinear layout block

Sri Charan B
Sri Charan B over 13 years ago

Hi,

I am new to this forum and i have started my career as a layout designer recently.

Iam trying to develop a skill code which gives me the area of a block irrespective of the pdk or technology used. By using the "bBox" command i am able to get half of my work done. But the problem i am facing is if any space inside the block is left empty even that area is also counted. So i want to eliminate the unused space and get the area of space which is used. Can please someone help me with this and guide me to correct procedure if my approach is wrong. Thanks in advance for help

  • Cancel
  • lawlag02
    lawlag02 over 13 years ago

    Hi Sri,

    Google the topic "Area of Polygon" or "shoelace formula", it will point you to the right direction.

    In theory, Any shape in a cartesian plane, given the coordinates of all vertices, The area can be calculated.

    regards, lrlsk

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

    This function can be used to find the area of a polygon or rectangle. Not sure if that's exactly what is wanted here though:

    /***************************************************************
    *                                                              *
    *                       (abArea object)                        *
    *                                                              *
    *               Calculate the area of an object.               *
    *      Currently only works with polygons and rectangles.      *
    *                                                              *
    ***************************************************************/
    
    (procedure (abArea object)
      (let (sum crd lastPt firstPt crdList area corners ll ur dx dy objType)
            (setq objType (dbGetq object objType))
            (if (equal objType "polygon") 
                (progn
                 (setq crdList (dbGetq object points))
                 (setq sum 0)
                 (setq firstPt (setq lastPt (car crdList)))
                 (setq crdList (cdr crdList))
                 (foreach crd crdList
                          (setq dx (difference (xCoord crd) (xCoord lastPt)))
                          (setq sum (plus sum (times dx (plus (yCoord crd) (yCoord lastPt)))))
                          (setq lastPt crd))
                 (setq sum (plus sum
                                 (times (difference (xCoord firstPt) (xCoord lastPt))
                                        (plus (yCoord firstPt) (yCoord lastPt)))))
                 (setq area (times 0.5 (abs sum))))
                (when (equal objType "rect") 
                      (setq corners (dbGetq object bBox))
                      (setq ll (car corners))
                      (setq ur (cadr corners))
                      (setq dx (difference (xCoord ll) (xCoord ur)))
                      (setq dy (difference (yCoord ll) (yCoord ur)))
                      (setq area (abs (times dx dy))))
                )
           area))

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Sri Charan B
    Sri Charan B over 13 years ago

    Thank you guys.

    Andrew this code is working in the manner i wanted to. I tried a lot with all the possible ways i knew to convert the obtained values into microns but i can't get it. Is there a possiblity to convert the values to microns?

    Thanks in advance for any help

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

    I assume you don't really mean microns, given that area can't be in microns. You either mean square microns or maybe square metres?

    Assuming that your user units in the layout are in microns (which would usually be the case) - the coordinate display in the tool should read out 1um as 1 - then the result of abArea will be in square microns. If you want it in square metres, you'd just multiply the result by 1e-12.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Sri Charan B
    Sri Charan B over 13 years ago
    Yes you are correct. I was talking about the area in square microns. That will be a choice of getting the area but can we directly get the output without this multiplication at the end after getting the result. Thank you for your help
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    As I said, unless something is unusual, the user units in your layout would typically be in microns (that's certainly the default, and I've not come across many people changing that default), and hence the area returned by abArea will be in square microns, and so would not need any multiplication.

    Even if you wanted it in some other units, what's so difficult about doing the multiplication? It's a programming language after all - all you would need to do is:

    procedure(abAreaInSquareMetres(obj)
      abArea(obj)*1e-12
    )

    and then use abAreaInSquareMetres instead. Or change the abArea code to include the multiplication.

    I don't understand why that's a problem for you?

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Sri Charan B
    Sri Charan B over 13 years ago

    Thank You very much Andrew. I got the result as though i wanted. Really your code was very helpful to acheive my goal.

    Regards,

    • 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