Storage allocation for embedded processors

  • Authors:
  • Jan Sjödin;Carl von Platen

  • Affiliations:
  • Uppsala University, Uppsala, Sweden;IAR Systems, Malmö, Sweden

  • Venue:
  • CASES '01 Proceedings of the 2001 international conference on Compilers, architecture, and synthesis for embedded systems
  • Year:
  • 2001

Quantified Score

Hi-index 0.00

Visualization

Abstract

In an embedded system, it is common to have several memory areas with different properties, such as access time and size. An access to a specific memory area is usually restricted to certain native pointer types. Different pointer types vary in size and cost. For example, it is typically cheaper to use an 8-bit pointer than a 16-bit pointer. The problem is to allocate data and select pointer types in the most effective way. Frequently accessed variables should be allocated in fast memory, and frequently used pointers and pointer expressions should be assigned cheap pointer types. Common practice is to perform this task manually.We present a model for storage allocation that is capable of describing architectures with irregular memory organization and with several native pointer types. This model is used in an integer linear programming (ILP) formulation of the problem. An ILP solver is applied to get an optimal solution under the model. We describe allocation of global variables and local variables with static storage duration.A whole program optimizing C compiler prototype was used to implement the allocator. Experiments were performed on the Atmel AVR 8-bit microcontroller [2] using small to medium sized C programs. The results varied with the benchmarks, with up to 8% improvement in execution speed and 10% reduction in code size.