• 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. Is there a way to access/modify external data from enterfunction...

Stats

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

Is there a way to access/modify external data from enterfunction doneProc without using globals?

hcjiv1
hcjiv1 over 5 years ago

I know people have to do this all the time but I was not able to find a solution. Is there away to pass extra data to the doneProc of an enterfunction, for instance enterBox in this case? I need to add the box with it's options to an existing data structure and would rather not use global variables if it can be helped. Something like:

(define createNewBox

  (lambda (mystruct)

    (enterBox ?doneProc "myDoneProc")))

How do I inform myDoneProc about mystruct so it can add the resulting box to mystruct?

TIA,

-Harry

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

    Hi Harry,

    The best thing would have been if the enter functions (such as enterBox) supported having the callback specified as a function object, in which case you could then pass a lexically scoped function which would then be able to call a function which can access your data structure in the same scope. Unfortunately that's not supported - it only allows a string (and it then calls it by appending the arguments). Some other human interface functions were updated a while ago to support function object callbacks, but not the enter functions.

    I came up with a fairly ugly workaround which avoids needing any global variables, but I'm not particularly comfortable with sharing it here (a colleague in R&D came up with a slightly different ugly workaround). So I think the simple answer for now is that you can't really do this. I would suggest you contact customer support and describe your requirement, and ask for a duplicate for CCR 2169313 to be filed on your behalf.

    Regards,

    Andrew.

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

    Hi Harry,

    The best thing would have been if the enter functions (such as enterBox) supported having the callback specified as a function object, in which case you could then pass a lexically scoped function which would then be able to call a function which can access your data structure in the same scope. Unfortunately that's not supported - it only allows a string (and it then calls it by appending the arguments). Some other human interface functions were updated a while ago to support function object callbacks, but not the enter functions.

    I came up with a fairly ugly workaround which avoids needing any global variables, but I'm not particularly comfortable with sharing it here (a colleague in R&D came up with a slightly different ugly workaround). So I think the simple answer for now is that you can't really do this. I would suggest you contact customer support and describe your requirement, and ask for a duplicate for CCR 2169313 to be filed on your behalf.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • hcjiv1
    hcjiv1 over 5 years ago in reply to Andrew Beckett

    Hi Andrew,

    Thank you! Yes a function object would be the ideal solution but I can see where that might be difficult since it would have to be called from within the skill event loop.  For now I will use a global variable. I'm not too concerned about two of my enterfunctions being active at the same time but I may implement the global as a lookup table to allow for that just in case.

    Thanks again!

    -Harry

    • 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