Patent ID: 7743366

Claim:
A method of compiling a computer program for execution on a data processing apparatus having memory configured into a plurality of memory sections, each memory section having a record of attributes associated therewith identifying one or more access properties associated with that memory section, said access properties comprising at least one of latency of an access, energy cost of an access, an available access bandwidth to the associated memory section, energy cost of storing a data unit in the associated memory section and an indication as to whether access to the associated memory section is contended due to sharing with other data processing apparatuses, the method comprising the steps of: a) performing a compilation in order to generate a plurality of code portions each with an initial mapping in the memory; b) evaluating a cost function to generate a cost value associated with the initial mapping of the plurality of code portions, said cost function dependent on said record of attributes of at least one of said plurality of memory sections; c) if the cost value does not satisfy a threshold cost value, re-performing the compilation of the program into a plurality of code portions having regard to the record of attributes of each memory section in order to generate a modified mapping; d) re-evaluating the cost function to generate a revised cost value associated with the modified mapping by accounting an access cost based on said attributes; e) iteratively repeating steps (c) and (d) until a predetermined condition is met; and f) outputting the mapping whose associated cost value most closely satisfied the threshold cost value, wherein the compilation at steps (a) and (c) is performed by a compiler having a set of operating constraints.