Memory Management
5-2
5.1 Memory Management
The Memory Section Manager (MEM module) manages named memory
segments that correspond to physical ranges of memory. If you want more
control over memory segments, you can create your own linker command file
and include the linker command file created when you run the configuration
script.
The MEM module also provides a set of functions for dynamically allocating
and freeing variable-sized blocks of memory. The BUF module provides a set
of functions for dynamically allocating and freeing fixed-sized blocks of
memory.
Unlike standard C functions like malloc, the MEM functions enable you to
specify which segment of memory is used to satisfy a particular request for
storage. Real-time DSP hardware platforms typically contain several different
types of memory: fast, on-device RAMs; zero wait-state external SRAMs;
slower DRAMs for bulk data; and several others. Having explicit control over
which memory segment contains a particular block of data is essential to
meeting real-time constraints in many DSP applications.
The MEM module does not set or configure hardware registers associated
with a DSPs memory subsystem. Such configuration is your responsibility
and is typically handled by software loading programs, or in the case of Code
Composer Studio, the GEL start-up or menu options. For example, to access
external memory on a C6000 platform, the External Memory Interface (EMIF)
registers must first be set appropriately before any access. The earliest
opportunity for EMIF initialization within DSP/BIOS would be during the user
initialization function (see
Global Settings
in the
TMS320 DSP/BIOS API
Reference Guide
for your platform).
The MEM functions allocate and free variable-sized memory blocks. Memory
allocation and freeing are non-deterministic when using the MEM module,
since this module maintains a linked list of free blocks for each particular
memory segment. MEM_alloc and MEM_free must transverse this linked list
when allocating and freeing memory.
5.1.1
Configuring Memory Segments
The templates provided with DSP/BIOS define a set of memory segments.
These segments are somewhat different for each supported DSP board. If
you are using a hardware platform for which there is no configuration
template, you need to customize the MEM objects and their properties. You
can customize MEM segments in the following ways:
❏
Insert a new MEM segment and define its properties. For details on MEM
object properties, see the
TMS320 DSP/BIOS API Reference Guide
for
your platform.
Summary of Contents for TMS320 Series
Page 1: ...TMS320 DSP BIOS v5 40 User s Guide Literature Number SPRU423G April 2009 ...
Page 16: ...xvi ...
Page 152: ...Tasks 4 48 Figure 4 12 Trace from Example 4 7 ...
Page 168: ...Semaphores 4 64 Figure 4 14 Trace Results from Example 4 11 ...
Page 202: ...5 20 ...
Page 287: ...Index 9 Index Void 1 11 W words data memory 3 15 of code 1 5 wrapper function 2 29 ...
Page 288: ...Index 10 Index ...