300 likes | 733 Views
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. Introduction.
E N D
EE 345S Real-Time Digital Signal Processing LabFall 2008 Lab #1Introduction to Hardware & Software Tools of TMS320C6713 DSK
Outline • Introduction • C6713 DSK Board • C6713 DSP • C6700 Instruction Set Architecture • Code Composer Studio • LabVIEW • MATLAB/MathScript
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.
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.
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)
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.
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.
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.
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).
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.
Program RAM Data Cache or Cache Addr Internal Buses DMA Serial Port Host Port Boot Load Timers Pwr Down Data .D1 .D2 .M1 .M2 External Memory -Sync -Async Regs (A0-A15) Regs (B0-B15) .L1 .L2 .S1 .S2 Control Regs CPU C6700 DSP Simplified Architecture
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.
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.
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).
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.
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
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.
Code Composer Studio - Example • Add C source file to “labmain.c”:
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.
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.
LabVIEW Online LabView Interactive Tutorial can be found at: http://zone.ni.com/devzone/cda/tut/p/id/4425 Front Panel Block Diagram
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…).
MATLAB Command Window Workspace Current Directory Command History
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
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
…The End! See You Next Week!