• 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 know if leRegUserObjectSelectionFilter is running...

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 143
  • Views 13885
  • 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 know if leRegUserObjectSelectionFilter is running?

psill
psill over 12 years ago

Is there a way to determine if  leRegUserObjectSelectionFilter running? 

When I use leUnregUserObjectSelectionFilter() and leRegUserObjectSelectionFilter is running I get an output t and when it is not running it outputs t also.

Is there a function to determine the state of  leRegUserObjectSelectionFilter?

 

psill 

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    What do you mean by "is running"? I don't quite understand the question...

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • psill
    psill over 12 years ago

    How do I detect if the session has invoked leRegUserObjectSelectionFilter, so if it is executed I could leUnregUserObjectSelectionFilter to turn off the select filter. And if it is not filtering, to reinvoke leRegUserObjectSelectionFilter.

    psill 

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • dmay
    dmay over 12 years ago

    I don't know how to check to see if the ObjectSelectionFilter currently has a function registered. However, it seems like you should be able to setup your own means of managing this. Rather than registering and unregistering the filter, just register it once at the beginning of your session. Then, within the procedure that you register, you can check the status of a global variable or form to determine whether or not you do any filtering. It is up to your command to return t or nil. If you wish not to filter, then you always return t.

    For example, in the code we register, we always return t if the cellview is read-only. This allows a user to select whatever they want in read-only mode, but we can enforce our filter criteria when the cellview is in edit mode.

    Derek

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

     I also use this code to support registering more than one filter:

    /* abLeMultiSelectionFilter.ils
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Dec 02, 2008 
    Modified   
    By         
    
    A mechanism to allow multiple filters to be registered
    for leRegUserLayerSelectionFilter and leRegUserObjectSelectionFilter
    
    Defines:
    
    abLeRegUserLayerSelectionFilter(t_funcName)
    abLeUnregUserLayerSelectionFilter(t_funcName)
    abLeRegUserObjectSelectionFilter(t_funcName)
    abLeUnregUserObjectSelectionFilter(t_funcName)
    
    These are similar to the original functions with prefix le instead of
    abLe, but note that the original unreg functions don't need a function
    name (this does, because it needs to know which function is
    being unregistered)
    
    ***************************************************
    
    SCCS Info: @(#) abLeMultiSelectionFilter.ils 12/02/08.11:51:17 1.1
    
    */
    
    (let ()
      /******************************************************************
      *                                                                 *
      *    (defineFilterWrapper regFunc unregFunc filterName "uut")     *
      *                                                                 *
      *   Closure which returns a list of three functions - one to be   *
      *   the registration function, one the unregistration function,   *
      *  and one the filter itself. Needs to know the function objects  *
      *   to perform the single registration, unregistration, and the   *
      *              ultimate (global) name of the filter.              *
      *                                                                 *
      *  The idea is that this keeps track of multiple registrations,   *
      *  and then calls all the registered filter functions sequence,   *
      * so turns with a single registered filter function, can actually *
      *                 call several functions instead.                 *
      *                                                                 *
      ******************************************************************/
      (defun defineFilterWrapper (regFunc unregFunc filterName "uut")
        (let (filterList registered)
          ;------------------------------------------------------------------
          ; local function to register the selection filter
          ;------------------------------------------------------------------
          (defun register (func)
            (when (stringp func) (setq func (stringToSymbol func)))
            (unless (member func (car filterList))
              (setq filterList (tconc filterList func)))
            (unless registered
              (setq registered t)
              (regFunc filterName)
              )
            t
            )
          ;------------------------------------------------------------------
          ; local function to unregister the selection filter
          ;------------------------------------------------------------------
          (defun unregister (func)
            (when (stringp func) (setq func (stringToSymbol func)))
            (setq filterList 
                  (lconc nil (remove func (car filterList))))
            (unless (car filterList)
              (setq registered nil)
              (unregFunc)
              )
            t
            )
          ;------------------------------------------------------------------
          ; local function to actually be the selection filter
          ;------------------------------------------------------------------
          (defun filter (obj)
            (forall func (car filterList)
                    (funcall func obj))
            )
          (list register unregister filter)
          )
        )
    
      ;----------------------------------------------------------------------
      ; Use the closure to define the multi-version of 
      ; leRegUserLayerSelectionFilter and leUnregUserSelectionFilter
      ;----------------------------------------------------------------------
      (let (funcs)
        (setq funcs (defineFilterWrapper leRegUserLayerSelectionFilter
                                         leUnregUserLayerSelectionFilter
                                         "abMultiLayerSelectionFilter"))
        (setq abLeRegUserLayerSelectionFilter (car funcs))
        (setq abLeUnregUserLayerSelectionFilter (cadr funcs))
        (setq abMultiLayerSelectionFilter (caddr funcs))
        )
    
      ;----------------------------------------------------------------------
      ; Use the closure to define the multi-version of
      ; leRegUserObjectSelectionFilter and leUnregUserObjectSelectionFilter
      ;----------------------------------------------------------------------
      (let (funcs)
        (setq funcs (defineFilterWrapper leRegUserObjectSelectionFilter
                                         leUnregUserObjectSelectionFilter
                                         "abMultiObjectSelectionFilter"))
        (setq abLeRegUserObjectSelectionFilter (car funcs))
        (setq abLeUnregUserObjectSelectionFilter (cadr funcs))
        (setq abMultiObjectSelectionFilter (caddr funcs))
        )
      t
      )
    
    
    Regards,

     

    Andrew.

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

     And here's an example that can (optionally) use this - and uses the type of approach that Derek suggests (registers it once, but then uses a flag to control whether it is active or not). In this case the flag is a lexically scoped (rather than global) variable, but the principle is what matters here. Also, the actual functionality in the code is not relevant if using IC615 because it's now a standard feature of the layout editor (Edit->Protect) - so I include it here for illustration purposes.

    Regards,

    Andrew

     

    /* abProtect.ils
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Nov 14, 2008 
    Modified   Nov 19, 2008 
    By         A.D.Beckett
    
    Package for implementing a protection mechanism for
    layout. The idea is that you can protect objects, and
    consequently they are then not selectable.
    
    For example:
    
    ; initialize the system
    abProtect->init()
    
    ; protect the selected objects
    abProtect->protectSelected()
    
    ; turn off protection mode so everything is
    ; selectable (t to turn back on)
    abProtect->setOption('protectMode nil)
    
    ; select all the protected things
    abProtect->selectProtected()
    
    ; unprotect all the selected objects (have
    ; to turn off protect mode first, or use selectProtected)
    abProtect->unprotectSelected()
    
    ; unprotect everything
    abProtect->unprotectAll()
    
    ; protect everything in a named group
    abProtect->protectGroup("groupName")
    abProtect->unprotectGroup("groupName")
    
    ; hilight the protected objects
    abProtect->hilight()
    ; and unhilight them
    abProtect->unhilight()
    
    ; using abSelectObjByName code, prompt user to pick
    ; a figGroup to be protected
    abSelectObjByName('figGroups geGetEditCellView() abProtect->protectObj)
    ; and to unprotect
    abSelectObjByName('figGroups geGetEditCellView() abProtect->unprotectObj)
    
    ; using an alternative select filter registration
    ; function - e.g. from abLeMultiSelectionFilter.ils
    ; must be done before init. This allows additional filters to be 
    ; defined
    abProtect->setOption('regSelectionFilter 'abLeRegUserObjectSelectionFilter)
    abProtect->init()
    
    ***************************************************
    
    SCCS Info: @(#) abProtect.ils 12/02/08.13:05:00 1.4
    
    */
    
    (importSkillVar abProtect)
    (setq abProtect
          (let (
                (options (makeTable 'options nil))
                (optionNames '(protectMode 
                                deselectAfterProtect hilightLPP
                                hilightHalo
                                haloPosition haloType haloThickness
                                haloTransparency haloDrawStroke
                                regSelectionFilter))
                )
            /***************************************************************
            *                                                              *
            *                (setOption option value "sg")                 *
            *                                                              *
            *   Exported function for setting an option for the protect    *
            *    package. Needs the name of the option and a value. The    *
            *     name is checked to ensure it is a valid option name.     *
            *                                                              *
            ***************************************************************/
            (defun setOption (option value "sg")
              (if (memq option optionNames)
                (setarray options option 
                          (if (listp value) (copy value) value)
                          )
                (error "Unrecognised option %L - must be one of %L\n"
                       option optionNames)
                )
              ) ; defun setOption
            /***************************************************************
            *                                                              *
            *                 (getOption @optional option)                 *
            *                                                              *
            *  Exported function for getting the value of an option or a   *
            *               list of the legal option names.                *
            *                                                              *
            ***************************************************************/
            (defun getOption (@optional option)
              (if option
                (if (memq option optionNames)
                  (arrayref options option)
                  (error "Unrecognised option %L - must be one of %L\n"
                         option optionNames)
                  )
                (sort (copy optionNames) 'alphalessp)
                )
              ) ; defun getOption
            /***************************************************************
            *                                                              *
            *                   (protectSelected [wid])                    *
            *                                                              *
            *    Exported function for protecting the selected figures     *
            *            in the specified (or current) window.             *
            *                                                              *
            ***************************************************************/
            (defun protectSelected (@optional (wid (hiGetCurrentWindow)))
              (setSGq (geGetSelSet wid) t protected)
              ;--------------------------------------------------------------
              ; Deselect if the preference has been set
              ;--------------------------------------------------------------
              (when (arrayref options 'deselectAfterProtect)
                (geDeselectAll wid)
                )
              t
              ) ; defun protectSelected
            /***************************************************************
            *                                                              *
            *                  (protectGroup name [wid])                   *
            *                                                              *
            *    Exported function to protect a group (figGroup) given     *
            *                          the name.                           *
            *                                                              *
            ***************************************************************/
            (defun protectGroup (name @optional (wid (hiGetCurrentWindow)))
              (let (theFigGroup)
                (setq theFigGroup
                      (dbGetFigGroupByName (geGetEditCellView wid) name))
                (when theFigGroup
                  (putpropq theFigGroup t protected)
                  )
                ) ; let
              ) ; defun protectGroup
            /***************************************************************
            *                                                              *
            *                 (unprotectGroup name [wid])                  *
            *                                                              *
            *              Unprotect a group, given its name               *
            *                                                              *
            ***************************************************************/
            (defun unprotectGroup (name @optional (wid (hiGetCurrentWindow)))
              (let (theFigGroup)
                (setq theFigGroup
                      (dbGetFigGroupByName (geGetEditCellView wid) name))
                (when theFigGroup
                  (dbDeletePropByName theFigGroup "protected")
                  )
                ) ; let
              ) ; defun unprotectGroup
            /***************************************************************
            *                                                              *
            *                     (protectObj d_obj)                       *
            *                                                              *
            *                 Given an object, protect it.                 *
            *                                                              *
            ***************************************************************/
            (defun protectObj (obj "d")
              (putpropq obj t protected)
              )
            /***************************************************************
            *                                                              *
            *                     (unprotectObj d_obj)                     *
            *                                                              *
            *                Given an object, unprotect it.                *
            *                                                              *
            ***************************************************************/
            (defun unprotectObj (obj "d")
              (dbDeletePropByName obj "protected")
              )
            /***************************************************************
            *                                                              *
            *                  (unprotectSelected [wid])                   *
            *                                                              *
            *   Exported function to unprotect the selected objects. Of    *
            *   course, you need to select them first, so probably need    *
            * to either turn off the protectMode, or select the protected  *
            *                items using selectProtected()                 *
            *                                                              *
            ***************************************************************/
            (defun unprotectSelected (@optional (wid (hiGetCurrentWindow)))
              (foreach fig (geGetSelSet wid)
                       (dbDeletePropByName fig "protected")
                       )
              t) ; defun unprotectSelected
            /***************************************************************
            *                                                              *
            *                (operateOnAllObjects cv func)                 *
            *                                                              *
            *    Internal function to apply a specified function to all    *
            *   objects. This avoids having to replicated this iteration   *
            *                      in lots of places.                      *
            *                                                              *
            ***************************************************************/
            (defun operateOnAllObjects (cv func)
              (foreach objs 
                       (list
                         (getSGq cv shapes)
                         (getSGq cv instances)
                         (getSGq cv vias)
                         (getSGq cv figGroups)
                         (getSGq cv mosaics)
                         (getSGq cv blockages)
                         (getSGq cv rows)
                         (getSGq cv markers)
                         (getSGq cv areaBoundaries)
                         (getSGq cv guides)
                         (getSGq cv routes)
                         (getSGq cv steiners)
                         (list (getq cv prBoundary))
                         (list (getq cv snapBoundary))
                         )
                       (foreach fig objs
                                (func fig)
                                )
                       )
              ) ; defun operateOnAllObjects
            /***************************************************************
            *                                                              *
            *                   (selectProtected [wid])                    *
            *                                                              *
            *    External function to select all the protected objects     *
            *                                                              *
            ***************************************************************/
            (defun selectProtected (@optional (wid (hiGetCurrentWindow)))
              (let (cv (protectMode (arrayref options 'protectMode)))
                (setq cv (geGetEditCellView wid))
                ;------------------------------------------------------------
                ; Temporarily suspend the protect mode
                ;------------------------------------------------------------
                (setarray options 'protectMode nil)
                (operateOnAllObjects cv
                                     (lambda (fig)
                                       (when (getq fig protected)
                                         (geSelectFig fig)
                                         )
                                       )
                                     )
                ;------------------------------------------------------------
                ; And then turn it back on (if on previously)
                ;------------------------------------------------------------
                (setarray options 'protectMode protectMode)
                )
              ) ; defun selectProtected
            /***************************************************************
            *                                                              *
            *                     (unprotectAll [wid])                     *
            *                                                              *
            *          External function to unprotect everything           *
            *                                                              *
            ***************************************************************/
            (defun unprotectAll (@optional (wid (hiGetCurrentWindow)))
              (let (cv (protectMode (arrayref options 'protectMode)))
                (setq cv (geGetEditCellView wid))
                (setarray options 'protectMode nil)
                (errset
                  (operateOnAllObjects cv
                                       (lambda (fig)
                                         (dbDeletePropByName fig "protected")
                                         )
                                       )
                  )
                (setarray options 'protectMode protectMode)
                )
              ) ; defun unprotectAll
            /***************************************************************
            *                                                              *
            *                      (unhilight [wid])                       *
            *                                                              *
            *     External function to unhilight the protected objects     *
            *                                                              *
            ***************************************************************/
            (defun unhilight (@optional (wid (hiGetCurrentWindow)))
              (let (hs)
                (setq hs (getq wid protectHilightSet))
                (when (geIsValidHilightSet hs) (geDeleteHilightSet hs))
                t
                )
              )
            /***************************************************************
            *                                                              *
            *                       (hilight [wid])                        *
            *                                                              *
            *   External function to hilight (with Halos if desired) the   *
            *                      protected objects                       *
            *                                                              *
            ***************************************************************/
            (defun hilight (@optional (wid (hiGetCurrentWindow)))
              (let (hs cv)
                (unhilight)
                (setq cv (geGetEditCellView wid))
                (setq hs (geCreateHilightSet cv (arrayref options 'hilightLPP)))
                (operateOnAllObjects cv
                                     (lambda (fig)
                                       (when (getq fig protected)
                                         (geAddHilightRectangle hs
                                                                (getq fig bBox))
                                         )
                                       )
                                     )
                (when (and
                        (isCallable 'geSetHilightSetHaloParameters)
                        (arrayref options 'hilightHalo)
                        )
                  (geSetHilightSetHaloParameters
                    hs
                    (arrayref options 'haloPosition)
                    (arrayref options 'haloType)
                    (arrayref options 'haloThickness)
                    (arrayref options 'haloTransparency)
                    (arrayref options 'haloDrawStroke)
                    ))
                (putpropq hs t enable)
                (putpropq wid hs protectHilightSet)
                t
                )
              ) ; defun hilight
            /***************************************************************
            *                                                              *
            *                      (selectFilter fig)                      *
            *                                                              *
            *    Function, exported as abProtectSelectFilter, which is     *
            * registered as the selection filter function. This is called  *
            *    for each object to determine whether it is selectable.    *
            *                                                              *
            ***************************************************************/
            (defun selectFilter (fig)
              (cond
                ((null (arrayref options 'protectMode)) t)
                ((getq fig protected) nil)
                (t t)
                )
              ) ; defun selectFilter
            /***************************************************************
            *                                                              *
            *                            (init)                            *
            *                                                              *
            *     Exported function to initialize the protect system.      *
            *                                                              *
            ***************************************************************/
            (defun init ()
              (funcall
                (arrayref options 'regSelectionFilter)
                "abProtectSelectFilter")
              ) ; defun init
            ;----------------------------------------------------------------
            ; Export the select filter
            ;----------------------------------------------------------------
            (setq abProtectSelectFilter selectFilter)
            ;----------------------------------------------------------------
            ; Defaults
            ;----------------------------------------------------------------
            (setarray options 'protectMode t)
            (setarray options 'hilightLPP '("y0" "drawing"))
            (setarray options 'hilightHalo t)
            (setarray options 'haloPosition "over")
            (setarray options 'haloType "plain")
            (setarray options 'haloThickness "normal")
            (setarray options 'haloTransparency 50)
            (setarray options 'haloDrawStroke t)
            (setarray options 'regSelectionFilter 'leRegUserObjectSelectionFilter)
            ;----------------------------------------------------------------
            ; The DPL containing all the exported functions for the
            ; package
            ;----------------------------------------------------------------
            (list nil
              'setOption setOption
              'getOption getOption
              'protectSelected protectSelected
              'unprotectSelected unprotectSelected
              'selectProtected selectProtected
              'unprotectAll unprotectAll
              'protectGroup protectGroup
              'unprotectGroup unprotectGroup
              'protectObj protectObj
              'unprotectObj unprotectObj
              'hilight hilight
              'unhilight unhilight
              'init init
              ) ; list
            ) ; let
          ) ; setq abProtect
    

     

    • 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