Digital Filters lab3 slides 2of2 数字滤波器实验幻灯片之2.pptVIP

  • 0
  • 0
  • 约4.4千字
  • 约 18页
  • 2016-08-22 发布于河南
  • 举报

Digital Filters lab3 slides 2of2 数字滤波器实验幻灯片之2.ppt

Digital Filters lab3 slides 2of2 数字滤波器实验幻灯片之2

* * * * EE 345S Real-Time Digital Signal Processing Lab Spring 2009 Lab #3.2 3.3 Digital Filters Akshaya Srivatsa * Outline More About Circular Buffers C Code v/s Assembly How Function Makes Call Using Assembly in C Linear Assembly Code How To Read Assembly Files IIR Filters DF-I and Implementation IIR Filter DF-II and Implementation Task List for Lab #3.2 Task List for Lab #3.3 * More About Circular Buffers 8 registers: A4-A7 and B4-B7 can be used as circular buffers. Number of words in the buffer = Block Size 2 bits BK0 and BK1 (each 5 bit fields) of AMR (Address Mode register) BUF_LEN = 2NBlock+1 where BUF_LEN is total no. of bytes. * More About Circular Buffers Buffer must be aligned to byte boundaries i.e. multiples of block size Implementation: #define Nblock 6 #define BUF_LEN_WORD 1(Nbloack-1) # define BUF_LEN 1(Nblock+1) #pragma DATA_ALIGN(x, BUF_LEN) x[] should be global. This prevents carries and borrows in address calculation between blocks to access data. * C Code v/s Assembly We use C coding over Assembly for the following reasons Rapid Software development Applications can be easily ported to DSP’s Assembly Code is tough to write because Multiple levels of pipelining. Multiple Execution Units Different instructions take different execution times * How Function Makes Call In function call, first argument is the left most one. Registers A0-A9 and B0-B9 are saved on the stack. The first 10 arguments are saved in registers A and B. Other ones are saved on stack. The caller branches to the function. Returned values are stored in B3. Upon returning, the stack is popped and loaded back into the register. * Using Assembly in C Every variable in C is prefixed with an underscore in assembly. (x in C is _x in assembly) B3 (Return value) and A3 (Structure Register) must not be used freely. Objects or functions declared in assembly that is called by C needs to be declared with .def or .global. Must start with .cproc and end with .endproc to mark the s

文档评论(0)

1亿VIP精品文档

相关文档