Assignment 3
Assignment 3
Assignment #3
Introduction to MicroBlaze
Overview
This Lab is an introduction to Embedded System development with the Spartan-6 family FPGAs. In this
session you will design a custom embedded hardware system and develop simple application software.
A soft processor is a microprocessor core that can be wholly implemented using logic synthesis. It can be
implemented via different semiconductor devices containing programmable logic like FPGAs. As a well-
known case we will work with The MicroBlaze core. The MicroBlaze is a soft microprocessor core
designed for Xilinx FPGAs from Xilinx. As a soft-core processor, MicroBlaze is implemented entirely in
the general-purpose memory and logic fabric of Xilinx FPGAs. One sample microarchitecture is shown
below:
We will use AXI (Advanced Extensible Interface) bus which is defined under AMBA 3 standard which you
might have heard it before.
At last, you should specify board support files which is provided for you along with this file. (It is not
necessary to be in the exact path of figure!) Select OK to go to next wizard.
You can change peripheral options and settings in the new window. But leave them as are for now.
Select Generate Netlist and wait until it finishes. Please be patient as this may take several minutes.
Thereafter Select Export Design and select export & launch SDK in prompting window.
Note: If Xilinx SDK is already open, close it before selecting export & launch SDK
Source codes can be found under src directory. Edit helloworld.c so as your program displays switch
values on LEDs. Use the following guides to complete the code:
#include <xparameters.h>
#include <xgpio.h>
3. Assign these variables to switch and LED interface with the XGpio_Initialize function. (Search web to
find out how to do this)
5. Read data from switches with XGpio_DiscreteRead. Similarly write to LEDs with XGpio_DiscreteWrite.
Now from project menu click on Build all to compile your codes. After that you are ready to download
bitstream to FPGA and run the software. In SDK, from Xilinx tools select Program FPGA. Then from Run
menu click on Run As->Launch on hardware.
Tip: You may encounter this error from SDK: JTAG cable not found. In the case, you should select
Configure JTAG settings from Xilinx tools menu and specify the settings like this:
Part III – Add Two Variables
Change your C code to add right half of switches to left half and display the result on LEDs. The TA will
ask you to change the code in lab session.