Laboratory 1

In laboratory 1 you will design a system-on-chipi using the Xilinxi development suite and targeted at the XUPi development board. Your design will contain a MicroBlazei soft-processori, a serial port, and three GPIOi devices. The processor will be connected to the serial port and GPIOi peripherals in a shared-bus architecture. You will then program this system-on-chipi, using the C programming language, to print out your name five times to the screen of a desktop computer which is connected to the XUPi development board using the serial port.

In this laboratory your system-on-chipi design will consist of three major components:

  1. A MicroBlazei soft-processori
    The MicroBlazei will be the processor in your system-on-chipi design. The program that you design in this laboratory will be compiled to the MicroBlazei ISAi and then executed by the processor that you instantiate within your design. Compilation is done inside of the Xilinxi development suite and makes use of the GCC compiler contained within.
     
  2. A serial port
    The serial port in this system-on-chipi design provides communication between the XUPi development board and the desktop computer connected to it. In this laboratory your program will print out a message by sending characters one at a time from the XUPi to the desktop computer. These characters will be received on the desktop computer and printed out to the screen.
     
  3. Three GPIOi devices
    The three GPIOi devices in your system-on-chipi design will control the LEDi, push button, and DIP switch peripherals contained on the XUPi development board. In this laboratory these hardware peripherals will not be used by the software program, however, in future laboratories these peripherals will be used and it is beneficial to learn how to instantiate them in your system-on-chipi design.

Before you begin this laboratory we suggest that you become familiar with the Xilinxi development suite. Please read the Introduction to EDK, Base System Builder, and XPS Interface tutorials before you begin. 

Project Assignment

  1. Use the base system builder to create a basic system-on-chipi
  2. Create a software project and make it print out your name five times
  3. Synthesize your system-on-chipi, compile your software project, and combine them into a bitstream
  4. Download your bitstream onto the XUPi development board and execute it

This may not seem like much, but, at the end of this laboratory you will have created a system-on-chipi and executed a program on top of it in a bare metal environment. This represents a very basic but fully functional embedded system.

Project Directions

The directions for completing this project can be found on the Laboratory 1 Directions page. This page contains step-by-step directions on how to build your system-on-chipi design and software application. Additionally, there is a screencast of the entire project which shows how the project is completed.

It will be to your benefit to either print out the project directions or to have the project directions page open while you are doing this laboratory.

Project Questions

  1. What is an FPGAi?
  2. What is a system-on-chipi? Why is it different from your desktop computer system?
  3. What does soft-core IP mean?
  4. What is are MHS, MSS, and UCF files?
  5. What does it mean to cross-compile a program?
  6. Why does it take so long to build the HW portion of your system?
  7. How does the desktop computer program the FPGAi, how does it monitor the FPGAi?

Directions

[video file=/sites/default/files/video/lab1.flv]
Lab 1 Screen Cast
Click to Play

Creating a new Project

  1. Open the Xilinxi Platform Studio Application (XPS)
    • Start -> All Programs -> Xilinxi Platform Studio 9.1i -> Xilinxi Platform Studio
  2. Select "Base System Builder wizard"
    • Then Click OK
  3. Enter "H:\eecs388\lab1\system.xmp" as the project file
    • Then click OK
    • Select "Yes" to create the folder if necessary
  4. Select "I would like to create a new design"
    • Then click Next
  5. Select "I would like to create a system for the following development board"
    • Select "Xilinxi" as the board vendor
    • Select "XUPi Virtex-II Pro Development System" as the board name
    • Select "C" as the board revision
    • Then click on Next
  6. Select "MicroBlazei"
    • Then click on Next
  7. Use "100MHz" as the processor frequency
    • Use "On-chip HW debug module"
    • Select "64KB" for the data and instruction size
    • Then click on Next
  8. Enable "RS232_Uart_1"
    • Use "OPB UARTLITE" at the peripheral
    • Use 9600 as the baud rate
    • Use 8 as the data bits value
    • Use NONE as the parity
    • Ensure that interrupts are not enabled
    • Ensure "Ethernet_MAC" is unselected
    • Ensure "SysAce_CompactFlash" is unselected
    • Then click on Next
  9. Enable LEDs_4Bit, DIPSWs_4Bit, and PushButtons_5Bit
    • Use OPB GPIOi for all of them
    • Ensure interrupts are not enabled for all of them
    • Ensure DDR_512MB_64Mx64_rank2_row13_col10_cl2_5 is not enabled
    • Ensure DDR_512MB_64Mx64_rank1_row13_col11_cl2_5 is not enabled
    • Then click on Next
  10. Ensure DDR_256MB_32Mx64_rank1_row13_col1_cl2_5 is not enabled
    • Ensure DDR_128MB_16Mx64_rank1_row13_col9_cl2_5 is not enabled
    • Then click on Next
  11. Ensure there are no other peripherals listed
    • Then click on Next
  12. Ensure STDIN is RS232_Uart_1
    • Ensure STDOUT is RS232_Uart_1
    • Ensure boot memory is ilmb_cntlr
    • Ensure Memory test is enabled
    • Ensure Peripheral self test is enabled
    • Then click on Next
  13. Ensure that ilmb_cntrl is the intruction memory
    • Ensure that dlmb_cntlr is the data, stack, and heap memory
    • Then click on Next
  14. Ensure that ilmb_cntrl is the instruction memory
    • Ensure that dlmb_cntlr is the data, stack, and heap memory
    • Then click on Next
  15. Look over the information screen
    • Click on Generate to create your system
  16. Ensure "Save settings file" is selected
    • Click on Finish

Adding the Software Application

  1. Ensure that the Applications tab is active in the Project Information Area on the left of the window
  2. Double click on "Add Software Application Project..."
  3. In the Software Application Project dialog enter "lab1" as the name
    • Ensure microblaze_0 is selected as the processor
    • Ensure "Project is an ELF-only Project" is not selected
    • Click on OK
  4. Locate "Project: lab1" in the software application list
    • Right click on "sources" and select "Add new file"
    • Create a new folder named "lab1" in the file dialog
    • Enter the lab1 folder
    • Enter lab1.c as the file name
    • Click save
  5. Click on the "+" next to "sources"
    • Double click on lab1.c
    • Enter the following into the source file

      /* <comments with your name and KUID> */
      /* <comments with a description of this source file> */

      #include <stdio.h>
      int main(void)
      {
          <your code here>
          return 0;
      }
       

    • Fill in the main function to print out your name and KUID five times
    • Hint: the printf function and a for loop would be useful for this
  6. Right click on "Project: lab1" and select "Mark to initialize BRAMs"
    • Right click on "Project: TestApp_Memory" and click on "Mark to initialize BRAMs" to unselect it

Testing the Design

  1. Select "Update Bitstream" to synthesize your hardware and compile your software
    • Menu: Device Configuration -> Update Bitstream
    • This takes a while
  2. Open up HyperTerminal
    • Menu: Start -> All Programs -> Accessories -> Communications -> HyperTerminal
    • Enter an area code if needed and click on OK until you have the main window
    • Create a new connection using COM1, a 9600 baud rate, 8 data bits, 1 stop bit, no parity, and no flow control
  3. Select "Download Bitstream" to download your design to the board for execution
    • Menu: Device Configuration -> Download Bitstream
    • This takes a while
  4. You should see you name output in the HyperTerminal window that you opened

Cleaning up for Submission

Before you submit a project to your TA you will need to clean out all of the XPS generated files. You can do this by selecting "Project -> Clean All Generated Files" from the menu. Please do this before submitting all projects.