• 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. Temporarily aliasing a function

Stats

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

Temporarily aliasing a function

tailsnaf
tailsnaf over 13 years ago

Hi,

 I'm wondering if the following is possible in skill - 

Say I have an existing skill library that I don't have edit access to. This library calls a procedure as part of a higher-level routine.

What I would like to do is intercept this call to the procedure, and insert my own 'wrapper' and then call the procedure.

So for example - the current setup is:  

top_proc -> calls sub_proc 

 

I want 'alias' sub_proc, so it is called sub_proc_orig, and then define my own procedure called sub_proc.

sub_proc will 'do some work' and then pass on the call to sub_proc_orig, so the call-chain would now be:

top_proc -> calls sub_proc (my proc) -> calls sub_proc_orig (original proc) 

 

Is this possible by using the 'address/id' of the existing sub_proc perhaps? 

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    putd('sub_proc_orig getd('sub_proc))
    ; allow redefinition of write protected functions - only needed if it's write protected
    sstatus(debugMode t)
    procedure(sub_proc(correct args for sub_proc)
      ...
      sub_proc_orig(...)
    )

    Do this carefully though - if it gets forgotten that the function is being overloaded this way, it can make it very confusing to the poor soul trying to debug why the original function doesn't behave the same way that they're expecting...

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • tailsnaf
    tailsnaf over 13 years ago
    This is excellent Andrew, thanks. I will proceed with caution - I plan on passing directly through by default, and only in the advanced mode doing some pre-processing first.
    • 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