EasyManua.ls Logo

Texas Instruments TMS320 DSP User Manual

Texas Instruments TMS320 DSP
88 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #39 background image
www.ti.com
4.1.2 Stack Memory
4.1.3 Static Local and Global Data Memory
Data Memory
In the example above, the algorithm requires 960 16-bit words of single-access on-chip memory, 720
16-bit words of external persistent memory, and there are no special alignment requirements for this
memory. Note that the entries in this table are not required to be constants; they may be functions of
algorithm instance creation parameters.
In addition to bulk "heap" memory, algorithms often make use of the stack for very efficient allocation of
temporary storage. For most real-time systems, the total amount of stack memory for a thread is set once
(either when the program is built or when the thread is created) and never changes during execution of
the thread. This is done to ensure deterministic execution of the thread. It is important, therefore, that the
system integrator know the worst-case stack space requirements for every algorithm.
Rule 20
All algorithms must characterize their worst-case stack space memory requirements (including
alignment).
Stack space requirements for an algorithm must be characterized using a table such as that shown below.
Size Align
Stack Space 400 0
Both the size and alignment fields should be expressed in units of 8-bit bytes. If no special alignment is
required, the alignment number should be set to zero.
In the example above, the algorithm requires 200 16-bit words of stack memory and there is no special
alignment requirement for this memory. Note that the entry in this table are not required to be a constant;
it may be function of the algorithm's instance creation parameters.
One way to achieve reentrancy in a function is to declare all scratch data objects on the local stack. If the
stack is in on-chip memory this provides easy access to fast scratch memory.
The problem with this approach to reentrancy is that, if carried too far, it may require a very large stack.
While this is not a problem for single threaded applications, traditional multi-threaded applications must
allocate a separate stack for each thread. It is unlikely that more than a few these stacks will fit in on-chip
memory. Moreover, even in a single threaded environment, an algorithm has no control over the
placement of the system stack; it may end up with easy access to very slow memory.
These problems can be avoided by algorithms taking advantage of the IALG interface to declare their
scratch data memory requirements. This gives the application the chance to decide whether to allocate
the memory from the stack or the heap, which ever is best for the system overall.
Guideline 5
Algorithms should keep stack size requirements to a minimum.
Static data memory is any data memory that is allocated and placed when the program is built and
remains fixed during program execution. In many DSP architectures, there are special instructions that
can be used to access static data very efficiently by encoding the address of the data in the instruction's
opcode. Therefore, once the program is built, this memory cannot be moved.
Rule 21
Algorithms must characterize their static data memory requirements.
SPRU352G June 2005 Revised February 2007 Algorithm Performance Characterization 39
Submit Documentation Feedback

Table of Contents

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS320 DSP and is the answer not in the manual?

Texas Instruments TMS320 DSP Specifications

General IconGeneral
CategoryDigital Signal Processor
ManufacturerTexas Instruments
Data Bus WidthVaries by model (e.g., 16-bit, 32-bit)
ArchitectureHarvard architecture
Address Bus WidthVaries by model
MemoryVaries by model
On-Chip RAMVaries by model
On-Chip ROMVaries by model
ApplicationsAudio processing, telecommunications
Operating TemperatureVaries by model
Package TypeVaries by model (e.g., QFP, BGA)

Summary

Preface

Read This First

Provides introductory information and context for the document.

Overview

Scope of the Standard

Defines the levels of guidelines for the TMS320 DSP Algorithm Standard.

Requirements of the Standard

Lists key elements and objectives for the TMS320 DSP Algorithm Standard.

Goals of the Standard

Outlines the objectives for creating and adhering to the TMS320 DSP Algorithm Standard.

Intentional Omissions

Lists aspects intentionally omitted from the current version of the standard.

System Architecture

Describes the common partitioning of modern DSP system architectures.

General Programming Guidelines

Use of C Language

Specifies adherence to C language run-time conventions for algorithm interoperability.

Threads and Reentrancy

