• 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. Could you please let me know, how I can get the bBox value...

Stats

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

Could you please let me know, how I can get the bBox value of a selected metal?

Arokia
Arokia over 3 years ago

Hi Team, 

I'm trying to write a procedure which displays the bBox value of a selected metal in a Layout. Is there a function for this task?

Thanks,

Arokia

  • Cancel
Parents
  • Arokia
    Arokia over 3 years ago

    Ie, it should display the bBox value in the CIW window of virtuoso cadence. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Arokia
    Arokia over 3 years ago in reply to Arokia

    Like for example, the below code will display the x and y coordinates of a selected instance in the CIW window. 

    procedure( getxy()

    let( ()

    coordList = nil

    foreach(item geGetSelSet()

    printf("Selected item coordinate: %L\n" item~>xy)

    coordList = cons(item~>xy coordList)

    )

    )

    )

    But I'm trying to display the bBox values of a selected metal in the CIW window.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Arokia
    Arokia over 3 years ago in reply to Arokia

    Like for example, the below code will display the x and y coordinates of a selected instance in the CIW window. 

    procedure( getxy()

    let( ()

    coordList = nil

    foreach(item geGetSelSet()

    printf("Selected item coordinate: %L\n" item~>xy)

    coordList = cons(item~>xy coordList)

    )

    )

    )

    But I'm trying to display the bBox values of a selected metal in the CIW window.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to Arokia

    Arokia,

    This code shows how to print the individual bBoxes or the overall bBoxes:

    procedure(CCFshowBBox(@key printIndividual printOverall (figs geGetSelSet()))
      when(figs
        destructuringBind(((ollx olly) (ourx oury)) car(figs)~>bBox
          foreach(fig figs
            when(printIndividual
              printf("Selected item bBox: %L\n" fig~>bBox)
            )
            destructuringBind(((llx lly) (urx ury)) fig~>bBox
              ollx=min(ollx llx)
              olly=min(olly lly)
              ourx=max(ourx urx)
              oury=max(oury ury)
            )
          )
          when(printOverall
            printf("Overall bBox of selected objects: %L\n"
              list(ollx:olly ourx:oury))
          )
          list(ollx:olly ourx:oury)
        )
      )
    )

    To use it:

    CCFshowBBox(?printIndividual t)

    CCFshowBBox(?printIndividual t ?printOverall t)

    CCFshowBBox(?printOverall t)

    depending on what you want. Of course, you may want to adapt as you see fit. What the code does is use destructuringBind to split out the lower left x and y, and upper left x and y, and collect the min and max of these over all items before reassembling into a bBox type list. Note that it slightly unnecessarily visits the first element in the selected set twice, but that was to avoid having an additional printIndividual condition and print outside of the foreach loop.

    Hope that helps!

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • AurelBuche
    AurelBuche over 3 years ago in reply to Arokia

    Hi,

    I was not as fast as Andrew but here is a solution that might do the job and be robust enough thanks to ABE

    (inScheme
    ;; scheme is necessarry, use inScheme or save the following code in a .ils file

    (let nil
     
        (defun infinity nil
          "Return infinity"
          10e999)
     
        (defun abe_layer_box (abe_lay)
          "Return ABE_LAY bounding box"
          (let ((x_min  (infinity))
                (y_min  (infinity))
                (x_max -(infinity))
                (y_max -(infinity))
                (iter  (abeTileIterator abe_lay))
                tile)
            ;; Browse abe_lay tiles
            (while (setq tile iter->next)
              (destructuringBind ((x0 y0) (x1 y1)) tile->bbox
                ;; Store hull bounding box coordinates
                (setq x_min (min x0 x_min))
                (setq y_min (min y0 y_min))
                (setq x_max (max x1 x_max))
                (setq y_max (max y1 y_max))
                ))
          ;; Return coordinates list only when it has been updated
          (unless (exists n (list x_min y_min x_max y_max) (isInfinity n))
            (list x_min:y_min x_max:y_max))))
     
      (defglobalfun custom_get_layer_box (@key (cv  (geGetEditCellView))
                                               (lpp (leGetEntryLayer))
                                          @rest _args)
        "Return LPP bounding box in CV"
        (unwindProtect
          (progn (abeInit cv)
                 (abe_layer_box (abeLayerFromCellView (car lpp) ?purpose (cadr lpp))))
          (abeDone)
          ));def

       );closure

    );inScheme

    • 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