• 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. Adding menu entries to ADE L window

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 15103
  • 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

Adding menu entries to ADE L window

ChrisEAS
ChrisEAS over 13 years ago

While migrating some SKILL code from Cadence 5 to Cadence 6 I'm encountering problems with adding menu entries. On Cadence 5, I was able to add a menu entry to the Analog Artist window by using it's name "analogArtist-schematic":

 deRegUserTriggers("analogArtist-schematic" ... )

However, in Cadence 6 this name seems not to correspond to the ADE L window anymore. Which is the preffered way of including menu entries into ADE L within Cadence 6?

Cheers, Chris

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    Chris,

    That never was the ADE window. That's the viewType of the schematic corresponding to the ADE window - i.e. the window you launched ADE from. That should still work - in fact I just tried it using this (very old) code:

    /* abAddArtMenus.il
    
    Author     A.D.Beckett
    Group      Structured Custom, Cadence Design Systems Ltd.
    Machine    SUN
    Date       Dec 09, 1996 
    Modified   
    By         
    
    Method to add menus to artist simulation environment
    in 4.4
    
    ***************************************************
    
    SCCS Info: @(#) abAddArtMenus.il 11/20/08.15:26:09 1.1
    
    */
    
    
    /***************************************************************
    *                                                              *
    *                  (abAddArtMenusCreateMenu)                   *
    *                                                              *
    *       Create a dummy menu, just to show the principle        *
    *                                                              *
    ***************************************************************/
    
    (procedure (abAddArtMenusCreateMenu)
      (let (item1 item2)
           (setq item1 
                 (hiCreateMenuItem
                  ?name 'item1
                  ?itemText "Item 1"
                  ?callback "printf(\"Item1\n\")"))
           (setq item2 
                 (hiCreateMenuItem
                  ?name 'item2
                  ?itemText "Item 2"
                  ?callback "printf(\"Item2\n\")"))
           (hiCreatePulldownMenu
            'abArtMenu
            "Test"
            (list item1 item2)
            )))
    
    /***********************************************************************
    *                                                                      *
    *                     (abAddArtMenusTrigger args)                      *
    *                                                                      *
    *  Define a post-install trigger function for analogArtist-schematic   *
    * to install user defined menus in the artist simulation encapsulation *
    *                               window.                                *
    *                                                                      *
    ***********************************************************************/
    
    (procedure (abAddArtMenusTrigger args)
      (let (session sevWindow)
           /* get hold of the session - note sevSession is undocumented */
           (setq session (sevSession (getq args window)))
           /* and then the simulation window associated with the session */
           (setq sevWindow (getq session window))
           /* when there is a window associated, and the action is to install */
           (when (and sevWindow (equal (getq args action) 'install))
                 /* create menu if it doesn't exist */
                 (unless (boundp 'abArtMenu) (abAddArtMenusCreateMenu))
                 /* unless the menu is already there */
                 (unless (member 'abArtMenu
                                 (hiGetBannerMenus sevWindow))
                         /* insert it in right most place */
                         (hiInsertBannerMenu sevWindow abArtMenu
                                             (length (hiGetBannerMenus sevWindow)))
                         )
                 )
           ))
    
    
    /* 
    Need to install as a post install function
    
    deRegUserTriggers("analogArtist-schematic" nil nil 'abAddArtMenusTrigger)
    
    */
    A cleaner way (which could also be done in IC5141) is to define a menus file. Create a menus/spectre.menus file looking like this:

     

    ;------------------------------------------------------------------------
    ; Load the standard menus file
    ;------------------------------------------------------------------------
    load(prependInstallPath("etc/tools/menus/spectre.menus"))
    
    ;------------------------------------------------------------------------
    ; Identical to the IC614/IC615 menus files, but with "Custom" added.
    ; Note that the & in the names indicates the following char is the 
    ; accelerator key
    ;------------------------------------------------------------------------
    (sevSetMainWindowPulldownMenus
      (let (menu)
       menu = `(
                    "S&ession"
                    "Set&up"
                    "&Analyses"
                    "&Variables"
                    "&Outputs"
                    "&Simulation"
                    "&Results"
                    "&Tools"
                    "&Custom"
                    "&Help"
        )
        when( envGetVal("adexl.launchFromTest" "showMenu")
            menu = cons("&Launch" menu)
        )
        menu
      )
    )
    
    ;------------------------------------------------------------------------
    ; Add to the existing menus, rather than "setting". Better than making this
    ; a copy of the built-in default menus and then hacking - much more likely
    ; to stay in sync this way.
    ;------------------------------------------------------------------------
    (sevAddMenuItemLists
      (lambda
       (session name)
       (case
        name
        ;--------------------------------------------------------------------
        ; Define Custom menu
        ;--------------------------------------------------------------------
        ("&Custom"
         `(
           ("item&A" ?callback (fnA ',session))
           ("item&B" ?callback (fnB ',session))
           ("item&C" ?subMenu t)
          ))
        ("item&C"
         `(
           ("itemC&1" ?callback (fnC1 ',session))
           ("itemC&2" ?callback (fnC2 ',session))
          ))
        )
       )
      )

     

    Hopefully that gives you a clue as to alternative ways. This second approach also works when ADE is launched directly from the CIW, or by double-clicking a state cellView (which the other deRegUserTriggers way did not, even in IC5141, because it's really a schematic sub-app trigger).

    Regards,

    Andrew.

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

    I knew about the menu files. However, I wasn't really sure about which of the two is the cleaner way. Will go for the menu file now.

     Thanks for the swift reply. Chris.

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

    I'm feeling a bit uneasy about the menu file solution. What happens if there are other parties manipulating the menu file, especially when distribution the solution to a customer. I'm afraid this may clash somehow. Especially since the menu is not just added to the end, but the whole list of menu entries is specified literally. Isn't there another non-interfering solution?

     Chris

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

    Chris, 

    You potentially could use the

    asimenv.startup sessInitTrigFunc  string  ""

    .cdsenv setting, but again, that can only be a single function.

    There's a long-standing request for a trigger-based mechanism to do this - it can be done right now, but uses private functions (although that approach won't work with ADE XL).

    Best to contact customer support over this to come up with a more extensible way of doing this.

    Andrew.

    • 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