• 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. Sorting list of Bounding boxes

Stats

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

Sorting list of Bounding boxes

Arava
Arava over 5 years ago

Hi,

I wrote a custom procedure to which setof function will give sorted list (Bottom-Left to Top-Right) of bBoxes as input.

Order of the list will decide the functioning of the procedure.


Now i started working on lower nodes (virtuoso version 12.3-64b), i don't know the exact reason "setof" output is not following the order Bottom-Left to Top-Right.

Can anyone help me to get "setof" output in order or any procedure to sort the bBox list.

Any switch need to changed? or problem with virtuoso version using?.

Thanks,
Arava.

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

    Arava,

    setof doesn't sort anything (nor ever has done). There's no switch or problem with the Virtuoso version because this is not what setof is supposed to do. All setof does is return the members of a list that match a condition.

    Perhaps you should post your code so that we know what you're talking about? I could give you code to do the sorting, but given your misunderstanding about setof, I'd like to be clear about what it's expecting.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 5 years ago

    Arava,

    setof doesn't sort anything (nor ever has done). There's no switch or problem with the Virtuoso version because this is not what setof is supposed to do. All setof does is return the members of a list that match a condition.

    Perhaps you should post your code so that we know what you're talking about? I could give you code to do the sorting, but given your misunderstanding about setof, I'd like to be clear about what it's expecting.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Arava
    Arava over 5 years ago in reply to Andrew Beckett

    Thanks Andrew.

    sorry its order of shapes not bBoxes, (actually procedure works on bBox of  OUTLINEs).

    outlineLpp=list("OUTLINE" "drawing")
    outlines = setof(obj cvId~>shapes obj~>lpp == outlineLpp)
    OL_bBox=outlines~>bBox

    Arava.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to Arava

    So which do you want sorted, the variable outlines or the variable OL_bBox?

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Arava
    Arava over 5 years ago in reply to Andrew Beckett

    Finally OL_bBox must be a list of bBoxes order from BottomLeft to TopRight

    Arava

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to Arava

    procedure(CCFcompareBBoxes(bb1 bb2)
      let((ll1 ll2)
        ll1=lowerLeft(bb1)
        ll2=lowerLeft(bb2)
        if(xCoord(ll1)==xCoord(ll2) then
          yCoord(ll1)<yCoord(ll2)
        else
          xCoord(ll1)<xCoord(ll2)
        )
      )
    )

    OL_bBox=sort(outlines~>bBox 'CCFcompareBBoxes)

    This sorts based on the lower left of the bBox, by x coordinate first, then y. If you need a different order (BottomLeft to TopRight is ambiguous in your description), then it's easy enough to change the code - the comparison function returns t if the first bounding box is "less" than the second, and you can define what you mean by "less".

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Arava
    Arava over 5 years ago in reply to Andrew Beckett

    Thank you so much Andrew Slight smile

    This works perfectly!!!

    • 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