Home > Community > Forums > Custom IC SKILL > Pulldown menu not working through .cdsinit file

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Pulldown menu not working through .cdsinit file 

Last post Fri, Aug 2 2013 11:06 AM by preetgarcha. 9 replies.
Started by preetgarcha 30 Jul 2013 03:30 PM. Topic has 9 replies and 1207 views
Page 1 of 1 (10 items)
Sort Posts:
  • Tue, Jul 30 2013 3:30 PM

    • preetgarcha
    • Not Ranked
    • Joined on Thu, May 9 2013
    • Calgary, Alberta
    • Posts 3
    • Points 45
    Pulldown menu not working through .cdsinit file Reply

    Hi,

    I have written a simple Skill function to automatically add a menu to every new schematic and layout view, based on the following thread and Cadence Tutorial for IC Skill Language Programming 3: http://www.cadence.com/Community/forums/t/17476.aspx?PageIndex=1

    I load in the file containing the function definition into my .cdsinit file but the menu does not start appearing until I copy the same load statement into my CIW. Once I do that, the function works just fine and the menus show up as expected for each new window I open.

    My virtuoso session does load in the function from .cdsinit file: when I enter addPlotMenu() into CIW, it gives me an error regarding usage (too few arguments), not about an undefined function, so it must be getting loaded in.

    Can you help me figure out what the problem might be? I want the menus to show up without having to load in any files through CIW. My code is pasted below.

    Regards,

    Preet

    procedure( addPlotMenu(args)

    TrPlot = hiCreateMenuItem(
    ?name 'TrMenuItemPlot
    ?itemText "Plot"
    ?callback "plotFunctionWrapper()"
    )

    ;unless(boundp('TrPulldownMenu)
    list(hiCreatePulldownMenu(
    'TrPulldownMenu
    "Plot"
    list(TrPlot)
    )
    ); list
    ;);unless

    ); procedure


    deRegUserTriggers("schematic" nil 'addPlotMenu)
    deRegUserTriggers("maskLayout" nil 'addPlotMenu)

    • Post Points: 20
  • Wed, Jul 31 2013 12:46 AM

    • berndfi
    • Top 100 Contributor
    • Joined on Tue, Sep 11 2012
    • Neubiberg, Bavaria
    • Posts 67
    • Points 1,255
    Re: Pulldown menu not working through .cdsinit file Reply

    Two errors in the code:
    1. You missed the "hiInsertBannerMenu".
    2. The "deReUserTriggers" was missing one optional argument which have to be set to "nil".

    See my modifications to your code:

     1 procedure( createPlotMenu( )
     2   
     3     if( boundp( '__plotMenu__ )
     4         then __plotMenu__
     5     else
     6         hiCreatePulldownMenu(
     7             '__plotMenu__
     8             "Plot"
     9             list(
    10                 hiCreateMenuItem(
    11                     ?name     'plot
    12                     ?itemText "Plot"
    13                     ?callback "plotFunctionWrapper()"
    14                 )
    15             )
    16         ) ;; hiCreatePulldownMenu
    17     ) ;;; close if
    18 ) ;; close procedure
    19
    20 procedure( addPlotMenu( args )
    21     hiInsertBannerMenu(
    22         args->window
    23         createPlotMenu()
    24         length( hiGetBannerMenus( args->window ) ) - 1
    25     )
    26 ) ;; close procedure
    27
    28 ;deRegUserTriggers( t_viewType [ s_appTrigger [ s_menuTrigger [ s_postInstallTrigger ] ] ] )
    29 deRegUserTriggers( "schematic" nil nil 'addPlotMenu )
    30 deRegUserTriggers( "maskLayout" nil nil 'addPlotMenu )
    • Post Points: 20
  • Wed, Jul 31 2013 1:00 AM

    Re: Pulldown menu not working through .cdsinit file Reply

    Bernd (and preetgarcha),

    Actually, the code was correct. The second argument is a menu trigger, and that should return a list of pulldown menus, and then it's the design editor's responsibility to insert the banner menus.

    In fact doing it the way that you've proposed will lead to problems - we've had numerous issues over the years caused by inserting menus in a post install trigger - you tend to find that tools compete with each other and you don't get all the menus.

    The original code works for me - the most likely issue is that there is some other code being loaded which does a deUnRegUserTriggers. A long time ago (pre-4.4.6 I think), you could only register a single menu trigger - and so sometimes various PDKs or customizations would unregister any existing triggers first themselves.

    You could try adding:

    trace(deUnRegUserTriggers)

    at the end of your code to see if that is being called (you'll need a SKILL Development license for this to work though). You could also use deGetAppInfo("schematic") in the CIW to see whether the trigger is still registered:

    deGetAppInfo("schematic")->userMenuTrigger
    deGetAppInfo("schematic")->userMenuTrigList

    (and the same for maskLayout). Report here what you find.

    Kind Regards,

    Andrew.

    • Post Points: 35
  • Wed, Jul 31 2013 1:30 AM

    • berndfi
    • Top 100 Contributor
    • Joined on Tue, Sep 11 2012
    • Neubiberg, Bavaria
    • Posts 67
    • Points 1,255
    Re: Pulldown menu not working through .cdsinit file Reply

    Andrew,

    I read your initial post from the related thread after I posted my suggestion.
    In fact the above code form "preetgarcha" does not work for me,
    maybe because of the reason you described.
    What is expected to be the trace output, it does not show anything to me?

    • Post Points: 20
  • Wed, Jul 31 2013 1:42 AM

    Re: Pulldown menu not working through .cdsinit file Reply

    Hi Bernd,

    The trace will only show something if something is actually calling the deUnRegUserTriggers function.

    What did the deGetAppInfo() show?

    Regards,

    Andrew.

    • Post Points: 20
  • Wed, Jul 31 2013 2:16 AM

    • berndfi
    • Top 100 Contributor
    • Joined on Tue, Sep 11 2012
    • Neubiberg, Bavaria
    • Posts 67
    • Points 1,255
    Re: Pulldown menu not working through .cdsinit file Reply

    deGetAppInfo("schematic")->userMenuTrigList
    => (trigger1 trigger2 addPlotMenu)

    deGetAppInfo("schematic")->userMenuTrigger
    => trigger1

     

    • Post Points: 20
  • Wed, Jul 31 2013 3:15 AM

    Re: Pulldown menu not working through .cdsinit file Reply

    Bernd,

    Can you do trace(addPlotMenu) and then open a schematic? Does it get called? One possibility is that you have a postInstallTrigger defined which customizes the menus, and this might clobber the menus added by addPlotMenu.

    Regards,

    Andrew.

     

    • Post Points: 5
  • Wed, Jul 31 2013 7:56 AM

    • preetgarcha
    • Not Ranked
    • Joined on Thu, May 9 2013
    • Calgary, Alberta
    • Posts 3
    • Points 45
    Re: Pulldown menu not working through .cdsinit file Reply

    Hi Andrew,

    Thanks for the quick response. deUnRegUserTriggers does indeed get called as virtuoso starts up:

    Loading /user/pgarcha/.cdsinit...
    Loading awv.cxt
    Loading cdf.cxt
    ||||||||deUnRegUserTriggers(...)
    ||||||||deUnRegUserTriggers --> ...
    ||||||||deUnRegUserTriggers(...)
    ||||||||deUnRegUserTriggers --> ...
    ||||||||deUnRegUserTriggers(...)
    ||||||||deUnRegUserTriggers --> ...

    deGetAppInfo("schematic)->userMenuTrigger returns _jazzUserMenuTrigger.

    deGetAppInfo("schematic")->userMenuTrigList returns a list with addPlotMenu missing.

    Given that I cannot modify the other files to remove the unregistering of user triggers, is there a way to register addPlotMenu again without using the CIW? As per a Cadence Training Module (Introduction to SKILL Language Programming), when the Virtuoso Design Environment starts up, it loads (1) SKILL contexts, (2) .cdsenv, and (3) .cdsinit files in order and then loads (4) other SKILL contexts in response to user activity. Is there anything in between (3) and (4) that can be modified in my local machine to achieve that?

    I appreciate your help.

    Regards,

    Preet

    • Post Points: 20
  • Fri, Aug 2 2013 6:02 AM

    Re: Pulldown menu not working through .cdsinit file Reply

    Hi Preet,

    It might just be a case of doing your customization in the right place in the .cdsinit - presumably other stuff is being loaded after your customization which is destroying your setup. If you can reorder it, then you can define yours after the Jazz code has done its thing.

    Regards,

    Andrew.

    • Post Points: 20
  • Fri, Aug 2 2013 11:06 AM

    • preetgarcha
    • Not Ranked
    • Joined on Thu, May 9 2013
    • Calgary, Alberta
    • Posts 3
    • Points 45
    Re: Pulldown menu not working through .cdsinit file Reply

    Hi Andrew,

    If you mean re-ordering within my local .cdsinit file, then the addPlotMenu load statement is the last one already. But if you mean we can somehow change the order of how files are loaded into the CIW, that would be very useful if I could learn how to do it.

    What I understand so far is that my company's .cdsinit file loads the PDK's system.cdsinit file and then a bunch of other harmless functions after. As per the code, system.cdsinit file loads in my local .cdsinit file and then calls triggers to grab userApp, userMenu and such. This is where I believe the deUnRegUserTriggers is being called. I can ask for permission to modify the company's .cdsinit file to load in my .cdsinit file in again after the PDK's system.cdsinit file has finished its work. But I do not want to take a risk and break something in the system for this simple menu, although it will be helpful to my colleagues to plot their schematics and symbols this way. Is there any other way out by changing files local to myself?

    I will be looking forward to your reply.

    Regards,

    Preet

    • Post Points: 5
Page 1 of 1 (10 items)
Sort Posts:
Started by preetgarcha at 30 Jul 2013 03:30 PM. Topic has 9 replies.