www.ti.com
Data Memory
In the example above, the algorithm requires 960
4.1.2 Stack Memory
In addition to bulk "heap" memory, algorithms often make use of the stack for very efficient allocation of temporary storage. For most
Rule 20
All algorithms must characterize their
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
In the example above, the algorithm requires 200
One way to achieve reentrancy in a function is to declare all scratch data objects on the local stack. If the stack is in
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
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.
4.1.3 Static Local and Global Data Memory
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 | Algorithm Performance Characterization | 39 |
Submit Documentation Feedback |
|
|