EE265 Lab 1 Notes

Due Thursday 1/15/2009

Winter 2008-2009
Instructor: Teresa Meng

What to submit

- demonstration of functionality during office hours

- submit in drop off box and hard copies of

    - lab writeup

    - simpleFIR.s55

 

Goals

Get the basic code to work first. Then,

- Use RPT or RPTBLOCAL instead of 80 MACM instructions.

- Exploit the symmetry of the filter coefficients.

- Utilize the periodic zeros in the coefficients.

42 cycles will get you full credit for the "execution cycles" component of your grade.

 

Tips

Just get your code to be working and optimized for this specific set of filter coefficients. Don't worry about a general set of filter coefficients.

 

When you build your program, normally the out file is in ./debug directory


Enabling automatic download:
     In CCS, Option->Customize->Program/Project Load TAB
             check Load Program After Build
     With this option enabled, every time you build your program, CCS
     shall download your out file to the DSP board.

 

|| can be used mostly likely just before the RPT instruction, but it should be verified with compile and test.

Read more about parallelism in instruction reference manual.

 

dual-MAC refers to MAC::MAC.

 

The text file generated by write_vector_to_file_for_DSP.m is assembly code.
Just copy and paste it to your assembly file, input data part. Don't try to
use CCS menu file->data->load with the text file.

 

Use parenthesis for initializing pointers to arbitrary values. For example,

AMOV #(coefDATA+39), XAR2

sets XAR2 to be the word address that is 39 words after coefDATA.


<Cmem> in the instruction reference manual means that you SHOULD use CDP.

The final filtered result can be checked with CCS menu view->memory with the
correct address of the output (in fact, you can use "output" as the address).

If you want to implement skipping over zeros, you may need to use RPTBLOCAL (not RPTB) and the T0 register. This will need *(AR1+T0) instead of *AR1+ sometimes. See mnemref.pdf --> introduction to addressing modes --> indirect addressing modes --> AR indirect addressing modes for details.

 

You are allowed to reorganize the structure of the coefficients, but the input data should remain an array of 80 values.

Once you complete your work, you will need to know the size of text and
data. It's in the map file in ./Debug directory. Open the simpleFIR.map and
look at the size of .text, outdat, coefDat, and inDat.

 

Writeup hints

1, 2, and 4 are very easy questions
For 3, just make your answer based on initialized / uninitialized and
program / data. e.g. initialized program.

For 5, you can read chapter 3 of Mnemonic reference manual; but here's the answer.
- dual indirect addressing mode for Xmem and Ymem, and coefficient indirect
addressing mode for Cmem.
- Constraints on the memory allocation: Data buffers addrsesed by Xmem /
Ymem would be in DARAM, and coefficient addressed by Cmem would bin SARAM.

For 6, all these are 1 cycle instruction, #bytes can be found by trials in
assembly in CCS. For addressing mode, just write either as constant or
indirect.

For 7, again both instructions are 1 cycle instructions; AMOV sets the whole
23bits of XAR register, while MOV sets just the lower 16bits. There are
differences in the number of bytes of each instruction.

For 8, you can try it on CCS. FYI: In CPU register view, you can modify the
value of any register by double clicking the register and write the value.
Data in the address 0xa000/0xa001 means the data in 0xa000 and 0xa001.