$wgJobRunRate = 0; Guide for Running tests using Standalone Apps and Linux Filesystem - Run-Time Reconfiguration JVM

Guide for Running tests using Standalone Apps and Linux Filesystem

From Run-Time Reconfiguration JVM

Jump to: navigation, search



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

  1. 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.
  2. 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".
  3. 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.
  4. Once you have copied over your .c and .h file, right click on "Project: TestApp_Memory" and "Generate Linker Script". Then just click Generate.
  5. 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.
  6. 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"
  7. This command should run your test as a standalone application on the PowerPC - to see the output run minicom.
  8. "make -f system.make download" runs the command impact -batch etc/download.cmd

Using XMD

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.

  1. At the command-line type "xmd"
  2. Connect to the processor using "ppcc"
  3. 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.
  4. Run your program with "run" and "stop" and use Minicom to see the results.
  5. 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.
  6. You can also run this command on the command line using "xload xmp <filename.xmp>"

Testing With C Drivers

  1. When you create a new user core you have the choice to create drivers in the last step
  2. 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)
  3. 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

  1. If you can't see any output on minicom but your program compiles correctly, there could be several reasons:
  2. 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
  3. Try setting the baud rate in your program with the lines
  4. XUartNs550i_SetBaud(XPAR_RS232_UART_BASEADDR, XPAR_XUARTNS550_CLOCK_HZ, 9600); 
    XUartNs550_mSetLineControlReg(XPAR_RS232_UART_BASEADDR, XUN_LCR_8_DATA_BITS);
  5. Make sure your program baud rate and Minicom's baud rate match up (9600 is the default)
  6. Check etc/download.cmd to make sure it is downloading the bitstream in the implementation directory (implementation
  7. 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
  8. If none of these steps work and you get a message like:
  9. Unable to connect to PowerPC target. Invalid Prcessor Version No 0x00000000
  10. 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
  11. Check in the bios to see if your parallel port is set to "ECP" mode
  12. Check Xilinx's answer record [1]

Testing with Linux Kernel on the ML-310

  1. 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"
  2. Open the project file using EDK: for testing with the linux kernel use xps ml310_pci_linux.xmp
  3. Copy cores to the /pcores directory and then add the cores to the EDK design (see Base System tutorial for steps).
  4. 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.
  5. 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.
  6. 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.
  7. 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
  8. Open "minicom" on the machine to which the board is connected and switch on the power for the board
  9. Now boot into one of the existing configurations (usually 6 or 7)
  10. Login as "root" and type the magic password..e-mail me in case you forgot the password
  11. 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 ""
  12. Now mount part1 of the compact flash card on the board using the following command "mount /dev/xsysace/disc0/part1 /mnt/cf"
  13. Browse to /mnt/cf and you should see 7 partitions in it
  14. 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.
  15. 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).
  16. Run your device driver using "insmod devicedriver.o" and use minicom to see the results

Personal tools