• 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. How to flip an instance SIDEWAYS using skill

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 144
  • Views 19505
  • 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

How to flip an instance SIDEWAYS using skill

BALBOA
BALBOA over 11 years ago

HI,

 I need a command or a program to flip the selected instance sideways without changing the orientation.

Regards,

Girish

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

     Although the downside of doing that is that it flips around the Y axis, which might not be what you want.

    You might find this useful:

     

    /* abFlip.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Jun 22, 2005 
    Modified   Nov 18, 2009 
    By         A.D.Beckett
    
    Functions to do flipping (and rotation) in place. Examples
    of usage:
    
    abFlip()
      - does a flip horizontally relative to the centre of the selected figures
    abFlip(?relativeTo 'lowerLeft)
      - does a horizontal flip relative to the lower left corner
    abFlip(?orient "MX" ?relativeTo 'upperRight)
      - does a vertical flip relative to the upperRight corner
    abFlip(?orient "MY" ?relativeTo 'upperRight ?mode 'copy)
      - does a horizontal flipped copy relative to the upperRight corner
    abFlip(?orient "R90" ?relativeTo 'refPoint)
      - does a 90 degree rotation relative to the reference point (often
        the + key on the numeric keypad).
    
    In this function:
    
    ?orient can be set to:
    
        "MY" - mirror in Y axis (i.e. horizontal flip) (default)
        "MX" - mirror in X axis (i.e. vertical flip)
        "R90" - 90 degree anti-clockwise rotate
        "R180" - 180 degree anti-clockwise rotate
        "R270" - 90 degree clockwise rotate
        "R0" - no rotation (not much point!)
        "MYR90" - mirror in Y axis and rotate by 90
        "MXR90" - mirror in X axis and rotate by 90
    
    ?relativeTo can be set to:
    
    'centerBox - center of selected figures (default)
    'lowerLeft - lower left of selected figures
    'lowerRight - lower right of selected figures
    'upperLeft - upper left of selected figures
    'upperRight - upper right of selected figures
    'refPoint - the reference point
    'origin - the cellview origin (i.e. 0:0)
    
    ?mode can be set to 
    
    'move - (the default) flip during a move
    'copy - (the default) flip during a copy
    
    ?noSnap can be set to t if you don't want it to
    snap the origin of the flip
    
    abSetRefPoint(?relativeTo 'upperLeft)
      - set the ref point relative to the selected objects
    
    The ?relativeTo has the same meaning as for abFlip()
    
    ***************************************************
    
    SCCS Info: @(#) abFlip.il 11/18/09.11:21:07 1.3
    
    */
    
    /******************************************************************
    *                                                                 *
    *         (abFlip [?orient "MY"] [?relativeTo 'centerBox]         *
    *           [?mode 'move] [?win windowId] [?noSnap nil])          *
    *                                                                 *
    * Flips the selected objects (if any) relative to somewhere, with *
    *       a particular orientation. Can either copy or move.        *
    *      For details, see the comments at the top of this file      *
    *                                                                 *
    ******************************************************************/
    
    (procedure (abFlip @key (orient "MY") (relativeTo 'centerBox) 
                       (mode 'move) noSnap
                       (win (hiGetCurrentWindow)))
      (let (bbox figs origin transform)
           (setq figs (geGetSelSet win))
           ;-----------------------------------------------------------------
           ; work out the origin of the transform
           ;-----------------------------------------------------------------
           (setq bbox (abFindBBox figs))
           (setq origin
                 (case relativeTo
                       (centerBox (centerBox bbox))
                       (lowerLeft (lowerLeft bbox))
                       (lowerRight (list (xCoord (upperRight bbox))
                                         (yCoord (lowerLeft bbox))))
                       (upperLeft (list (xCoord (lowerLeft bbox))
                                        (yCoord (upperRight bbox))))
                       (upperRight (upperRight bbox))
                       (refPoint (leGetRefPoint (geGetEditCellView win)))
                       (origin (list 0 0))
                       (t (error "Unknown ?relativeTo mode; must be one of 'centerBox, 'lowerLeft, 'lowerRight, 'upperLeft, 'upperRight, 'refPoint, 'origin"))
                       ))
           (when origin
                 (unless noSnap
                         (setq origin
                               (list
                                (times (round (quotient 
                                               (xCoord origin)
                                               (getq win xSnapSpacing)))
                                       (getq win xSnapSpacing))
                                (times (round (quotient 
                                               (yCoord origin)
                                               (getq win ySnapSpacing)))
                                       (getq win ySnapSpacing))
                                )))
                 ;-----------------------------------------------------------
                 ; Combine the transform to do a shift to the origin,
                 ; rotate/flip, and then shift back again
                 ;-----------------------------------------------------------
                 (setq transform
                       (dbConcatTransform
                        (dbConcatTransform
                         (list (mapcar 'minus origin) "R0")
                         (list 0:0 orient)
                         )
                        (list origin "R0")
                        ))
                 ;-----------------------------------------------------------
                 ; Then either move or copy all the figures
                 ;-----------------------------------------------------------
                 (foreach fig figs
                          ;--------------------------------------------------
                          ; Don't move or copy the shape if it's attached
                          ; to something else that is also selected
                          ;--------------------------------------------------
                          (unless fig~>parent && geIsFigSelected(fig~>parent)
                            (case mode
                              (move 
                                (dbMoveFig fig (dbGetq fig cellView) transform))
                              (copy 
                                (dbCopyFig fig (dbGetq fig cellView) transform))
                              )
                            )
                          )
                 t
                 )
           )
      )
    
    /***************************************************************
    *                                                              *
    *   (abSetRefPoint [?relativeTo 'centerBox] [?win windowId])   *
    *                                                              *
    *     Set the reference point relative to somewhere on the     *
    *                        selected set.                         *
    *                                                              *
    ***************************************************************/
    
    (procedure (abSetRefPoint @key (relativeTo 'centerBox) 
                       (win (hiGetCurrentWindow)))
      (let (bbox figs origin)
           ;-----------------------------------------------------------------
           ; Work out the new reference point
           ;-----------------------------------------------------------------
           (setq figs (geGetSelSet win))
           (setq bbox (abFindBBox figs))
           (setq origin
                 (case relativeTo
                       (centerBox (centerBox bbox))
                       (lowerLeft (lowerLeft bbox))
                       (lowerRight (list (xCoord (upperRight bbox))
                                         (yCoord (lowerLeft bbox))))
                       (upperLeft (list (xCoord (lowerLeft bbox))
                                        (yCoord (upperRight bbox))))
                       (upperRight (upperRight bbox))
                       (refPoint (leGetRefPoint (geGetEditCellView win)))
                       (origin (list 0 0))
                       (t (error "Unknown ?relativeTo mode; must be one of 'centerBox, 'lowerLeft, 'lowerRight, 'upperLeft, 'upperRight, 'refPoint, 'origin"))
                       ))
           (when origin
                 (leSetRefPoint (geGetEditCellView win) origin)
                 )
           )
      )
    /* abZoomSel.il
    
    Author     A.D.Beckett
    Group      Structured Custom, Cadence Design Systems Ltd
    Machine    SUN
    Date       May 20, 1993 
    Modified   A.D.Beckett
    By         Feb 04, 1998 
    
    Various procedures for zooming to selected set, and for
    zooming to probed things.
    
    ***************************************************
    
    SCCS Info: @(#) abZoomSel.il 11/20/08.15:26:22 1.3
    
    */
    
    /*************************************************
    *                                                *
    *          (abExtendBBox bbox @rest xy)          *
    *                                                *
    * procedure to take a bounding box and extend it *
    *              by a list of points.              *
    *                                                *
    *************************************************/
    
    (procedure (abExtendBBox bbox @rest xy)
      (let (minx maxx miny maxy coord)
           (if (and (listp xy)
                    (listp (car xy))
                    (listp (car (car xy))))
               (setq xy (car xy)))
           (if (null bbox) 
               (setq bbox (list (car xy) (car xy))))
           (setq minx (xCoord (lowerLeft bbox)))
           (setq maxx (xCoord (upperRight bbox)))
           (setq miny (yCoord (lowerLeft bbox)))
           (setq maxy (yCoord (upperRight bbox)))
           (foreach coord xy
                    (if (lessp (xCoord coord) minx) (setq minx (xCoord coord)))
                    (if (lessp (yCoord coord) miny) (setq miny (yCoord coord)))
                    (if (greaterp (xCoord coord) maxx) (setq maxx (xCoord coord)))
                    (if (greaterp (yCoord coord) maxy) (setq maxy (yCoord coord))))
           /* return the new bbox */
           (list (list minx miny) (list maxx maxy))))
    
    /******************************************
    *                                         *
    *      (abEnlargeBBox bbox percent)       *
    *                                         *
    * extend the bounding box by a percentage *
    *                                         *
    ******************************************/
    
    (procedure (abEnlargeBBox bbox percent)
      (let (extendX extendY)
           /* calculate extensions */
           (setq extendX
                 (quotient
                  (times
                   (difference
                    (xCoord (upperRight bbox))
                    (xCoord (lowerLeft bbox)))
                   percent)
                  200.0))
           (setq extendY
                 (quotient
                  (times
                   (difference
                    (yCoord (upperRight bbox))
                    (yCoord (lowerLeft bbox)))
                   percent)
                  200.0))
           /* return the enlarged bounding box */
           (list 
            (list 
             (difference (xCoord (lowerLeft bbox)) extendX)
             (difference (yCoord (lowerLeft bbox)) extendY))
            (list 
             (plus (xCoord (upperRight bbox)) extendX)
             (plus (yCoord (upperRight bbox)) extendY)))))
    
    /******************************************
    *                                         *
    *          (abBBoxToPoints bbox)          *
    *                                         *
    * Convert a bounding box to a point list. *
    *                                         *
    ******************************************/
    
    (procedure (abBBoxToPoints bbox)
      (list 
       (lowerLeft bbox)
       (list (xCoord (lowerLeft bbox)) (yCoord (upperRight bbox)))
       (upperRight bbox)
       (list (xCoord (upperRight bbox)) (yCoord (lowerLeft bbox)))))
    
    
    /**********************************************************
    *                                                         *
    *                   (abFindBBox select)                   *
    *                                                         *
    * Find the bounding box of the list of objects passed in. *
    *     Copes with partially selected objects as well.      *
    *                                                         *
    **********************************************************/
    
    (procedure (abFindBBox select @optional forceWholeObject)
      (let (bbox)
           (foreach dbp select
                    (if (or forceWholeObject (geIsFigAllSelected dbp))
                        (setq bbox (abExtendBBox bbox (dbGetq dbp bBox)))
                        (let (pointList)
                             /* generate a point list for object, either directly or from bbox */
                             (unless (setq pointList (dbGetq dbp points))
                                     (setq pointList (abBBoxToPoints (dbGetq dbp bBox))))
                             /* scan two lists, extending bbox if point is selected */
                             (mapc '(lambda (point bool) 
                                            (when bool (setq bbox (abExtendBBox bbox point))))
                                   pointList
                                   (geGetSelSetFigPoint dbp)))))
           /* return bounding box */
           bbox))
    
    
    /*******************************************
    *                                          *
    *    (abZoomSel @optional (select nil))    *
    *                                          *
    * Zoom in on the selected set (no overlap) *
    *  Copes with partially selected objects   *
    *                                          *
    *******************************************/
    
    (procedure (abZoomSel @optional (select nil))
      (let (bbox wind forceWholeObject)
           /* get current window */
           (setq wind (hiGetCurrentWindow))
           /* get selected set if not passed in */
           (if select 
               (setq forceWholeObject t)
               (setq select (geGetSelSet wind)))
    
           (setq bbox (abFindBBox select forceWholeObject))
           (if bbox
               (hiZoomIn wind (list (geEditToWindowPoint wind (lowerLeft bbox))
                                    (geEditToWindowPoint wind (upperRight bbox))))
               (hiDisplayAppDBox
                ?name 'abZSnothingSelected
                ?dboxBanner "Nothing Selected"
                ?dboxText "Nothing is selected for Zoom Selected"
                ?dialogType hicMessageDialog
                ?buttonLayout 'Close))))
    
    
    /*****************************************
    *                                        *
    * (abZoomSelPlus @optional (select nil)) *
    *                                        *
    * same as abZoomSel, but enlarges by 10% *
    *                                        *
    *****************************************/
    
    (procedure (abZoomSelPlus @optional (select nil) (percent 10))
      (let (bbox wind forceWholeObject)
           /* get current window */
           (setq wind (hiGetCurrentWindow))
           /* get selected set if not passed in */
           (if select 
               (setq forceWholeObject t)
               (setq select (geGetSelSet wind)))
    
           (setq bbox (abFindBBox select forceWholeObject))
           (if bbox
               (progn
                (setq bbox (abEnlargeBBox bbox percent))
                (hiZoomIn wind (list (geEditToWindowPoint wind (lowerLeft bbox))
                                     (geEditToWindowPoint wind (upperRight bbox)))))
               (hiDisplayAppDBox
                ?name 'abZSnothingSelected
                ?dboxBanner "Nothing Selected"
                ?dboxText "Nothing is selected for Zoom Selected"
                ?dialogType hicMessageDialog
                ?buttonLayout 'Close))))
    
    /***************************************************************
    *                                                              *
    *                       (abZoomOrig win)                       *
    *                                                              *
    *         simple function for zooming in at the origin         *
    *                                                              *
    ***************************************************************/
    
    (procedure (abZoomOrig win)
      (hiZoomIn win '((-0.2 -0.2) (0.2 0.2))))
    
    /******************************************************************************
    *                                                                             *
    *           (abZoomProbes @optional (window (hiGetCurrentWindow)))            *
    *                                                                             *
    * Zoom into probed objects. Works with nets and instances in extracted views. *
    *         Haven't tested with all objects, but seems to work so far!          *
    *                                                                             *
    ******************************************************************************/
    
    (procedure (abZoomProbes @optional (window (hiGetCurrentWindow)))
      (let (cellView probedObjects probedFigs)
           (setq cellView (geGetEditCellView window))
           ;-----------------------------------------------------------------
           ; find all the probed objects in the current window
           ;-----------------------------------------------------------------
           (setq probedObjects 
                 (setof obj (foreach mapcar probe 
                                     (geGetAllProbe window) (getq probe objectId))
                                      (equal (dbGetq obj cellView) cellView)))
           (setq probedFigs
                 (foreach mapcan object probedObjects 
                          (case (dbGetq object objType)
                                ("sig"
                                 ;-------------------------------------------
                                 ; combine the figures
                                 ;-------------------------------------------
                                 (foreach mapcan net
                                          ;----------------------------------
                                          ; get from sigs to member nets
                                          ;----------------------------------
                                          (foreach mapcar memNet 
                                                   (dbGetq object memNets) 
                                                   (car memNet))
                                          (dbGetq net figs))
                                 )
                                ("net"
                                 (dbGetq object figs)
                                 )
                                (t (list object))
                                )))
           ;-----------------------------------------------------------------
           ; zoom into them
           ;-----------------------------------------------------------------
           (abZoomSel probedFigs)
           ))
     

     

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

     Although the downside of doing that is that it flips around the Y axis, which might not be what you want.

    You might find this useful:

     

    /* abFlip.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Jun 22, 2005 
    Modified   Nov 18, 2009 
    By         A.D.Beckett
    
    Functions to do flipping (and rotation) in place. Examples
    of usage:
    
    abFlip()
      - does a flip horizontally relative to the centre of the selected figures
    abFlip(?relativeTo 'lowerLeft)
      - does a horizontal flip relative to the lower left corner
    abFlip(?orient "MX" ?relativeTo 'upperRight)
      - does a vertical flip relative to the upperRight corner
    abFlip(?orient "MY" ?relativeTo 'upperRight ?mode 'copy)
      - does a horizontal flipped copy relative to the upperRight corner
    abFlip(?orient "R90" ?relativeTo 'refPoint)
      - does a 90 degree rotation relative to the reference point (often
        the + key on the numeric keypad).
    
    In this function:
    
    ?orient can be set to:
    
        "MY" - mirror in Y axis (i.e. horizontal flip) (default)
        "MX" - mirror in X axis (i.e. vertical flip)
        "R90" - 90 degree anti-clockwise rotate
        "R180" - 180 degree anti-clockwise rotate
        "R270" - 90 degree clockwise rotate
        "R0" - no rotation (not much point!)
        "MYR90" - mirror in Y axis and rotate by 90
        "MXR90" - mirror in X axis and rotate by 90
    
    ?relativeTo can be set to:
    
    'centerBox - center of selected figures (default)
    'lowerLeft - lower left of selected figures
    'lowerRight - lower right of selected figures
    'upperLeft - upper left of selected figures
    'upperRight - upper right of selected figures
    'refPoint - the reference point
    'origin - the cellview origin (i.e. 0:0)
    
    ?mode can be set to 
    
    'move - (the default) flip during a move
    'copy - (the default) flip during a copy
    
    ?noSnap can be set to t if you don't want it to
    snap the origin of the flip
    
    abSetRefPoint(?relativeTo 'upperLeft)
      - set the ref point relative to the selected objects
    
    The ?relativeTo has the same meaning as for abFlip()
    
    ***************************************************
    
    SCCS Info: @(#) abFlip.il 11/18/09.11:21:07 1.3
    
    */
    
    /******************************************************************
    *                                                                 *
    *         (abFlip [?orient "MY"] [?relativeTo 'centerBox]         *
    *           [?mode 'move] [?win windowId] [?noSnap nil])          *
    *                                                                 *
    * Flips the selected objects (if any) relative to somewhere, with *
    *       a particular orientation. Can either copy or move.        *
    *      For details, see the comments at the top of this file      *
    *                                                                 *
    ******************************************************************/
    
    (procedure (abFlip @key (orient "MY") (relativeTo 'centerBox) 
                       (mode 'move) noSnap
                       (win (hiGetCurrentWindow)))
      (let (bbox figs origin transform)
           (setq figs (geGetSelSet win))
           ;-----------------------------------------------------------------
           ; work out the origin of the transform
           ;-----------------------------------------------------------------
           (setq bbox (abFindBBox figs))
           (setq origin
                 (case relativeTo
                       (centerBox (centerBox bbox))
                       (lowerLeft (lowerLeft bbox))
                       (lowerRight (list (xCoord (upperRight bbox))
                                         (yCoord (lowerLeft bbox))))
                       (upperLeft (list (xCoord (lowerLeft bbox))
                                        (yCoord (upperRight bbox))))
                       (upperRight (upperRight bbox))
                       (refPoint (leGetRefPoint (geGetEditCellView win)))
                       (origin (list 0 0))
                       (t (error "Unknown ?relativeTo mode; must be one of 'centerBox, 'lowerLeft, 'lowerRight, 'upperLeft, 'upperRight, 'refPoint, 'origin"))
                       ))
           (when origin
                 (unless noSnap
                         (setq origin
                               (list
                                (times (round (quotient 
                                               (xCoord origin)
                                               (getq win xSnapSpacing)))
                                       (getq win xSnapSpacing))
                                (times (round (quotient 
                                               (yCoord origin)
                                               (getq win ySnapSpacing)))
                                       (getq win ySnapSpacing))
                                )))
                 ;-----------------------------------------------------------
                 ; Combine the transform to do a shift to the origin,
                 ; rotate/flip, and then shift back again
                 ;-----------------------------------------------------------
                 (setq transform
                       (dbConcatTransform
                        (dbConcatTransform
                         (list (mapcar 'minus origin) "R0")
                         (list 0:0 orient)
                         )
                        (list origin "R0")
                        ))
                 ;-----------------------------------------------------------
                 ; Then either move or copy all the figures
                 ;-----------------------------------------------------------
                 (foreach fig figs
                          ;--------------------------------------------------
                          ; Don't move or copy the shape if it's attached
                          ; to something else that is also selected
                          ;--------------------------------------------------
                          (unless fig~>parent && geIsFigSelected(fig~>parent)
                            (case mode
                              (move 
                                (dbMoveFig fig (dbGetq fig cellView) transform))
                              (copy 
                                (dbCopyFig fig (dbGetq fig cellView) transform))
                              )
                            )
                          )
                 t
                 )
           )
      )
    
    /***************************************************************
    *                                                              *
    *   (abSetRefPoint [?relativeTo 'centerBox] [?win windowId])   *
    *                                                              *
    *     Set the reference point relative to somewhere on the     *
    *                        selected set.                         *
    *                                                              *
    ***************************************************************/
    
    (procedure (abSetRefPoint @key (relativeTo 'centerBox) 
                       (win (hiGetCurrentWindow)))
      (let (bbox figs origin)
           ;-----------------------------------------------------------------
           ; Work out the new reference point
           ;-----------------------------------------------------------------
           (setq figs (geGetSelSet win))
           (setq bbox (abFindBBox figs))
           (setq origin
                 (case relativeTo
                       (centerBox (centerBox bbox))
                       (lowerLeft (lowerLeft bbox))
                       (lowerRight (list (xCoord (upperRight bbox))
                                         (yCoord (lowerLeft bbox))))
                       (upperLeft (list (xCoord (lowerLeft bbox))
                                        (yCoord (upperRight bbox))))
                       (upperRight (upperRight bbox))
                       (refPoint (leGetRefPoint (geGetEditCellView win)))
                       (origin (list 0 0))
                       (t (error "Unknown ?relativeTo mode; must be one of 'centerBox, 'lowerLeft, 'lowerRight, 'upperLeft, 'upperRight, 'refPoint, 'origin"))
                       ))
           (when origin
                 (leSetRefPoint (geGetEditCellView win) origin)
                 )
           )
      )
    /* abZoomSel.il
    
    Author     A.D.Beckett
    Group      Structured Custom, Cadence Design Systems Ltd
    Machine    SUN
    Date       May 20, 1993 
    Modified   A.D.Beckett
    By         Feb 04, 1998 
    
    Various procedures for zooming to selected set, and for
    zooming to probed things.
    
    ***************************************************
    
    SCCS Info: @(#) abZoomSel.il 11/20/08.15:26:22 1.3
    
    */
    
    /*************************************************
    *                                                *
    *          (abExtendBBox bbox @rest xy)          *
    *                                                *
    * procedure to take a bounding box and extend it *
    *              by a list of points.              *
    *                                                *
    *************************************************/
    
    (procedure (abExtendBBox bbox @rest xy)
      (let (minx maxx miny maxy coord)
           (if (and (listp xy)
                    (listp (car xy))
                    (listp (car (car xy))))
               (setq xy (car xy)))
           (if (null bbox) 
               (setq bbox (list (car xy) (car xy))))
           (setq minx (xCoord (lowerLeft bbox)))
           (setq maxx (xCoord (upperRight bbox)))
           (setq miny (yCoord (lowerLeft bbox)))
           (setq maxy (yCoord (upperRight bbox)))
           (foreach coord xy
                    (if (lessp (xCoord coord) minx) (setq minx (xCoord coord)))
                    (if (lessp (yCoord coord) miny) (setq miny (yCoord coord)))
                    (if (greaterp (xCoord coord) maxx) (setq maxx (xCoord coord)))
                    (if (greaterp (yCoord coord) maxy) (setq maxy (yCoord coord))))
           /* return the new bbox */
           (list (list minx miny) (list maxx maxy))))
    
    /******************************************
    *                                         *
    *      (abEnlargeBBox bbox percent)       *
    *                                         *
    * extend the bounding box by a percentage *
    *                                         *
    ******************************************/
    
    (procedure (abEnlargeBBox bbox percent)
      (let (extendX extendY)
           /* calculate extensions */
           (setq extendX
                 (quotient
                  (times
                   (difference
                    (xCoord (upperRight bbox))
                    (xCoord (lowerLeft bbox)))
                   percent)
                  200.0))
           (setq extendY
                 (quotient
                  (times
                   (difference
                    (yCoord (upperRight bbox))
                    (yCoord (lowerLeft bbox)))
                   percent)
                  200.0))
           /* return the enlarged bounding box */
           (list 
            (list 
             (difference (xCoord (lowerLeft bbox)) extendX)
             (difference (yCoord (lowerLeft bbox)) extendY))
            (list 
             (plus (xCoord (upperRight bbox)) extendX)
             (plus (yCoord (upperRight bbox)) extendY)))))
    
    /******************************************
    *                                         *
    *          (abBBoxToPoints bbox)          *
    *                                         *
    * Convert a bounding box to a point list. *
    *                                         *
    ******************************************/
    
    (procedure (abBBoxToPoints bbox)
      (list 
       (lowerLeft bbox)
       (list (xCoord (lowerLeft bbox)) (yCoord (upperRight bbox)))
       (upperRight bbox)
       (list (xCoord (upperRight bbox)) (yCoord (lowerLeft bbox)))))
    
    
    /**********************************************************
    *                                                         *
    *                   (abFindBBox select)                   *
    *                                                         *
    * Find the bounding box of the list of objects passed in. *
    *     Copes with partially selected objects as well.      *
    *                                                         *
    **********************************************************/
    
    (procedure (abFindBBox select @optional forceWholeObject)
      (let (bbox)
           (foreach dbp select
                    (if (or forceWholeObject (geIsFigAllSelected dbp))
                        (setq bbox (abExtendBBox bbox (dbGetq dbp bBox)))
                        (let (pointList)
                             /* generate a point list for object, either directly or from bbox */
                             (unless (setq pointList (dbGetq dbp points))
                                     (setq pointList (abBBoxToPoints (dbGetq dbp bBox))))
                             /* scan two lists, extending bbox if point is selected */
                             (mapc '(lambda (point bool) 
                                            (when bool (setq bbox (abExtendBBox bbox point))))
                                   pointList
                                   (geGetSelSetFigPoint dbp)))))
           /* return bounding box */
           bbox))
    
    
    /*******************************************
    *                                          *
    *    (abZoomSel @optional (select nil))    *
    *                                          *
    * Zoom in on the selected set (no overlap) *
    *  Copes with partially selected objects   *
    *                                          *
    *******************************************/
    
    (procedure (abZoomSel @optional (select nil))
      (let (bbox wind forceWholeObject)
           /* get current window */
           (setq wind (hiGetCurrentWindow))
           /* get selected set if not passed in */
           (if select 
               (setq forceWholeObject t)
               (setq select (geGetSelSet wind)))
    
           (setq bbox (abFindBBox select forceWholeObject))
           (if bbox
               (hiZoomIn wind (list (geEditToWindowPoint wind (lowerLeft bbox))
                                    (geEditToWindowPoint wind (upperRight bbox))))
               (hiDisplayAppDBox
                ?name 'abZSnothingSelected
                ?dboxBanner "Nothing Selected"
                ?dboxText "Nothing is selected for Zoom Selected"
                ?dialogType hicMessageDialog
                ?buttonLayout 'Close))))
    
    
    /*****************************************
    *                                        *
    * (abZoomSelPlus @optional (select nil)) *
    *                                        *
    * same as abZoomSel, but enlarges by 10% *
    *                                        *
    *****************************************/
    
    (procedure (abZoomSelPlus @optional (select nil) (percent 10))
      (let (bbox wind forceWholeObject)
           /* get current window */
           (setq wind (hiGetCurrentWindow))
           /* get selected set if not passed in */
           (if select 
               (setq forceWholeObject t)
               (setq select (geGetSelSet wind)))
    
           (setq bbox (abFindBBox select forceWholeObject))
           (if bbox
               (progn
                (setq bbox (abEnlargeBBox bbox percent))
                (hiZoomIn wind (list (geEditToWindowPoint wind (lowerLeft bbox))
                                     (geEditToWindowPoint wind (upperRight bbox)))))
               (hiDisplayAppDBox
                ?name 'abZSnothingSelected
                ?dboxBanner "Nothing Selected"
                ?dboxText "Nothing is selected for Zoom Selected"
                ?dialogType hicMessageDialog
                ?buttonLayout 'Close))))
    
    /***************************************************************
    *                                                              *
    *                       (abZoomOrig win)                       *
    *                                                              *
    *         simple function for zooming in at the origin         *
    *                                                              *
    ***************************************************************/
    
    (procedure (abZoomOrig win)
      (hiZoomIn win '((-0.2 -0.2) (0.2 0.2))))
    
    /******************************************************************************
    *                                                                             *
    *           (abZoomProbes @optional (window (hiGetCurrentWindow)))            *
    *                                                                             *
    * Zoom into probed objects. Works with nets and instances in extracted views. *
    *         Haven't tested with all objects, but seems to work so far!          *
    *                                                                             *
    ******************************************************************************/
    
    (procedure (abZoomProbes @optional (window (hiGetCurrentWindow)))
      (let (cellView probedObjects probedFigs)
           (setq cellView (geGetEditCellView window))
           ;-----------------------------------------------------------------
           ; find all the probed objects in the current window
           ;-----------------------------------------------------------------
           (setq probedObjects 
                 (setof obj (foreach mapcar probe 
                                     (geGetAllProbe window) (getq probe objectId))
                                      (equal (dbGetq obj cellView) cellView)))
           (setq probedFigs
                 (foreach mapcan object probedObjects 
                          (case (dbGetq object objType)
                                ("sig"
                                 ;-------------------------------------------
                                 ; combine the figures
                                 ;-------------------------------------------
                                 (foreach mapcan net
                                          ;----------------------------------
                                          ; get from sigs to member nets
                                          ;----------------------------------
                                          (foreach mapcar memNet 
                                                   (dbGetq object memNets) 
                                                   (car memNet))
                                          (dbGetq net figs))
                                 )
                                ("net"
                                 (dbGetq object figs)
                                 )
                                (t (list object))
                                )))
           ;-----------------------------------------------------------------
           ; zoom into them
           ;-----------------------------------------------------------------
           (abZoomSel probedFigs)
           ))
     

     

    • 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