DOC PREVIEW
Columbia CSEE 4840 - lab 1

This preview shows page 1 out of 3 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CSEE W4840 Embedded System Design Lab 1Stephen A. EdwardsDue February 2, 2006AbstractWrite a C program that counts in decimal on the XSB–300Eboard. Learn how to compile and run a program, program theFPGA, and use serial communication for debugging.1 IntroductionThe XSB–300E board consists of a large number of peripheralsclustered around a Xilinx Spartan XC2S300E FPGA, which hasroughly 300 000 raw gates that can be user-programmed intoany configuration. For this lab, you will use a configurationwe have provided for you, consisting of the Microblaze 32-bitmicroprocessor, a UART, and a soft peripheral that controls thetwo seven-segment LEDs on the board and the bargraph LED.2 A WarningThe XSB–300E boards are very expensive, finicky, and diffi-cult to acquire. Please treat them gently: they are not built towithstand punishment. In particular, I’m sure all you strongColumbia students could break off any given connector afterabout two or three disconnect-connect cycles. Leave the cablesconnected.Like all electronic equipment, they are very sensitive to elec-trostatic discharge and the floor of the lab is helpfully coveredwith carpet that tends to create lots of static. You shouldn’t needto touch the boards, but if you must, ground yourself first bytouching the case of the power supply.The boards also do not appreciate being dunked in water,Coca-Cola, milk, crumbs, and just about every other sort offoodstuff. Food and drink are prohibited in the lab. If we catchyou eating or drinking in the lab, we will make you install allthe Xilinx software from scratch before doing the next lab (thenastiest punishment we could think of).We only have fifteen boards and they have to last for a while.Anybody who breaks a board will be hauled in front of the classand pelted with rotten tomatoes.3 Hello WorldFirst, get your XSB–300E board to show signs of life by usingthe canned project we have provided.1. Log into one of the clients. These Linux machinesare named micro1.ilab.columbia.edu throughmicro15.ilab.columbia.edu.2. Set up environment variables by sourcing a small script:$ . ˜sedwards/xilinx.shXILINX set to /usr/cad/xilinx/ise7.1i$ which xps/usr/cad/xilinx/edk7.1i/bin/lin/xpsYou will need to do this every time you log in or add it toyour .bashrc.3. Create a directory where you’ll put this project and cd intoit. The Xilinx tools create a lot of intermediate files (overa thousand for “Hello World”) and do not clean up afterthemselves, so it is important to keep things segregated.$ mkdir lab1$ cd lab14. Unpack the template project files by un-tarring them frommy directory:$ tar zvxf ˜sedwards/4840/lab1.tar.gz5. Start Xilinx Platform Studio and give it the name of theproject file:$ xps system.xmpXilinx Platform StudioXilinx EDK 7.1.2 Build EDK_H.12.5.1Copyright (c) 1995-2005 Xilinx, Inc.Launching XPS GUI...6. Start the synthesis process by clicking the “BRAM INIT”button.1system.xmpsystem.mhssystem.mssc_source_files/main.cpcores/clkgen_v1_00_a/data/clkgen_v2_1_0.mpdpcores/clkgen_v1_00_a/data/clkgen_v2_1_0.paopcores/clkgen_v1_00_a/hdl/verilog/clkgen.vpcores/opb_xsbleds_v1_00_a/data/opb_xsbleds_v2_1_0.mpdpcores/opb_xsbleds_v1_00_a/data/opb_xsbleds_v2_1_0.paopcores/opb_xsbleds_v1_00_a/hdl/vhdl/opb_xsbleds.vhddata/system.ucfetc/bitgen.utetc/fast_runtime.optFigure 1: Important files in the lab1 project.This takes a long time and generates lots of harmless mes-sages and over a thousand temporary files, but will even-tually compile the project into a .bit file suitable for theFPGA on the XSB board and finally download it.Fortunately, clicking this again will only recompile the filesthat have changed.7. Meanwhile, in another window, start minicom, a serialcommunications program. The boards have a serial port onthem and the sample project includes a UART (UniversalAsynchronous Receiver Transmitter) that can be used tocommunicate through a null modem cable to the host. Wewill use this for debugging since it provides a way to printthings from the C program.Once Minicom is running, make sure it is using the first se-rial device, /dev/ttyS0, and operating at 9600 baud, 8data bits, 1 stop bit, no parity bits (displayedas 9600 8N1in the bar along the bottom), and not use hardware or soft-ware flow control. “Ctrl-a o” opens a configuration menu.Leave Minicom running while you’re working on yourboard: it will display characters printed from the C pro-gram running on the board.8. When the synthesis process finishes (i.e., when it no longersays “Running make...” and has a spinning baton at thebottom of the window), download the generated bitstreamto the board by clicking on the “!u1” button.1The LEDsshould flash for a while and “Hello World!” should appearin Minicom. Make sure your board is connected properly(it should have a power connection from the external powersupply, a connection through a parallel cable, and a connec-tion through a serial cable) and powered on. An LED nearthe power connector lights whenever power is applied tothe board.If you can’t get things to work, pester someone for help.4 What is going on?Figure 1 lists the important files in the sample project.The system.xmp file describes the project, mostly its nameand the names of relevant files.1Alternatively, run “download implementation/download.bit” in your lab1directory.The system.mhs file lists how the hardware should be as-sembled to create the project. For example, it lists the LED andserial connections, the Microblaze processor, the UART, and theperipheral that controls the LEDs. Probably the most interestinglines in this file are those that define the LED peripheral:BEGIN opb_xsbledsPARAMETER INSTANCE = ledsPARAMETER HW_VER = 1.00.aPARAMETER C_BASEADDR = 0xFEFF0200PARAMETER C_HIGHADDR = 0xFEFF02ffPORT OPB_Clk = sys_clkBUS_INTERFACE SOPB = myopb_busPORT RIGHT_LED = RIGHT_LEDPORT LEFT_LED = LEFT_LEDPORT BAR_LED = BAR_LEDENDThis instantiates an opb_xsbleds “core” connected tothe main processor bus and memory mapped from addresss0xFEFF0200 to 0xFEFF02ff. These magic numbers willbe useful later when you write code that controls the LEDs.The system.mss file describes how the software should beassembled for the system, and is less interesting than .mhs file.It says to include the UART driver and to connect stdin and std-out of the program to the driver.The main.c file contains the main() function that is runwhen the system is downloaded. You will modify this for thislab.The files under


View Full Document

Columbia CSEE 4840 - lab 1

Documents in this Course
SPYCAM

SPYCAM

91 pages

PAC-XON

PAC-XON

105 pages

lab 1

lab 1

6 pages

memory

memory

3 pages

Structure

Structure

12 pages

Video

Video

3 pages

pacman

pacman

4 pages

Lab 1

Lab 1

6 pages

Scorched

Scorched

64 pages

Video

Video

22 pages

Memory

Memory

23 pages

DVoiceR

DVoiceR

29 pages

MAZE

MAZE

56 pages

PAC XON

PAC XON

13 pages

PACXON

PACXON

13 pages

MP3 Player

MP3 Player

133 pages

Load more
Download lab 1
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view lab 1 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view lab 1 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?