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: /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.
TrPlot = hiCreateMenuItem(?name 'TrMenuItemPlot?itemText "Plot"?callback "plotFunctionWrapper()")
deRegUserTriggers("schematic" nil 'addPlotMenu)deRegUserTriggers("maskLayout" nil 'addPlotMenu)
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:
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:
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:
(and the same for maskLayout). Report here what you find.
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?
The trace will only show something if something is actually calling the deUnRegUserTriggers function.
What did the deGetAppInfo() show?
deGetAppInfo("schematic")->userMenuTrigList=> (trigger1 trigger2 addPlotMenu)