7.2. Simple overlay support

A system for supporting simple overlays is possible that does not require specific support within the trace debug tools. This solution is based on the requirement that the memory space into which the overlays are loaded exists in multiple places in the memory map.This system works in the same way that the Tightly Coupled Memory (TCM) address space can be used to alias a TCM address range throughout the whole TCM address space. That is, some of the unused address bits are don’t care when determining the memory to be accessed.

For example, if you have 16KB of SRAM, bits [13:0] of the address determine the 32-bit word to access and bits [31:24] determine when to access that particular block. However, if bits [15:14] are in the address decoder, four copies of the memory block exist in the memory map. In other words the same word can be accessed using four different addresses. That is, when bits [15:14] of the address are 00, 01, 10, or 11 as shown in Figure 7.1.

Figure 7.1. SDRAM example overlays

If this 16KB block is to hold overlays, you can use bits [15:14] to indicate which of four possible overlays are loaded into this memory block. The value of bits [15:14] of the program counter is traced by the ETM. In the trace tools a static image of the code being executed, with the four possible overlays statically linked (using scatter loading in the ARM tools) into the appropriate 16KB blocks of memory space, enables the trace decompression tools to successfully decompress the trace.

When the overlay manager loads and calls a new overlay, it copies the code into RAM and then jumps to the overlay. Bits [15:14] of the address, loaded into the PC, are set appropriately. The physical address identifies the location in memory. The virtual address uniquely identifies the data to access and the location within that overlay.

Figure 7.2. Mapping overlays to a physical address

Copyright © 1999-2002, 2006 ARM Limited. All rights reserved.ARM DDI 0157G
Non-Confidential