AN2345 Freescale Semiconductor / Motorola, AN2345 Datasheet - Page 6

no-image

AN2345

Manufacturer Part Number
AN2345
Description
Real-Time Memory Manager for StarCore DSPs
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
VSMM Basics
2
2.1 VSMM Target System Properties
2.2 Memory Block Header
6
VSMM Basics
This section presents an overview of the VSMM requirements, and architecture. The VSMM allows an
application to obtain fixed-size memory blocks from a partition (heap) consisting of a contiguous area of
memory. All memory blocks within a heap must be of the same size, and each heap may have an integral
number of blocks. Allocation of a block of memory from a heap occurs in real time and is deterministic.
The VSMM allows multiple heaps, and the number of heaps is limited only by the amount of physical
memory available, allowing various sizes of memory blocks to be accessed by an application. Heaps can
be created and eliminated at run-time, and a memory block from one heap may be partitioned into smaller
block sizes. The VSMM can create heaps dynamically at run-time, providing heaps of varying block
sizes. The VSMM also allows heaps to be created from other heaps, partitioning the new heap into
smaller block sizes than those of the heap from which it was created.
This section presents the features of the VSMM that define the capabilities of the VSMM architecture and
implementations based on this architecture, as follows:
• Compactness. Because of the extremely limited memory available to most DSPs, VSMM code space is
• Speed. In the highly complex tasks that today’s DSPs execute; speed is essential. Typically, the more
• Efficiency. To attain the best use of available memory, VSMM overhead must be minimized. An
• Flexible operation. The VSMM routines not required by an application or system can be omitted from
• RTOS-compatible. The VSMM can operate within an RTOS environment, so its routines are reentrant
• Byte Alignment.The VSMM adheres to the Motorola StarCore DSP byte-alignment rules. Refer to [1]
• Fragmentation. The VSMM design results in no fragmentation of available memory. Garbage
Each memory block within a heap contains an 8-byte header, referred to as the memory block header
(MBH). The MBH identifies the heap from which the block is allocated. The handle or address of each
heap is stored within the MBH when a block is allocated from the heap. The heap handle is the address of
the associated heap memory control block. See Figure 4 for an illustration of an allocated memory block
and its associated MBH. When a memory block is freed via the VSMMMemFree routine, the memory
block is returned to the heap indicated by the data within its associated MBH.
limited to no more than 2 KB. The maximum VSMM code size is approximately 1.5 KB with a
minimum code size of approximately 700 bytes.
efficiently an application executes on a DSP, more users are supported by the system, making the cost
less prohibitive. Therefore, all VSMM routines are geared toward optimal efficiency. There is no
maximum cycle requirement for a VSMM routine, but each routine is fully optimized to execute within
the least amount of cycles, and all routines must have a bounded response time.
overhead of 32 bytes per heap and 16 bytes per memory block allocation is acceptable. The VSMM
requires only 24 bytes per heap and 8 bytes per memory block.
a build. Additionally, the design is not restricted to a specific DSP or operating system (OS) but instead
is configurable based on the targeted DSP and operating system, including the RTOS.
and deterministic, and they observe mutual exclusion during critical pointer updates. All critical
sections of code, that is, code requiring mutual exclusion, are kept short and efficient. The VSMM can
also operate efficiently and reliably within non-RTOS environments.
for information on byte alignment requirements for Motorola StarCore devices.
collection is not implemented.
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com

Related parts for AN2345