Home > Community > Forums > Custom IC Design > How to create personalized menu in virtuoso layout editor

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: *

 How to create personalized menu in virtuoso layout editor 

Last post Fri, Nov 2 2012 11:31 AM by jaleco. 29 replies.
Started by AmitBiswas 03 Dec 2010 07:10 AM. Topic has 29 replies and 11733 views
Page 1 of 2 (30 items) 1 2 Next >
Sort Posts:
  • Fri, Dec 3 2010 7:10 AM

    • AmitBiswas
    • Top 500 Contributor
    • Joined on Sun, Jan 25 2009
    • Bangalore, Karnataka
    • Posts 22
    • Points 575
    How to create personalized menu in virtuoso layout editor Reply
    Hi, I have written few scripts in skill language. I want group all the scripts together into a single menu in virtuoso layout editor. Like in the layout editor window there are several menus at the top containing multiple functions, I want to create my personalized menu in the layout editor window. I also want to put that script in the .cdsinit file, so that when cadence will be started the menus will be loaded automatically in the layout editor window like the other menus. Thanks in advance, Amit
    • Post Points: 35
  • Fri, Dec 3 2010 8:36 AM

    • skillUser
    • Top 10 Contributor
    • Joined on Fri, Sep 19 2008
    • Austin, TX
    • Posts 2,567
    • Points 15,575
    Re: How to create personalized menu in virtuoso layout editor Reply

    Hi Amit,

    There are a couple of ways to approach this, you can either define menu items via a menus file, i.e. the layEdit.menus in this case, which would reside in your ./menus/ or ~/menus directory, or you can create the menus and add them via SKILL.  Here's a brief example of the bits that you might need for that approach:


    procedure(AmitAddMenu(args)
    let( ((win args->window) item1 item2 menu)
    ;; create a couple of menu items
    item1 = hiCreateMenuItem( ?name 'item1 ?itemText "My First Item"
    ?callback "AmitFunctionOne()"
    )
    item2 = hiCreateMenuItem( ?name 'item2 ?itemText "My Second Item"
    ?callback "AmitFunctionTwo()"
    )
    ;; create a menu that includes the menu items
    menu = hiCreatePulldownMenu('AmitMenu "Amit Menu" list(item1 item2))
    ;; insert this menu as the last menu
    hiInsertBannerMenu(win menu length(hiGetBannerMenus(win))
    );let
    ); procedure
    ;; create a user postinstall trigger that automatically adds the menu

    deRegUserTriggers("maskLayout" nil nil 'AmitAddMenu)

    You might need to add code to check if the menu is already present, but hopefully this framework gives you an idea of how to do it.

    Regards,

    Lawrence.

    • Post Points: 20
  • Fri, Dec 3 2010 1:20 PM

    • AmitBiswas
    • Top 500 Contributor
    • Joined on Sun, Jan 25 2009
    • Bangalore, Karnataka
    • Posts 22
    • Points 575
    Re: How to create personalized menu in virtuoso layout editor Reply
    Thanks Lawrence for your quick reply

    Here is the code as you suggested, and its working fine. But I want to add the menus automatically like
    the other menus are already available when we open a layout editor
    like File Edit View Create Verify Connectivity ......etc


    win=hiGetCurrentWindow()
     
    Item1= hiCreateMenuItem(?name 'disco1
                 ?itemText "&item1"
                ?callback "println(\"Amit\")"
                )
    Item2= hiCreateMenuItem(?name 'disco2
                 ?itemText "i&tem2"
                ?callback "println(\"Kumar\")"
                )
     
    Item3= hiCreateMenuItem(?name 'disco3
                 ?itemText "it&em3"
                ?callback "println(\"Biswas\")"
                )
    Item4= hiCreateMenuItem(?name 'disco4
                 ?itemText "item4"
                ?callback "println(\"Halisahar\")"
                )
    Item5= hiCreateMenuItem(?name 'disco5
                 ?itemText "item5"
                ?callback "println(\"Pandit Para\")"
                )
    Item6= hiCreateMenuItem(?name 'disco6
                 ?itemText "item6"
                ?callback "println(\"Rabindrapally\")"
                )
     
    hiCreatePulldownMenu('trSubMenu2 "Address" list(Item4 Item5))
    hiCreatePulldownMenu('trSubMenu3 "Addr" list(Item1 Item6))
    slidmenus2=hiCreateSliderMenuItem(
                ?name 'slidmenus2
                ?itemText "Slide2"
                ?subMenu trSubMenu2
                )
    slidmenus3=hiCreateSliderMenuItem(
                ?name 'slidmenus3
                ?itemText "Slide3"
                ?subMenu trSubMenu3
                )           
    hiCreatePulldownMenu('trSubMenu1 "Name" list(Item1 Item2 Item3 slidmenus3))

    slidmenus1=hiCreateSliderMenuItem(
                ?name 'slidmenus1
                ?itemText "Slide1"
                ?subMenu trSubMenu1
                )
    hiCreatePulldownMenu('trPulldownMenu "Amit Menu" list(slidmenus1 slidmenus2 Item6))
    hiInsertBannerMenu(win  trPulldownMenu length(hiGetBannerMenus(win)))
    ;hiDeleteBannerMenu(win length(hiGetBannerMenus(win))-2)
    • Post Points: 5
  • Fri, Dec 3 2010 1:30 PM

    • skillUser
    • Top 10 Contributor
    • Joined on Fri, Sep 19 2008
    • Austin, TX
    • Posts 2,567
    • Points 15,575
    Re: How to create personalized menu in virtuoso layout editor Reply

    Hi Amit,

    I can't really read your posted code, but it looks like you missed off the all-important deRegUserTriggers() command?  This is the part that automatically runs your code, triggered by the action of opening a layout - hence, you may only need to do this once if the menu is global across all layout windows.  When you open a layout window the code is triggered and it adds the menu. Job done!

    Am I missing something else?

    regards,
    Lawrence.

    • Post Points: 20
  • Fri, Dec 3 2010 2:21 PM

    Re: How to create personalized menu in virtuoso layout editor Reply
    Lawrence
    Now I did exactly what you said. Her is the complete code.It is not working.
    I am getting one error in CIW when I am opening a layout

    ;*************************** Error copied from the CIW *************************************************

    dagDoNamedAction( dagNumToTool(4) dagGetObjectByPath( dagNumToTool(4) '( "ILBRootNode" "ILBRootClass"  "amit_test1" "ILBLibraryClass"  "Everything" "ILBCategoryClass"  "RECT_TEST" "ILBCellClass"  "layout" "ILBCellViewClass" )) "Read" )
    *Error* My_Custom_Menu: too many arguments (0 expected, 1 given) - ((nil wasPushed nil prependList nil configId nil configL nil libName "amit_test1" libId dd:0x1e4959d0 cellName "RECT_TEST" viewName "layout" viewType "maskLayout" fileName nil viewFileId dd:0x1e495b90 accessMode "r" viewNameList nil hierarchy ("{amit_test1 RECT_TEST layout }:r") hierPath "" appName "Layout" help "Layout" rootType "maskLayout" action install eip nil pushed nil window window:12 srcContext nil instanceName "" checkOutLicense t sessionWindow swindow:2 subMaster nil))
    <<< Stack Trace >>>
    (... in _deApplyTrigger ...)
    (... in unknown ...)
    funobj@0x19cdc660()
    (... in _dePullTrigger ...)
    (... in _deCallUserPostInstallTrigger ...)
    (... in _dePostOpenProcess ...)
    (... in _deOpen ...)
    (... in deOpen ...)
    deOpen(myFileSpec myWindowSpec myAccessMode)
    if((fileType == "cds44") then (masterFileName = substring(rindex(masterFile "/") 2)) if(!(fileId = ddGetObj(libraryName cellName viewName masterFileName)) then sprintf(msg "Unable to determine file id") ICLGetResponse(msg "INFO - IBMCadBrowser" hicInformationDialog 'Close) return()) if((fileLength((fileId->readPath)) == 0) then sprintf(msg "File is zero length. Perhaps this cellview has not \nbeen saved yet. Try using 'Edit' instead.") ICLGetResponse(msg "INFO - IBMCadBrowser" hicInformationDialog 'Close) return()) if(generateDplOnly then return(list(nil 'library libraryName 'cell cellName 'view viewName 'level levelName 'sandbox sandboxName 'file (fileId->readPath)))) (myFileSpec = list(nil 'libName libraryName 'cellName cellName 'viewName viewName)) (myWindowSpec = nil) (myAccessMode = "read") deOpen(myFileSpec myWindowSpec myAccessMode) else (fullFileName = strcat(sourceDir "/" masterFile)) if(generateDplOnly then return(list(nil 'library libraryName 'libraryPath libraryPath 'cell cellName 'view viewName 'level levelName 'sandbox sandboxName 'file fullFileName))) ICLInvokeReader(libraryPath libraryName cellName viewName levelName sandboxName fullFileName))
    prog((sourceDir fileId myFileSpec myWindowSpec myAccessMode viewType masterFileName masterFile msg fileType mfpStruct fullFileName) if((sandboxName && (sandboxName != "")) then (sourceDir = ICLSandboxDir(libraryPath libraryName sandboxName)) if(!sourceDir then return()) else if((levelName && (levelName != "")) then (sourceDir = ICLLevelDir(libraryPath libraryName levelName)) if(!sourceDir then return()))) sprintf(msg "Unable to retrieve master filepath for view %s" viewName) (mfpStruct = (ICLGetMasterFilePath ?libraryPath libraryPath ?library libraryName ?cell cellName ?view viewName ?errorMsg msg ?printWhen "error" ?directory sourceDir ?returnStruct t)) (masterFile = car((mfpStruct->values))) if(((mfpStruct->rc) == 2) then (fileType = "cds44")) if(!masterFile then return()) if(!fileType then sprintf(msg "Cannot determine file type of file %s." masterFile) (fileType = (ICLFileTypeMap ?libraryPath libraryPath ?library libraryName ?file masterFile ?errorMsg msg ?printWhen "error"))) if(!fileType then sprintf(msg "Unable to determine file type for view %" viewName) ICLGetResponse(msg "INFO - IBMCadBrowser" hicInformationDialog 'Close) return()) if((fileType == "cds44") then (masterFileName = substring(rindex(masterFile "/") 2)) if(!(fileId = ddGetObj(libraryName cellName viewName masterFileName)) then sprintf(msg "Unable to determine file id") ICLGetResponse(msg "INFO - IBMCadBrowser" hicInformationDialog 'Close) return()) if((fileLength((fileId->readPath)) == 0) then sprintf(msg "File is zero length. Perhaps this cellview has not \nbeen saved yet. Try using 'Edit' instead.") ICLGetResponse(msg "INFO - IBMCadBrowser" hicInformationDialog 'Close) return()) if(generateDplOnly then return(list(nil 'library libraryName 'cell cellName 'view viewName 'level levelName 'sandbox sandboxName 'file (fileId->readPath)))) (myFileSpec = list(nil 'libName libraryName 'cellName cellName 'viewName viewName)) (myWindowSpec = nil) (myAccessMode = "read") deOpen(myFileSpec myWindowSpec myAccessMode) else (fullFileName = strcat(sourceDir "/" masterFile)) if(generateDplOnly then return(list(nil 'library libraryName 'libraryPath libraryPath 'cell cellName 'view viewName 'level levelName 'sandbox sandboxName 'file fullFileName))) ICLInvokeReader(libraryPath libraryName cellName viewName levelName sandboxName fullFileName)))
    ICLBrowse(libraryPath libraryName sandboxName levelName cellName viewName versionNumber generateDplOnly)
    ...
    *WARNING* (DEBASE-102079): A Skill error occurred in function My_Custom_Menu
    t
    hiCloseWindow(window(13))
    t

    ;**************************************** Program starts ********************************

    procedure(My_Custom_Menu()
    win=hiGetCurrentWindow()
     
    Item1= hiCreateMenuItem(?name 'disco1
                 ?itemText "&item1"
                ?callback "println(\"Amit\")"
                )
    Item2= hiCreateMenuItem(?name 'disco2
                 ?itemText "i&tem2"
                ?callback "println(\"Kumar\")"
                )
     
    Item3= hiCreateMenuItem(?name 'disco3
                 ?itemText "it&em3"
                ?callback "println(\"Biswas\")"
                )
    Item4= hiCreateMenuItem(?name 'disco4
                 ?itemText "item4"
                ?callback "println(\"Halisahar\")"
                )
    Item5= hiCreateMenuItem(?name 'disco5
                 ?itemText "item5"
                ?callback "println(\"Pandit Para\")"
                )
    Item6= hiCreateMenuItem(?name 'disco6
                 ?itemText "item6"
                ?callback "println(\"Rabindrapally\")"
                )
     
    hiCreatePulldownMenu('trSubMenu2 "Address" list(Item4 Item5))
    hiCreatePulldownMenu('trSubMenu3 "Addr" list(Item1 Item6))
    slidmenus2=hiCreateSliderMenuItem(
                ?name 'slidmenus2
                ?itemText "Slide2"
                ?subMenu trSubMenu2
                )
    slidmenus3=hiCreateSliderMenuItem(
                ?name 'slidmenus3
                ?itemText "Slide3"
                ?subMenu trSubMenu3
                )           
    hiCreatePulldownMenu('trSubMenu1 "Name" list(Item1 Item2 Item3 slidmenus3))

    slidmenus1=hiCreateSliderMenuItem(
                ?name 'slidmenus1
                ?itemText "Slide1"
                ?subMenu trSubMenu1
                )
    hiCreatePulldownMenu('trPulldownMenu "Amit Menu" list(slidmenus1 slidmenus2 Item6))
    hiInsertBannerMenu(win  trPulldownMenu length(hiGetBannerMenus(win)))
    ;hiDeleteBannerMenu(win length(hiGetBannerMenus(win)))
    );procedure
    deRegUserTriggers("maskLayout" nil nil 'My_Custom_Menu)
    • Post Points: 20
  • Fri, Dec 3 2010 2:30 PM

    • skillUser
    • Top 10 Contributor
    • Joined on Fri, Sep 19 2008
    • Austin, TX
    • Posts 2,567
    • Points 15,575
    Re: How to create personalized menu in virtuoso layout editor Reply

    Hi Amit,

    the error message appears to be self explanatory: My_Custom_Menu will be supplied with one argument that is a disembodied property list ("dpl" for short) but it was defined to accept no arguments: 

     *Error* My_Custom_Menu: too many arguments (0 expected, 1 given) - ...

    The trigger will automatically supply the dpl to the function, this is why the function needs to accept at least one argument. See my example where I have "args" for this argument, and then this is used to obtain the window id (this is the correct way to do it anyway, since hiGetCurrentWindow() can actually pick up the "What's New" window, for example).

    Also, which version are you using?  I'd guess at 9502/4.3.4 given the "dag" prefixed functions, but it is possible that these are just customizations...

    Try again and let us know how things turn out.

    Regards,

    Lawrence.

    • Post Points: 20
  • Fri, Dec 3 2010 2:52 PM

    Re: How to create personalized menu in virtuoso layout editor Reply
    Thanks Lawrence, It is working now, the way I expected. One minor correction in the code you sent is procedure(My_Custom_Menu(args) let((win ) win=args->window not procedure(My_Custom_Menu(args) let((win args->window) I was getting error *Error* let: illegal binding form - (args->window). anyways, finally it is working. Thanks again for your quick support and guidance. I really appreciate your effort.
    • Post Points: 20
  • Sun, Dec 5 2010 4:46 AM

    Re: How to create personalized menu in virtuoso layout editor Reply

    Amit,

    I should point out that the way that Lawrence suggested doing this is the wrong way to add a banner menu (sorry Lawrence). Adding a pulldown banner menu in a post install trigger is likely to cause trouble (I've seen this happen numerous times), and since there is a userMenuTrigger available (this is the third argument to deRegUserTriggers). In fact it makes it simpler, because all your function has to do is return a list of pulldown menus to add, and does not need to worry itself with inserting them in the banner - that is done by the Design Editor infrastructure. So it would be something like:

    procedure(AmitAddMenu(_args)
    let( (item1 item2)
    ;; create a couple of menu items
    item1 = hiCreateMenuItem( ?name 'item1 ?itemText "My First Item"
    ?callback "AmitFunctionOne()"
    )
    item2 = hiCreateMenuItem( ?name 'item2 ?itemText "My Second Item"
    ?callback "AmitFunctionTwo()"
    )
    ;; create a menu that includes the menu items and return a list of the
    ;; pulldown menus
    list(hiCreatePulldownMenu('AmitMenu "Amit Menu" list(item1 item2)))
    );let
    ); procedure
    ;; create a userMenuTrigger trigger that automatically adds the menu

    deRegUserTriggers("maskLayout" nil 'AmitAddMenu)

    Note this is untested - and in practice you would add code to avoid redefining the pulldown menu each time (e.g. unless(boundp('AmitMenu) ...) but hopefully you get the principle.

    Regards,

    Andrew.

    • Post Points: 65
  • Mon, Dec 6 2010 12:25 AM

    • Amit Biswas
    • Not Ranked
    • Joined on Sat, Dec 4 2010
    • Bangalore, Karnataka
    • Posts 12
    • Points 150
    Re: How to create personalized menu in virtuoso layout editor Reply
    Thanks Andrew for suggesting the improvement
    • Post Points: 5
  • Tue, Jan 11 2011 6:53 AM

    Re: How to create personalized menu in virtuoso layout editor Reply

     Hi,

        if i want to add menus in virtuoso analog design environment, what is the first argument in the deRegUserTriggers function? can anybody give a name list of ADE and layout ect,

    Regards,

    zfeng

    Regards, zfeng
    • Post Points: 20
  • Wed, Jan 12 2011 12:29 AM

    • Amit Biswas
    • Not Ranked
    • Joined on Sat, Dec 4 2010
    • Bangalore, Karnataka
    • Posts 12
    • Points 150
    Re: How to create personalized menu in virtuoso layout editor Reply
    Example: deRegUserTriggers("maskLayout" nil nil 'My_Custom_Menu)
    • Post Points: 20
  • Wed, Jan 12 2011 1:20 AM

    Re: How to create personalized menu in virtuoso layout editor Reply

     Thanks,

          yes, we can do that and i am sure  "maskLayout"  can be replaced by "schematic", and now , i want to add  a menu in analog environment , so which argument should i use?

    Regards, zfeng
    • Post Points: 20
  • Wed, Jan 12 2011 1:52 AM

    Re: How to create personalized menu in virtuoso layout editor Reply

    For ADE, you could use  "analogArtist-schematic", however this will only work when you start ADE from the schematic. If you open it from the CIW, or by loading a state directly (e.g. from the library manager), then it will not trigger. The issue is that ADE is not really an editor of a view in the same sense as maskLayout or schematics, and so the Design Editor (i.e. de) functionality doesn't come into play.

    The right way to do ADE customization is to use menus files. Here's one way:

    http://support.cadence.com/wps/mypoc/cos?uri=deeplinkmin:ViewSolution;solutionNumber=11286092

    The other way to do it might be to use the sessInitTrigFunc cdsenv setting:

    http://support.cadence.com/wps/mypoc/cos?uri=deeplinkmin:ViewSolution;solutionNumber=11524352

    This sessInitTrigFunc was added in IC5141 in 5.10.41.500.5.124 and is also in IC612 onwards (it was added in an IC611 hotfix, strictly speaking), in September 2008.

    Regards,

    Andrew.

     

    • Post Points: 35
  • Wed, Jan 12 2011 2:27 AM

    Re: How to create personalized menu in virtuoso layout editor Reply

     Hi Andrew,

         why i can't login  the link you writed?

    Regards,

    zfeng

    Regards, zfeng
    • Post Points: 20
  • Wed, Jan 12 2011 2:32 AM

    Re: How to create personalized menu in virtuoso layout editor Reply

    Zfeng,

    You'll need a Cadence Online Support account (this requires you to be a customer with a maintenance contract). You can register via http://support.cadence.com - you'd need access to your License server hostid to do it (so that we can identify which customer you are). If you're at a European university and accessing your software via Europractice, you'd need to contact Europractice (I believe they have the means to create "light" accounts which allow read access to solutions etc, but not submit service requests - you have to do that via Europractice).

    Regards,

    Andrew.

    • Post Points: 20
Page 1 of 2 (30 items) 1 2 Next >
Sort Posts:
Started by AmitBiswas at 03 Dec 2010 07:10 AM. Topic has 29 replies.