EE 345S Real-Time Digital Signal Processing Lab Fall 2007

advertisement
EE 345S Real-Time Digital
Signal Processing Lab
Fall 2008
Lab #1
Introduction to Hardware & Software
Tools of TMS320C6713 DSK
Outline







Introduction
C6713 DSK Board
C6713 DSP
C6700 Instruction Set Architecture
Code Composer Studio
LabVIEW
MATLAB/MathScript
2
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.
3
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.
4
TI DSP Families

Low cost, Fixed-Point, 16-bit (for control):


Power Efficient, Fixed-Point, 16-Bit (for wireless
phones and modems):


TMS320C1x, ’C2x, ’C20x, ’C24x
’C5x, ’C54x, ’C55x
High Performance DSP’s (DSL, Imaging, Video…):


’C62x, ’C64x (16-bit fixed-point)
’C3x, ’C4x, ’C67x (32-bit floating-point)
5
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.
6
TMS320C6713 DSK Block Diagram
7
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.
8
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.
9
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).
10
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.
11
C6700 DSP Simplified Architecture
Program RAM
or Cache
Data Cache
Addr
Internal Buses
DMA
Data
.D2
.M1
.M2
.L1
.L2
.S1
.S2
Regs (B0-B15)
Regs (A0-A15)
External
Memory
-Sync
-Async
.D1
Serial Port
Host Port
Boot Load
Timers
Control Regs
Pwr Down
CPU
12
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.
13
DSP Units

.M Multiplication Unit:


.L Logic Unit:


Arithmetic, comparisons and logic operations.
.S Shifter Unit:


16-bit × 16-bit, 32-bit × 32-bit, 64-bit × 64-bit
Bit manipulation (set, get, shift, rotate).
.D Data Unit:


Load/Store to/from memory (exclusively)
Performs addition and pointer arithmetic.
14
C67xx Instruction Set
15
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).
16
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.
17
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
18
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.
19
Code Composer Studio - Example

Add C source file to “labmain.c”:
20
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.
21
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.
22
LabVIEW
Front Panel
Block Diagram
Online LabView Interactive Tutorial can be found at:
http://zone.ni.com/devzone/cda/tut/p/id/4425
23
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…).


24
MATLAB
Command Window
Workspace
Current Directory
Command History
25
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 at
http://www.utexas.edu/its-archive/rc/tutorials/matlab/matlab73.pdf
26
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/hando
uts/matlab/index.html
27
…The End!
See You Next Week!
28
Download