EECS 388 Laboratory

Welcome to EECS 388: Computer Systems and Assembly Language. In this class you will learn how computer systems are constructed and how to program those computer systems using assembly language. Learning will focus on internal microprocessor organization, programming in assembly language, performing input and output, and controlling external devices. The interaction of these four basic computing elements is at the core of effective embedded system design and is important knowledge in general purpose computing as well.

The laboratory for this class makes use of the Xilinxi XUPi development board pictured on the right. This development board is built around the Virtex-II Pro FPGAi. These FPGAsi are high-performance, high-density reconfigurable devices which students will use for system-on-chipi development. Students will use these devices and their associated development environments to develop fully functional embedded system designs which they will program using a combination of assembly language and C.

In addition to the FPGAi, the XUPi development boards contain many integrated peripherals which will be used by the students. Using peripherals such as serial ports, LEDs, push buttons, and switches, students will learn the basic mechanisms of I/O and external device control.

The system designs in this class will all make use of the MicroBlazei microprocessor; a 32-bit soft-processori core developed by Xilinxi for use in their FPGAsi. This processor is a simple but modern 3 or 5 stage pipelined microprocessor which is based on the DLXi architecture described by Patterson and Hennessy in their computer architecture book. The instruction set architecture (ISAi) of the MicroBlazei will be studied in depth and will be used by students in most of the laboratory exercises.

Students in this course should leave the class with knowledge of computer system design and assembly programming. Students should also leave with understanding of the basic relationships between high-level languages, assembly level programming, and hardware level system design.

Syllabus

Contact Information

Wesley Peck
2045 Eaton Hall
peckw@ittc.ku.edu
Cenk Sahin
2045 Eaton Hall
cenksahin@ku.edu
 

Lab Schedule

Tuesday
2:30 - 4:45 PM
3002 Eaton Hall
Wednesday
2:00 - 4:15 PM
3002 Eaton Hall
Thursday
2:30 - 4:45 PM
3002 Eaton Hall
 

Office Hours

Wesley Peck
Tuesday
12:00 - 2:30 PM
2045 Eaton Hall
Wesley Peck
Wednesday
12:00 - 2:00 PM
2045 Eaton Hall
Cenk Sahin
Tuesday
2:30 - 4:30 PM
3002 Eaton Hall
 

Reference Materials

In addition to the reading materials required in the lecture, the laboratory part of this class will require the use of many of the reference documents provided by Xilinxi for their products. These reference materials give details information on the design of Xilinxi hardware components and will be invaluable to completing the projects in this class. A list of interesting reference materials can be found on the website on the Reference Materials page.

Expectations

During this course students will be expected to learn basic concepts in computer systems design and assembly level programming. This course is FPGAi based and makes use of the Xilinxi XUPi development board. As such, students will learn to be proficient with the Xilinxi development environment and Xilinxi FPGAsi. By the end of the course students will be expected to design and program simple embedded systems using these tools.

This is not an introductory level course. While the TAs in your class are more than happy to answer your questions, they will not do your projects for you. This means that they will help you to understand the general concepts in the class, they will help you with problems that you encounter with the Xilinxi tools, and they will help you debug and fix specific problems in your project. They will not, however, repeat lectures for students that missed class or answer questions which are general or vague, such as "What is wrong with my code?". As an upper-level course, you are expected to work outside of class on your project and come to class prepared with questions.

Grading

Students are also expected to demonstrate their working designs on the due date for the given laboratory. Demonstrations are done in class with your TA and they must be completed by the end of that lab. If you fail to demonstrate your project by the due date you can demonstrate your project the next laboratory period for a 25% penalty. Laboratory projects will receive a grade of 0% if they are more than one week late. There are no exceptions to these rules unless you have received special permission from your TA before the due date.

