• 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 reverse function of axlSessionRegisterCreationCallback...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 149
  • Views 4016
  • 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 reverse function of axlSessionRegisterCreationCallback, i.e. axlSessionUnRegisterCreationCallback ?

TKTAN1973
TKTAN1973 11 months ago

Dear Experts,

Assuming I had these loaded during virtuoso startup in a .cdsinit file.

procedure( func1(session @rest args)
let(()
printf("Length of arguments: %d\n" length(args))
); let
); procedure

(axlSessionRegisterCreationCallback (lambda (session) (axlSessionConnect session "postInstall" 'func1)))
(axlSessionRegisterCreationCallback (lambda (session) (axlSessionConnect session "postCreatedTest" 'func1)))

(axlSessionRegisterCreationCallback (lambda (session) (axlSessionConnect session "preRun" 'func1)))

So after opening a maestro view, I can see what I expect in the CIW, e.g. Length of arguments: 0 or Length of arguments: 3 when I made a copy of the test, etc.

Thus comes my question, is there a axlSessionUnRegisterCreationCallback option that can unregister what I register? I know there is a axlSessionDisconnect function but it does not appear to remove what I had register for the following signals: postInstall, postCreatedTest and preRun after closing and reopening the maestro.

I'm trying to code an utility that allows us enable/disable some func to be trigger during "postInstall", "postCreatedTest" and "preRun". Enabling is easy but I'm scratching my head whether there's any easy way to disable it without commenting the lines away and restart virtuoso session.

Thanks in advance for any help/suggestion that you could offer.

Ps: I've search the forum and mostly the searches returns how to register the callback creation which I've been able to do so and not how to unregister it. But I might have miss out something due to my limited search so pardon me if this has been asked before.

  • Cancel
  • Andrew Beckett
    Andrew Beckett 11 months ago

    There's no function to unregister the session creation callback.

    Of course, what you can do is have the function registered with axlSessionRegisterCreationCallback conditionally call axlSessionConnect to only register the signal callbacks you want to be triggered in the newly created session. Or you could have the triggers always connected and then conditionally do something within them or not.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • TKTAN1973
    TKTAN1973 11 months ago in reply to Andrew Beckett

    Thanks Andrew for such an obvious answer~ What was I thinking in the first place? The solution is so straight forward. Thank you so much!

    Is there any shortcomings that you could think off using either approaches?

    The most obvious benefit I see in the second approach is that when the session is already created, it can take effect immediately if you change the condition. Where as the first approach can only take effect after a new session is started when the condition change.

    ;register a callback to connect the triggers on ADE XL session start
    (axlSessionRegisterCreationCallback 'ADEXLTriggers_func1)
    (axlSessionRegisterCreationCallback 'ADEXLTriggers_func2)

    ;connect ADE XL triggers
    (defun ADEXLTriggers_func1 (session)
    if(boundp('myVar) && myVar!=nil then
    (axlSessionConnect session "postInstall" 'func1)
    (axlSessionConnect session "postCreatedTest" 'func1)
    (axlSessionConnect session "preRun" 'func1)
    else
    (axlSessionDisconnect session 'func1)
    )
    )

    (defun ADEXLTriggers_func2 (session)
    (axlSessionConnect session "postInstall" 'func2)
    (axlSessionConnect session "postCreatedTest" 'func2)
    (axlSessionConnect session "preRun" 'func2)
    )

    ;define a handler to connect to a trigger
    procedure( func1(session @rest args)
    let(()
    printf("Func1: Length of arguments: %d\n" length(args))
    ); let
    ); procedure
    procedure( func2(session @rest args)
    let(()
    if(boundp('myVar) && myVar!=nil then
    printf("Func2: Length of arguments: %d\n" length(args))
    ); if
    ); let
    )

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett 11 months ago in reply to TKTAN1973

    In terms of efficiency it's unlikely to make any noticeable difference - I'd probably default to the first approach unless I needed the ability to change the behaviour during the session (as you said).

    Note that in ADEXLTriggers_func1 you don't need the axlSessionDisconnect call - the functions won't be connected to the signal unless you connected them in the first place for that session, which won't have happened since you're in the session creating callback.

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • TKTAN1973
    TKTAN1973 11 months ago in reply to Andrew Beckett

    Apologies for the late response as I was OOO. Thanks Andrew for the advice. You are correct. ADEXLTriggers_func1  is only register during session setup. So there's no need for the 'else' condition to disconnect. You have fully answer my query. Pray

    • 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