Trigger Functions

Discussion in 'Cadence' started by Tracy Groller, May 9, 2005.

  1. I am trying to figure out some of the
    trigger functions, I would like to be able
    to launch a procedure each time a
    schematic is opened for for write acess .


    --


    \ ~ ~ ///
    ---- ( @ @ )
    | | ======oOOo==(_)==oOOo=======================================
    | |__<*> ___ Tracy Groller | Texas Instruments, Inc.
    | _|III|_ | ------------------| Wireless RFCMOS Design
    _____| /_ III _/ \ TI MSGID: TAG2 | P.O. Box 660199, MS 8729
    \_ /III/ | PC Drop: PFLL | Dallas, Texas 75266
    \ _ /III/ _| -------------------------------------------------
    \_/ \ \___> - Phone: (214) 480-2217 Text Pager
    \ / Email:
    \ \ =======================================================
    \---\
     
    Tracy Groller, May 9, 2005
    #1
  2. procedure(TracyTrigger(args)
    when(member(args->accessMode '("a" "w"))
    printf("Opened in edit mode\n")
    ;;; do what you want here ;;;
    )
    )

    deRegUserTriggers("schematic" nil nil 'TracyTrigger)
     
    Andrew Beckett, May 9, 2005
    #2
  3. Tracy Groller

    John Gianni Guest

    Likewise, upon exit, Jay wrote a nice routine:

    ;;------------------------------------------------------------------------;;
    ;; FileName : JayExit.il
    ;;
    ;; Purpose : Demonstrate use of pre-exit & post-exit triggers.
    ;;
    ;; Author: M. Singh (aka "Jay Knows Best" ::
    ;;
    ;; Paste the following line into your .cdsinit file or in your CIW
    ;; load("JayExit.il")
    ;;------------------------------------------------------------------------;;

    ;-- What do you want to do just before exiting ???
    ;
    procedure(JayBeforeExitProc()
    printf("This is just before session exit. Do something in the
    session.\n")
    ); end procedure
    ;
    ;
    ;-- Exit is final... What now ???
    ;
    procedure(JayAfterExitProc()
    printf("This is the place for any post-session processing.\n")
    ;(hiDisplayForm hiSaveForRestoreForm )
    ); end procedure
    ;
    ;-- Register regExitBefore and/or regExitAfter.
    procedure(JayInvokeMyExit()
    regExitBefore('JayBeforeExitProc)
    regExitAfter('JayAfterExitProc)
    ); end procedure
    ;
    ;; Invoke and Implement call back.
    JayInvokeMyExit()
    ;end
     
    John Gianni, May 9, 2005
    #3
  4. Tracy Groller

    John Gianni Guest

    I added the "Jay knows best" above (not Jay).

    Notice both Andrew ("Andrew knows all") and Jay ("Jay konws best")
    follow Cadence naming recommendations:
    - Start all Customer functions & file names with a prefix;
    - Start the prefix with a caital letter;
    - Run the results through a SKILL Survey
    (This provies a complete three-file function inventory for
    ease-of-maintenance & it allows for survey results for no hassle
    migration to subsequent releases!)

    Note: For its part, Cadence all new SKILL functions should start with a
    lower-case prefix & all new Cadence private unsupported undocumented
    functions should additionally start with an underscore.

    That way, you know at a glance, the status of any particular SKILL
    function or file - just by the name.

    John Gianni
    "The email address above is a spam trap; use my corporate email."
     
    John Gianni, May 9, 2005
    #4
  5. fogh,

    Many thanks for the post,
    Andrew thanks for putting the info together
    much better than cdsdoc examples .

    Tracy


    --


    \ ~ ~ ///
    ---- ( @ @ )
    | | ======oOOo==(_)==oOOo=======================================
    | |__<*> ___ Tracy Groller | Texas Instruments, Inc.
    | _|III|_ | ------------------| Wireless RFCMOS Design
    _____| /_ III _/ \ TI MSGID: TAG2 | P.O. Box 660199, MS 8729
    \_ /III/ | PC Drop: PFLL | Dallas, Texas 75266
    \ _ /III/ _| -------------------------------------------------
    \_/ \ \___> - Phone: (214) 480-2217 Text Pager
    \ / Email:
    \ \ =======================================================
    \---\
     
    Tracy Groller, May 9, 2005
    #5
  6. Tracy Groller

    S. Badel Guest

    I used to save the old value of the trigger and call it from my own trigger
    to avoid overriding. I tought it was needed, however seeing your code i did
    a try and i was surprised to see it is not.

    Is this a new behavior or was i always doing wrong?

    stéphane
     
    S. Badel, May 10, 2005
    #6
  7. Tracy Groller

    Erik Wanta Guest

    Stéphane:
    There was a limitation where one could only register one user trigger
    per view type. This limitation doesn't exist in the later IC versions
    (from IC5033 I believe). I do check to see that I unregister a user
    trigger before registering it again however.

    ;make sure that myUserTrigger isn't already registered
    when(member('myUserTrigger
    deGetAppInfo("analogArtist-schematic")->userPostInstallTrigList)
    ;if registered, unregister
    _deUnRegUserTrigger("analogArtist-schematic" nil nil 'myUserTrigger)
    ) ; when

    ;register my trigger
    deRegUserTriggers("analogArtist-schematic" nil nil 'myUserTrigger)
     
    Erik Wanta, May 10, 2005
    #7
  8. A change was made some point in the IC446 hotfix stream to allow multiple
    trigger registrations. Before that I had some wrapper code around
    deRegUserTriggers which kept a record of all the registrations, and then the
    registered function called all the functions registered with my own code in
    turn. Luckily that's no longer needed.

    So it's certainly there in all IC5.X versions.

    Regards,

    Andrew.
     
    Andrew Beckett, May 11, 2005
    #8
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.