In addition to the in-class demonstration, students will be expected to turn in a project report for every laboratory. These project reports should follow the guidelines established in the Project Reports documentation. These project reports are worth 25% of your overall project score and will be graded thoroughly. If you fail to turn in a report for your project you will be penalized 50% on your overall project score. Project reports along with all other laboratory submission materials are due Friday on the week that the project is demonstrated to your TA.

Grading Disputes

Questions about grading and grading disputes will not be answered during the laboratory period. If you have a question about your grade or think that you deserve more points then you should visit your TA during their office hours. If you feel that you deserve more points on your grade then you must demonstrate to your TA exactly why you deserve more points. Vague requests for more points will not be successful. Additionally, the TAs reserve the following rights when reassessing a grade:

  1. The entire project or homework will be regraded, not just the problem which you feel you deserve more points on. This means that you could lose or gain points on any problem.
  2. If you compare your work to another student's work then both student's will have their work regraded. This means that your friend could lose points on their work if we graded it incorrectly the first time.
  3. Grades will not be reassessed more than two weeks after they are returned. Do not try to get more points on all of your projects and homeworks at the end of the semester, it will not work.

 

Deliverables

For each laboratory project in this class you will be required to demonstrate a working design on the due date in class and turn in your project materials to the TA by Friday on the week that the project was demonstrated. Thus, the deliverables for each laboratory is the following:

  1. Demonstration of a working design
    At the end of your laboratory period during the week in which the project is due students will demonstrate a working design to their TA. This demonstration will account for the majority of your grade for the project, 65%. The quality of a students solution will be a factor in the student's grade as well as the correctness. A project which is correct technically but is of poor quality will lose points.
     
  2. Project system design files
    Each project in this class will require students to design and implement a system-on-chipi design using the Xilinxi development environment. Students will submit these design files as part of their projects. Each design must have the names of all the students who contributed to the design. The project design is worth 5% of your project grade with points determined largely by how well the design is commented.
     
  3. Project source code
    Most projects in this class will require that the student develop a program in C or assembly language to control their system-on-chipi design. Students will submit these source files as part of their projects. Each source code file must be thoroughly documented and must include the names of all students which contributed to the source code. The project source code is worth 5% of your project grade with points determined largely by how well the source code is commented.
     
  4. Project report
    The report for each lab is due by Friday on the week that the project is demonstrated to your TA. Each report must follow the guidelines established in the project report format. Failure to do so will result in a loss of points. The project reports are worth 25% of the overall project grade.

Project materials must be submitted to your TA in electronic format, including the project report. Project reports must be submitted as either a Word Document or as a PDF. All project materials must be submitted to your TA in a single zip file. Project submissions which consist of multiple files or submissions which are not in zip format will not be accepted. Additionally, your project submission must follow these guidelines:

  1. Project submission file name
    Projects submissions to your TA must be named "lab<number>_<lastname>.zip". For instance lab0_peckw.zip or lab3_sahin.zip are both valid names for submission to your TA. File names such as lab0.zip, wesley.zip, or lab0_peckw.7z are not valid and will not be accepted. Failure to use a valid name for your project submissions will result in a loss of points.
     
  2. Project submission directory structure
    The zip file that you submit for your project should contain a directory named "design" which contains your project's system-on-chipi design files, a directory named "source" which contains your project's source files, and a file named "<lastname>.pdf " or "<lastname>.doc" which should be your project report. Failure to follow these guidelines may result in a loss of points. As an example, your zip file should look like the following:
    • lab0_peckw.zip
      • design
        • system.mhs
        • system.mss
        • system.xmp
        • ...
      • source
        • lab0.c
        • lab0.S
        • ...
      • peckw.pdf

Additionally, please clean up your system-on-chipi design before submitting them to your TA as instructed in laboratory 1. In the past failure to perform this step has resulted in projects not be received correctly by the TAs due to limitations of email.

Report Format

Each laboratory project requires the submission of a report along with the design and source files. Every report should contain all of the information described below. Failure to include any of this information will result in a loss of points.

Abstract