Defines threads and discusses reentrancy requirements for algorithms.

Data Memory

Discusses memory allocation, types, and management for algorithms.

Program Memory

Covers requirements for code relocation and alignment in program memory.

ROM-ability

Addresses the ability of algorithm code to be placed in ROM.

Use of Peripherals

Prohibits direct peripheral access and outlines how algorithms can use DMA.

Algorithm Component Model

Interfaces and Modules

Describes modules as the basic software component and their interfaces.

Algorithms

Defines algorithms as modules implementing the IALG interface.

Packaging

Details how to bundle modules into a deliverable form for development systems.

Algorithm Performance Characterization

Data Memory

Characterizes algorithm data memory requirements (heap, stack, static).

Program Memory

Details requirements for characterizing algorithm program memory usage.

Interrupt Latency

Specifies how to characterize and limit worst-case interrupt latency.

Execution Time

Explains how to characterize typical and worst-case execution times for algorithms.

DSP-Specific Guidelines

CPU Register Types

Categorizes CPU registers and provides guidelines for their use.

Use of Floating Point

Advises against the use of floating-point data types to reduce library dependencies.

TMS320C6xxx Rules and Guidelines

Provides specific rules and guidelines for TMS320C6000 family DSPs.

TMS320C54xx Rules and Guidelines

Provides specific rules and guidelines for TMS320C5400 family DSPs.

TMS320C55x Rules and Guidelines

Provides specific rules and guidelines for TMS320C5500 family DSPs.

TMS320C24xx Guidelines

Provides specific rules and guidelines for TMS320C24xx family DSPs.

TMS320C28x Rules and Guidelines

Provides specific rules and guidelines for TMS320C28x family DSPs.

Use of the DMA Resource

Overview

Introduces rules and guidelines for algorithms utilizing DMA resources.

Algorithm and Framework

Defines the relationship between algorithms and frameworks for DMA resource management.

Requirements for the Use of the DMA Resource

Lists requirements for DMA usage in eXpressDSP-compliant algorithms.

Logical Channel

Explains the concept of logical DMA channels for algorithm use.

Data Transfer Properties

Defines parameters for DMA transfer blocks (frames, elements).

Data Transfer Synchronization

Discusses methods to ensure DMA transfers complete before CPU access.

Abstract Interface

Describes the IDMA2/IDMA3 interfaces for declaring DMA resource requirements.

Resource Characterization

Details how to characterize DMA resource usage (concurrency, size, frequency).

Runtime APIs

Lists allowed runtime APIs for configuring and managing DMA transfers.

Strong Ordering of DMA Transfer Requests

Explains FIFO ordering and queue ID properties for DMA transfers.

Submitting DMA Transfer Requests

Describes functions for submitting DMA transfer requests and their alignment requirements.

Device Independent DMA Optimization Guideline

Provides a guideline to minimize DMA channel reconfiguration overhead.

C6xxx Specific DMA Rules and Guidelines

Covers DMA rules and guidelines specific to C6000 series DSPs.

C55x Specific DMA Rules and Guidelines

Covers DMA rules and guidelines specific to C55x series DSPs.

Inter-Algorithm Synchronization

Discusses sharing physical DMA channels between algorithms.

Rules and Guidelines

General Rules

Enforces rules for eXpressDSP-compliant software and identifies guideline types.

Performance Characterization Rules

Lists rules related to characterizing algorithm performance metrics.

DMA Rules

Lists rules specifically for algorithms utilizing the DMA resource.

General Guidelines

Lists general recommendations for algorithm development.

DMA Guidelines

Lists guidelines related to DMA usage by algorithms.

Core Run-Time APIs

TI C-Language Run-Time Support Library

Lists allowable TI C-language run-time support library functions for algorithms.

DSP/BIOS Run-time Support Library

Lists allowable DSP/BIOS run-time support functions for algorithms.

Bibliography

Glossary

Glossary of Terms

Defines key terms used throughout the TMS320 DSP Algorithm Standard document.

Related product manuals