Digital Signal Processors for Real-Time Embedded Systems - PowerPoint PPT Presentation

1 / 35
About This Presentation
Title:

Digital Signal Processors for Real-Time Embedded Systems

Description:

Digital Signal Processors for Real-Time Embedded Systems By Jeremy Kohel Overview What is a DSP? Common characteristics of DSP s Software considerations Available ... – PowerPoint PPT presentation

Number of Views:54
Avg rating:3.0/5.0
Slides: 36
Provided by: Jer999
Category:

less

Transcript and Presenter's Notes

Title: Digital Signal Processors for Real-Time Embedded Systems


1
Digital Signal Processors for Real-Time Embedded
Systems
  • By Jeremy Kohel

2
Overview
  • What is a DSP?
  • Common characteristics of DSPs
  • Software considerations
  • Available tools
  • Example code

3
What is a DSP?
  • Definition
  • A specialized microprocessor designed
    specifically for the rapid processing of digital
    signals in real time.
  • What does this mean?
  • Where are they found?

4
Digital Signal Processing in Action
5
Common characteristics of DSPs
  • The ability to perform many highly numeric
    intensive tasks at fast speeds
  • Efficient instructions (MACs)
  • Efficient memory access
  • Efficient address generation

6
MACs
  • MACs multiply-accumulate instructions
  • Highly used in DSP applications
  • Must be done in at most a single instruction
    cycle
  • Equivalent to a a (b x c) where a is an
    accumulator register

7
MACs (cont.)
  • MACs are helpful to calculate the sum of many
    multiplication operations
  • Vector dot products used in many algorithms, i.e.
    filtering
  • Some DSPs have multiple accumulators and
    multiplier units so they can perform many MACs
    in a single instruction cycle

8
Basic DSP architecture
9
MAC example
10
Efficient Memory Access
  • DSPs must be able to make multiple access to
    memory in a single instruction cycle
  • Allows for fetching the next instruction while at
    the same time fetching operands and/or saving
    data to memory from a previous instruction

11
In order for this to happen
  • Requires multiple on-chip buses
  • Requires multiple on-chip memory banks
  • Only a few instructions in the entire instruction
    set have this ability

12
Address Generation
  • DSPs require separate generation units in order
    to find the next address needed
  • Run in the background outside the main data path
  • Allows an address of operand access to be
    calculated at the same time as performing
    arithmetic operations

13
Software Considerations
  • How will the program be developed/tested
  • DSP hardware, simulator
  • In what language will the program be developed?
  • Assembly, C/C, Ada, etc.

14
Cross Compiler vs. Native Compiler
  • DSP object code differs from the object code of a
    regular, CPU-driven workstation
  • Cross compiler runs on CPU workstation and
    creates DSP object code
  • Native compiler runs on CPU workstation and
    creates object code for that computer
  • Either have DSP hardware at hand or test with a
    simulator to mimic hardware

15
Language Dilemma
  • Assembly vs. C
  • Compilers are available for other higher level
    languages
  • C is most commonly used in real-time applications
  • Advantages and disadvantages of each

16
DSP Assembly
  • More efficient than C code
  • Provides a more optimal solution
  • Includes instructions to make common tasks more
    efficiently executed
  • Loop or Repeat instruction
  • Doesnt waste cycles on checking count variables
    or branching back to the top of a loop

17
Disadvantages of DSP Assembly
  • Takes longer to write code
  • More difficult to write solutions
  • R7 Max(R5, R6)
  • LDF R7, R6
  • COMF R5, R7
  • LDFLT R7, R5

18
More Disadvantages
  • DSP data is stored differently (No integers)
  • Only fractional part of floating point numbers
  • Therefore you cant get a number greater than 1
  • 7FFFFF 0.99999988709
  • Highest number allowed
  • MSB is the sign bit

19
Problems?
  • There can be numbers larger than 1 or smaller
    than 1
  • This is allowed using the accumulator and 56 bits
  • Accumulator A2(8 bits)A1(24 bits)A0(24 bits)

