This report proposes the scratchpad memory management unit (SMMU) to act as a perfect data cache for a known subset of the data used by a program. This enables the execution time for each load or store operation in the program to be precisely determined. The SMMU must be explicitly controlled by the program, which commands the addition and removal of objects from the SMMU and its associated scratchpad memory. This report explains why the SMMU enables memories with high access latency to be used efficiently within hard real-time embedded systems. It describes the SMMU in abstract form, explaining how it solves the memory latency and pointer aliasing problems and how programs could use it. Then, it describes the implementation of a version of the SMMU for the Microblaze processor, enabling SMMU experiments within real embedded systems. Lastly, it conducts a case study involving a large C program to understand the costs and benefits of the SMMU for real code. A memory profiler is used to detect objects that can be usefully allocated within the scratchpad by identifying their base pointers. The implementation for Microblaze is found to be practical in terms of clock frequency and logic area. The case study shows that the SMMU capabilities cannot be applied to all variables, but the performance of the SMMU within the functions being considered is within a factor of two of the performance of a perfect data cache.

BibTex Entry

@techreport{Whitham2009,
 author = {Jack Whitham and Neil Audsley},
 institution = {University of York},
 number = {YCS-2009-439},
 title = {The Scratchpad Memory Management Unit for Microblaze: Implementation, Testing, and Case Study},
 year = {2009}
}