EE 345S Real-Time Digital Signal Processing Lab Spring 2009

Slides:



Advertisements
Similar presentations
Chapter 7 Linear Assembly
Advertisements

Lecture 4 Introduction to Digital Signal Processors (DSPs) Dr. Konstantinos Tatas.
Lecture 6 Programming the TMS320C6x Family of DSPs.
1 ARM Movement Instructions u MOV Rd, ; updates N, Z, C Rd = u MVN Rd, ; Rd = 0xF..F EOR.
Assembly and Linear Assembly Evgeny Kirshin, 05/10/2011
CPU Review and Programming Models CT101 – Computing Systems.
Chapter 14 Finite Impulse Response (FIR) Filters.
1 Computer Architecture MIPS Simulator and Assembly language.
PART 4: (2/2) Central Processing Unit (CPU) Basics CHAPTER 13: REDUCED INSTRUCTION SET COMPUTERS (RISC) 1.
EE 445S Real-Time Digital Signal Processing Lab Fall 2013 Lab #3.1 Digital Filters Chao Jia.
Software and Hardware Circular Buffer Operations First presented in ENCM There are 3 earlier lectures that are useful for midterm review. M. R.
1 Handling nested procedures Method 1 : static (access) links –Reference to the frame of the lexically enclosing procedure –Static chains of such links.
CS 536 Spring Run-time organization Lecture 19.
Computer Architecture I - Class 9
Sampling, Reconstruction, and Elementary Digital Filters R.C. Maher ECEN4002/5002 DSP Laboratory Spring 2002.
EECC250 - Shaaban #1 Lec # 5 Winter Stacks A stack is a First In Last Out (FILO) buffer containing a number of data items usually implemented.
Chapter 13 Reduced Instruction Set Computers (RISC) Pipelining.
Implementation of Basic Digital Filter Structures R.C. Maher ECEN4002/5002 DSP Laboratory Spring 2003.
Assembly תרגול 8 פונקציות והתקפת buffer.. Procedures (Functions) A procedure call involves passing both data and control from one part of the code to.
Topics covered: ARM Instruction Set Architecture CSE 243: Introduction to Computer Architecture and Hardware/Software Interface.
Digression: the “Stack” 1 CS502 Spring 2006 Digression: the “Stack” Imagine the following program:– int factorial(int n){ if (n
16.317: Microprocessor System Design I Instructor: Dr. Michael Geiger Spring 2012 Lecture 29: Microcontroller intro.
1 Real time signal processing SYSC5603 (ELG6163) Digital Signal Processing Microprocessors, Software and Applications Miodrag Bolic.
EE 445S Real-Time Digital Signal Processing Lab Spring 2012 Lab #3.1 Digital Filters Some contents are from the book “Real-Time Digital Signal Processing.
GPGPU platforms GP - General Purpose computation using GPU
Embedded Systems Design ICT Embedded System What is an embedded System??? Any IDEA???
Introduction to Subroutines. All the combinations in which a subroutine can be written 1. The subroutine may be: a. Internal or b. External 2. The type.
Processor Architecture Needed to handle FFT algoarithm M. Smith.
Programmer's view on Computer Architecture by Istvan Haller.
EE 445S Real-Time Digital Signal Processing Lab Fall 2013 Lab #2 Generating a Sine Wave Using the Hardware & Software Tools for the TI TMS320C6748 DSP.
Chapter 4 Memory Management Virtual Memory.
Understanding the TigerSHARC ALU pipeline Determining the speed of one stage of IIR filter – Part 2 Understanding the pipeline.
ajay patil 1 TMS320C6000 Assembly Language and its Rules Assignment One of the simplest operations in C is to assign a constant to a variable: One.
Microprocessors The ia32 User Instruction Set Jan 31st, 2002.
LIST OF EXPERIMENTS USING TMS320C5X Study of various addressing modes of DSP using simple programming examples Sampling of input signal and display Implementation.
Computer Organization 1 Instruction Fetch and Execute.
CSC 8505 Compiler Construction Runtime Environments.
Assembly Language Co-Routines
EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #3 Generating a Sine Wave Using the Hardware & Software Tools for the TI TMS320C6713 DSP.
EE 445S Real-Time Digital Signal Processing Lab Fall 2013 Lab 3 IIR Filters Chao Jia Debarati Kundu Andrew Mark.
STUDY OF PIC MICROCONTROLLERS.. Design Flow C CODE Hex File Assembly Code Compiler Assembler Chip Programming.
Computers’ Basic Organization
Chapter 14 Functions.
Storage Classes There are three places in memory where data may be placed: In Data section declared with .data in assembly language in C - Static) On the.
CS501 Advanced Computer Architecture
Chapter 7 Linear Assembly
CS2100 Computer Organisation
ECE 3430 – Intro to Microcomputer Systems
SOFTWARE DESIGN AND ARCHITECTURE
Embedded Systems Design
Run-time organization
CS703 - Advanced Operating Systems
Outline for this evening
A systolic array for a 2D-FIR filter for image processing
Software and Hardware Circular Buffer Operations
Lecture 14 Virtual Memory and the Alpha Memory Hierarchy
Trying to avoid pipeline delays
MIPS Instructions.
The University of Adelaide, School of Computer Science
Lab 3 Part III Instructions
by Richard P. Paul, 2nd edition, 2000.
Lab 3 Part II Instructions
Computer Architecture
General Optimization Issues
Optimizing ARM Assembly
Chapter 12 Pipelining and RISC
Zhongguo Liu Biomedical Engineering
Understanding the TigerSHARC ALU pipeline
Real time signal processing
Lecture 4: Instruction Set Design/Pipelining
Presentation transcript:

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 start and end points for optimization.

Linear Assembly Code Has the extension .sa No information about parallel instructions, latencies or register usage. An assembly optimizer- Find instructions that can operate in parallel Assign register usage Handle pipeline latencies Optimize execution time

How To Read Assembly Files _<tag> is entry point .cproc are the arguments for the function .reg are the registers declared that are used. .return is the return value stored in B3. .endproc is end of procedure

IIR Filters IIR Filters can be represented as Its time domain equivalent is This is called “Direct Form” since co-efficients directly appear in the difference equation. Filter requires N+M+1 storage elements for all the x[n] and y[n] values.

IIR Filters DF-I Implementation

IIR Filters DF-I Implementation Compute v[n] Compute y[n] Update state variables

IIR Filters DF-I Implementation The FDA tool on Matlab breaks the IIR filter into biquads or IIR filters with order 2. Same co-efficients are used for DF-I and DF-II The co-efficients are in this order [b1 b2 b3 … bN (a1=1) a2 a3 … aN] For M biquads, you get M+1 scaling factors. Typically scaleM+1 = 1 Implementation is scale1 – biquad1 – scale2 – biquad2 - .. scaleM – biquadM – scaleM+1

IIR Filters DF-II Implementation Let us rewrite the IIR filter difference equation:

IIR Filters DF-II Implementation Step 1: Step 2:

Common Mistakes Each biquad is an IIR filter. If you working with biquads, treat each one independently. Each biquad has its own state variabled. DO NOT MIX THE STATE VARIABLES OF BIQUADS. Always first evaluate output for a biquad before you do any operations on the next biquad.

Task List Tasks for Lab 3.1 are FIR Filter Profiling IIR Filter Design IIR DF-I Implementation and profiling Important Points DO NOT OVERWRITE older C files. The task list can be found at the following link http://users.ece.utexas.edu/~bevans/courses/realtime/lectures/laboratory/c6713/lab3/Lab_3_Task_List.doc

Task List Tasks for Lab 3.1 are IIF Filter DF-II Implementation and Profiling LabVIEW VI for Magnitude & Phase Response Answer all Questions Important Points DO NOT OVERWRITE DF-I code Create a new labmain.c The task list can be found at the following link http://users.ece.utexas.edu/~bevans/courses/realtime/lectures/laboratory/c6713/lab3/Lab_3_Task_List.doc