EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software...

28
EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK

Transcript of EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software...

Page 1: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

EE 345S Real-Time Digital Signal Processing Lab

Fall 2008

Lab #1Introduction to Hardware & Software

Tools of TMS320C6713 DSK

Page 2: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

2

Outline

Introduction C6713 DSK Board C6713 DSP C6700 Instruction Set Architecture Code Composer Studio LabVIEW MATLAB/MathScript

Page 3: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

3

Introduction

Goal is to implement communication system components by writing C and/or assembly language programs for the TI TMS320C6713 floating-point DSP.

C6713 DSP resides on the TI TMS320C6713 DSP Starter Kit (DSK) which connects to the PC by USB.

Page 4: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

4

Fixed vs. Floating Point DSP’s

Fixed Point DSP’s (Modems, Controllers, Phones…) Cheaper, Consume less power, Need special care when programming to avoid

overflows, More dominant in the market.

Floating Point DSP’s (DSL, Video, Imaging…) Easier to program, Complex architecture (more computationally

demanding) More expensive.

Page 5: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

5

TI DSP Families

Low cost, Fixed-Point, 16-bit (for control): TMS320C1x, ’C2x, ’C20x, ’C24x

Power Efficient, Fixed-Point, 16-Bit (for wireless phones and modems): ’C5x, ’C54x, ’C55x

High Performance DSP’s (DSL, Imaging, Video…): ’C62x, ’C64x (16-bit fixed-point) ’C3x, ’C4x, ’C67x (32-bit floating-point)

Page 6: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

6

Advantages of DSP’s vs. Analog Circuit

Can implement complex linear and non-linear algorithms,

Application can be modified simply by changing code,

Highly reliable, Manufacturing is fairly easy.

Page 7: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

7

TMS320C6713 DSK Block Diagram

Page 8: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

8

DSK Features

Has a TMS320C6713 DSP operating at 225 MHz.

AIC32 stereo codec line with Line In, Line Out, MIC and headphone jacks to interface with analog audio signals that are sampled and digitized so it can be processed by DSP.

Page 9: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

9

DSK Features

5V Power Supply. 16 MB of synchronous DRAM. 512 KB of non-volatile flash memory. 4 user accessible LED’s and DIP (Dual In-

line Package) switches to provide user with some interactive feedback (I/O).

Expansion connectors for daughter cards, external memories and other DSP’s.

Page 10: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

10

C6713 DSP Features

VLIW (Very Long Instruction Word) CPU Core that takes advantage of parallelism (ILP). Fetches 8 32-bit instructions at once (total of 256

bits). Has 8 independent functional units:

4 ALU’s (fixed and floating-point): .L1, .L2, .S1 and .S2. 2 ALU’s (fixed-point): .D1 and .D2. 2 Multipliers (fixed and floating-point): .M1 and .M2.

Load/Store architecture with 32 32-bit general purpose registers (all instructions operate on registers as opposed to data in memory using .D1/.D2).

Page 11: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

11

C6713 DSP Features

8 functional units are divided into 2 sets each with 4 different units and their own 16 general purpose registers (A0-A15 and B0-B15).

There is a single data bus connecting the 2 sides. Register files support data ranging in size from

16-bit through 40-bit fixed point & 64-bit floating point.

Register access using the register file across the CPU supports one read and one write per cycle.

Page 12: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

12

C6700 DSP Simplified Architecture

Program RAM Data Cacheor Cache

Internal Buses

Control Regs

Regs (B

0-B

15

)

Regs (A

0-A

15

)

.D1

.M1

.L1

.S1

.D2

.M2

.L2

.S2

CPU

Addr

Data

ExternalMemory -Sync -Async

DMA

Serial Port

Host Port

Boot Load

Timers

Pwr Down

Page 13: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

13

C6713 DSP Features

Instruction Set Features Hardware support for IEEE 754 standard on single

and double precision floating-point operations. 8, 16 or 32-bit addressable load/store instructions.

