9 Replies Latest reply on Aug 17, 2009 9:10 PM by patrick.cashman

    How to import scripts into mentor running in a unix environment

    poagola

      hey guys

      im new here

       

      i just got introduced to mentor at work which runs on my unix account. I have some scripts that i would like to import into this enviroment to run on mentor and do some testing on some schematics and pcb fablink drawings? where does mentor store its scripts ? in which directory does it access them from? i have already created a dummy drawing where i test my dummy scripts. some scripts already exist but i am trying to not use them because they are an active environment? any help would be appreceiated guys ASAP

        • 1. Re: How to import scripts into mentor running in a unix environment
          yu.yanfeng

          Ample script can put anyware. If you hop it can be loaded automatically when invoking the tool, just modified the startup ample.

          • 2. Re: How to import scripts into mentor running in a unix environment
            poagola

            thanks but that doesnt really answer my question.....you have to invoke the script to run it so where does it read this from? i want to put the script in a different location thatn my other files in otherwords i want to create a sandbox that i can use for testing..........how do i do this?

            • 3. Re: How to import scripts into mentor running in a unix environment
              ed_smith

              Which product are you referring to?

               

              Thanks.

              • 4. Re: How to import scripts into mentor running in a unix environment
                poagola

                hello ed

                 

                i am refereng to the mentor grapihcs. I have a bunch of scripts that are in my mentor environment. I would like to set up another directory where i can run some dummy scrtips and test them without corrupting the production environment. Where does mentor invoke it  scripts from and also where can i get tutorials on AMPLEware?

                • 5. Re: How to import scripts into mentor running in a unix environment
                  yu.yanfeng

                  Poagola,

                  If You means you wanna run some Ample codes to do test how to write Ample script, please check those install testing scripts under Mentor Tree. A;thought I have stopped to use Board Station V8.2 nearly 13 years ago, but I believe it still be there. That's a good reference to teach you how to write Ample.

                  Yanfeng

                  • 6. Re: How to import scripts into mentor running in a unix environment
                    ed_smith

                    I believe you are talking about AMPLE scripts which you want to load on top of the standard Mentor userware? If this is the case, you can keep his scripts in a directory and set the environment varable AMPLE_PATH pointing to the directory path. If there are multiple such paths, they need to be seperated by ":" on UNIX and MWE platforms and ";" on MKS. However, you need to make sure the file names match the corresponding AMPLE scope.

                    A more detailed information on the subject can be found in AMPLE user manual located at $MGC_HOME/../docs/pdfdocs/ample_user.doc in chapter 12: Userware Organization.

                    • 7. Re: How to import scripts into mentor running in a unix environment
                      poagola

                      ed_smith

                       

                      thank you for your assistance...but im still in the dark.....the AMPLE_PATH is it in the start up script? it is an environment variable so how do i set that up?

                      is this in Mentor or it is somewhere else

                      also the Ample user manual at MGC_HOME where do i locat that path? in the unix environment ? thank you for your feedback

                      • 8. Re: How to import scripts into mentor running in a unix environment
                        ed_smith

                        Both AMPLE_PATH and MGC_HOME are environment variables.

                        • 9. Re: How to import scripts into mentor running in a unix environment
                          patrick.cashman

                          There's another way to do this without changing the ample_path variable.

                           

                          Here's what I do - not sure if it's the best way but it works great.

                           

                          1. Set up a directory where all your scripts will reside.  Divide them up in subdirectories by dmgr, layout, schematic, etc.  Put all the scripts you have in the appropriate subdirectory.

                           

                          2. Modify your startup files, like this example:

                           

                          The following code in schematic.startup will create a custom menu:  (you can put it before or after whatever is already there)

                          //this part creates the menu drop-down in the menu bar
                          $add_menu_item(, $menu_bar_item("CUSTOM", "custom_pulldown",,,"blue"),
                          $menu_default_menu_bar_name);

                          $hide_menu_bar();
                          $show_menu_bar();

                          //this part adds the menu items to the menu drop-down
                          $create_menu($window_scope_name(), @pulldown, "custom_pulldown",
                          $menu_default_columns, $menu_default_color,//take note of the commas after each line
                          $menu_special_text_item("MENU ITEM 1","function_1()",,,"helvetica-bold:12","Blue"),
                          $menu_separator_item(),
                          $menu_special_text_item("MENU ITEM 2","function_2()",,,"helvetica-bold:12","Blue"),
                          $menu_separator_item());//take note of the final ) at the end, followed by the semicolon

                          // this part loads your userware functions into the da_session scope           
                          $load_userware("/your userware path/function_1.ample", "da_session", @ample);
                          $load_userware("/your userware path/function_2.ample", "da_session", @ample);

                          //function_1() etc have to match the names of the functions inside the ample
                          //userware files.

                           

                          3. The only difference for other BoardStation tools is that you need to load the userware into the correct scope. The custom menu creation part is the same in all of them.  Here are examples of loading userware into other scopes:

                           

                          Design Manager:

                          $load_userware("/your userware path/function_1.ample", "dmgr_model", @ample);

                           

                          Layout:

                          $load_userware("/your userware path/function_1.ample", "lay_area", @ample);

                           

                          Fablink:

                          $load_userware("/your userware path/function_1.ample", "fab_area", @ample);

                           

                          4. Load and test your scripts.  The way I do this is to have one ample script for each tool called load_userware.ample.  In this script, all I do is load all existing userware into the tool again.  If I am working on something, I do some work, reload it, test, make changes to the script, save it, reload, test, and so on.  This way you can keep the tool open and reload the scripts without shutting the tool down and restarting every time you make a change.  I put the Load Userware menu pick near the top of my custom menu in each tool so that it's quick and easy to get to it.

                           

                          This should get you started.  If you need some example files showing more about this, send your email and I'll give you some.

                           

                          -Patrick