This section should contain one short paragraph which summarizes the work that your performed for the laboratory and describes the results that you ended with. The abstract should be no more than five to ten sentences but should still be informative.

Introduction

This section should contain several paragraphs which discuss any background information which is pertinent to the laboratory. Additionally, it should describe what the purpose of the laboratory was and what the expected results of the laboratory are. Diagrams should be used to illustrate the system-on-chipi and software designs. Ensure that all diagrams are correctly labeled.

Design and Implementation

This section section should contain many paragraphs which describe the system that was designed and implemented. You should detail exactly what was built as part of the laboratory, how it was built, and why it was built. Block diagrams, figures, source code, and screen shots are all highly effective and consise ways of communicating your design and implementation.

Results

This section should contain several paragraphs which describe the results of the laboratory. Describe the functionality of the resulting design and discuss how well your design and implementation solved the original problem. Provide any useful system metrics such as the amount of code or the amount of time which was required to solve the problem. Also be sure to mention any problems which were encountered during your design and implementation.

Question Answers

This section should contain the answers to all of the questions which are part of the laboratory. The length of your answer is dependent on the question being asked, however, generally speaking answers should be between two sentences and two paragraphs. Answers should get to the core of the question without being overly verbose.

Conclusion

This section should contain one or two paragraphs which finish the report. Reiterate the original problem and quickly reason about how and why your design and implementation solve the problem. Provide any insight you might have about possible future work related to the project and provide any interesting extensions to the project that could be explored.

References

This section should list all of the reference material which was used during your design and implementation. As engineers you are accountable for your actions and reports. Providing references establishes credibility as to the design and provides a path of reasoning for you decisions and ideas. References should be cited in your report using the appropriate reference number as show below:

...
...
The Hthreads operating system established the effectiveness of hardware components in operating system design [1].
...
...

[1] J. Agron, W. Peck, E. Anderson, D. Andrews, E. Komp, R. Sass, F. Baijot, and J. Stevens, “Run-Time Services for Hybrid CPU/FPGAi Systems On Chip,” in Proceedings of the 27th IEEE International Real-Time Systems Symposium (RTSS), December 2006.

[2] MicroBlazei Processor Reference Guide - http://www.xilinx.com/ise/embedded/mb_ref_guide.pdf.

Reference Materials

Xilinxi MicroBlazei Reference

The MicroBlazei reference guide is invaluable for anyone making use of the microprocessor. The reference guide contains a detailed description of the MicroBlazei architecture including information about the register set, pipelining, memory systems, and data types. The guide also contains a comprehensive list of all instructions supports by the MicroBlazei ISAi.

MicroBlaze Reference Guide

Xilinxi GPIOi Reference

The GPIOi reference guide describes the hardware specifications for the OPB GPIOi peripheral. The Xilinxi GPIOi peripheral is a design time configurable general purpose I/O device which gives software the ability to inspect and control wires within the FPGAi. This is done through a register set which is exposed by the GPIOi peripheral as a memory mapped region on the OPB bus. Software is able to read and write to this register set using standard load and store operations from the processors ISAi.

GPIO Reference Guide

Xilinxi Interrupt Controller Reference

The Xilinxi interrupt controller reference guide describes the hardware specifications for the OPB INTC peripheral. This peripheral is a design-time configurable programmable interrupt controller. Modern processors are only capable of responding to one or two difference external interrupt sources. The programmable interrupt controller is a hardware peripheral which give more flexibility to system-on-chipi designers by taking an arbitrary number of interrupts sources and condensing them into a single interrupt source, the PIC itself. The PIC then exposes, as registers, the original sources of the interrupts. Thus, software is able to respond to an arbitrary number of interrupt sources by examining the PIC registers.

Interrupt Controller Reference Guide

Project Submission

Before uploading your EECS 388 project submission please select the correct laboratory number from the drop down menu:[upload path=eecs388]

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 -> Xilinx