L1/L2 Memory Architecture (2 level cache). Can be configured to support Little Endian or

Big Endian. 16-bit HPI to allow other processor access to

memory space.

Page 14: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

14

DSP Units

.M Multiplication Unit: 16-bit × 16-bit, 32-bit × 32-bit, 64-bit × 64-bit

.L Logic Unit: Arithmetic, comparisons and logic operations.

.S Shifter Unit: Bit manipulation (set, get, shift, rotate).

.D Data Unit: Load/Store to/from memory (exclusively) Performs addition and pointer arithmetic.

Page 15: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

15

C67xx Instruction Set

Page 16: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

16

Parallel Operations

Instruction word for each functional unit is 32-bits.

Instructions are fetched 8 at a time in 256 bit packets called fetch packets.

Up to 8 instructions can be executed in parallel, one in each functional unit.

Bit 0 of 32-bit instruction indicates if next instruction belongs to same execute packet.

Fetch packet ≠ Execute packet (execute packet can be larger than 256 bits, so it spans more fetch packets).

Page 17: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

17

Code Composer Studio

CCS is TI’s proprietary IDE that provides a transition between a high-level DSP program and an on-board machine language program. It is used to: Generate programs for the C6713 DSP using

C language, Load them into the DSK, Run them, Monitor program execution.

Page 18: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

18

Code Composer Studio - Example

Make sure DSK is connected to PC via USB and to power outlet before opening CCS.

Open CCS by double clicking on the CCS icon

To connect to the DSK, go to: “Debug → Connect”.

To start a new project, go to: “Project → New…”

Choose Appropriate DSP

Family

Page 19: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

19

Code Composer Studio - Example

“Skeleton.exe” is a project skeleton we will use where we only need to insert our code.

Available online on course website.

Page 20: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

20

Code Composer Studio - Example

Add C source file to “labmain.c”:

Page 21: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

21

Code Composer Studio - Example

Now, Compile code: “Project → Compile File”, Build project: “Project → Build”, Load program to DSK: “File → Load Program”

and choose “.out” file in “Debug” folder, Run the program on DSP: “Debug → Run”.

Profiling is a feature in CCS that allows us to get the time needed to execute certain sequence of instructions.

Page 22: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

22

LabVIEW

Laboratory Virtual Instrumentation Engineering Workbench.

It is a powerful IDE for data acquisition, instrumentation, analysis, signal processing, control…

LabVIEW programs called Virtual Instruments (VI’s). Each VI has 2 components:

Front Panel: user interface of the VI, has all controls and indicators for I/O.

Block Diagram: code is added using graphical representations of functions to control front panel objects.

Page 23: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

23

LabVIEW

Front Panel

Block Diagram

Online LabView Interactive Tutorial can be found at: http://zone.ni.com/devzone/cda/tut/p/id/4425

Page 24: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

24

MATLAB

MATrix LABoratory. It is a numerical computing environment

and programming language. Allows easy matrix manipulation, plotting of

functions and data, implementation of algorithms, creation of GUI’s…

Includes many specialized toolboxes that extend the regular MATLAB environment (communications, Control, Signal Processing…).

Page 25: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

25

MATLABCommand Window

Current Directory

Workspace

Command History

Page 26: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

26

MATLAB

MATLAB Help is very practical and user-friendly. Can access the MATLAB Help by pressing F1, or

going to “Help → MATLAB Help”. Also, in the Command Window, can type

help <function_name> to show the help document of a given function.

lookfor <keyword> to searche all help documents for a given keyword.

MATLAB Tutorial can be found athttp://www.utexas.edu/its-archive/rc/tutorials/matlab/matlab73.pdf

Page 27: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

27

MathScript

Software from LabVIEW. Same as MATLAB but does not support all

functions available in MATLAB. Appendix D in course reader: http://users.ece.utexas.edu/~bevans/courses/

realtime/handouts/matlab/index.html

Page 28: EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #1 Introduction to Hardware & Software Tools of TMS320C6713 DSK.

28

…The End!

See You Next Week!