CCFE is the fusion research arm of the United Kingdom Atomic Energy Authority FPGA Workshop January 2011 Xilinx SDK Tutorial Billy Huang / Graham Naylor
CCFE is the fusion research arm of the United Kingdom Atomic Energy Authority
FPGA WorkshopJanuary 2011
Xilinx SDK Tutorial
Billy Huang / Graham Naylor
2
Software Development Kit (SDK)
• Overview
– Slides introducing the SDK.
– Creating an SDK project, compiling and running.
– Viewing output on HyperTerminal.
3
SDK
• What is the SDK?– The Sofware Development Kit (SDK) is a program which allows C/C++
programming for the Microblaze.
• The SDK uses the GNU C Compiler. This program allows you to easilycompile a program and make it run on the processor.
• The easiest compiler to use is the compiled binary form, i.e. not tocompile your own compiler! The binary form will run on any x86 (mostIntel and AMD 32-bit) system. SDK includes this compiler. Later youwill use a compiler outside of the Microblaze environment.
• Code sources:
[1] http://git.monstr.eu/git/gitweb.cgi
[2] http://git.xilinx.com/
[3] http://gcc.gnu.org/git/?p=gcc.git;a=shortlog;h=refs/heads/microblaze
4
Create a Xilinx C Project
1. Create a “Xilinx C Project”. This will give you access to a numberof pre-written example C applications which will run on theMicroblaze.
5
Create a Hello World application
1. Select the “Hello World” application,And then “Next”.
2. Select “Finish”.
6
Connect the UART
1. Select the “Hello World”application,And then “Next”.
• UART and Serial console are used to mean the same thing.
2. Select “standalone” on the left side. Then changethe stdin/stdout to xps_uart16550.This connects the software to the UART.
7
• We make some minor program modifications in platform.c to getthe serial console working. Whilst choosing a higher baud rate of115200 bps.
• SCROLL DOWN below #define etc. And change 9600 to 115200.Also make the changes in the red box.
9
Open HyperTerminal (or similar)
• Start -> Programs -> Accessories -> Communications -> HyperTerminal
10
Run on Hardware
• Launch the program on the FPGA board. Behind the scenes this connects usingXMD and then runs the “dow program.elf” followed by “run”.
11
Hello World
• You should see “Hello World” displayed on the terminal.
• If you cannot see any output on the UART try to close theterminal program and re-open it, then reprogram the FPGA.