20
Acc (cont.)
  • If the number stored is 24 bits then its stored
    in A1 with A0 being zeroed out and A2 being sign
    extended
  • FF834345000000
  • Otherwise the MSB of A2 is the sign bit with the
    other 7 being the integer and the other 48 being
    the decimal
  • 00834345125345
  • (Allows for numbers between 128.0 and 127.99)

21
Embedded C
  • Easier to write code for
  • Programs are shorter and less complex
  • Compilers available
  • C is very versatile, and highly portable

22
Problems with C
  • The resulting assembly code is not optimal and
    therefore must be hand optimized
  • Many compilers claim code optimized for density
    and execution time
  • Most of the time this is not the case
  • Compilers allow for assembly code to be inserted
    inline

23
Other issues
  • C requires a large number of external libraries
    that need to be compiled into the program
  • I/O libraries
  • Run-Time libraries (math, string, memory)
  • DSP libraries (matrix arithmetic, filtering,
    image processing)

24
(No Transcript)
25
Software Tools
  • DirectDSP by Signalogic
  • Creates an interface between the DSP hardware and
    other well known development environments
  • Matlab, Visual Studio, .NET
  • Real-time watches
  • Waveform generator

26
DirectDSP
27
Code Composer Studio
  • Distributed by Texas Instruments
  • Provides a user-friendly IDE
  • C/C compiler
  • Project Manager
  • Simulator

28
CCS
  • Real-time analysis (similar to DirectDSP)
  • Cache log
  • Color codes cache hits to optimize algorithm
    placement
  • Code Coverage
  • Highlights lines of code not executed
  • Lists number of times lines are executed
  • Allows optimization

29
ANSI C Code Generator
  • Distributed by Hyperception
  • Works in coordination with graphical design
    environments
  • Creates C code based on the design
  • Good for porting algorithms
  • Decrease develop time

30
Problems with code generation
  • Doesnt provide optimized code
  • Must be hand optimized
  • Wont generate assembly libraries

31
Code Example
  • void UserProc(void ptrIn, void ptrOut, long
    nLen, short int nNumTrace)
  • ifdef defined(TMS320C3x) defined(TMS320C4x)
    defined(DSP5600x) defined(ADSP2106x)
  • define x ((long)ptrIn)
  • define y ((long)ptrOut)
  • endif
  • short int n

32
More code
  • for (n0 nltnLen n)
  •  
  • xn 0.75xn 1000
  • yn xn

33
Conclusion Things to remember
  • DSPs are not versatile, they are specialized to
    a specific task
  • CPU/DSP systems popular
  • They value efficiency over oscillator frequency
  • When developing a DSP application higher level
    languages are easier, but will not give as
    optimized code as assembly

34
References
  • 1 Choosing a DSP Processor, Berkeley Design
    Technology white paper, http//www.bdti.com/articl
    es/choose_2000.pdf
  •  
  • 2 Jennifer Eyre and Jeff Bier, The Evolution
    of DSP Processors, Berkeley Design Technology
    white paper
  • http//www.bdti.com/articles/evolution.pdf
  • 3 Adding user defined C routines to real-time
    DSP code, Signal Logic, http//www.signalogic.com
    /index.pl?pageccodeusing
  • 4 "DSP Algorithm Development Tools" DSP
    Multimedia Technology, November 1993

35
References (cont.)
  • 5 Digital Signal Processing, C6000 DSPs,
    Texas Instruments, http//focus.ti.com/paramsearch
    /docs/parametricsearch.tsp?familydspsectionId2
    tabId57familyId132
  •  
  • 6 C-Language Programming for DSP, Pentek Inc
    white paper, http//www.pentek.com/deliver/TechDoc
    .cfm/C_LangProg.pdf?FilenameC_LangProg.pdf
Write a Comment
User Comments (0)
About PowerShow.com