• 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. change default GUI callback

Stats

  • Locked Locked
  • Replies 17
  • Subscribers 143
  • Views 20543
  • 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

change default GUI callback

Leonid Y
Leonid Y over 13 years ago

Hello guys,

 I am a bit new to skill programming. I would like to change default behaviour of a standard form. Basically I would like one field to change its value when another field is modified in a default form. To be more specific, I want some exact values to be set in "Create Instance"  dialog for the "Delta X", "Delta Y" fields when a particular Lib Cell View is chosen.

I have found out that the form is bound to  the leCreateInstForm structure and it , in turns, has the fields: libName cellName viewName instName and so on; Each one has a list of properties including more interesting for me:

 _focusInCallback

 _modifyCallback

_callback

The values of first two properties are empty "" and the last one is set to

 "leInstCellNameCB(leCreateInstForm~>cellName~>value)"

which I suppose default skill routine which checks for cellview existence  in Library Manager and something else. I guess it is exactly where the things happen.

Till this moment everything seems to be clear, but when I replace  the default routine with my own one , which does just perfect when it is fed to CIW , it not only does not do what I expect but the whole mechanism seems to get broken till I restart icfb.

So, my questions :

- is it possible in general to change default behaviour in my case? some straight ways or tricky ones.

- what does the underscore  sign in the beginning of _callback property mean? There must be some special meaning..

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    To change the callback, you should use hiChangeFormCallback(leCreateInstForm "yourNewCallback()") .

    The underscore at the beginning of the property is a convention to indicate that it's private (we use a similar convention for function names too).

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Leonid Y
    Leonid Y over 13 years ago

    Andrew, thank you for your reply.

    As far as I understand the hiChangeFormCallback sets _doneAction (and optionally _cancelAction) which are to be run when form submitted with OK button or whatever. So it is all right when you need to provide some values to a form, then do some processing and then execute an action. I need a bit different thing. I would like the values are re-calculated(re-set) each time I change cellName in the form. So I suppose I need to operate with this "cellName" field instead of the whole form.

    Is it possible to change callback for a particular field of the form? I have tried

    hiChangeFormCallback(leCreateInstForm~>cellName "yourNewCallback()") 

    with no success.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Leonid Y
    Leonid Y over 13 years ago

     I continued my investigation. I played with whole form callback defined it according to Andrew's advice , but still do not see any effect even for this case. Simply no changes. Should I call some function which reloads something in order to apply a change?

    Also , returning back to assigning a function to a form field - is it OK just to use "=" operator? because the  hiChangeFormCallback operates at a form level, i.e. it does not accept a field (e.g. leCreateInstForm->cellName) as a parameter.

    Please help, I have no idea where to find an answer. The only reference guide I know is skuiref which seems not be too willing to give some info about adjusting built-in functionality. And I am stuck in the very beginning.

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

    I misread your original question (didn't realise it was the form field callback you wanted to change). I just tried it, and it works fine:

    procedure(myCB()
      printf("HERE I AM\n")
      leInstCellNameCB(leCreateInstForm->cellName->value)
    )

    leCreateInstForm->cellName->_callback="myCB()"

    Then when I interact with the cellName field (and move the focus out of the field), it prints HERE I AM in the CIW, and then does the original callback.

    With this particular form, I don't think changing the form callback (with hiChangeFormCallback()) has any effect, because it's an "options" form - associated with an enter function. So there's no OK or Apply on the form - it's merely a form to provide options when digitizing (i.e. clicking where you want the instance to be placed).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Leonid Y
    Leonid Y over 13 years ago

     Andrew, I was able to make some progress with your advice, thank you.

    Initially I was trying the method but failed probably due to syntax mistake or something.

    Now I can tune up necessary values depending on the value in the field , so that part is great. I have already modified your simple callback to my needs and it works fine. Though I needed to place the leInstCellNameCB(leCreateInstForm->cellName->value) built-in callback in the end of the procedure to let my changes apply(not to be over written by the leInstCellNameCB function)

    Now I have another problem that the form re-calculate all values each time it is called, i.e. there must be some another callback responsible for initial value calculations, but I can not identify which one it is.. Is there some reserved procedure or name for such function?

    Also, I encounter problem that Cadence does not accept any changes in callbacks till I restart the whole session. Once callback is defined and bound to a form , it is not possible to change something in the callback procedure and watch results on the form. I wonder if there is a special function that "reset"a form or callbacks so that I could call it instead of restaring the whole session.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Leonid Y
    Leonid Y over 13 years ago

    I found out that the form is called by leHiCreateInst() and it is probably the function that checks and sets all initial values for fields. Now that's the question how to modify it? 

    One idea is to re-assign the function in this way:

     

     procedure(leHiCreateInst()

     leHiCreateInst();

    _some_actions

    )

    And here is the system reply:

     *Error* def: function is write protected and cannot be redefined - leHiCreateInst

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

    I don't really understand why you can't do that via the lib, cell, view field callbacks on the form? Why do you need to wrap the command somehow? It's not going to be easy, because there's an enterFunction being used here, and the form is only the options form for that.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Leonid Y
    Leonid Y over 13 years ago

    Andrew, yes I can attach callbacks to the fields, but each time the form is called it invokes some another procedure which reset all settings to defaults, e.g. deltaX, deltaY. So I guess I also have to redefine some another callback in order to have it initially calculated right way but I can't identify which one

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

    What if you wrap it with a hiRegTimer call to update the deltas right after the form comes up? You would setup your bindkey for placing an instance like this:

    hiRegTimer("myInstCallback()" 1) leHiCreateInst()

    This would initiate your callback one tenth of a second after the form comes up.

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Leonid Y
    Leonid Y over 13 years ago

    Thanks Derek, your advice helped.

    Now I'm almost fine, the only I need is to define callback at every startup

    leCreateInstForm->cellName->_callback="_myCB()"

    If I add the line into .cdsinit it fails due to  non existent layout window.

    How can I add the line to Layout Editor startup script? I see there are plenty commands loaded when LE window invoked, so the question is where it's done.

    • 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