• 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. Intercept custom skill function before execution

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 13771
  • 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

Intercept custom skill function before execution

adc23
adc23 over 6 years ago

Hi,

We have a custom skill script which can be called either through a menu or a keyboard shortcut inside the virtuoso schematic editor. This skill function reads a cadence variable which is set in our cdsinit file. This variable defines the root directory of where the output of the function is placed. The remainder of the directory is derived from the cell name. 

I am not able to change this function as it is used company wide. However, our team wants the option to steer the output of the function based on the virtuoso library as well as the cell. I've identified two possible ways of doing this but haven't been able to work out how to implement either of them:

  • write a function which is called any time a window gains focus. If the window is a virtuoso schematic window, update the cadence variable with the appropriate destination for that window. 
  • create a trigger which catches the function before it's called, and modify the variable before calling the function.

I can't see anything in the documentation about knowing when a window gains focus - only how to set the focus of a window. I also don't have enough SKILL knowledge to understand the custom triggers. Are either of these solutions viable - or, is there a better way to achieve the same result?

Thanks,

Alistair

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago

    Hi Alistair,

    There is a trigger which can be registered when the current window changes:

    procedure(CCFcurrentWindowChanged(winNum)
      let((winId cv)
        unless(winNum==0
          winId=window(winNum)
        )
        when(winId
          cv=geGetEditCellView(winId)
          getWarn()
          unless(cv~>cellViewType=="schematic"
            cv=nil
          )
        )
        when(cv
          sprintf(ROOTDIR "/tmp/%s_%s_%s" cv~>libName cv~>cellName cv~>viewName)
        )
      )
    )

    hiRegCurWindowTrigger('CCFcurrentWindowChanged)

    ; second trigger approach needed for new windows (i.e. if you open a schematic design) because
    ; the current window trigger is invoked before the cellView is installed in the window. Also
    ; if you descend or ascend in a window, the current window trigger doesn't get called - but this
    ; will
    procedure(CCFschPostInstall(args)
      sprintf(ROOTDIR "/tmp/%s_%s_%s" args->libName args->cellName args->viewName)
    )

    deRegUserTriggers("schematic" nil nil 'CCFschPostInstall)

    The alternative is to store away the original function and redefine a new version with the same name which sets the variable and then calls your stored function. Something like:

    unless(getd('MyStoredFunction)
      putd('MyStoredFunction getd('TheOriginalFunction))
      sstatus(debugMode t)
      procedure(TheOriginalFunction(@rest args)
        let((cv)
          cv=geGetEditCellView()
          when(cv
            sprintf(ROOTDIR "/tmp/%s_%s_%s" cv->libName cv->cellName cv->viewName)
          )

          apply('MyStoredFunction args)
        )
      )
    )

    You'd have to change the function names in this second approach.

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • adc23
    adc23 over 6 years ago in reply to Andrew Beckett

    Hi Andrew, 

    Thanks, this allows me to do exactly what I need it to. 

    Alistair

    • 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