ECE 354 - Computer System Lab II

Project 5 - Compiling to the PIC and a TI Digital Signal Processor

Introduction

In this project you will learn how to use high-level code (e.g. C) to target the PIC 16F877 and a sophisticated DSP chip from Texas Instruments. Labs 1-4 all involved painful low-level programming in assembly language. DSP are widely used now and due to the arrival of reasonable compilation tools, application development occurs primarily in a high-level language (C). Lucky for you, we don't even have the hardware, so this lab just involves running the compiler and simulator to estimate run-time performance for both the DSP and the PIC. As mentioned in lecture, each student will be responsible for completing this lab individually.

This assignment consists of two parts. The first part involves the use of the TI DSP. Information regarding this part of the assignment can be found here. This site describing this lab project and providing links to background information from Texas Instruments. The software should already be loaded on the 354 Lab PCs. Contact Keith and Ed for the CD-ROM if you want your own copy. Consider NOT printing out the entire databook and programmer's guide, but just browse it in Acrobat and print selected pages. (If you print the whole book, please do NOT use the 354 Lab printers!). The second part of the assignment involves compiling a simple C program that is provided to assembly code, assembling the program using MPASM, and then simulating it to determine performance. This performance will then be compared to an assembly version of the code which you will write. More information on this part of the assignment can be found here.

I hope this lab will provide a good sense of closure in the course since it brings you up to the level at which most real embedded systems (controllers, signal processors, etc.) are actually developed. Labs 1-4 were meant to show you in (sometimes painful) detail, the hardware mechanisms and low-level software that you are hidden from in the DSP.

Demonstration

During the demo I expect to see you run a vector-matrix multiply example with both the original and optimized C code for the DSP. To prove that these multiplications are running correctly for the DSP please have a version of the code with "printf" statements that show the original values of the matrices and the results of multiplying them together. Note that when you determine the performance numbers for the code the "printf" statements should be commented out. During the demo you should be able to show me how to use all associated software (compiler, simulator, etc). For the PIC portion of the assignment I expect to see a simulation of both the assembly code created by the PIC compiler and the code you created by hand.

Report

The lab report format for lab 1 and 2 should be followed for this report. Since there is no hardware there will be no schematics required. Since each student should hand in a report for this assignment, there is no need for a separate personal statement. Include discussion of any problems encountered in a section in the report. For the DSP portion of the assignment, your report should include your source code, compiler directives and profiler outputs as well as any analysis and questions mentioned in the lab description web page. In particular, I will be looking for profiler outputs which indicate evidence of how long each version of your DSP code took to run. Please include the generated assembler code for both the original and optimized C code. Highlight the increased parallelism in the code and explain the reasons for the improvement in the report. The report should also include the matrix and vector used for experimentation and the resulting vector generated for both programs. This information can be generated via "printf" statements and the results of the runs should be attached to the reports to show the matrices. Remember that measured performance for the two programs should be calculated with the "printf" statements commented out.

For the PIC portion of the assignment simulation cycle counts should be provided for both assembly versions of your program. Be sure to discuss BOTH sets of assembly code in your "Discussion of Code" section of the report. What are some of the interesting features of the compiler-generated version of the assembly code?