Unformatted text preview:

1/6 Getting Started with Eclipse, GRMON, and the LEON2 (See Appendix A for Installation Instructions) Launching Eclipse: • Open Eclipse by visiting Start-> All Programs-> Class-> 465-> Eclipse. • Specify a new workspace location. o Make a new folder on your mapped CEC drive for your workspace. o Workspace must NOT have spaces in the path! This will lead to a cryptic error down the road. • Close the Welcome splash screen if it appears. Creating a New Project: • Click File->New->C Project. • Give your project a name. • Select “Executable (sparc-elf toolchain, bare sparc-elf with minimal i/o)”. • Make sure Debug.toolchain is selected and click finish. • If it prompts to open C++ development perspective, click “Yes”. Creating Your Source Files: • Close the Welcome window if it is displayed. • In the Project Explorer pane, right-click on the project folder->New->[Source File | Header File] depending on what you want to create. • After giving your file a name, it will now be under the project tree. Note that header files must end with .h, and source files must end with .c. • The following steps require a working binary, so go ahead and write a simple c-program. Then click on Project->Build Project or just click on the hammer icon. Configuring Project to use GRMON as an External Tool: • Navigate to Run->External Tools->Open External Tools Dialog. • Double-click on TSIM2/GRMON launcher. • Change the Name from New_configuration to Default GRMON Launch • In the Main tab, select GRMON from the drop-down box.2/6 • Set the executable to “C:\opt\grmon-eval\grmon-eval.exe” • Set the working directory to ${workspace_loc}/${project_name} • GRMON startup options should be: Serial, Com2, 115200. • Check UART Loopback, Click Apply, then Close. Configuring Debugger Launch: • Navigate to Run->Open Debug Dialog. Double-Click on C/C++ Application Running TSIM2/GRMON. • Enter the name of your project in the Name field if it isn’t filled in automatically. • Within the Main tab, the project name should be set correctly. Click “Search Project” to set the application name. • On the GRMON tab, select “Default GRMON Launch” from the Select Target drop-down box. Check “Terminate GRMON/TSIM2-LEON3 after debugging session terminates.” • On the Debugger tab, select “sparc-elf gdb debugger” from the drop-down menu. Stop on startup at main should be checked. • Click on Apply, then Close. • Everything is now setup to debug your application on the LEON2! Using Eclipse: • Launching Your Design for Debug: o Ensure the appropriate bitfile has been loaded on the FPGA and that it verifies properly. o Press and hold S2 for 2 seconds. When you release S2, LD1, LD2 and LD3 should be lit. If they are not all 3 lit, press and hold S2 again. Then press S1. Only LD2 and LD3 should be lit. o Make sure that the serial cable from the bottom PCI slot on the computer is connected to the Nu-Horizons board port labeled rs232-1. This should be COM2. o Click on Run->Open Debug Dialog… Select your project name listed under “C/C++ Application running on TSIM2/GRMON” and click Debug. It the C/C++ Perspective is still displayed you will be prompted to switch to the Debug Perspective. Check the “Remember my Decision” box and click Yes. If you get the error “Variable reference empty selection: ${project_name}” then click OK3/6 and click in the code window of a module in your project or your project in the Project Explorer. Then relaunch the debugger. o To launch the debugger again, switch to the C/C++ Perspective and click on the down arrow next to the bug icon and select your Project. o You will see the output of GRMON in your console as well as stdout from your program. In addition, you will see the state of your program at the beginning of Main(). You can now debug your code. o To run your code through to the end, click on the Resume button (see figure below). • Changing Perspectives: o There should be a quick-switch option in the upper right-hand corner between C/C++ view and Debug view. These are the only 2 views you should need in this class. You can edit your C code from either perspective. • Compiling your code: o Click on Project->Build Project or click on the hammer icon. • Using the Debugger o The debug perspective with the default windows is shown below:4/6 o Debug - The following buttons are active:  Resume - continues running the program until a breakpoint or the end of the program is reached.  Suspend - pause the program  Terminate – Stops the program and disconnects from GRMON. If you want to restart your program you either need to run it to the end or press the Terminate button.  Step Into - execute highlighted instruction and steps into function calls. Be careful only to step into your functions and not C library functions.  Step Over - execute the highlighted instruction but does not step into functions. o Variables – Displays all of your local variables in a tab in the upper right window. o Breakpoints – Lists all of your breakpoints in a tab in the upper right window. To set a breakpoint, double click on the Marker Bar in the left margin of the code window next to a line of code. Unfortunately, this adds 2 breakpoints for Resume Suspend Terminate Step Into Step Over Marker Bar for Setting Breakpoints Expressions Variables Breakpoints5/6 that line and the only way to delete the breakpoint is to select both of them in the Breakpoints tab and press the delete key. o Expressions – Enable this view by pressing Window->Show View->Expressions. This will open a watch window in a tab in the upper right window. Right click in the Expressions tab and select Add Watch Expression… and enter the variable you want to watch. o Memory – This is on a tab in the bottom window. Right click on the Monitor side and select Add Memory Monitor. Enter an address like 0x80000100 and it will be displayed on the right.6/6 Appendix A Installing Eclipse for LEON2/GRMON Development: • Make sure the Jave Runtime Environment is installed (www.java.com) • Download the “Eclipse IDE for C/C++ Developers” (also known as CDT) zip file from: http://www.eclipse.org/downloads/ • Unzip the distribution. There will be an eclipse.exe executable in the eclipse/ folder. Execute eclipse.exe. • Select a workspace for testing. Workspace must NOT


View Full Document

WUSTL CSE 465M - Getting Started with Eclipse

Download Getting Started with Eclipse
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Getting Started with Eclipse and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Getting Started with Eclipse 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?