Guide for Running tests using Standalone Apps and Linux Filesystem
From Run-Time Reconfiguration JVM
This guide serves as an introduction to two basic types of tests that can be performed on systems and cores created with EDK (7.1 at the time of writing) It is assumed that before testing the ml310 board has been set up correctly with a linux image and that an EDK base system has been created. This guide will discuss testing cores using the Power PC and then by synthesizing cores to hardware.
Testing With the Power PC Using a C Program
- If user cores are added via EDK's drop down menu then this step can be skipped. For any user created cores, copy the core directory to the pcores directory for your base system.
- For a user created core go to Project/Add/Edit Cores to add your new core from the peripherals list. Then go to bus connections and add your core to its respective bus (opb or plb) by clicking next to its name in the list. Finally set the core's base address by selecting it from the list and either entering a base address or by choosing to "generate addresses".
- Next click on the applications tab and select TestApp_Memory. You can use the existing source for a basic memory self-test or you can copy your own .c and .h file from the drivers/"yourcorename"/src/"yourcorename"selftest.c. You may have to change the base addresses in your C file to match those you selected for your core - base addresses can be easily accessed in the file ppc405_0/include/xparameters.h. If you don't have either a TestApp_Memory directory or a drivers directory check the EDK base system tutorial on how to add a memory self test and how to create a new core with EDK.
- Once you have copied over your .c and .h file, right click on "Project: TestApp_Memory" and "Generate Linker Script". Then just click Generate.
- Go to the command-line and change to the directory for your project. Run the command "make -f system.make program" which does the same thing as the EDK command "Build All User Applications" under Tools.
- Then copy your whole EDK project directory over to a temporary folder onto one of the machines with FPGAS (acc-h1 or tweety are examples) and compile and download a bitstream to the PowerPC using the command "make -f system.make download"
- This command should run your test as a standalone application on the PowerPC - to see the output run minicom.
- "make -f system.make download" runs the command impact -batch etc/download.cmd
Note that the first step describes how to test a standalong application stored in the bram - for apps stored in DDR, you must download and run them using xmd - the BRAMs can be initialized to have a bootloop since they will not run anything important in this case.
- At the command-line type "xmd"
- Connect to the processor using "ppcc"
- To download an executable standalone application, cd to the right directory and then type "dow <executablename>.elf". The address range for your application should be displayed.
- Run your program with "run" and "stop" and use Minicom to see the results.
- Using XPS, you can click on the xmd button which will load your .xmp file. Then you can run your app as above or click on the gdb debugger and select "connect to target" and "run" to step through your program.
- You can also run this command on the command line using "xload xmp <filename.xmp>"
Testing With C Drivers
- When you create a new user core you have the choice to create drivers in the last step
- You can copy the .c file and the .h file from your drivers directory and modify them to write to registers you specified in your program (base address for register 0 is the base address of your core)
- Tests are run in the same manner as with standalone C applications - the difference is that now your user cores will be running in hardware and your test can read and write to and from these cores.
Errors With Using C Program / Driver
Most of these errors result with programming the FPGA using Xilinx's JTAG accessory over the parallel port
- If you can't see any output on minicom but your program compiles correctly, there could be several reasons:
- Make sure that you use UART16550 with interrupt support when you create a base system with EDK 7.1 since OPB_UARTLITE seems to have some bugs
- Try setting the baud rate in your program with the lines
- Make sure your program baud rate and Minicom's baud rate match up (9600 is the default)
- Check etc/download.cmd to make sure it is downloading the bitstream in the implementation directory (implementation
- Check to make sure that your program is initialized to a bram if it stored there or that a bootloop is initialized to the bram if your program is running from DDR. You can initialize your program to a bram by right clicking on its name in the EDK Applicationstab and selecting "initialize to BRAM" - a green arrow by the name indicates that it will be placed in the BRAM. To update the BRAM run make -f system.make init_bram
- If none of these steps work and you get a message like:
- Then try downloading a bitstream you know works (such as one of the examples from the Xilinx website) and then download your bitstream - this usually initializes some unknown parameter and is your best bet
- Check in the bios to see if your parallel port is set to "ECP" mode
- Check Xilinx's answer record 
XUartNs550i_SetBaud(XPAR_RS232_UART_BASEADDR, XPAR_XUARTNS550_CLOCK_HZ, 9600);
Unable to connect to PowerPC target. Invalid Prcessor Version No 0x00000000
Testing with Linux Kernel on the ML-310
- Download a basic PCI design from the wiki.rtrjvm webpage at http://www.ittc.ku.edu/rtrjvm/ml310_pci_design.zip ; the design is called "ml310_pci _design.zip"
- Open the project file using EDK: for testing with the linux kernel use xps ml310_pci_linux.xmp
- Copy cores to the /pcores directory and then add the cores to the EDK design (see Base System tutorial for steps).
- Set the address for your core under addresses in Add/Edit Cores to a value above 0x90000000. ** Do not generate an address for this core or you may not be able to write to it correctly.
- Run Tools/Update Bitstream to create a new bitstream with PCI support. This can take between 2 to 3 hours to finish and the bitstream will be located in the /implementation directory.
- Create a directory called zImage in the top level design. <LI>Next, go the the /zImage directory. Download the elf file for the Linux kernel from http://www.ittc.ku.edu/rtrjvm/zImageBootFromhda1.elf. To create an ACE file that can be run on the ML-310 copy the bitfile <download.bit> from /implementation and a file called genace.tcl from /data to the /zImage directory.
- To create your ace file run the command "xmd -tcl genace.tcl -elf zImageBootFromhda1.elf -jprog -hw download.bit -ace <name_of_the_acefile>.ace -board ml310
- Open "minicom" on the machine to which the board is connected and switch on the power for the board
- Now boot into one of the existing configurations (usually 6 or 7)
- Login as "root" and type the magic password..e-mail me in case you forgot the password
- The board's network should automatically come up in case you login to either option 6 or 7, but in case you don't have network up and running use "ifconfig eth0 "valid static ip" netmask "255.255.248.0"
- Now mount part1 of the compact flash card on the board using the following command "mount /dev/xsysace/disc0/part1 /mnt/cf"
- Browse to /mnt/cf and you should see 7 partitions in it
- Then copy your Ace file to one of the partitions (usually 6 or 7) on the compact flash disk (connected the the ML-310), unmount the partition on the compact flash (umount /mnt/cf) and then restart the board, and select your configuration (usually 6 or 7) to boot Linux with the hardware that you built.
- To test your core, create a module based device driver..Download a sample device driver and a Makefile. that writes and reads to and from your core (at base address 0x90000000 or above).
- Run your device driver using "insmod devicedriver.o" and use minicom to see the results