6.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. 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:2 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.

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 will be 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, allows 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.

Copyright © 2000, 2001 ARM Limited. All rights reserved.ARM DDI 0158D