Showing posts with label MethodTool. Show all posts
Showing posts with label MethodTool. Show all posts

Tuesday, July 26, 2016

Clone an Existing EIM using MethodTool

  1. Load the EIM to be cloned
    • Set MethodTool>Edit>Test Methods>External Interface
    • Click "External Interface" button and "Find enVision Object" dialog box will appear and shows a list of ExternalInterface to choose. 
    • Select The ExternalInterface to clone and press OK.
    • The text box beside "ExternalInterface" button now displays the name of the EIM you selected
    • The "Method Directory" now displays the path of the source code for the loaded EIM
    • All the member functions and variables defined or added into this EIM are also displayed 
  2. Clone the loaded EIM 
    • Set MethodTool>File>Clone...
    • in "Select Clone Directory" popup
      • set name of cloned EIM in text box beside "ExternalInterface"
      • set directory where the cloned EIM will be stored in text box beside "Method Directory:"
        • make sure to specify the folder where the source code and binaries will be stored
      • Click OK 
        • If a new folder is specified, it will be created 
        • mid, tmk, cxx, and hxx files will be created and are copies of the EIM that is cloned
        • the newly created cloned EIM is automatically compiled and DNT/FX1 folder with evso is created after successful build 
  3. Update sources
    • You can now make changes to the source code of the clone EIM

    Tuesday, July 19, 2016

    Create New EIM from Scratch Using MethodTool

    1. Create a new program or load an existing program. 
      • MethodTool can only be invoked when a program is loaded in enVision.
    2. Launch MethodTool from OpTool>Tools>Development>Method
    3. In MethodTool's menu, set MethodTool>Edit>Tool Mode>External Interface
    4. Set the working directory for EIM. 
      • Click the "Method Directory:" button in MethodTool
      • In the file selection dialog box, select the directory where the EIM files are to be stored
      • Optional: If a directory name is specified in "Enter Directory:" field in the file selection dialog box, this new directory will be created (if it does not exist yet) and the EIM files will be stored in it
    5. Specify EIM name using the "ExternalInterface:" button in MethodTool
      • clicking this button will invoke popup listing existing EIM already created previously. If you already created one before and wish to modify it, select it from the list
      • To create a new EIM, type the EIM name in the textbox beside "ExternalInterface:" button and press <return>
      • Once EIM is specified, you will notice that the "Linked Filename:" will now be filled with <path>/<external interface name>.evso and buttons in MethodTool for creating/modifying/building EIM source codes will be enabled
      • The .evso file will be the output binary file of a successful EIM source code compile
    6. Specify the entry point functions to be included in your EIM class
      • Entry point functions are methods that will be included in your EIM class. these methods are event handlers that you can modify to perform action when an event occur in enVision e.g. StartTest(), a function that is executed by EIM when testing starts in enVision. You can modify StartTest() function to perform actions you need when a start of test occurs
      • In MethodTool, click Edit>Entry Points... and "Select Entry Points" popup will appear. Select which entry point function you wish to add in your EIM class and press OK
    7. Create source codes 
      • In MethodTool, click "Create Sources" button and the following files will be created in the working directory:
        • <eim name>.mid
        • <eim name>.cxx
        • <eim_name>.hxx
      • Check the .cxx files if the entry point functions you selected are defined in the code
    8. Create Makefile
      • In MethodTool, click Options>Create Method Makefile... and "Create Method Makefile popup will appear
        • The evso Name will be the name of the binary file to be created when compiling is successful
        • The Path is where the source codes to be compiled are located
      • Right click on each lines listing the required source code files and choose "Dynamic Linked"
      • Press "Create Makefile" button
      • In the working directory, you will now see new files:
        • Makefile
        • <eim name>.tmk
    9. Define member parameters for your custom EIM class
      • MethodTool will only include 2 member methods init_local_member_data() and free_local_member_data() only if at least one custom parameter is declared
      • choose one of the rows (preferably the top most available) and write the name of the variable in "Name" column.
      • to specify the type of variable (e.g. TestheadConnection*)...
        • right-click on the member variable's "Data Type" field and popup will appear. choose "Local Data...".
        • In the dialog box that appear, enter the type name in the text box below "Standard Data Type" and press OK
      • Adding new member parameters or changing/updating existing ones will require you to update your source code in MethodTool so that changes will reflect.
        • In the MethodTool, click the "Update Sources" button
    10. Modify your source code and save changes
    11. Build the EIM
      • In MethodTool, click "Build" button.
      • You will be prompted couple of times. Just keep clicking Yes/OK
      • A terminal will open showing compile in progress. it will automatically close if successful. otherwise it will remain open for you to see the errors
      • The following files will be created in working directory upon successful build:
        • <DNT of FX1>/<eim name>.evso
        • Note that the folder can either be DNT or FX1 depending on which tester you used to compile it with
    12. Test the EIM
      • Create or load an existing test program of your choice in OpTool
      • Load your EIM in MethodTool
      • For debug purposes, make sure to add the ExtIntfInit() entry point function in your EIM if you haven't done so
        • Modify the source code by adding the following line inside ExtIntfInit() function in <eim>.cxx
          • program->writeln(STDOUT, "Hello EIM world!\n");
      • Compile the EIM and if successful, load it into enVision by clicking "Reload" button in MethodTool
      • In Optool menu, go to OpTool>Setup>EIM... and "Setup External Interface Method" popup will appear
        • If your test program already have an existing external interface object defined, you can just insert your EIM method in it by pressing "Insert Methods" button and selecting your EIM in the popup list. 
        • Note that if you can't find your EIM in the list, try pressing "Reload" button again in the MethodTool
        • Press OK
      • Once your EIM is loaded, a message "Hello EIM World!" will be printed in the Dataviewer
      • Note: In simulation, enVision does not automatically start EIM process so start it manually by restarting tester via command line as shown:
        • >restart_tester <tester> -seim